Reputation: 5
uploadToStorage() async { showDialog( context: context, builder: (c) { return LoadingAlertDialog(); } );
String imageFileName = DateTime.now().millisecondsSinceEpoch.toString();
StorageReference storageReference = FirebaseStorage.instance.ref().child(imageFileName);
StorageUploadTask storageUploadTask = storageReference.putFile(_imageFile);
StorageTaskSnapshot = await storageUploadTask.onComplete;
await taskSnapshot.ref.getDownloadURL().then((urlImage){
userImageUrl = urlImage;
_registerUser();
});
}
Upvotes: 0
Views: 295
Reputation: 5411
If you're using the latest version of the firebase_storage
package, the correct class is called UploadTask
not StorageUploadTask
.
See the API reference https://pub.dev/documentation/firebase_storage/latest/firebase_storage/UploadTask-class.html
Upvotes: 1