Flutter 图像\u选取器未将所选图像保存到缓存文件夹?
我正在使用image_picker 0.7.4拍摄图像,并注意到该文件正在保存到我的应用程序文档目录中,而不是缓存中。这正常吗Flutter 图像\u选取器未将所选图像保存到缓存文件夹?,flutter,Flutter,我正在使用image_picker 0.7.4拍摄图像,并注意到该文件正在保存到我的应用程序文档目录中,而不是缓存中。这正常吗 getImage() async { ImageSource imageSource; final action = await Dialogs.yesAbortDialog(context, 'Add Photo', 'Where would you like to import a photo from?', 'Camera', '
getImage() async {
ImageSource imageSource;
final action = await Dialogs.yesAbortDialog(context, 'Add Photo',
'Where would you like to import a photo from?', 'Camera', 'Gallery');
if (action == DialogAction.yes) {
imageSource = ImageSource.camera;
} else if (action == DialogAction.no) {
imageSource = ImageSource.gallery;
}
//TODO may need to play with quality settings
PickedFile selectedFile = await ImagePicker().getImage(
source: imageSource, imageQuality: 25, maxWidth: 800, maxHeight: 800);
if (selectedFile != null) {
setState(() {
imgs.add(selectedFile.path);
print(selectedFile.path);
});
}
}
输出
/storage/emulated/0/Android/data/com.ams.mobile_inspections/files/Pictures/scaled_968952ec-d095-4b28-852e-DF5A373F23AE88050656.jpg