Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
906 stars 199 forks source link

awesome_zoom_selector cast exception #447

Open giordy16 opened 4 months ago

giordy16 commented 4 months ago

Steps to Reproduce

I am building a custom layout using CameraAwesomeBuilder.custom and I want to show the zoom selector above the bottom actions using AwesomeZoomSelector. This is the code:

return CameraAwesomeBuilder.custom( saveConfig: ..., sensorConfig: SensorConfig.single( sensor: Sensor.position(SensorPosition.back), flashMode: FlashMode.auto, aspectRatio: CameraAspectRatios.ratio_4_3, zoom: 0.0, ), previewFit: CameraPreviewFit.fitWidth, enablePhysicalButton: true, builder: (state, preview) { return AwesomeCameraLayout( state: state, topActions: AwesomeTopActions( state: state, children: [AwesomeFlashButton(state: state)], ), middleContent: Column( children: [ AwesomeZoomSelector(state: state), ], ), bottomActions: AwesomeBottomActions( state: state, left: AwesomeCameraSwitchButton(state: state), captureButton: AwesomeCaptureButton(state: state), right: const SizedBox(), // hide the 'last photo' button ), ); }, ); `

Expected results

I should see the zoom selector buttons.

Actual results

I don't see the buttons, and an error is thrown

flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ ⛔ type 'int' is not a subtype of type 'double?' in type cast flutter: └───────────────────────────────────────────────────────────────────────────────────────── flutter: ┌───────────────────────────────────────────────────────────────────────────────────────── flutter: │ #0 main. (package:..../main.dart:34:9) flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ flutter: │ ⛔ Stacktrace: #0 CameraInterface.getMinZoom (package:camerawesome/pigeon.dart:1283:28) flutter: │ ⛔ flutter: │ ⛔ #1 _AwesomeZoomSelectorState.initAsync (package:camerawesome/src/widgets/zoom/awesome_zoom_selector.dart:27:15) flutter: │ ⛔ flutter: │ ⛔ flutter: └───────────────────────────────────────────────────────────────────────────────────────── `

About your device

Brand Model OS
Apple iPhone 14 17.2.1

Your flutter version

Flutter 3.16.8 • channel stable • https://github.com/flutter/flutter.git Framework • revision 67457e669f (5 weeks ago) • 2024-01-16 16:22:29 -0800 Engine • revision 6e2ea58a5c Tools • Dart 3.2.5 • DevTools 2.28.5