Skip to content
Discussion options

You must be logged in to vote

Solved this problem myself. Here's the answer in case anyones wondering.

Future mediaUploadToDestination(
      {required BuildContext context,
      required List files,
      required String destination}) async {
    List<String> urls = [];

    for (File image in files) {
      try {
        // reference of the storage directory
        Reference ref = FirebaseStorage.instance
            .ref()
            .child(destination + image.path.split('/').last.toString());

        await ref.putFile(image).whenComplete(
          () async {
            await ref.getDownloadURL().then(
              (value) {
                urls.add(value);
              },
            );
          },
      …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ShimronAlakkal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant