zxing2 0.2.3 copy "zxing2: ^0.2.3" to clipboard
zxing2: ^0.2.3 copied to clipboard

A multi-format 1D/2D barcode image processing library implemented in Dart. This is a port of the Android library.

example/main.dart

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
          .convert(numChannels: 4)
          .getBytes(order: img.ChannelOrder.rgba)
          .buffer
          .asInt32List());
  var bitmap = BinaryBitmap(HybridBinarizer(source));

  var reader = QRCodeReader();
  var result = reader.decode(bitmap);
  print(result.text);
}
53
likes
160
pub points
97%
popularity

Publisher

verified publisherxaha.dev

A multi-format 1D/2D barcode image processing library implemented in Dart. This is a port of the Android library.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

charcode, collection, fixnum, meta

More

Packages that depend on zxing2