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
I am trying to view the image saved locally in the gallery. My codes are below;
Uint8List pngBytes = await _qrToImage();
//await ImageGallerySaver.saveImage(pngBytes);
final Directory picturesDir = (await getExternalStorageDirectory())!;
final Directory dir =
Directory('${picturesDir.path}/Pictures/Test');
if (!(await dir.exists())) {
await dir.create(recursive: true);
}
// Save IMG
final String filePath = '${dir.path}/$defaultFileName.jpeg';
final File file = File(filePath);
await file.writeAsBytes(pngBytes);
// Add gallery
await ImageGallerySaver.saveFile(filePath);
This code saves the image to the location I specified. However, it creates the same file again under the "Pictures" directory. As a result, the file shown in the gallery is the one under "Pictures," not the one I saved. Therefore, if I delete the image from the gallery, the image at the path I specified is not deleted, so my app still thinks the image exists. The main issue is: How can I ensure that the saveFile function only saves the file to the path I specify?
The text was updated successfully, but these errors were encountered:
I am trying to view the image saved locally in the gallery. My codes are below;
This code saves the image to the location I specified. However, it creates the same file again under the "Pictures" directory. As a result, the file shown in the gallery is the one under "Pictures," not the one I saved. Therefore, if I delete the image from the gallery, the image at the path I specified is not deleted, so my app still thinks the image exists. The main issue is: How can I ensure that the saveFile function only saves the file to the path I specify?
The text was updated successfully, but these errors were encountered: