qrscan 0.1.4

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

Language: English | 中文简体

QR Code Scanner #

License Pub

A Flutter plugin 🛠 to scanning. Ready for Android 🚀 base on ZXing github

qrscan.gif

permission: #

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

Installation #

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

dependencies:
 qrscan: ^0.1.0

Usage example #

import 'package:qrscan/qrscan.dart' as scanner;

String barcode = await scanner.scan();

Contribute #

We would ❤️ to see your contribution!

License #

Distributed under the MIT license. See LICENSE for more information.

About #

Created by Shusheng.

[0.0.1] - 2019/04/7

[0.0.2] - 2019/04/7

[0.0.3] - 2019/04/7

[0.1.0] - 2019/04/8

[0.1.1] - 2019/04/8

[0.1.2] - 2019/04/8

[0.1.3] - 2019/04/8

[0.1.4] - 2019/04/11

example/README.md

qrscan_example #

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:qrscan/qrscan.dart' as scanner;

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

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

  @override
  initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Qrcode Scanner Example'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.end,
            children: <Widget>[
              Text(barcode),
              MaterialButton(
                onPressed: scan,
                child: Text("Scan"),
                color: Colors.blue,
                textColor: Colors.white,
              ),
            ],
          ),
        ),
      ),
    );
  }

  Future scan() async {
    try {
      String barcode = await scanner.scan();
      setState(() => this.barcode = barcode);
    } on PlatformException catch (e) {
      if (e.code == scanner.CameraAccessDenied) {
        setState(() {
          this.barcode = 'The user did not grant the camera permission!';
        });
      } else {
        setState(() => this.barcode = 'Unknown error: $e');
      }
    } on FormatException {
      setState(() => this.barcode =
          'null (User returned using the "back"-button before scanning anything. Result)');
    } catch (e) {
      setState(() => this.barcode = 'Unknown error: $e');
    }
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  qrscan: ^0.1.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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:qrscan/qrscan.dart';
  
Version Uploaded Documentation Archive
0.1.4 Apr 11, 2019 Go to the documentation of qrscan 0.1.4 Download qrscan 0.1.4 archive
0.1.3 Apr 8, 2019 Go to the documentation of qrscan 0.1.3 Download qrscan 0.1.3 archive
0.1.2 Apr 8, 2019 Go to the documentation of qrscan 0.1.2 Download qrscan 0.1.2 archive
0.1.1 Apr 8, 2019 Go to the documentation of qrscan 0.1.1 Download qrscan 0.1.1 archive
0.1.0 Apr 7, 2019 Go to the documentation of qrscan 0.1.0 Download qrscan 0.1.0 archive
0.0.3 Apr 7, 2019 Go to the documentation of qrscan 0.0.3 Download qrscan 0.0.3 archive
0.0.2 Apr 7, 2019 Go to the documentation of qrscan 0.0.2 Download qrscan 0.0.2 archive
0.0.1 Apr 7, 2019 Go to the documentation of qrscan 0.0.1 Download qrscan 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.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
Dev dependencies
test ^1.5.1
test_coverage ^0.2.0