barcode_scan 0.0.1

  • Example
  • Installing
  • Versions
  • 49

Barcode Scanner #

A flutter plugin for scanning 2D barcodes and QR codes.

This provides a simple wrapper for two commonly used iOS and Android libraries:



Features #

  • [x] Scan 2D barcodes
  • [x] Scan QR codes
  • [x] Control the flash while scanning
  • [ ] Customize the permission request text
  • [ ] Support multiple barcode libraries

Getting Started #

###Android For Android, you must do the following before you can use the plugin:

  • Add the camera permission to your AndroidManifest.xml

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

  • Add the Barcode activity to your AndroidManifest.xml

    <activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>

iOS #

To use on iOS, you must add the the camera usage description to your Info.plist

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

[0.0.1] - 10/29/17

  • Supports 2D & QR Codes
  • Control flash while scanning


import 'dart:async';

import 'package:barcode_scan/barcode_scanner.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  String barcode = "";

  initState() {

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
          appBar: new AppBar(
            title: new Text('Barcode Scanner Example'),
          body: new Center(
            child: new Column(
              children: <Widget>[
                new Container(
                  child: new MaterialButton(
                      onPressed: scan, child: new Text("Scan")),
                  padding: const EdgeInsets.all(8.0),
                new Text(barcode),

  Future scan() async {
    String barcode = await BarcodeScanner.scan();
    setState(() => this.barcode = barcode);

Use this package as a library

1. Depend on it

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

  barcode_scan: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:barcode_scan/barcode_scan.dart';
Version Uploaded Documentation Archive
1.0.0 Mar 4, 2019 Go to the documentation of barcode_scan 1.0.0 Download barcode_scan 1.0.0 archive
0.0.8 Nov 19, 2018 Go to the documentation of barcode_scan 0.0.8 Download barcode_scan 0.0.8 archive
0.0.7 Aug 30, 2018 Go to the documentation of barcode_scan 0.0.7 Download barcode_scan 0.0.7 archive
0.0.6 Aug 30, 2018 Go to the documentation of barcode_scan 0.0.6 Download barcode_scan 0.0.6 archive
0.0.5 Aug 21, 2018 Go to the documentation of barcode_scan 0.0.5 Download barcode_scan 0.0.5 archive
0.0.4 Apr 17, 2018 Go to the documentation of barcode_scan 0.0.4 Download barcode_scan 0.0.4 archive
0.0.3 Feb 8, 2018 Go to the documentation of barcode_scan 0.0.3 Download barcode_scan 0.0.3 archive
0.0.2 Nov 8, 2017 Go to the documentation of barcode_scan 0.0.2 Download barcode_scan 0.0.2 archive
0.0.1 Oct 30, 2017 Go to the documentation of barcode_scan 0.0.1 Download barcode_scan 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.