qr
4.0.1, released 3 weeks ago by kevmoo.com
A pure‑Dart library for generating QR code data and image matrices.
What it does
It creates QR code payloads with configurable error correction and ECI support, then produces a module matrix that can be rendered manually. The API is immutable and works on all Dart platforms.
AI-written summary of version 4.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to generate QR codes in pure Dart or Flutter without a ready‑made widget
- You want full control over rendering the QR modules yourself
- You require ECI (Extended Channel Interpretation) or custom payload building
Skip it when
- You need a ready‑made Flutter widget for QR display
- You need QR scanning functionality
Strengths
- Supports all QR versions (1‑40) and error‑correction levels
- ECI support for multi‑language payloads
- Pure Dart, works on all platforms
- Immutable API reduces bugs
Weaknesses
- No built‑in Flutter widget, you must render the matrix yourself
- Breaking API changes in recent major versions
- Requires Dart SDK ^3.13.0
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:qr/qr.dart';
final qrCode = QrCode(
payload: QrPayload.fromString('Hello, world in QR form!'),
errorCorrectLevel: QrErrorCorrectLevel.low,
);
final qrImage = QrImage(qrCode);
// Render qrImage.moduleCount x qrImage.moduleCount matrix as neededAlternatives
Packages that do the same job and could replace qr.
- fhir_path
Model-independent FHIRPath evaluation engine in Dart, port of the Java reference implementation.
73Compare - reflectable
Provides runtime reflection via code generation with configurable capabilities.
71Compare - path_parsing
Pure Dart library for parsing SVG path strings and generating Dart path code.
50Compare - anyhow
Dart implementation of Rust's Result monad type and anyhow crate for error handling.
45Compare
Works with
Packages commonly used together with qr: ones it builds on, ones built on it, and its own family.
- qr_flutterBuilt on qrFlutter widget for rendering QR codes with customizable size, colors, and optional embedded images.
- barcodeBuilt on qrBarcode generation library for Dart that can generate generic drawing operations for any backend.
- pretty_qr_codeBuilt on qrA highly customizable Flutter widget for rendering QR codes.
- qr_imageBuilt on qrGenerate QR code images with logos easily using image processing and QR code libraries.
- auth_totpBuilt on qrA time-based one-time password (TOTP) and HOTP authentication package for Flutter apps.
- welkui_flutterBuilt on qrComic-inspired Flutter widget set with crisp outlines, hard shadows, and bundled typography.
- qr_widgetBuilt on qrFlutter widget for rendering QR codes with optional image overlay.