diff --git a/ios/Podfile.lock b/ios/Podfile.lock index aefd02a..0727976 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3,6 +3,8 @@ PODS: - Flutter - camera_avfoundation (0.0.1): - Flutter + - device_info_plus (0.0.1): + - Flutter - disk_space_plus (0.0.1): - Flutter - Firebase/CoreOnly (12.8.0): @@ -251,6 +253,7 @@ PODS: DEPENDENCIES: - app_links (from `.symlinks/plugins/app_links/ios`) - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - disk_space_plus (from `.symlinks/plugins/disk_space_plus/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) @@ -311,6 +314,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/app_links/ios" camera_avfoundation: :path: ".symlinks/plugins/camera_avfoundation/ios" + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" disk_space_plus: :path: ".symlinks/plugins/disk_space_plus/ios" firebase_analytics: @@ -357,6 +362,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: app_links: a754cbec3c255bd4bbb4d236ecc06f28cd9a7ce8 camera_avfoundation: 5675ca25298b6f81fa0a325188e7df62cc217741 + device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe disk_space_plus: a36391fb5f732dbdd29628b0bac5a1acbd43aaef Firebase: 9a58fdbc9d8655ed7b79a19cf9690bb007d3d46d firebase_analytics: b5a19eaf3e4bf4187b0815ef4850b8916e2bc549 diff --git a/lib/ui/widgets/camera_viewfinder.dart b/lib/ui/widgets/camera_viewfinder.dart index 29aeef4..0691b18 100644 --- a/lib/ui/widgets/camera_viewfinder.dart +++ b/lib/ui/widgets/camera_viewfinder.dart @@ -1,5 +1,8 @@ +import 'dart:io' show Platform; + import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; +import 'package:device_info_plus/device_info_plus.dart'; class CameraViewfinder extends StatefulWidget { final void Function(XFile) onPictureTaken; @@ -37,9 +40,15 @@ class _CameraViewfinderState extends State break; } } + + // This is a temporary workaround for iPhone 17 family devices + final iOS = Platform.isIOS ? await DeviceInfoPlugin().iosInfo : null; + _controller = CameraController( cameraToUse, - ResolutionPreset.max, + iOS != null && iOS.utsname.machine.contains("iPhone18") + ? ResolutionPreset.ultraHigh + : ResolutionPreset.max, enableAudio: false, ); diff --git a/pubspec.lock b/pubspec.lock index 748cc7d..fad5ab8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -297,6 +297,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + device_info_plus: + dependency: "direct main" + description: + name: device_info_plus + sha256: "4df8babf73058181227e18b08e6ea3520cf5fc5d796888d33b7cb0f33f984b7c" + url: "https://pub.dev" + source: hosted + version: "12.3.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f + url: "https://pub.dev" + source: hosted + version: "7.0.3" diacritic: dependency: transitive description: @@ -1703,6 +1719,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.15.0" + win32_registry: + dependency: transitive + description: + name: win32_registry + sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae" + url: "https://pub.dev" + source: hosted + version: "2.1.0" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 1c6005c..9c60130 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -101,6 +101,7 @@ dependencies: git: url: https://github.com/Moseco/flutter_exif_rotation ref: '55b72de' + device_info_plus: ^12.3.0 dependency_overrides: flutter_statusbarcolor_ns: