Skip to content

A ValueNotifier<String> was used after being disposed. #31

@Adbhutashra

Description

@Adbhutashra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions