Open Adbhutashra opened 7 months ago
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
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