yomu library

Yomu - Pure Dart QR Code and Barcode Reader Library

A zero-dependency QR code and barcode decoding library for Dart and Flutter.

Quick Start

import 'package:yomu/yomu.dart';

// Create a YomuImage container
final image = YomuImage.rgba(bytes: imageBytes, width: 300, height: 300);

// Decode QR codes and all barcode formats
final result = Yomu.all.decode(image);
print(result.text);

// Decode QR codes only
final qrResult = Yomu.qrOnly.decode(image);

Main Classes

  • Yomu - The main entry point for QR code and barcode decoding
  • DecoderResult - Contains the decoded text and metadata
  • BarcodeScanner - Configuration for 1D barcode scanning
  • BarcodeResult - Contains the decoded barcode text and metadata

Exception Handling

All yomu-specific exceptions extend YomuException:

try {
  final image = YomuImage.rgba(bytes: imageBytes, width: 300, height: 300);
  final result = Yomu.all.decode(image);
} on YomuException catch (e) {
  print('Failed: ${e.message}');
}

Classes

BarcodeDecoder
Abstract base class for 1D barcode decoders.
BarcodeResult
1D Barcode decoder result.
BarcodeScanner
1D barcode scanner with configurable decoders.
CodabarDecoder
Codabar barcode decoder.
Code128Decoder
Code 128 barcode decoder.
Code39Decoder
Code 39 barcode decoder.
DecoderResult
The result of a successful QR code decode operation.
EAN13Decoder
EAN-13 barcode decoder.
EAN8Decoder
EAN-8 barcode decoder.
ITFDecoder
ITF (Interleaved 2 of 5) barcode decoder.
UPCADecoder
UPC-A barcode decoder.
Yomu
The main entry point for QR code and barcode decoding operations.
YomuImage
A platform-agnostic image container for passing data to Yomu.

Enums

YomuImageFormat
Represents the pixel format of a YomuImage.

Exceptions / Errors

ArgumentException
Thrown when an invalid argument is provided to a Yomu method.
BarcodeException
Exception thrown when 1D barcode decoding fails.
DecodeException
Thrown when decoding the detected code fails.
DetectionException
Thrown when QR code or barcode detection fails.
ImageProcessingException
Thrown when image processing fails.
ReedSolomonException
Thrown when Reed-Solomon error correction fails.
YomuException
Base class for all yomu-specific exceptions.