Skip to content

File Null When Picking Video #2

Description

@ahmdmau

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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