qr 4.0.0 copy "qr: ^4.0.0" to clipboard
qr: ^4.0.0 copied to clipboard

A QR code generation library for Dart. Supports QR code version 1 through 40, error correction and redundancy.

A QR code generation package for Dart.

Pub Package package publisher CI

Features #

  • Supports QR code versions 1 - 40
  • Error correction / redundancy
  • ECI (Extended Channel Interpretation) support

Demo #

A rich, HTML demo can be found at: qr.kevmoo.com.

QR Code Generator Demo

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 = QrCode(
  payload: QrPayload.fromString('Hello, world in QR form!'),
  errorCorrectLevel: QrErrorCorrectLevel.low,
);
final qrImage = QrImage(qrCode);

To enable Extended Channel Interpretation (ECI) mode or build multi-part data, you can use QrPayload:

final payload = QrPayload()
  ..addECI(QrEciValue.utf8)
  ..addString('Hello, world in QR form!');

final qrCode = QrCode(
  payload: payload,
  errorCorrectLevel: QrErrorCorrectLevel.low,
);

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

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

See the example directory for further details.

Packages that use package:qr #

238
likes
160
points
2.01M
downloads
screenshot

Documentation

API reference

Publisher

verified publisherkevmoo.com

Weekly Downloads

A QR code generation library for Dart. Supports QR code version 1 through 40, error correction and redundancy.

Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

Dependencies

meta

More

Packages that depend on qr