flutter_barcode_scanner 0.0.9

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 91

flutter_barcode_scanner #

A plugin for Flutter apps that adds barcode scanning support on both Android and iOS.

pub package

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 #

⚡ Don't worry, you don't need to do anything.

iOS #

Deployment target : 10 Swift Version : 5

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 5 as the code for iOS is written in Swift 5. To use on iOS, open the Xcode and add camera usage description in Info.plist.

<key>NSCameraUsageDescription</key>
<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

dependencies:
  ...
  flutter_barcode_scanner: ^0.0.9
  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,CANCEL_BUTTON_TEXT,isShowFlashIcon);

Here in scanBarcode(COLOR_CODE,CANCEL_BUTTON_TEXT) COLOR_CODE is hex-color which is the color of line in barcode overlay you can pass color of your choice, , CANCEL_BUTTON_TEXT is a text of cancel button on screen you can pass text of your choice and language, isShowFlashIcon is bool value used to show or hide the flash icon.

0.0.9 #

  • Potential bug fix for issue #9 (Swift 3 inference for @Objc)

0.0.8 #

  • Added one more parameter in scanBarcode which is isShowFlashIcon. Now you can pass bool value of your choice to show or hide the flash icon.
  • Upgraded example code to Swift 5. Plugin is now Swift 5 compatible.

0.0.7 #

  • Added one more parameter in scanBarcode which is CANCEL_BUTTON_TEXT. Now you can pass text of your choice and your language choice.

0.0.6 #

  • Bug fixes and improvements

0.0.5 #

  • Added support for Android X

0.0.4 #

  • Bug fixes and improvements

0.0.3 #

  • Added Android Support for 16 and above
  • Minor changes and bug fixes

0.0.2 #

  • Minor bug fixes and improvements

0.0.1 #

  • Initial release.

example/README.md

flutter_barcode_scanner_example #

Demonstrates how to use the flutter_barcode_scanner plugin.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_barcode_scanner: ^0.0.9

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:flutter_barcode_scanner/flutter_barcode_scanner.dart';
  
Version Uploaded Documentation Archive
0.0.9 May 2, 2019 Go to the documentation of flutter_barcode_scanner 0.0.9 Download flutter_barcode_scanner 0.0.9 archive
0.0.8 Apr 12, 2019 Go to the documentation of flutter_barcode_scanner 0.0.8 Download flutter_barcode_scanner 0.0.8 archive
0.0.7 Mar 28, 2019 Go to the documentation of flutter_barcode_scanner 0.0.7 Download flutter_barcode_scanner 0.0.7 archive
0.0.6 Mar 23, 2019 Go to the documentation of flutter_barcode_scanner 0.0.6 Download flutter_barcode_scanner 0.0.6 archive
0.0.5 Mar 23, 2019 Go to the documentation of flutter_barcode_scanner 0.0.5 Download flutter_barcode_scanner 0.0.5 archive
0.0.4 Mar 12, 2019 Go to the documentation of flutter_barcode_scanner 0.0.4 Download flutter_barcode_scanner 0.0.4 archive
0.0.3 Mar 11, 2019 Go to the documentation of flutter_barcode_scanner 0.0.3 Download flutter_barcode_scanner 0.0.3 archive
0.0.2 Mar 8, 2019 Go to the documentation of flutter_barcode_scanner 0.0.2 Download flutter_barcode_scanner 0.0.2 archive
0.0.1 Mar 8, 2019 Go to the documentation of flutter_barcode_scanner 0.0.1 Download flutter_barcode_scanner 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
88
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

We analyzed this package on Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8