Hi!
Im getting issue when picking video using gallery_picker. When picking image, there is no issue. But when im picking video, then get the file, there an issue: null pointer operator. Here is my code:
`List? media = await GalleryPicker.pickMedia(
context: context,
config: Config(mode: Mode.light),
);
if (media != null) {
List medias = await Future.wait(media.map((element) async {
final file = await element.getFile();
return PostMedia(
mediaType: element.type, file: file, fileName: file.name);
}));
if (!mounted) return;
context.read().add(OnAddMedia(medias));
}
`
Please let me know how to fix this! Thanks in advance!
Hi!
Im getting issue when picking video using gallery_picker. When picking image, there is no issue. But when im picking video, then get the file, there an issue: null pointer operator. Here is my code:
`List? media = await GalleryPicker.pickMedia(
context: context,
config: Config(mode: Mode.light),
);
if (media != null) {
List medias = await Future.wait(media.map((element) async {
final file = await element.getFile();
return PostMedia(
mediaType: element.type, file: file, fileName: file.name);
}));
if (!mounted) return;
context.read().add(OnAddMedia(medias));
}
`
Please let me know how to fix this! Thanks in advance!