When I go through opening up the camera to set profile image using image picker, the app crashes and I lost connection to device
:
When pick up image from gallery its working fine,
my 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/
If you are using an iOS device then you have to add permission for image picking. Add these line in your info.plist file.
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With