I’m confused I’ve taken a picture but can’t save it to the phone.How should I save pictures to the phone?
I used the following code to take a picture.
ValueNotifier<XFile?>_imageFile=ValueNotifier(null);
ImagePicker _imagePicker=ImagePicker();
Future<void> _getImage(ImageSource imageSource) async{
XFile? imgFile=await _imagePicker.pickImage(source: imageSource);
_imageFile.value=imgFile;
}
2
Answers
This is another aproach to save your picked image:
about "pathToSaveHere" you can use "
path_provider
" plugin of flutter https://pub.dev/packages/path_provider. It provide severeal methods to get paths you are able to save. Note that: due permissions restrictions you CANNOT save everywhere.First add gallery_saver package then call this function,