DEV Community

Cover image for Flutter Web: Firebase Storage

Flutter Web: Firebase Storage

happyharis on January 10, 2020

Flutter Web: Firebase Storage *Disclaimer: The firebase storage api for Flutter Web is still buggy. There is some uncaught errors in the...
Collapse
 
alic50985540 profile image
Alic •

Thank you for the tutorial!
It works!
But I have 2 questions:
1) the upload does work from an android browser but not from iPhone. Do you know why?
2) the images, that I upload from android are rotated in firebase. Do you know why?

Thanks!

Collapse
 
alic50985540 profile image
Alic •

I solved the first issue.
The OnChanged does not work with sarafi mobile.

Using Eventlistener is the solution.

Collapse
 
happyharis profile image
happyharis •

Sorry I don't. However, thanks for sharing the first issue's solution!

Collapse
 
iamakx profile image
Akash Giri •

I am getting below error

TypeError: Cannot read property 'storage' of undefined
at Object.storage$ as storage
at localhost:54783/packages/dharmacha...
at banner._BannerManagerState.new.setState (localhost:54783/packages/flutter/s...)
at banner._BannerManagerState.new.uploadToFirebase (localhost:54783/packages/dharmacha...)
at uploadToFirebase.next ()
at runBody (localhost:54783/dart_sdk.js:37190:34)
at Object._async as async
at banner._BannerManagerState.new.uploadToFirebase (localhost:54783/packages/dharmacha...)
at banner._BannerManagerState.new. (localhost:54783/packages/dharmacha...)

Collapse
 
xeandy profile image
xeandy •

Hi i saw your video. But image doesnt upload

Collapse
 
happyharis profile image
happyharis •

have you set your rules to be able to write without authentications?

Collapse
 
goksoy66 profile image
goksoy66 •

same here.
it doesnt make upload.
the rules doesnt require any authentication.
what can it be the reason?

Thread Thread
 
goksoy66 profile image
goksoy66 • • Edited

I found the solution by reading comments below YouTube post.

I have to add the following line to index.html as a script.

gstatic.com/firebasejs/7.11.0/fire...

Collapse
 
svongripp profile image
svongripp •

Hey, thanks for the article!

Any idea how to go about streaming FireStore data to a list in Flutter web?

Collapse
 
happyharis profile image
happyharis •

Are you getting from a collection or documents?

If collection firestoreData.snapshot.map((data) => data.docs.map((doc)=> doc.data))).toList()

If documents, just add in manually in a list like list.insert(data)

Collapse
 
oscar__martin profile image
Óscar Martin 💙 •

You saved my night, thanks buddy!

Collapse
 
7cold profile image
Léo Coldibelli •

downloadURL? How?

Collapse
 
zaid13 profile image
zaid bin saeed •

TypeError: dart.global.firebase.storage is not a function

when i press enter i see this error