firebaseflutterfirebase-storageprofile-picture

Flutter firebase_storage FirebaseStorage.instance(): The expression doesn't evaluate to a function, so it can't be invoked


FirebaseStorage storage = FirebaseStorage(storageBucket: '');

is deprecated, but when I use

FirebaseStorage storage = FirebaseStorage.instance();

I get this error: The expression doesn't evaluate to a function, so it can't be invoked.


Solution

  • I just had to use instanceFor instead:

    FirebaseStorage storage = FirebaseStorage.instanceFor(bucket: '');