QrImageView class

A widget that shows a QR code.

Inheritance

Constructors

QrImageView({required String data, Key? key, double? size, bool drawCircle = false, Color? circleColor, EdgeInsets padding = const EdgeInsets.all(10.0), Color backgroundColor = Colors.transparent, @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color foregroundColor = Colors.black, int version = QrVersions.auto, int errorCorrectionLevel = QrErrorCorrectLevel.L, QrErrorBuilder? errorStateBuilder, bool constrainErrorBounds = true, bool gapless = true, ImageProvider<Object>? embeddedImage, QrEmbeddedImageStyle embeddedImageStyle = const QrEmbeddedImageStyle(), String semanticsLabel = 'qr code', QrEyeStyle eyeStyle = const QrEyeStyle(eyeShape: QrEyeShape.square), QrDataModuleStyle dataModuleStyle = const QrDataModuleStyle(dataModuleShape: QrDataModuleShape.square), bool embeddedImageEmitsError = false, Gradient? gradient})
Create a new QR code using the String data and the passed options (or using the default options).
QrImageView.withQr({required QrCode qr, Key? key, Color? circleColor, double? size, EdgeInsets padding = const EdgeInsets.all(10.0), Color backgroundColor = Colors.transparent, @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color foregroundColor = Colors.black, int version = QrVersions.auto, int errorCorrectionLevel = QrErrorCorrectLevel.L, QrErrorBuilder? errorStateBuilder, bool constrainErrorBounds = true, bool gapless = true, bool drawCircle = false, ImageProvider<Object>? embeddedImage, QrEmbeddedImageStyle embeddedImageStyle = const QrEmbeddedImageStyle(), String semanticsLabel = 'qr code', QrEyeStyle eyeStyle = const QrEyeStyle(eyeShape: QrEyeShape.square, color: Colors.black), QrDataModuleStyle dataModuleStyle = const QrDataModuleStyle(dataModuleShape: QrDataModuleShape.square, color: Colors.black), bool embeddedImageEmitsError = false, Gradient? gradient})
Create a new QR code using the QrCode data and the passed options (or using the default options).

Properties

backgroundColor Color
The background color of the final QR code widget.
final
circleColor Color?
final
constrainErrorBounds bool
If true then the error widget will be constrained to the boundary of the QR widget if it had been valid. If false the error widget will grow to the size it needs. If the error widget is allowed to grow, your layout may jump around (depending on specifics).
final
dataModuleStyle QrDataModuleStyle
Styling option for QR data module.
final
drawCircle bool
final
embeddedImage ImageProvider<Object>?
The image data to embed (as an overlay) in the QR code. The image will be added to the center of the QR code.
final
embeddedImageEmitsError bool
If set to true and there is an error loading the embedded image, the errorStateBuilder callback will be called (if it is defined). If false, the widget will ignore the embedded image and just display the QR code. The default is false.
final
embeddedImageStyle QrEmbeddedImageStyle
Styling options for the image overlay.
final
errorCorrectionLevel int
The QR code error correction level to use.
final
errorStateBuilder QrErrorBuilder?
The callback that is executed in the event of an error so that you can interrogate the exception and construct an alternative view to present to your user.
final
eyeStyle QrEyeStyle
Styling option for QR Eye ball and frame.
final
foregroundColor Color
The foreground color of the final QR code widget.
final
gapless bool
If set to false, each of the squares in the QR code will have a small gap. Default is true.
final
gradient Gradient?
The gradient for all (dataModule and eye)
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
padding EdgeInsets
The external padding between the edge of the widget and the content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsLabel String
semanticsLabel will be used by screen readers to describe the content of the qr code. Default is 'qr code'.
final
size double?
The intended size of the widget.
final
version int
The QR code version to use.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<QrImageView>
Creates the mutable state for this widget at a given location in the tree.
override
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