BarcodeView.symbol constructor

BarcodeView.symbol(
  1. BarcodeSymbol symbol, {
  2. Key? key,
  3. BarcodeStyle style = BarcodeStyle.classic,
  4. double? width,
  5. double? height,
  6. String? semanticLabel,
})

Draws a BarcodeSymbol as it is: the modules a reader sampled from a code (Barcode.symbol), or a symbol from BarcodeWriter.encode or BarcodeStyle.encode. Nothing is encoded, so the code shown is exactly the one read.

final BarcodeSymbol? symbol = capture.barcode.symbol;
if (symbol != null) BarcodeView.symbol(symbol, width: 56);

In debug mode, asserts that a QR code under a BarcodeStyle.logo has the error correction the logo needs; encode it with BarcodeStyle.encode to get it.

Implementation

BarcodeView.symbol(
  BarcodeSymbol this.symbol, {
  super.key,
  this.style = BarcodeStyle.classic,
  this.width,
  this.height,
  this.semanticLabel,
}) : data = symbol.text,
     bytes = null,
     writer = null,
     errorBuilder = null;