Git Product home page Git Product logo

arahimli / flutter_native_barcode_scanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freedelity/flutter_native_barcode_scanner

0.0 0.0 0.0 124 KB

Fast barcode/QR scanner flutter plugin using PlatformView and processing on native side

Home Page: https://pub.dev/packages/native_barcode_scanner

License: BSD 3-Clause "New" or "Revised" License

Ruby 3.48% Objective-C 0.06% Kotlin 46.86% Dart 24.07% Swift 25.52%

flutter_native_barcode_scanner's Introduction

native_barcode_scanner

A fast flutter plugin to scan barcodes and QR codes using the device camera. This plugin also supports text and MRZ recognition from the camera.

This plugin offers good performance compared to other plugins by minimizing the amount of data that is transferred between the Dart VM and the native side.

Most of the operations are actually done in the native side by using native SDK for barcode recognition and using PlatformView to show the camera stream.

Barcode recognition is based on these SDK:

The PlatformView allows to avoid transferring every video frame to let the plugin client display it inside a classical Flutter view. Using PlatformView has a performance trade-off compared to Flutter views but having to copy every frames through platform channels is much more costly. Even for devices with an older version than Android 10 (where PlatformViews induced a bigger performance penalty), using PlatformView gives better performance than other plugins exchanging image stream across platform channels.

Platform Support

Android iOS
Barcode (*)
Text
MRZ

(*) Support for specific barcodes is specified below

Barcode format Supported

Format Android iOS
CODE-39
CODE-93
CODE-128
EAN-8
EAN-13
ITF
Codabar
DataMatrix
QRCode
UPC-A
UPC-E

Getting Started

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

dependencies:
  native_barcode_scanner: ^1.0.0

Usage

Then you just have to import the package with

import 'package:native_barcode_scanner/barcode_scanner.dart';

Then, create a BarcodeScannerWidget in your widget tree where you want to show the camera stream. This widget has a onBarcodeDetected callback which can be used to be notified when barcodes are detected and let you process them:

@override
  Widget build(BuildContext context) {
    return BarcodeScannerWidget(
      onBarcodeDetected: (barcode) {
        print('Barcode detected: ${barcode.value} (format: ${barcode.format.name})');
      }
    );
  }

If you need to manipulate the behaviour of the barcode scanning process, you may use the static methods of the BarcodeScanner class.

flutter_native_barcode_scanner's People

Contributors

verbruik avatar ndusart avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.