-2

这是显示应用程序崩溃的 gif https://media.giphy.com/media/Qm9PALMAtAw2W4AUzf/giphy.gif

onPressed: () => _pickImage(),
Future _pickImage() async {
    image = await _picker.getImage(source: ImageSource.gallery);
}

没有错误消息或任何东西,只是失去了与设备的连接

Navigator.pop()调用关闭对话框时也会发生这种丢失的连接行为

4

1 回答 1

2

在 Info.plist 中添加以下行

<key>NSCameraUsageDescription</key>
<string>Can i get permission to pick image?</string>
<key>NSMicrophoneUsageDescription</key>
<string>Can i get permission to pick image?</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Can i get permission to pick image?</string>
于 2021-03-27T05:48:40.740 回答