QRCode.withQr constructor
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).
Implementation
QRCode.withQr({
required QRCodeGenerate qr,
super.key,
this.size,
this.padding = const EdgeInsets.all(10.0),
this.backgroundColor = Colors.transparent,
this.version = QRVersion.auto,
this.errorCorrectionLevel = QRErrorCorrectLevel.L,
this.errorStateBuilder,
this.constrainErrorBounds = true,
this.gapless = true,
this.embeddedImage,
this.embeddedImageStyle,
this.semanticsLabel = 'qr code',
this.eyeStyle = const QREyeStyle(
eyeShape: QREyeShape.square,
color: Colors.black,
),
this.dataModuleStyle = const QRDataModuleStyle(
dataModuleShape: QRDataModuleShape.square,
color: Colors.black,
),
this.embeddedImageEmitsError = false,
@Deprecated('use colors in eyeStyle and dataModuleStyle instead')
this.foregroundColor,
}) : assert(
QRVersion.isSupportedVersion(version),
'QR code version $version is not supported',
),
_data = null,
_qrCode = qr;