I'm having trouble saving the picked image permanently on my application, whenever I move to a new screen the image disappears it kills the path, here is my code below:
type Future<File?> pickImages(BuildContext context)async{
File? image;
try{
final pickedImage = await ImagePicker().pickImage(source: ImageSource.gallery);
if(pickedImage != null){
image = File(pickedImage.path);
}
} catch (e){
print(e);
}
return image;
}
// for selecting the image
void selectImage()async{
image = await pickImages(context);
setState(() {
});
}here
I have tried a few methods but run into the same error