如何解决抖动图像选择器卡在相机上
我使用插件 https://pub.dev/packages/image_picker
图片选择器:^0.8.0+3
在android上,代码在某些设备上运行良好,但在ios上安装时,但使用相机拍照时,应用程序卡在相机显示屏上
我使用手机 5 和手机 10,但都卡在相机显示屏上, 按钮“重拍”和“使用照片”无法点击
这是我的代码
final pickedFile = await picker.getImage(
maxWidth: 800,imageQuality: 85,source: ImageSource.camera,);
if (pickedFile != null) {
dPrint('Original path: ${pickedFile.path}');
String dir = path.dirname(pickedFile.path);
var timeStamp = DateTime.now().millisecondsSinceEpoch;
var fileName = "IMG_" + timeStamp.toString() + ".jpg";
String newPath = path.join(dir,fileName);
File newFile = await File(pickedFile.path).copy(newPath);
if (newFile != null) {
print(newFile);
}
}
颤振医生结果:
Doctor summary (to see all details,run flutter doctor -v):
[✓] Flutter (Channel stable,2.0.0,on Mac OS X 10.15.7 19H2 darwin-x64,locale en-ID)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
! Some Android licenses not accepted. To resolve this,run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
Flutter 2.0.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 60bd88df91 (3 months ago) • 2021-03-03 09:13:17 -0800
Engine • revision 40441def69
Tools • Dart 2.12.0
解决方法
您需要点按 Use Photo
才能获取图像
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。