BarcodeContentView class
Shows a BarcodeContent as a barcode drawn with what its standard
requires: a BarcodeView of its payload.
- A SwissQrBillContent gets BarcodeStyle.swissQrBill (the Swiss cross) unless a style is given.
- An EpcPaymentContent or SwissQrBillContent is a QR code with error correction M, as the EPC and the Swiss Payment Standards ask.
- A Gs1Content is encoded as GS1, a BinaryContent byte for byte.
- A content whose BarcodeContent.validate finds problems shows errorBuilder instead of a code.
BarcodeContentView(
const EpcPaymentContent(
name: 'Kaffeehaus Lumen GmbH',
iban: 'DE89370400440532013000',
amount: '19.50',
),
width: 220,
errorBuilder: (context, error) => Text(error.message),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BarcodeContentView
Constructors
- BarcodeContentView(BarcodeContent content, {Key? key, BarcodeWriter writer = const BarcodeWriter(BarcodeFormat.qrCode), BarcodeStyle? style, double? width, double? height, String? semanticLabel, Widget errorBuilder(BuildContext context, BarcodeWriteException error)?})
-
Creates a view of
content, encoded withwriter(a QR code by default).const
Properties
- content → BarcodeContent
-
What the code holds.
final
- errorBuilder → Widget Function(BuildContext context, BarcodeWriteException error)?
-
Shown instead of the barcode if content has problems
(BarcodeContent.validate; the error's message lists them, one per
line) or cannot be encoded. Without it, an empty box is shown.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Height in logical pixels.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Accessibility label; see
BarcodeView.semanticLabel.final - style → BarcodeStyle?
-
Colors, shapes, logo, title, caption and quiet zone;
BarcodeStyle.swissQrBill for a SwissQrBillContent and
BarcodeStyle.classic for the rest when
null.final - width → double?
-
Width in logical pixels.
final
- writer → BarcodeWriter
-
Encodes the payload: the format, error correction, version and the
text under linear barcodes. A payment standard that needs a QR code
with error correction M gets it, whatever this says.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited