qr_flutter 2.1.0+55

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

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.

Features #

  • Built on QR - Dart
  • Supports QR code versions 1 - 40
  • Error correction / redundancy
  • Configurable output size, padding, background and foreground colors
  • Export to image data to save to file or use in memory
  • No internet connection required

Installing #

If you're using Flutter 1.2+ or the master/beta channel then you will need to use version 2.0.0 or higher as Flutter 1.2 is not compatible with earlier versions of the Flutter framework.

dependencies:
  qr_flutter: ^2.0.0

If you're using an older Flutter version (< 1.2.1), you must use version 1.1.6 if you cannot upgrade to the latest version of Flutter:

dependencies:
  qr_flutter: ^1.1.6

Note: If you're using the Flutter master channel, if you encounter build issues, or want to try the latest and greatest then you should use the master branch and not a specific release version. To do so, use the following configuration in your pubspec.yaml:

dependencies:
  qr_flutter:
    git:
      url: git://github.com/lukef/qr.flutter.git

Keep in mind the master branch could be unstable.

After adding the dependency to your pubspec.yaml you can run: flutter packages get or update your packages using your IDE.

Getting started #

To start, import the dependency in your code:

import 'package:qr_flutter/qr_flutter.dart';

Next, to render a basic QR code you can use the following code (or something like it):

new QrImage(
  data: "1234567890",
  size: 200.0,
),

Depending on your data requirements you may want to tweak the QR code output. The following options are available:

PropertyTypeDescription
versionintA value between 1 and 40. See http://www.qrcode.com/en/about/version.html for details.
errorCorrectionLevelintA value defined on QrErrorCorrectLevel. e.g.: QrErrorCorrectLevel.L.
sizedoubleThe (square) size of the image. If not given, will auto size using shortest size constraint.
paddingEdgeInsetsPadding surrounding the QR code data
backgroundColorColorThe background color (default is none)
foregroundColorColorThe foreground color (default is black)
gaplessboolAdds an extra pixel in size to prevent gaps (default is true)

Example #

See the example directory for a basic working example.

FAQ #

Has it been tested in production? Can I use it in production? #

Yep! It's stable and ready to rock. It's currently in use in quite a few production applications including:

Outro #

Credits #

Thanks to Kevin Moore for his awesome QR - Dart library. It's the core of this library.

For author/contributor information, see the AUTHORS file.

License #

QR.Flutter is released under a modified MIT license. See LICENSE for details.

2.1.0 #

  • The gapless option is now true by default.
  • Allow assigning Key values to QrImage widgets.
  • Update qr.dart dependency.
  • qr.dart is now exported so you don't need a second import.

2.0.0 #

  • Flutter 1.2.1 compatibility

2.0.0-dev.1 #

1.1.6 #

  • Adds analyzer configuration
  • Fixes linting issues
  • Migrate to Dart 2.x friendly syntax
  • Tidy some initialization logic / code
  • Bump copyright

1.1.5 #

  • Add image data export functions (see test/painter_tests.dart for an example)

1.1.4 #

  • Add gapless toggle

1.1.3 #

  • Lower min sdk version to cater to some older versions of Flutter

1.1.2 #

  • The QrImage widget will now autosize if no size has been defined (thanks @romkor!)
  • Requires Dart 2 (as so does Flutter)
  • Dart 2 pubspec compatability changes

1.1.1 #

  • Fixes and issue where the QR image won't get repainted even though the data has changed

1.1.0 #

  • Update to 1.0 release of the dart qr library

1.0.0 #

  • Initial release

example/README.md

qr #

A new Flutter project.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  qr_flutter: ^2.1.0+55

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:qr_flutter/qr_flutter.dart';
  
Version Uploaded Documentation Archive
2.1.0+55 Jun 6, 2019 Go to the documentation of qr_flutter 2.1.0+55 Download qr_flutter 2.1.0+55 archive
2.0.0+51 Feb 26, 2019 Go to the documentation of qr_flutter 2.0.0+51 Download qr_flutter 2.0.0+51 archive
1.1.6 Jan 16, 2019 Go to the documentation of qr_flutter 1.1.6 Download qr_flutter 1.1.6 archive
1.1.5 Oct 31, 2018 Go to the documentation of qr_flutter 1.1.5 Download qr_flutter 1.1.5 archive
1.1.3 Aug 9, 2018 Go to the documentation of qr_flutter 1.1.3 Download qr_flutter 1.1.3 archive
1.1.2 Aug 6, 2018 Go to the documentation of qr_flutter 1.1.2 Download qr_flutter 1.1.2 archive
1.1.1 Apr 20, 2018 Go to the documentation of qr_flutter 1.1.1 Download qr_flutter 1.1.1 archive
1.1.0 Apr 20, 2018 Go to the documentation of qr_flutter 1.1.0 Download qr_flutter 1.1.0 archive
1.0.0 Mar 4, 2018 Go to the documentation of qr_flutter 1.0.0 Download qr_flutter 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
98
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
98
Learn more about scoring.

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

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/src/qr_image.dart.

Run flutter format to format lib/src/qr_image.dart.

Format lib/src/qr_painter.dart.

Run flutter format to format lib/src/qr_painter.dart.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
qr ^1.1.0 1.1.1
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
flutter_test
test ^1.3.4