flutter_qr_reader 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 93

flutter_qr_reader #

QR code (scan code / picture) recognition (AndroidView/UiKitView)

DEMO #

demo

demo

Getting Started #

import 'package:flutter_qr_reader/flutter_qr_reader.dart';

// 识别图片
final String data = await FlutterQrReader.imgScan(File);

// 嵌入视图
QrReaderView(
  width: 320,
  height: 350,
  callback: (container) {},
)
// 打开手电筒
..setFlashlight
// 开始扫码
..startCamera
// 结束扫码
..stopCamera

For IOS #

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>

And you will need provide the description of camera's permission to work properly, otherwise will crash your app.

  <key>NSCameraUsageDescription</key>
	<string>The porpuse explaining why you will use the camera</string>

Built-in UI #

Widget build(BuildContext context) {
    return new Scaffold(
      body: QrcodeReaderView(key: qrViewKey, onScan: onScan),
    );
}

GlobalKey<QrcodeReaderViewState> qrViewKey = GlobalKey();

Future onScan(String data) async {
    await showCupertinoDialog(
      context: context,
      builder: (context) {
        return CupertinoAlertDialog(
          title: Text("扫码结果"),
          content: Text(data),
          actions: <Widget>[
            CupertinoDialogAction(
              child: Text("确认"),
              onPressed: () => Navigator.pop(context),
            )
          ],
        );
      },
    );
    qrViewKey.currentState.startScan();
}

0.0.1 #

0.0.2 #

增加内置UI

0.0.3 #

0.0.4 #

0.0.5 #

1.0.0 #

1.0.0+1 #

1.0.1 #

修改扫码后的操作

1.0.2 #

降低zxing版本至3.3.3

1.0.3 #

解决scanBoxRatio无效问题

example/README.md

flutter_qr_reader_example #

Demonstrates how to use the flutter_qr_reader plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_qr_reader: ^1.0.3

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_qr_reader/flutter_qr_reader.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
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]
93
Learn more about scoring.

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

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flutter_qr_reader.dart.

Run flutter format to format lib/flutter_qr_reader.dart.

Format lib/qrcode_reader_view.dart.

Run flutter format to format lib/qrcode_reader_view.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
image_picker ^0.6.0+9 0.6.1+11
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test