mohesu / barcode_scanner

A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS.
Apache License 2.0
37 stars 27 forks source link

cannot invoke a non-'const' constructor where a const expression is expected. #53

Closed rahul-mobilecoderz closed 1 year ago

rahul-mobilecoderz commented 1 year ago

../../../.pub-cache/hosted/pub.dev/ai_barcode_scanner-0.0.7/lib/src/ai_barcode_scanner.dart:221:30: Error: Cannot invoke a non-'const' constructor where a const expression is expected. Try using a constructor or factory that is 'const'. child: Column( ^^^^^^

rahul-mobilecoderz commented 1 year ago

kindly resolve this issues .

rvndsngwn commented 1 year ago

Hi @rahul-mobilecoderz Thanks for bringing this to my attention. Let me check it out.

rvndsngwn commented 1 year ago

Hey @rahul-mobilecoderz Would you be able to share your flutter doctor output with me?

rahul-mobilecoderz commented 1 year ago

rahulkushwaha@MC-MM0020RAHKUSH qrcodescanner % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.7.1, on macOS 13.1 22C65 darwin-arm64, locale en-IN) [!] Android toolchain - develop for Android devices (Android SDK version 33.0.1) ✗ cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details. [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.1) [✓] VS Code (version 1.79.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

@rvndsngwn Kindly check it.

rvndsngwn commented 1 year ago

Based on the output of flutter doctor, it seems that you have a couple of issues related to the Android toolchain. Here are the steps you can follow to resolve them:

  1. Missing cmdline-tools component:

    • Run the following command in your terminal:
      path/to/sdkmanager --install "cmdline-tools;latest"
    • Replace path/to/sdkmanager with the actual path to the sdkmanager executable in your Android SDK installation.
  2. Unknown Android license status:

    • Run the following command in your terminal:
      flutter doctor --android-licenses
    • This will prompt you to accept the Android SDK licenses. Follow the instructions to accept the licenses.

After resolving these issues, you can run flutter doctor again to verify that everything is working correctly.

rvndsngwn commented 1 year ago

Now you can use the https://pub.dev/packages/ai_barcode_scanner/versions/1.0.0-dev.1 Prerelease package. Please let me know if there are any issues.

rahul-mobilecoderz commented 1 year ago

It is working now . Thanks