I want to set get image from the camera and set it to the following code:
image: DecorationImage(image: FileImage(file),
So I did this:
File file = await ImagePicker.pickImage(
source: ImageSource.camera,
);
Now above code works fine for now, but 'pickImage' is deprecated and we should use imagePicker.getImage() method instead.
So I used imagePicker.getImage() instead:
PickedFile file = await ImagePicker().getImage(
source: ImageSource.camera,
);
But when I try to set this file to the following image type, it doesn't work
image: DecorationImage(image: FileImage(file),)
How to solve this issue?