Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: "type 'int' is not a subtype of type 'double?' in type cast" in awesome_zoom_selector #534

Open
Umair-Syed opened this issue Nov 14, 2024 · 1 comment

Comments

@Umair-Syed
Copy link

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.dart

About your device

Brand Model OS
Apple iPhone 15 18.1

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

@Umair-Syed
Copy link
Author

Umair-Syed commented Nov 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant