qr
v3.0.2A QR code generation library for Dart and Flutter. Supports QR code version 1 through 40, error correction and redundancy.
Архив пакета: https://pubdev.letsnova.ru/api/archives/qr/3.0.2.tar.gz
dart pub add qrREADME
A QR code generation library for Dart and Flutter.
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 = QrCode(4, QrErrorCorrectLevel.L)
..addData('Hello, world in QR form!');
final qrImage = QrImage(qrCode);
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.
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
barcode - A package that supports many types of scannable codes, include QR.
Demo
A working demo can be found here: kevmoo.github.io/qr.dart
История изменений
3.0.2
- Require package
web: ^1.0.0. - Require Dart 3.4 or greater.
3.0.1
- Fix example in
README.md. - Require Dart 2.16 or greater.
3.0.0
QrImageadded to handle image bits.QrCode.make()removedQrCode.isDark()moved toQrImage- Added alpha numeric mode support via
addAlphaNumeric
2.1.0
- Added numeric mode support via
addNumeric
2.0.0
- Expose Mask Pattern as a parameter of QrCode.make()
- Migrated to null safety.
- Require Dart SDK
>=2.12.0 <3.0.0.
1.3.0
- Added
QrCode.addByteData. - Added
QrCode.fromUint8List.
1.2.1
- Require Dart SDK
>=2.6.0 <3.0.0.
1.2.0
- Expose
InputTooLongExceptionexception 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
fromDataQrCode factory that allows QrCode initiation without providingtypeNumber.
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.
