Hello, I add image picker package and successed to display image from gallery or camera. But after launch in prod I have serveral users with an issue.
When user select or take a picture, the image is display and save. After live test with user and after closing app and reload app, in same day I havn't issue. But after 1 or 2 days, user said me that image disappear...
here is the UI part
ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: new Container(
width: MediaQuery.of(context).size.width/2,
height: MediaQuery.of(context).size.width/2,
decoration: new BoxDecoration(
image: new DecorationImage(
image: FileImage(File("${eventData.data10}")),
fit: BoxFit.cover
))
),
)
Here is my save path part
File _image_picker;
final picker = ImagePicker();
Future getImage() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final pickedFile = await picker.getImage(source: ImageSource.gallery);
setState(() {
if (pickedFile != null) {
_image_picker = File(pickedFile.path);
prefs.setString('path_image_picker',pickedFile.path);
} else {
print('No image selected.');
}
});
}
Here is my load path part
load_image()async{
SharedPreferences prefs = await SharedPreferences.getInstance();
setState(() {
var path_image_picker=prefs.getString('path_image_picker');
_image_picker = File("$path_image_picker");
});
}
Hello, I add image picker package and successed to display image from gallery or camera. But after launch in prod I have serveral users with an issue.
When user select or take a picture, the image is display and save. After live test with user and after closing app and reload app, in same day I havn't issue. But after 1 or 2 days, user said me that image disappear...
here is the UI part
Here is my save path part
File _image_picker;
final picker = ImagePicker();
Here is my load path part