title: Flutter Failed to upload Multiple images obtained from multi_image_picker
body: <p>I've been successful in obtaining multiple images using the multi_image_picker but failed to upload the images to firebase storage. Am requesting for help as regards saving the images to firebase storage and returning the urls. </p>
  
  <p>Ive posted my code below, Thanks.</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'dart:async';
  import 'package:firebase_storage/firebase_storage.dart';
  import 'package:flutter/services.dart';
  import 'package:multi_image_picker/multi_image_picker.dart';
  import 'package:mock_data/mock_data.dart';
  
  
  
  class PageTwo extends StatefulWidget {
    @override
    _MyAppState createState() =&gt; new _MyAppState();
  }
  
  class _MyAppState extends State&lt;PageTwo&gt; {
    List&lt;Asset&gt; images = List&lt;Asset&gt;();
    String popop = mockString(50);
  
    @override
    void initState() {
      super.initState();
    }
  
    Widget buildGridView() {
      return GridView.count(
        crossAxisCount: 3,
        children: List.generate(images.length, (index) {
          Asset asset = images[index];
          return AssetThumb(
            asset: asset,
            width: 300,
            height: 300,
          );
        }),
      );
    }
  
    Future saveImage(Asset asset) async {
      String fileName = popop;
      ByteData byteData = await asset.requestOriginal();
      List&lt;int&gt; imageData = byteData.buffer.asUint8List();
      StorageReference ref = FirebaseStorage.instance.ref().child(fileName);
      StorageUploadTask uploadTask = ref.putData(imageData);
  
      return await (await uploadTask.onComplete).ref.getDownloadURL();
    }
  
    Future&lt;void&gt; loadAssets() async {
      List&lt;Asset&gt; resultList = List&lt;Asset&gt;();
      try {
        resultList = await MultiImagePicker.pickImages(
            maxImages: 300,
            enableCamera: true,
            selectedAssets: images,
            cupertinoOptions: CupertinoOptions(takePhotoIcon: "chat"),
            materialOptions: MaterialOptions(
              actionBarColor: "#abcdef",
              actionBarTitle: "Example App",
              allViewTitle: "All Photos",
              selectCircleStrokeColor: "#000000",
            ));
      } 
      }
      if (!mounted) return;
  
      setState(() {
        images = resultList;
        _error = error;
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Getting pics'),
          ),
          body: Column(
            children: &lt;Widget&gt;[
              RaisedButton(
                child: Text("Pick images"),
                onPressed: loadAssets,
              ),
              RaisedButton(
                child: Text("Save Image"),
                onPressed: () =&gt; saveImage,
              ),
              Expanded(
                child: buildGridView(),
              )
            ],
          ),
        ),
      );
    }
  }
  </code></pre>