Open Umair-Syed opened 2 days ago
Here is my implementation of awesomeCamera
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Take a Picture')),
body: CameraAwesomeBuilder.awesome(
saveConfig: SaveConfig.photo(),
topActionsBuilder: (state) {
return AwesomeFlashButton(
state: state,
);
},
middleContentBuilder: (state) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Spacer(),
AwesomeZoomSelector(state: state),
const SizedBox(height: 16)
],
);
},
bottomActionsBuilder: (state) {
state.captureState$.listen((mediaCapture) async {
if (MediaCaptureStatus.success == mediaCapture?.status) {
try {
final croppedImageFuture = _cropImage(
mediaCapture!.captureRequest.path!,
context,
);
if (context.mounted) {
context.pop(croppedImageFuture);
}
} catch (e) {
logError('Error taking picture: $e');
}
}
});
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: TripleRail(
leading: AwesomeCameraSwitchButton(state: state),
middle: AwesomeCaptureButton(state: state),
),
);
},
),
);
}
Steps to Reproduce
In iPhone 15 (iOS 18.1) open CameraAwesomeBuilder.awesome with AwesomeZoomSelector
Expected results
Camera should work without any crash
Actual results
Exception: type 'int' is not a subtype of type 'double?' in type cast. This leads to line
minZoom = await CamerawesomePlugin.getMinZoom();
in awesome_zoom_selector.dartAbout your device
Your flutter version
flutter --version Flutter 3.24.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision 603104015d (3 weeks ago) • 2024-10-24 08:01:25 -0700 Engine • revision db49896cf2 Tools • Dart 3.5.4 • DevTools 2.37.3