On flutter web, I pick an image file from the computer and get a File image object. Then I want to upload it to Firebase Storage. For Android and iOS versions of the app I w
Related Addendum: How to download: Why this was such a hidden secret, I have no idea. Thanks to Learn Flutter Code for this nice little tutorial.
Don't make Firebase Storage a dependency, just Firebase with:
import 'package:firebase/firebase.dart' as fb;
Then create a method:
Future myDownloadURL() async {return await fb.storage().refFromURL('gs://').child('$id.jpg').getDownloadURL();}
Call it from a FutureBuilder like so:
FutureBuilder(
future: myDownloadURL(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return ;
}
return CircleAvatar(
radius: backgroundRadius * 2,
child: Image.network(snapshot.data.toString()),
);
},
)