edwn
edwn

Reputation: 23

How to show circular progress indicator while uploading image

I'm new on flutter this is my code.

final ref = FirebaseStorage.instance
            .ref()
            .child('users')
            .child(widget.user.uid)
            .child('$clotheId.jpg');
        await ref.putFile(_pickedImage!);

Upvotes: 0

Views: 1030

Answers (1)

sahilatahar
sahilatahar

Reputation: 915

Declare an variable bool isUploaded = false; And apply condition that isUploaded ? Text("Uploded Succesful") : CircularProcessIndicator(),

In which method you are uploading then set:

final ref = 
    FirebaseStorage.instance
    .ref()
    .child('users')
    .child(widget.user.uid)
    .child('$clotheId.jpg');
    await ref.putFile(_pickedImage!).then((value) {setState((){isUploaded = true; });});
 

Upvotes: 1

Related Questions