[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.

Overview

GitHub license GitHub stars Pub GitHub forks

Reborned 🎉

Original barcode_scan was discontinued, so barcode_scan2 was borned with sound null safety support 🎉

barcode_scan2

A flutter plugin for scanning 2D barcodes and QR codes.

This provides a simple wrapper for two commonly used iOS and Android libraries:

Features

  • Scan 2D barcodes
  • Scan QR codes
  • Control the flash while scanning
  • Permission handling

Getting Started

Android

For Android, you must do the following before you can use the plugin:

  • Add the camera permission to your AndroidManifest.xml

  • This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See installing the Kotlin plugin.

Edit your project-level build.gradle file to look like this:

buildscript {
    ext.kotlin_version = '1.3.61'
    // ...
    dependencies {
        // ...
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
// ...

Edit your app-level build.gradle file to look like this:

apply plugin: 'kotlin-android'
// ...
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    // ...
}

Now you can depend on the barcode_scan plugin in your pubspec.yaml file:

dependencies:
    # ...
    barcode_scan: any

Click "Packages get" in Android Studio or run flutter packages get in your project folder.

iOS

To use on iOS, you must add the the camera usage description to your Info.plist

<dict>
    
    <key>NSCameraUsageDescriptionkey>
    <string>Camera permission is required for barcode scanning.string>
    
dict>

Usage

import 'package:barcode_scan/barcode_scan.dart';

void main() async {
  var result = await BarcodeScanner.scan();

  print(result.type); // The result type (barcode, cancelled, failed)
  print(result.rawContent); // The barcode content
  print(result.format); // The barcode format (as enum)
  print(result.formatNote); // If a unknown format was scanned this field contains a note
}

Advanced usage

You can pass options to the scan method:

import 'package:barcode_scan/barcode_scan.dart';

void main() async {

  var options = ScanOptions(
    // set the options
  );

  var result = await BarcodeScanner.scan(options: options);

  // ...
}

Supported options

Option Type Description Supported by
strings.cancel String The cancel button text on iOS iOS only
strings.flash_on String The flash on button text iOS + Android
strings.flash_off String The flash off button text iOS + Android
restrictFormat BarcodeFormat[] Restrict the formats which are recognized iOS + Android
useCamera int The index of the camera which is used for scanning (See BarcodeScanner.numberOfCameras) iOS + Android
autoEnableFlash bool Enable the flash when start scanning iOS + Android
android.aspectTolerance double Enable auto focus on Android Android only
android.useAutoFocus bool Set aspect ratio tolerance level used in calculating the optimal Camera preview size Android only

Development setup

Setup protobuf

Mac:

$ brew install protobuf
$ brew install swift-protobuf

Windows / Linux: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation

Activate the protobuf dart plugin:

$ flutter pub global activate protoc_plugin

Install theProtobuf Support plugin for IDEA / Android Studio or vscode-proto3 for VS Code

If you changed the protos.proto you've to execute the ./generate_proto.sh to update the dart / swift sources

Common problems

Android "Could not find org.jetbrains.kotlin:kotlin-stdlib-jre..."

Change org.jetbrains.kotlin:kotlin-stdlib-jre to org.jetbrains.kotlin:kotlin-stdlib-jdk (StackOverflow)

Comments
  • [Bug] Execution failed for task ':barcode_scan2:compileDebugKotlin'.

    [Bug] Execution failed for task ':barcode_scan2:compileDebugKotlin'.

    Describe the bug The project throws an error after upgrading to flutter 3.0

    To Reproduce

    • Update to Flutter 3.0

    Logs

    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (16, 1): Class 'ActivityHelper' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (71, 5): 'onRequestPermissionsResult' overrides nothing
    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (81, 58): Type mismatch: inferred type is Array<CapturedType(out String)>? but Array<(out) String!> was expected
    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (81, 71): Type mismatch: inferred type is IntArray? but IntArray was expected
    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ChannelHandler.kt: (64, 39): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected
    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\RequestCameraPermissionHandler.kt: (8, 1): Class 'RequestCameraPermissionHandler' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\RequestCameraPermissionHandler.kt: (11, 5): 'onRequestPermissionsResult' overrides nothing
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':barcode_scan2:compileDebugKotlin'.
    > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
       > Compilation error. See log for more details
    
    Flutter 3.0
    

    Additional context

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.22000.675], locale en-US)
    [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    [X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
        ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
    [X] Visual Studio - develop for Windows
        X Visual Studio not installed; this is necessary for Windows development.
          Download at https://visualstudio.microsoft.com/downloads/.
          Please install the "Desktop development with C++" workload, including all of its default components
    [√] Android Studio (version 2021.2)
    [√] VS Code (version 1.67.0)
    [√] Connected device (3 available)
    [√] HTTP Host Availability
    

    Possible cause

    e: C:\Users\Harish\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\barcode_scan2-4.2.0\android\src\main\kotlin\de\mintware\barcode_scan\ActivityHelper.kt: (16, 1): Class 'ActivityHelper' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
    
    bug 
    opened by Harishwarrior 9
  • [Bug] Error in release mode

    [Bug] Error in release mode

    Describe the bug When launching the scanner in an app built in release mode the scanner is not shown. Look below for the logs. There seems to be some problem with

    Field aspectTolerance_ for de.mintware.barcode_scan.d not found. Known fields are [private double de.mintware.barcode_scan.d.f, private boolean de.mintware.barcode_scan.d.g, private static final de.mintware.barcode_scan.d de.mintware.barcode_scan.d.h, private static volatile e.a.b.a1 de.mintware.barcode_scan.d.i]
    

    To Reproduce Steps to reproduce the behavior:

    1. in example/ exec flutter run --release
    2. click on the scan button in the action bar

    Expected behavior The scanner should be shown

    Logs

    example % flutter run --release
    Launching lib/main.dart on JSN L21 in release mode...
    Running Gradle task 'assembleRelease'...                                
    Running Gradle task 'assembleRelease'... Done                      64,2s
    ✓ Built build/app/outputs/flutter-apk/app-release.apk (7.7MB).
    Installing build/app/outputs/flutter-apk/app.apk...              2.465ms
    
    Flutter run key commands.
    h Repeat this help message.
    c Clear the screen
    q Quit (terminate the application on the device).
    E/flutter (18978): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(scan, null, java.lang.reflect.InvocationTargetException
    E/flutter (18978): 	at java.lang.reflect.Method.invoke(Native Method)
    E/flutter (18978): 	at de.mintware.barcode_scan.ChannelHandler.c(Unknown Source:50)
    E/flutter (18978): 	at f.a.c.a.j$a.a(Unknown Source:17)
    E/flutter (18978): 	at io.flutter.embedding.engine.e.b.d(Unknown Source:57)
    E/flutter (18978): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source:4)
    E/flutter (18978): 	at android.os.MessageQueue.nativePollOnce(Native Method)
    E/flutter (18978): 	at android.os.MessageQueue.next(MessageQueue.java:363)
    E/flutter (18978): 	at android.os.Looper.loop(Looper.java:173)
    E/flutter (18978): 	at android.app.ActivityThread.main(ActivityThread.java:8178)
    E/flutter (18978): 	at java.lang.reflect.Method.invoke(Native Method)
    E/flutter (18978): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
    E/flutter (18978): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
    E/flutter (18978): Caused by: java.lang.RuntimeException: Field aspectTolerance_ for de.mintware.barcode_scan.d not found. Known fields are [private double de.mintware.barcode_scan.d.f, private boolean de.mintware.barcode_scan.d.g, private static final de.mintware.barcode_scan.d de.mintware.barcode_scan.d.h, private static volatile e.a.b.a1 de.mintware.barcode_scan.d.i]
    E/flutter (18978): 	at e.a.b.v0.n0(Unknown Source:72)
    E/flutter (18978): 	at e.a.b.v0.T(Unknown Source:698)
    E/flutter (18978): 	at e.a.b.v0.R(Unknown Source:12)
    E/flutter (18978): 	at e.a.b.k0.e(Unknown Source:60)
    E/flutter (18978): 	at e.a.b.k0.a(Unknown Source:49)
    E/flutter (18978): 	at e.a.b.d1.d(Unknown Source:17)
    E/flutter (18978): 	at e.a.b.d1.e(Unknown Source:4)
    E/flutter (18978): 	at e.a.b.z.C(Unknown Source:4)
    E/flutter (18978): 	at e.a.b.z$a.p(Unknown Source:9)
    E/flutter (18978): 	at e.a.b.z$a.o(Unknown Source:0)
    E/flutter (18978): 	at de.mintware.barcode_scan.f$b.z(Unknown Source:7)
    E/flutter (18978): 	at de.mintware.barcode_scan.ChannelHandler.scan(Unknown Source:69)
    E/flutter (18978): 	... 12 more
    E/flutter (18978): , null)
    E/flutter (18978): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581)
    E/flutter (18978): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158)
    E/flutter (18978): <asynchronous suspension>
    E/flutter (18978): #2      BarcodeScanner._doScan (package:barcode_scan2/platform_wrapper.dart:74)
    E/flutter (18978): <asynchronous suspension>
    E/flutter (18978): #3      BarcodeScanner.scan.<anonymous closure> (package:barcode_scan2/platform_wrapper.dart:46)
    E/flutter (18978): <asynchronous suspension>
    E/flutter (18978): 
    
    

    Environment (please complete the following information):

    • [ ] iOS? Version: ...
    • [x] Android? Version: 10
    • [x] Real Device? Which?: Huawei JSN L21
    • [ ] Emulator/Simulator? Which?: ...
    • Version of barcode_scan

    v4.0.0

    • Output of flutter --version:
    Flutter 2.0.5 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision adc687823a (10 giorni fa) • 2021-04-16 09:40:20 -0700
    Engine • revision b09f014e96
    Tools • Dart 2.12.3
    
    bug 
    opened by DavideBicego 4
  • [Bug] Class 'ActivityHelper' is not abstract  when trying to compile to android?

    [Bug] Class 'ActivityHelper' is not abstract when trying to compile to android?

    BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

    Describe the bug i try to build a flutter app that scans a QR code, but it fails in the lib directly??

    To Reproduce follow the instructions to enable the barcode_scan2 lib (i added a 2 at each end of the name for pubspec dependency and lib include) and just try to compile it

    Expected behavior a working binary

    Screenshots

    Logs Launching lib/main.dart on Pixel 4a in debug mode... Running Gradle task 'assembleCompleteDebug'... e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (16, 1): Class 'ActivityHelper' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (71, 5): 'onRequestPermissionsResult' overrides nothing e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (81, 58): Type mismatch: inferred type is Array<CapturedType(out String)>? but Array<(out) String!> was expected e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ActivityHelper.kt: (81, 71): Type mismatch: inferred type is IntArray? but IntArray was expected e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/ChannelHandler.kt: (64, 39): Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/RequestCameraPermissionHandler.kt: (8, 1): Class 'RequestCameraPermissionHandler' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener e: /home/bboett/.pub-cache/hosted/pub.dartlang.org/barcode_scan2-4.2.0/android/src/main/kotlin/de/mintware/barcode_scan/RequestCameraPermissionHandler.kt: (11, 5): 'onRequestPermissionsResult' overrides nothing

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':barcode_scan2:compileDebugKotlin'.

    Compilation error. See log for more details

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 7s Exception: Gradle task assembleCompleteDebug failed with exit code 1

    Environment (please complete the following information):

    • [ ] iOS? Version: ...
    • [ ] Android? Version: 31
    • [ ] Real Device? Which?: pixel 4a
    • [ ] Emulator/Simulator?none.
    • Version of barcode_scan 4.2
    • Output of flutter --version:
    Flutter ...2.12.0-4.1.pre
    

    Additional context Add any other context about the problem here.

    bug 
    opened by nohkumado 3
  • Unable to resume activity in release mode Java.lang.NoSuchMethodException

    Unable to resume activity in release mode Java.lang.NoSuchMethodException

    Describe the bug I published an app in play store and throw an java.lang.NoSuchMethodException. I attached the trace in Logs section The issue also happens when you run the app with the follow command: flutter run --release I took the example of library and the issue is the same.

    To Reproduce Steps to reproduce the behavior: The method BarcodeScanner.scan(); throws an exception in production.

      void _scanQR(BuildContext context) async {
        ScanResult? scanResult;
    
        try {
          scanResult = await BarcodeScanner.scan();
        } on PlatformException catch (e) {
          if (e.code == BarcodeScanner.cameraAccessDenied) {
            Fluttertoast.showToast(msg: 'The camera access was denied');
          } else {
            ...
          }
        } catch (e) {
          ...
        }
    
        if (scanResult != null && scanResult.rawContent != '') {
         ...
        }
      }
    

    Expected behavior The call to scan should return and valid ScanResult

    Logs

    java.lang.RuntimeException: Unable to resume activity {###.####.###/de.mintware.barcode_scan.BarcodeScannerActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: c.b.d.e.values []
    java.lang.RuntimeException: 
      at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4504)
      at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4536)
      at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
      at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
      at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
      at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2104)
      at android.os.Handler.dispatchMessage (Handler.java:106)
      at android.os.Looper.loop (Looper.java:236)
      at android.app.ActivityThread.main (ActivityThread.java:7861)
      at java.lang.reflect.Method.invoke (Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
    Caused by: java.lang.RuntimeException: 
      at java.lang.Enum.enumValues (Enum.java:270)
      at java.lang.Enum.access$000 (Enum.java:61)
      at java.lang.Enum$1.create (Enum.java:277)
      at java.lang.Enum$1.create (Enum.java:275)
      at libcore.util.BasicLruCache.get (BasicLruCache.java:63)
      at java.lang.Enum.getSharedConstants (Enum.java:289)
      at java.lang.Class.getEnumConstantsShared (Class.java:2428)
      at java.util.EnumMap.getKeyUniverse (EnumMap.java:755)
      at java.util.EnumMap.<init> (EnumMap.java:138)
      at me.dm7.barcodescanner.zxing.ZXingScannerView.o (ZXingScannerView.java:4)
      at me.dm7.barcodescanner.zxing.ZXingScannerView.<init> (ZXingScannerView.java:3)
      at de.mintware.barcode_scan.ZXingAutofocusScannerView.<init> (ZXingAutofocusScannerView.java:5)
      at de.mintware.barcode_scan.BarcodeScannerActivity.setupScannerView (BarcodeScannerActivity.java)
      at de.mintware.barcode_scan.BarcodeScannerActivity.onResume (BarcodeScannerActivity.java)
      at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1457)
      at android.app.Activity.performResume (Activity.java:8264)
      at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4494)
      at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4536)
      at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
      at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
      at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
      at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2104)
      at android.os.Handler.dispatchMessage (Handler.java:106)
      at android.os.Looper.loop (Looper.java:236)
      at android.app.ActivityThread.main (ActivityThread.java:7861)
      at java.lang.reflect.Method.invoke (Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
    Caused by: java.lang.NoSuchMethodException: 
      at java.lang.Class.getMethod (Class.java:2072)
      at java.lang.Class.getDeclaredMethod (Class.java:2050)
      at java.lang.Enum.enumValues (Enum.java:267)
      at java.lang.Enum.access$000 (Enum.java:61)
      at java.lang.Enum$1.create (Enum.java:277)
      at java.lang.Enum$1.create (Enum.java:275)
      at libcore.util.BasicLruCache.get (BasicLruCache.java:63)
      at java.lang.Enum.getSharedConstants (Enum.java:289)
      at java.lang.Class.getEnumConstantsShared (Class.java:2428)
      at java.util.EnumMap.getKeyUniverse (EnumMap.java:755)
      at java.util.EnumMap.<init> (EnumMap.java:138)
      at me.dm7.barcodescanner.zxing.ZXingScannerView.o (ZXingScannerView.java:4)
      at me.dm7.barcodescanner.zxing.ZXingScannerView.<init> (ZXingScannerView.java:3)
      at de.mintware.barcode_scan.ZXingAutofocusScannerView.<init> (ZXingAutofocusScannerView.java:5)
      at de.mintware.barcode_scan.BarcodeScannerActivity.setupScannerView (BarcodeScannerActivity.java)
      at de.mintware.barcode_scan.BarcodeScannerActivity.onResume (BarcodeScannerActivity.java)
      at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1457)
      at android.app.Activity.performResume (Activity.java:8264)
      at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4494)
      at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4536)
      at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52)
      at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
      at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
      at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2104)
      at android.os.Handler.dispatchMessage (Handler.java:106)
      at android.os.Looper.loop (Looper.java:236)
      at android.app.ActivityThread.main (ActivityThread.java:7861)
      at java.lang.reflect.Method.invoke (Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
    

    Environment (please complete the following information):

    • [ ] iOS? Version: ...
    • [ ] Android? Version: Android 11 (SDK 30)
    • [ ] Real Device? Which?: Redmi Note 9 Pro
    • [ ] Emulator/Simulator? Which?: ...
    • Version of barcode_scan: ^4.2.0
    • Output of flutter --version: Flutter 2.5.2 • channel stable • https://github.com/flutter/flutter.git Framework • revision 3595343e20 (8 weeks ago) • 2021-09-30 12:58:18 -0700 Engine • revision 6ac856380f Tools • Dart 2.14.3

    Additional context I've worked with this library in test and it works, i found the problem in the production app in the Play Store.

    bug 
    opened by OmarACY 3
  • Migrate from JCenter to Maven Central for gradle dependencies

    Migrate from JCenter to Maven Central for gradle dependencies

    JCenter has issued a deprecation notice (https://blog.gradle.org/jcenter-shutdown). It is recommended to move to Maven Central, which Flutter itself is also officially doing.

    This PR addresses bug #56 by removing JCenter and adding Maven Central for gradle dependency resolution.

    opened by edreanernst 1
  • Flutter 3.0 fixes

    Flutter 3.0 fixes

    This does fix some issues in Flutter v3 as discussed here: https://github.com/mono0926/barcode_scan2/issues/49 and https://github.com/mono0926/barcode_scan2/issues/48

    opened by robinbonnes 1
  • Platform libraries are abandoned

    Platform libraries are abandoned

    I was posing a question about this flutter plugin and its longevity. As a developer I would like to use code that is actively maintained, because of bugs. That is a primary concern in the android ecosystem, where every 12 months a new major version of the os with breaking changes rolls out (the last two, android 12 and 11, introduces different breaking changes). I noticed that both the android and the ios libraries used by this plugin are abandoned. What are your plans about this? Do you think to migrate to another library with the same functionalities? This library is good, and thanks god someone continue to develop the original abandoned library and gave it nullsafety! But I have this question and it's important for me to know the answer.

    opened by luckv 1
  •  Changed protobuf_version and compileSdkVersion to support android12 …

    Changed protobuf_version and compileSdkVersion to support android12 …

    …/ SDK32.

    Changed protobuf_version and compileSdkVersion to support android12 / SDK32. When building to android12, an error occurs and it cannot be started.

    こんにちは。monoさん。 android12にビルドした場合、protobuf_versionの影響でビルドができないため修正してみました。 正直Androidのネイティブへの理解が低いため、適切でない可能性があります。間違っていたらすみません。

    opened by YuKiO-output 1
  • [Bug] ZXingAutofocusScannerView.java error: getParameters failed

    [Bug] ZXingAutofocusScannerView.java error: getParameters failed

    BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Logs If applicable, add the verbose output of flutter run.

    Environment (please complete the following information):

    • [ ] iOS? Version: ...
    • [ ] Android? Version: ...
    • [ ] Real Device? Which?: ...
    • [ ] Emulator/Simulator? Which?: ...
    • Version of barcode_scan
    • Output of flutter --version:
    Flutter ...
    

    Additional context Add any other context about the problem here.

    invalid 
    opened by luckv 1
  • 怎样删除左上角的应用名

    怎样删除左上角的应用名

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    invalid 
    opened by mujia521 1
  • [Feature Request] Not full screen camera preview

    [Feature Request] Not full screen camera preview

    Hi,

    Is there anyway to contain the camera preview in a container?

    I mean, if I call the BarcodeScanner.scan() it will open up a full screen camera panel so as to scan the barcode but, I want to open a specifically sized container to fit the camera preview, like a dialog box, for some reasons.

    If it is possible please let me know.

    Many thanks.

    opened by prooshani 1
  • [Bug] Buttons are not displayed on the camera screen

    [Bug] Buttons are not displayed on the camera screen

    Hello, thank you for your work, the package is great!

    Describe the bug

    When opening the camera to scan a barcode, the camera screen appears in full screen without displaying any buttons. So it is not possible to cancel the scan or activate the flash.

    To Reproduce

    Steps to reproduce the behavior:

    1. Open the page example provided in the package.
    2. Click on the camera icon.
    3. The cancel and flash buttons do not appear.

    Screenshots

    Screenshot_20221109-170117

    Environment (please complete the following information):

    • Android Version: 12
    • Real Device: Samsung S10+
    • Version of barcode_scan2: ^4.2.1
    • Output of flutter --version: Flutter 3.4.0-34.1.pre • channel beta • https://github.com/flutter/flutter.git Framework • revision 71520442d4 (5 weeks ago) • 2022-10-05 16:38:28 -0500 Engine • revision db0cbb2145 Tools • Dart 2.19.0 (build 2.19.0-255.2.beta) • DevTools 2.18.0
    bug 
    opened by Vantir 0
  • Replace jCenter? Can't build app with jCenter

    Replace jCenter? Can't build app with jCenter

    BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

    Describe the bug Hi, thanks for the package

    I see this is still using jCenter() which has been deprecated https://blog.gradle.org/jcenter-shutdown any chance of moving to mavenCentral()?

    I can't build my project

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':barcode_scan2'.
    > Could not resolve all artifacts for configuration ':barcode_scan2:classpath'.
       > Could not download protobuf-gradle-plugin-0.8.18.jar (com.google.protobuf:protobuf-gradle-plugin:0.8.18)
          > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-gradle-plugin/0.8.18/protobuf-gradle-plugin-0.8.18.jar'.
             > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-gradle-plugin/0.8.18/protobuf-gradle-plugin-0.8.18.jar'.
                > Read timed out
    > Failed to notify project evaluation listener.
       > Could not get unknown property 'android' for project ':barcode_scan2' of type org.gradle.api.Project.
       > Could not get unknown property 'android' for project ':barcode_scan2' of type org.gradle.api.Project.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 10m 0s
    

    To Reproduce Steps to reproduce the behavior:

    1. Build debug

    Expected behavior Can build an app

    Screenshots

    Logs

    Environment (please complete the following information):

    • [ ] Android? Version: min SDK 21
    • Version of barcode_scan = 4.2.1
    • Output of flutter --version:
    Flutter 2.10.1 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision db747aa133 (9 months ago) • 2022-02-09 13:57:35 -0600
    Engine • revision ab46186b24
    Tools • Dart 2.16.1 • DevTools 2.9.2
    

    Additional context

    bug 
    opened by maruzimuslih 0
  • [Feature Request] Get raw bytes when reading DataMatrix format

    [Feature Request] Get raw bytes when reading DataMatrix format

    I am reading a DataMatrix file and the result is stored in ScanResult as a String field called rawContent. However, the data stored in the DataMatrix is data compressed with zip.

    I need to get the exact raw bytes stored in DataMatrix and not a String that has probably been encoded/decoded from the raw bytes and has been altered.

    Can you help?

    opened by kaciula 0
  • [Feature Request] Limiting the Scan Zone, iOS

    [Feature Request] Limiting the Scan Zone, iOS

    When scanning in iOS, a barcode is already recognized when it is in the camera image outside of the scan zone. If you have multiple barcodes close to each other, it is not very easy to scan a barcode.

    It would be helpful if barcodes are only recognized inside the scan zone, which could be solved by scanRect see MTBBarcodeScanner:

    https://github.com/mikebuss/MTBBarcodeScanner#limiting-the-scan-zone

    Thanks in advance for a reply. If you need more information or if there is another way to solve this, please let me know.

    opened by Zoapone 0
  • Remove scanner screen action bar

    Remove scanner screen action bar

    Hi,

    I would like to remove the action bar on the scanner screen or change the title. Is it possible? I try to change the title but I can't figure out how to do it.

    Screenshot_20220606-191746_1

    opened by Scheph-96 0
  • Unable to change ActionBar and Status bar colors

    Unable to change ActionBar and Status bar colors

    My flutter app has diiferent color theme, but whenever I open scanner screen, ActionBar and Status bar appears in black color.

    How to change ActionBar and Status bar colors of Scanner Screen ?

    Please check below attached screenshot.

    barcode_scanner

    This is the only problem I am facing. Thanks for your awesome plugin.

    opened by surajpunemaha 0
Releases(v4.2.1)
  • v4.2.1(May 14, 2022)

    What's Changed

    • Flutter 3.0 fixes by @robinbonnes in https://github.com/mono0926/barcode_scan2/pull/50

    New Contributors

    • @robinbonnes made their first contribution in https://github.com/mono0926/barcode_scan2/pull/50

    Full Changelog: https://github.com/mono0926/barcode_scan2/compare/v4.2.0...v4.2.1

    Source code(tar.gz)
    Source code(zip)
  • v4.2.0(Dec 8, 2021)

    What's Changed

    • Changed protobuf_version and compileSdkVersion to support android12 … by @YuKiO-output in https://github.com/mono0926/barcode_scan2/pull/37

    New Contributors

    • @YuKiO-output made their first contribution in https://github.com/mono0926/barcode_scan2/pull/37

    Full Changelog: https://github.com/mono0926/barcode_scan2/compare/v4.1.4...v4.2.0

    Source code(tar.gz)
    Source code(zip)
  • v4.1.4(Dec 8, 2021)

    What's Changed

    • Fix When ViewController whose view is not in the window hierarchy , present Scan ViewController will failed. by @ethi1989 in https://github.com/mono0926/barcode_scan2/pull/5
    • Lock screen rotation when scanner is shown by @DavideBicego in https://github.com/mono0926/barcode_scan2/pull/7
    • Fix After flutter plugin register, the topViewController may changed … by @ethi1989 in https://github.com/mono0926/barcode_scan2/pull/10
    • Broken artifact fixes for Apple Silicon M1 by @alex-melnyk in https://github.com/mono0926/barcode_scan2/pull/28

    New Contributors

    • @ethi1989 made their first contribution in https://github.com/mono0926/barcode_scan2/pull/5
    • @DavideBicego made their first contribution in https://github.com/mono0926/barcode_scan2/pull/7
    • @alex-melnyk made their first contribution in https://github.com/mono0926/barcode_scan2/pull/28

    Full Changelog: https://github.com/mono0926/barcode_scan2/compare/v4.0.0...v4.1.4

    Source code(tar.gz)
    Source code(zip)
Owner
Masayuki Ono (mono)
Software Engineer (Flutter/Dart, Firebase/GCP, iOS/Swift, TypeScript)
Masayuki Ono (mono)
Animated radial and pie charts for Flutter

Flutter Circular Chart A library for creating animated circular chart widgets with Flutter, inspired by Zero to One with Flutter. Overview Create easi

Victor Choueiri 387 Dec 26, 2022
Elegant OHLC Candlestick and Trade Volume charts for @Flutter

flutter_candlesticks Elegant OHLC Candlestick and Trade Volume charts for Flutter Usage Install for Flutter with pub. Property Description data Requir

Trent Piercy 402 Dec 21, 2022
A powerful Flutter chart library, currently supporting Line Chart, Bar Chart, Pie Chart, Scatter Chart and Radar Chart.

FL Chart ?? A library to draw fantastic charts in Flutter ?? Chart Types LineChart BarChart PieChart Read More Read More Read More ScatterChart RadarC

Iman khoshabi 5.2k Dec 27, 2022
A beautiful bezier line chart widget for flutter that is highly interactive and configurable.

Bezier Chart A beautiful bezier line chart widget for flutter that is highly interactive and configurable. Features Multi bezier lines Allow numbers a

Aeyrium 428 Dec 21, 2022
This project is used to introduce the use of flutter canvas, include draw chart, clip image's path and draw progress indicator.

flutter_canvas This project is used to introduce the use of flutter canvas, include draw chart, clip image's path and draw progress indicator. draw ch

YouXianMing 9 Oct 27, 2022
Maybe this is the best k chart in Flutter.Support drag,scale,long press,fling.And easy to use.

k_chart Maybe this is the best k chart in Flutter.Support drag,scale,long press,fling.And easy to use. display image gif Getting Started Install depen

OpenFlutter 342 Jan 9, 2023
Flutter chart library contains depth charts supporting various indicators and zooming

flutter_k_chart 介绍 一个仿火币的flutter图表库包含深度图,支持各种指标及放大缩小、平移等操作 webdemo演示 Demo v0.1.0:下载 APK 演示 简单用例 1.在 pubspec.yaml 中添加依赖 本项目数据来自火币openApi,火币的接口可能需要翻墙,接口

gwh 259 Dec 30, 2022
Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.

GraphView Get it from | Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful

Nabil Mosharraf 326 Jan 6, 2023
A simple candlestick chart for flutter. Supports smooth scroll and zoom

simple_candlestick_chart A simple candlestick chart for flutter. Supports smooth

7c00 14 Oct 17, 2022
:bar_chart: [wip] Create beautiful, responsive, animated charts using a simple and intuitive API.

fcharts A work-in-progress chart library for Flutter. Until version 1.0.0 the API is subject to change drastically. Needless to say, fcharts is not pr

Keenan Thompson 323 Dec 21, 2022
Draw dashed lines with any shape and style you want. Just like that.

dashed_line Draw dashed lines with any shape and style you want. Just like that. Usage Add the dependency to your pubspec.yaml (you can see the newest

LeanCode 16 Dec 20, 2022
Track your habits day by day and check your result like the GitHub's contributions board

Habits Diary Track your habits day by day and see your result like the GitHub's contributions board Download Support If you want to support this proje

Pigna 25 Oct 27, 2022
Stores and manages the data of your week expenses with a chart

personal_expenses_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you st

null 1 Dec 26, 2021
Charts Library for Flutter, written in Dart with Flutter.

Table of Contents New in the current release Illustration of the new "iterative auto layout" feature Autolayout step 1 Autolayout step 2 Autolayout st

Milan Zimmermann 225 Dec 25, 2022
Beautiful sparkline charts for Flutter

flutter_sparkline Beautiful sparkline charts for Flutter. Installation Install the latest version from pub. Quick Start Import the package, create a S

Victor Choueiri 255 Dec 21, 2022
A Flutter widget to use Apache ECharts (incubating) in a reactive way.

中文 [![pub](https://img.shields.io/pub/v/flutter_echarts.svg)](https://pub.dev/packages/flutter_echarts) A Flutter widget to use Apache ECharts in a re

LIN Chen 629 Dec 29, 2022
A Flutter data visualization library based on Grammar of Graphics.

Graphic is now under a total refactoring. The prior available version code is here: v0.3.0 . A Flutter data visualization library based on Grammar of

LIN Chen 906 Jan 3, 2023
Flutter cryptocurrency UI dashboard.

?? ?? Crypto Dashboard Flutter UI Kit ?? ?? ?? ⭐️ ⭐️ ??‍?? Free Flutter UI Kits based on designs on UpLabs ?? . Watch Youtube Speed code Tutorial Here

Olayemii Garuba 69 Nov 20, 2022
A scrollable time chart in Flutter.

time_chart An amazing time chart in Flutter. Chart Types TimeChart AmountChart Getting Started 1 - Depend on it Add it to your package's pubspec.yaml

Minseong Kim 26 Oct 28, 2022