zxing2 0.1.1 zxing2: ^0.1.1 copied to clipboard
A multi-format 1D/2D barcode image processing library implemented in Dart. This is a port of the Android library.
import 'dart:io';
import 'package:image/image.dart' as img;
import 'package:zxing2/qrcode.dart';
void main() {
var image = img.decodePng(File('tool/example.png').readAsBytesSync())!;
LuminanceSource source = RGBLuminanceSource(image.width, image.height,
image.getBytes(format: img.Format.abgr).buffer.asInt32List());
var bitmap = BinaryBitmap(HybridBinarizer(source));
var reader = QRCodeReader();
var result = reader.decode(bitmap);
print(result.text);
}