Search code examples
flutterdarterror-handlingflutter-dependencies

How can I resolve this issue with Flutter?


Can anyone help me solve this issue?

enter image description here

I'm a beginner with Flutter.

Here is the code that I've written:

   File?croppedImage=await ImageCropper().cropImage(
        sourcePath:filePath,maxHeight:1080,maxWidth:1080
    );

And I'm facing this error:

croppedFile can't be assigned to a variable of type file?

How can I fix it?


Solution

  • The type of cropImage is CroppedFile

    CroppedFile? croppedFile = await ImageCropper().cropImage(sourcePath:filePath,maxHeight:1080,maxWidth:1080 );