input property
BarcodeInput?
get
input
What BarcodeWriter accepts for this format: a description for a
form field, an example and the kind of keyboard. null if it cannot
be written.
It guides the input; the writer checks it. An invalid input throws a
BarcodeWriteException that says what is wrong, e.g. Invalid check digit '4', expecting '3'.
final BarcodeInput input = BarcodeFormat.ean13.input!;
TextField(
decoration: InputDecoration(helperText: input.description, hintText: input.example),
keyboardType: input.digitsOnly ? TextInputType.number : TextInputType.text,
);
Implementation
BarcodeInput? get input => switch (this) {
qrCode || qrCodeModel2 => _qrCode,
microQrCode => _microQrCode,
rmqrCode => _rmqrCode,
dataMatrix => _dataMatrix,
aztec || aztecCode => _aztec,
aztecRune => _aztecRune,
pdf417 || compactPdf417 => _pdf417,
microPdf417 => _microPdf417,
code128 => _code128,
code39 || code39Standard => _code39,
code39Extended || code93 || telepenAlpha => _ascii,
codabar => _codabar,
itf || telepenNumeric => _evenDigits,
eanUpc || ean13 => _ean13,
ean8 => _ean8,
upcA => _upcA,
upcE => _upcE,
isbn => _isbn,
dataBar || dataBarOmni || dataBarStacked || dataBarStackedOmni => _gtin,
dataBarLimited => _gtinLimited,
dataBarExpanded || dataBarExpandedStacked => _gs1,
code32 => _code32,
pzn => _pzn,
telepen => _telepen,
dxFilmEdge => _dxFilmEdge,
_ => null,
};