Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (45 sloc) 1.56 KB

Flutter Barcode Plugin

The sample demonstrates how to create a simple Flutter barcode plugin with Dynamsoft Barcode Reader SDK for Android.

Usage

Download the source code:

git clone https://github.com/yushulx/flutter-barcode-plugin.git

Get a free 30-day trial license and set it in demo\lib\main.dart:

Future<void> initDynamsoftBarcodeReaderState() async {
    _barcodeReader = BarcodeReader();
    await _barcodeReader.initLicense('LICENSE-KEY');
  }

Read barcodes from an image file:

await _controller.takePicture(path);
String results = await _barcodeReader.decodeFile(path);

Build and run the app:

Android

cd demo
flutter run -d <Android Device ID>

iOS

cd demo/ios
pod install
cd ..
flutter run -d <iOS Device ID>

flutter barcode plugin

Flutter Barcode Plugin for Android & iOS

To edit and improve the plugin:

Android

Import barcode_reader/example/android to Android Studio.

iOS

Import barcode_reader/example/ios/Runner.xcworkspace to Xcode.

Reference

Blog

How to Create A Simple Flutter Barcode Plugin from Scratch

You can’t perform that action at this time.