qr 1.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 99

A QR code generation library for Dart and Flutter.

Build Status

Features #

  • Supports QR code versions 1 - 40
  • Error correction / redundancy

Getting started #

To start, import the dependency in your code:

import 'package:qr/qr.dart';

To build your QR code data you should do so as such:

final qrCode = new QrCode(4, QrErrorCorrectLevel.L);
qrCode.addData("Hello, world in QR form!");

Now you can use your _qrCode instance to render a graphical representation of the QR code. A basic implementation would be as such:

for (int x = 0; x < qrCode.moduleCount; x++) {
  for (int y = 0; y < qrCode.moduleCount; y++) {
    if (qrCode.isDark(y, x)) {
      // render a dark square on the canvas

See the example directory for further details.

Pre-made UI libraries #

The following libraries use qr.dart to generate QR codes for you out of the box:

QR - Flutter - A Flutter Widget to render QR codes

Demo #

A working demo can be found here: https://kevmoo.github.io/qr.dart/

Authors #

1.2.0 #

  • Expose InputTooLongException exception so that applications and libraries can check for data length errors.

1.1.1 #

  • Require Dart SDK >=2.1.0 <3.0.0.
  • Fix a bug that fromData doesn't add supplied data.

1.1.0 #

  • Add fromData QrCode factory that allows QrCode initiation without providing typeNumber.

1.0.1 #

  • Support Dart 2 stable.

1.0.0 #

  • Require at least Dart SDK 2.0.0-dev.17.
  • Fixed a subtle bug with number handling.

0.1.0+2 #

  • Update README to include basic documentation
  • Update pubspec.yaml description

0.1.0+1 #

  • Fix author email.

0.1.0 #

  • Initial release.


import 'src/qr_demo.dart';

void main() {

Use this package as a library

1. Depend on it

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

  qr: ^1.2.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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/qr.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health issues and suggestions

Document public APIs. (-0.00 points)

28 out of 29 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
meta ^1.1.0 1.1.8
Dev dependencies
build_runner ^1.1.2
build_web_compilers >=1.1.0 <3.0.0
pedantic ^1.0.0
stream_transform ^0.0.19
test ^1.5.0