You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm getting a weird behavior on iOS (Android is fine though). I'm using image_picker to get images either from camera or gallery, and the user is allowed to call that repeatedly.
It works fine for the first picture, but when adding another the picture displayed is the first one.
I'm then passing each file to an array in a provider state, and when i do my http call to post them to my backend only the last picture is returned for each file.
getImage() Future getImage(source) async { var picture = await ImagePicker.pickImage(source: source); if (picture != null) { picture = await FlutterExifRotation.rotateAndSaveImage(path: picture.path); Provider.of<NewDiscussionState>(context).addPicture(picture); } Navigator.pop(context); // Just closing the BottomSheet }
Same issue. I'm using a multi image picker, and only the last image works.
Looking in the source code and logs, it seems that the image is saved as 'apple.jpg' in a temp directory. Meaning if you have multiple calls running at the same time, the image will be overwritten. (and explains why we only have our last image)
I'm nog comfortable enough with Swift to submit a fix, but possibly a unique ID as filename for each image would solve this issue.
Hello,
I'm getting a weird behavior on iOS (Android is fine though). I'm using image_picker to get images either from camera or gallery, and the user is allowed to call that repeatedly.
It works fine for the first picture, but when adding another the picture displayed is the first one.
I'm then passing each file to an array in a provider state, and when i do my http call to post them to my backend only the last picture is returned for each file.
getImage()
Future getImage(source) async { var picture = await ImagePicker.pickImage(source: source); if (picture != null) { picture = await FlutterExifRotation.rotateAndSaveImage(path: picture.path); Provider.of<NewDiscussionState>(context).addPicture(picture); } Navigator.pop(context); // Just closing the BottomSheet }
Provider addPicture()
void addPicture(File picture) { _pictures.add(picture); notifyListeners(); }
It looks like the image gets stuck on some cache, but i have no mean to debug it as i don't have a mac environment
The text was updated successfully, but these errors were encountered: