I am trying to upload an image file which I have got using imagepicker.
updatePhoto(user, File imageFile) async {
FirebaseStorage storage = FirebaseStorage.instance;
Reference ref = storage.ref().child('user/profile/${user.uid}');
UploadTask uploadTask = ref.putFile(imageFile);
String url;
uploadTask.whenComplete(() async {
url = await ref.getDownloadURL();
}).catchError((onError) {
print(onError);
});
return url;
}
But above code returns following error
VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method Task#startPutFile on channel plugins.flutter.io/firebase_storage) #0 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:156 #1 new MethodChannelTask. (package:firebase_storage_platform_interface/src/method_channel/method_channel_task.dart) flutter: MissingPluginException(No implementation found for method Reference#getDownloadURL on channel plugins.flutter.io/firebase_storage)
I would appreciate if someone could help explain how to resolve this error. Thank you
flutter clean
first then restartIDE
then do pub get and run – Shubham Narkhede