I tried to load an image from gallery the code throw an Exception . The Exception is :Unhandled Exception: type 'PickedFile' is not a subtype of type 'File' in type cast This is my code:
_imgFromGallery() async {
PickedFile image = await ImagePicker().getImage(source: ImageSource.gallery);
if (image == null)
return null;
setState(() {
_isloading = false;
_image = image as File;
});
classify(image as File);
}