You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into the same issue. It was because I was disposing of the controller myself. The FileManager widget already disposes it for you. In my opinion, if the controller is exposed to the user, it should be up to them to dispose it, not the library. However, that's not how it was written.
Error : A ValueNotifier was used after being disposed.
Expanded(
child: FileManager(
controller: controller2,
builder: (context, snapshot) {
final List entities = snapshot;
return GridView.builder(
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 8.0,
mainAxisSpacing: 8.0,
),
itemCount: entities.length,
itemBuilder: (context, index) {
return Card(
color: Colors.black,
child: InkWell(
onTap: () {
if (FileManager.isDirectory(
entities[index])) {
controller2
.openDirectory(entities[index]);
} else if (isVideoFile(entities[index])) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ChewieVideoPlayer(
videoPath: entities[index].path,
),
),
);
} else {}
},
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FileManager.isFile(entities[index])
? const Icon(Icons.feed_outlined,
color: Colors.black)
: Image.asset(
'assets/icons/folder_icons.png',
width: 48,
height: 48,
),
const SizedBox(height: 8),
Flexible(
child: Text(
FileManager.basename(entities[index]),
style: const TextStyle(
color: Colors.white),
textAlign: TextAlign.center,
),
),
],
),
),
);
},
);
},
),
)
Help me on this
The text was updated successfully, but these errors were encountered: