flutter_barcode_scanner 0.0.3 icon indicating copy to clipboard operation
flutter_barcode_scanner: ^0.0.3 copied to clipboard


A plugin for barcode scanning support on Android and iOS. Supports barcodes, QR codes, etc.

flutter_barcode_scanner #

A flutter plugin adds barcode scanning support on both Android and iOS.

Demo gif

Try example #

Just clone the repository, open the project in Android Studio/ VS Code, open pubspec.yaml and click on Packages get. Connect device and hit run. To run on iPhone you need to run from Xcode first time and just make pod install in example/ios.

Getting Started #

Follow the steps for Android and iOS

Android #

To use on android, you need to add some permissions and a BarcodeCaptureActivity to AndroidManifest.

  1. Add the camera permission to your AndroidManifest.xml

    <uses-permission android:name="android.permission.CAMERA" />

  2. Add the BarcodeScanner activity to your AndroidManifest.xml. Do NOT modify the name.

    <activity android:name="com.amolg.flutterbarcodescanner.BarcodeCaptureActivity" />

iOS #

As iOS code is written in Swift so you need to convert your existing iOS codebase to swift (or if you are creating a new project from Android Studio make sure to check Include Swift support for iOS code.) To do that you can create a new project with same name in different location and then just copy iOS folder to existing.(if any changes made before make sure to add these in iOS(swift)). After making codebase in swift make sure that the Swift version is 4.2 as the code for iOS is written in Swift 4.2. To use on iOS, open the Xcode and add camera usage description in Info.plist

<string>Camera permission is required for barcode scanning.</string>

How to use ? #

After making the changes in Android ans iOS add flutter_barcode_scanner to pubspec.yaml

  flutter_barcode_scanner: ^0.0.1
  1. You need to import the package first.

    import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';

  2. Then use the scanBarcode method to access barcode scanning.

    String barcodeScanRes = await FlutterBarcodeScanner.scanBarcode(COLOR_CODE);

Here in scanBarcode(COLOR_CODE) you can pass hex-color which is the color of line in barcode overlay.

pub points


unverified uploader

A plugin for barcode scanning support on Android and iOS. Supports barcodes, QR codes, etc.



Icon for licenses.unknown (LICENSE)




Packages that depend on flutter_barcode_scanner