title: Flutter firebase storage plugin taking a lot of time to upload file
body: <p>I'm working on an Android app using flutter. In my app, there is a feature where a user can upload images from their device. For storing images I'm using firebase cloud storage &amp; here is the part of the code I'm using for uploading files to firebase cloud storage.</p>
  
  <pre><code>String fileName = "${this.userDetails['id']}_${uuid.v1()}";
  String fileExtension = p.extension(_imageFile.path);
  String newFileName = p.setExtension(fileName, fileExtension);
  
  print("STEP 1: New filename of image - 111: $newFileName");
  
  final StorageReference ref = FirebaseStorage.instance.ref().child("images/users/original/$newFileName");
  final StorageUploadTask uploadTask = ref.put(
              _imageFile, const StorageMetadata(contentLanguage: "en")
          );
  
  print("STEP 2: Image file uploaded - 222");
  
  final Uri downloadUrl = (await uploadTask.future).downloadUrl;
  print('STEP 3: downloadUrl data received - 333 : $downloadUrl');
  
  final http.Response downloadData = await http.get(downloadUrl);
  print('STEP 4: Download data received - 444 : ${downloadData.body}');
  </code></pre>
  
  <p>Here are 3 related flutter plug-in which I'm using which help above code to upload files.</p>
  
  <pre><code>import 'package:uuid/uuid.dart';
  import 'package:path/path.dart' as p;
  import 'package:firebase_storage/firebase_storage.dart';
  </code></pre>
  
  <p>Everything working fine. Except, file uploading is taking a lot of time. Almost it's taking more than 40-50 seconds to complete STEP-3(<code>print('STEP 3: downloadUrl data received - 333 : $downloadUrl');</code>). Sometimes 1 &amp; half minutes also. About my internet speed, it's it has almost 80Mbps upload &amp; download. My avg. uploaded image size is 100kB.</p>
  
  <p>Need some help to fig. out what's the issue.</p>
  
  <p>Adding a Screenshot(<strong>file size of 2.8 MB</strong>) from my Android Studio log -</p>
  
  <pre><code>I/flutter ( 4451): cliked on image upload button
  I/flutter ( 4451): Loading animation started
  I/flutter ( 4451): 2018-06-06 23:15:30.327722 - STEP 1: New file name got - 111: KyvU5PFfLRPxYFwHaiKHuywilMV2_679b9ee0-4800-11e8-fe1b-7f6c98d5147d.png
  I/flutter ( 4451): 2018-06-06 23:15:30.329420 - STEP 2: Image file uploaded - 222
  W/DynamiteModule( 4451): Local module descriptor class for com.google.android.gms.firebasestorage not found.
  W/zygote64( 4451): Unsupported class loader
  W/zygote64( 4451): Skipping duplicate class check due to unsupported classloader
  I/DynamiteModule( 4451): Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:6
  I/DynamiteModule( 4451): Selected remote version of com.google.android.gms.firebasestorage, version &gt;= 6
  W/zygote64( 4451): Unsupported class loader
  W/zygote64( 4451): Skipping duplicate class check due to unsupported classloader
  I/FlutterActivityDelegate( 4451): onResume setting current activity to this
  D/UploadTask( 4451): Increasing chunk size to 524288
  D/UploadTask( 4451): Increasing chunk size to 1048576
  D/UploadTask( 4451): Increasing chunk size to 2097152
  I/flutter ( 4451): 2018-06-06 23:17:43.445542 - STEP 3: downloadUrl image data - 333 : 
  I/flutter ( 4451): 2018-06-06 23:17:46.757227 - STEP 4: Download data - 444 : ÿØÿá1(Exif
  </code></pre>
  
  <hr>
  
  <p><strong>NOTE</strong>: This is maybe a plugin issue. So, Filed an issue on Github</p>
  
  <p><strong>Link</strong>: <a href="https://github.com/flutter/flutter/issues/18325" rel="noreferrer">https://github.com/flutter/flutter/issues/18325</a> </p>