QRCode class
A widget that shows a QR code.
- Inheritance
Constructors
-
QRCode({required String data, Key? key, double? size, EdgeInsets padding = const EdgeInsets.all(10.0), Color backgroundColor = Colors.transparent, int version = QRVersion.auto, int errorCorrectionLevel = QRErrorCorrectLevel.L, QRErrorBuilder? errorStateBuilder, bool constrainErrorBounds = true, bool gapless = true, ImageProvider<
Object> ? embeddedImage, QREmbeddedImageStyle? embeddedImageStyle, 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, @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color? foregroundColor}) - Create a new QR code using the String data and the passed options (or using the default options).
-
QRCode.withQr({required QRCodeGenerate qr, Key? key, double? size, EdgeInsets padding = const EdgeInsets.all(10.0), Color backgroundColor = Colors.transparent, int version = QRVersion.auto, int errorCorrectionLevel = QRErrorCorrectLevel.L, QRErrorBuilder? errorStateBuilder, bool constrainErrorBounds = true, bool gapless = true, ImageProvider<
Object> ? embeddedImage, QREmbeddedImageStyle? embeddedImageStyle, 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, @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color? foregroundColor}) - Create a new QR code using the QRCodeGenerate data and the passed options (or using the default options).
Properties
- backgroundColor → Color
-
The background color of the final QR code widget.
final
- constrainErrorBounds → bool
-
If
true
then the error widget will be constrained to the boundary of the QR widget if it had been valid. Iffalse
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
-
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
- 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< QRCode> -
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