how to get access to the external directory i.e to camera roll and save an image in the external directory on iOS using flutter? so that the captured image will be viewed from the photo app.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
So iOS doesn't actually have a notion of an external directory AFAIK.
In terms of saving photos or videos to camera roll or albums, there is a plugin, flutter_photokit that will allow you to do just that. You would need to save the photo/video to either the application documents directory or temporary directory (using path_provider) and then you can do the following:
FlutterPhotokit.saveToCameraRoll(filePath: '/path/to/photo.jpg');
// OR
FlutterPhotokit.saveToAlbum(filePath: '/path/to/video.mp4', albumName: 'MyAlbum');
Disclaimer: I am the author of this plugin