QRCode.withQr constructor

QRCode.withQr({
  1. required QRCodeGenerate qr,
  2. Key? key,
  3. double? size,
  4. EdgeInsets padding = const EdgeInsets.all(10.0),
  5. Color backgroundColor = Colors.transparent,
  6. int version = QRVersion.auto,
  7. int errorCorrectionLevel = QRErrorCorrectLevel.L,
  8. QRErrorBuilder? errorStateBuilder,
  9. bool constrainErrorBounds = true,
  10. bool gapless = true,
  11. ImageProvider<Object>? embeddedImage,
  12. QREmbeddedImageStyle? embeddedImageStyle,
  13. String semanticsLabel = 'qr code',
  14. QREyeStyle eyeStyle = const QREyeStyle(eyeShape: QREyeShape.square, color: Colors.black),
  15. QRDataModuleStyle dataModuleStyle = const QRDataModuleStyle(dataModuleShape: QRDataModuleShape.square, color: Colors.black),
  16. bool embeddedImageEmitsError = false,
  17. @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;