Search packages, repositories and app categories

Package detailsv4.0.1

qr

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
4.9M
Likes
265
Pub points
160

Install package

flutter pub add qr

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The qr package is a Dart library for generating QR codes, supporting versions 1 to 40 with customizable error correction levels. It enables developers to create scalable, reliable QR codes suitable for various applications. The library is lightweight and compatible across all major platforms including Android, iOS, Web, macOS, Windows, and Linux. It provides straightforward APIs for encoding text, URLs, and other data into QR code images. Ideal for apps requiring barcode generation without external dependencies.

Use cases

  • Generating QR codes for URLs
  • Creating product or ticket identifiers
  • Enabling contact sharing via QR
  • Supporting offline data transfer
  • Facilitating app linking
  • Embedding information in printable materials

Key features

  • Supports QR versions 1–40
  • Multiple error correction levels
  • Cross-platform compatibility
  • Simple API for encoding data
  • Highly customizable output
  • Lightweight and efficient

Suitable for

  • Mobile app developers
  • Web application creators
  • Desktop application builders
  • Inventory or ticketing systems
  • Marketing and event apps
  • Educational tools

Considerations

  • Requires manual handling of image rendering
  • No built-in UI components
  • Error correction affects size and readability
  • Limited to QR code generation only
  • No decoding functionality included
  • Output format depends on external rendering

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

Rankings