Skip to main content


Showing posts from May, 2021

Flutter web file image picker and upload firebase storage

 Flutter web file image picker and upload Firebase storage In this post i am showing full coding of flutter web image picker to upload data in storage fully working code . import   'dart:html' ;     selectImageFile(context) async { try { InputElement input = FileUploadInputElement()..accept = 'image/*';; setState(() { isLoading = true; }); input.onChange.listen((event) async { var file = input.files.first; var reader = FileReader(); reader.readAsDataUrl(file); reader.onLoadEnd.listen((event1) async { print('loading end'); var ref = storage.ref('complaints').child(basename(; firebase_storage.SettableMetadata metadata = firebase_storage.SettableMetadata( customMetadata: <String, String>{"uid": user.uid}, ); firebase_storage.UploadTask uploadTask = ref.putBlob(file, metadata); uploadTask.asStream().listen((event) { setState(() { isLoading = true; progress = event.bytesTransferred.toDouble() / e