0
votes

I use the plugin https://pub.dev/packages/image_picker

image_picker: ^0.8.0+3

on android the code runs fine on some devices, but when installed on ios, but when taking pictures with the camera, the application is stuck on the camera display

i using i phone 5 and i phone 10, but both stuck on camera display, Button "Retake" and "Use Photo" cant click

enter image description here

here is my code

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);
             }
           }

Flutter doctor result :

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
1
please add device detail(name, model), flutter doctor result and image_picker lib versionFaiizii Awan
@FaiiziiAwan I have added it, please helpRohmatul Laily
please confirm your dart version. run flutter --versionFaiizii Awan
@FaiiziiAwan I have added itRohmatul Laily
it is working perfectly on my side. dart version 2.12, device Iphone7 (OS 14.3), and ImagePicker 0.8.0Faiizii Awan

1 Answers

0
votes

You need to tap on Use Photo to get the image captured