Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qq_27981847/article/details/90473542
iOS need to project configuration plist file within the application access
<key>NSPhotoLibraryUsageDescription</key>
<string>Example usage description</string>
<key>NSCameraUsageDescription</key>
<string>Example usage description</string>
In pubspec.yaml add-dependent:
image_picker: ^0.6.0+4
Future getImage() async {
var image = await ImagePicker.pickImage(source: ImageSource.gallery);
setState(() {
if (image != null) _image = image;
});
}