qrcode_reader 0.3.2

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

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),
      ),
    );
  }
}

1. Depend on it

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


dependencies:
  qrcode_reader: "^0.3.2"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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.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
0.1.1 Sep 11, 2017 Go to the documentation of qrcode_reader 0.1.1 Download qrcode_reader 0.1.1 archive

All 11 versions...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1
  • Flutter: 0.0.22

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
85 / 100
Health:
Code health derived from static analysis. [more]
98 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
92

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
flutter 0.0.0
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
http 0.11.3+16
http_parser 3.1.1
meta 1.1.1 1.1.2
path 1.5.1
sky_engine 0.0.99
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.4 1.1.5
vector_math 2.0.5