qrcode_reader 0.3.3

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

QRCode Reader plugin for Flutter

A Flutter plugin for reading QR Codes with the camera.

Example

import 'package:qrcode_reader/QRCodeReader.dart';
Future<String> futureString = new QRCodeReader()
               .setAutoFocusIntervalInMs(200) // default 5000
               .setForceAutoFocus(true) // default false
               .setTorchEnabled(true) // default false
               .setHandlePermissions(true) // default true
               .setExecuteAfterPermissionGranted(true) // default true
               .scan();

These options are Android only, this is the simplest way of plugin usage:

Future<String> futureString = new QRCodeReader().scan();

0.3.2

  • iOS layout fixes

0.3.1

  • iOS orientation change fix

0.3.0

  • iOS support

0.2.0

  • Configurable permission behaviour

0.1.4

  • If the permission was granted the camera will open

0.1.3

  • When the app does not have the camera permission an error is sent in the result

0.1.2

  • Asking camera permissions

0.1.0

  • Initial Release

example/lib/main.dart

// Copyright (c) <2017> <Matheus Villela>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:qrcode_reader/QRCodeReader.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'QRCode Reader Demo',
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  final Map<String, dynamic> pluginParameters = {
  };

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Future<String> _barcodeString;

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: const Text('QRCode Reader Example'),
      ),
      body: new Center(
          child: new FutureBuilder<String>(
              future: _barcodeString,
              builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
                return new Text(snapshot.data != null ? snapshot.data : '');
              })),
      floatingActionButton: new FloatingActionButton(
        onPressed: () {
          setState(() {
            _barcodeString = new QRCodeReader()
                .setAutoFocusIntervalInMs(200)
                .setForceAutoFocus(true)
                .setTorchEnabled(true)
                .setHandlePermissions(true)
                .setExecuteAfterPermissionGranted(true)
                .scan();
          });
        },
        tooltip: 'Reader the QRCode',
        child: new Icon(Icons.add_a_photo),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  qrcode_reader: ^0.3.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:qrcode_reader/QRCodeReader.dart';
  
Version Uploaded Documentation Archive
0.3.3 Mar 24, 2018 Go to the documentation of qrcode_reader 0.3.3 Download qrcode_reader 0.3.3 archive
0.3.2 Oct 13, 2017 Go to the documentation of qrcode_reader 0.3.2 Download qrcode_reader 0.3.2 archive
0.3.1 Oct 11, 2017 Go to the documentation of qrcode_reader 0.3.1 Download qrcode_reader 0.3.1 archive
0.3.0 Oct 11, 2017 Go to the documentation of qrcode_reader 0.3.0 Download qrcode_reader 0.3.0 archive
0.2.2 Sep 19, 2017 Go to the documentation of qrcode_reader 0.2.2 Download qrcode_reader 0.2.2 archive
0.2.1 Sep 19, 2017 Go to the documentation of qrcode_reader 0.2.1 Download qrcode_reader 0.2.1 archive
0.2.0 Sep 19, 2017 Go to the documentation of qrcode_reader 0.2.0 Download qrcode_reader 0.2.0 archive
0.1.4 Sep 16, 2017 Go to the documentation of qrcode_reader 0.1.4 Download qrcode_reader 0.1.4 archive
0.1.3 Sep 16, 2017 Go to the documentation of qrcode_reader 0.1.3 Download qrcode_reader 0.1.3 archive
0.1.2 Sep 16, 2017 Go to the documentation of qrcode_reader 0.1.2 Download qrcode_reader 0.1.2 archive

All 12 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
90
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
45
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.

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 https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0