Ved*_*dha 4 android dart flutter
当我打开相机使用图像选择器设置个人资料图像时,应用程序崩溃并且我失去了与设备的连接
当从图库中拾取图像时,它工作正常,
我的 pubspec.yaml
name: flutterapp
description: A new Flutter project.
# Prevent accidental publishing to pub.dev.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
connectivity: ^3.0.6
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
font_awesome_flutter:
geolocator: ^7.7.0
http: ^0.13.4
image_picker: ^0.8.4+3
local_auth: ^1.1.8
path_provider: ^2.0.5
pdf: ^3.6.0
permission_handler: ^8.2.5
shared_preferences: ^2.0.8
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter:
uses-material-design: true
# Enable generation of localized Strings from arb files.
generate: true
assets:
# Add assets from the images directory to the application.
- assets/
Run Code Online (Sandbox Code Playgroud)
如果您使用的是 iOS 设备,则必须添加图像选取权限。将这些行添加到您的 info.plist 文件中。
<key>NSCameraUsageDescription</key>
<string>Access to take a photo by camera</string>
<key>NSAppleMusicUsageDescription</key>
<string>Access to pick a photo</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Access to pick a photo</string>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5901 次 |
| 最近记录: |