Skip to content

Latest commit

 

History

History
245 lines (129 loc) · 5.02 KB

README_EN.md

File metadata and controls

245 lines (129 loc) · 5.02 KB

ai_barcode

totem


English Document 中文文档

ai_barcode: Support Android and IOS recognition of 'one-dimensional barcode' and 'two-dimensional barcode'

pub package

Highlights: `` ai_barcode: Support Scanner embedded in flutter pages to meet changing business needs ''

Effect

iOS-Scanner Android-Scanner
ios android
:- :-
iOS-Creator Android-Creator
ios android
:- :-
Web-Creator MacOS-Creator
web macOS
:- :-

ai_barcode inproject practical application flutter sample

Download Android apk ios ipa obtained by running the project Blog web site

1.Installing

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

pub package


dependencies:

  ai_barcode: ^version

Or depending on

dependencies:

  # barcode plugin.
  ai_barcode:
    git:
      url: https://github.com/pdliuw/ai_barcode.git

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get


Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ai_barcode/ai_barcode.dart';


2.Usage

The use of 'Camera' requires dynamic application permission, dynamic permission recommendation:permission_handler

Configure permissions

Android permission configuration:


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

iOS permission configuration:


    <key>NSCameraUsageDescription</key>
    <string>Can we access your camera in order to scan barcodes?</string>


iOS supports PlatformView configuration:

	
    <key>io.flutter.embedded_views_preview</key>
    <true/>
    

1.Where '1D barcode, 2D barcode' is used:

Brief example

                //cameraWidth: the width of the camera; 
                //the height of the cameraHeight camera;
                //which can be dynamically adjusted according to the actual business

                Container(
                  color: Colors.black26,
                  width: cameraWidth,
                  height: cameraHeight,
                  child: PlatformAiBarcodeScannerWidget(
                    platformScannerController: _scannerController,
                  ),
                ),

Complete example

Full example, click here

2.Call / apply

*1、Turn on the camera device


          _scannerController.startCamera();

*2、Open Preview / Recognize 'Barcode'


          _scannerController.startCameraPreview();

*3、Close Preview / Recognize 'Barcode'


      _scannerController.stopCameraPreview();

*4、Turn off camera equipment


      _scannerController.stopCamera();

*5、Turn on the flashlight


      _scannerController.openFlash();

*5、Flashlight off


      _scannerController.closeFlash();

*5、Toggle flashlight


      _scannerController.toggleFlash();

Seeing it here is overwhelming?Click to see project examples

Thanksgiving

iOS-Barcode/QRCode Scanner/Creator Android-Barcode/QRCode Scanner/Creator Web、MacOS-QrCode Creator
Built on: MTBBarcodeScanner Built on: dm77/barcodescanner Built on: qr_flutter
:- :- :-

TODO

  • Support: Generate barcode

  • Support: Camera image can be frozen after successfully scanning barcode on iOS

LICENSE

BSD 3-Clause License

Copyright (c) 2020, pdliuw
All rights reserved.