Skip to main content

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.onLoadEnd.listen((event1) async {
print('loading end');
var ref = storage.ref('complaints').child(basename(;
firebase_storage.SettableMetadata metadata =
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() /
}).onError((error) => {
ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
content: new Text(error.toString()),
backgroundColor: Colors.lightGreen,

uploadTask.then((res) async {
var url = await res.ref.getDownloadURL();

} catch (e) {


  1. Roulette Live Casino Site - LuckyClub
    Roulette Live Casino. Casino game guide. Try it for real money now and gain a certain bonus. You can play roulette for fun or for real money with a


Post a Comment

Popular posts from this blog

Christmas is a Christian holiday Worshiping the birth of Jesus Christ

Hey, the guy’s Merry Christmas. As you know, every year Christmas is celebrated. So today we will talk about Christmas. Christmas is a Christian holiday Worshiping the birth of Jesus Christ Read Also: CAA and NRC final bill report and Internet service shutdown in 17 cities in u.p. About Christmas: Christmas is a Christian holiday worshiping the birth of Jesus Christ , who is believed to be the son of God. The festival of Christmas, which is celebrated on 25 December every year, The Christmas festival is celebrated on 25 December. On this day people feed each other cakes instead of sweets and greet the festival. Taking the form of Santa Claus, the person distributes toffees, gifts, etc. to the children. And children become little Santa Claus and do drama and distribution chocolate. There is also a tradition of giving sweets, chocolates, greeting cards, Christmas trees, decorative items, etc. to family members, friends, relatives and neighbors.

angular 8 environment configuration, setup and create a new project

A ngular 8 environment and project setup hey, everyone, this is engineer Brijesh Kumar and today we teach you angular 8 environment setup and project creation. Node installation Angular 8 CLI installation Creating an Angular 8 project Read Also: FLUTTER MULTIPLE IMAGE UPLOAD INTO FIRESTORE  angular 8 environment configuration, setup and create a new project node 1. Node Installation :- goto Node official website and download Node package and install locally or follow the link and install. here you get various variants and os support download link choose right after install. and check after installation completion version code type command node --version, npm --version. 2. Angular 8 CLI installation:- goto the site and install the latest CLI version 8.3.3 or more latest or type the command in terminal  npm install -g @angular/cli, after installation complete check the angular 8 CLI version type the command ng --version after that you see th