QrImageView.withQr constructor

QrImageView.withQr({
  1. required QrCode qr,
  2. Key? key,
  3. Color? circleColor,
  4. double? size,
  5. EdgeInsets padding = const EdgeInsets.all(10.0),
  6. Color backgroundColor = Colors.transparent,
  7. @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color foregroundColor = Colors.black,
  8. int version = QrVersions.auto,
  9. int errorCorrectionLevel = QrErrorCorrectLevel.L,
  10. QrErrorBuilder? errorStateBuilder,
  11. bool constrainErrorBounds = true,
  12. bool gapless = true,
  13. bool drawCircle = false,
  14. ImageProvider<Object>? embeddedImage,
  15. QrEmbeddedImageStyle embeddedImageStyle = const QrEmbeddedImageStyle(),
  16. String semanticsLabel = 'qr code',
  17. QrEyeStyle eyeStyle = const QrEyeStyle(eyeShape: QrEyeShape.square, color: Colors.black),
  18. QrDataModuleStyle dataModuleStyle = const QrDataModuleStyle(dataModuleShape: QrDataModuleShape.square, color: Colors.black),
  19. bool embeddedImageEmitsError = false,
  20. Gradient? gradient,
})

Create a new QR code using the QrCode data and the passed options (or using the default options).

Implementation

QrImageView.withQr({
  required QrCode qr,
  super.key,
  this.circleColor,
  this.size,
  this.padding = const EdgeInsets.all(10.0),
  this.backgroundColor = Colors.transparent,
  @Deprecated('use colors in eyeStyle and dataModuleStyle instead')
      this.foregroundColor = Colors.black,
  this.version = QrVersions.auto,
  this.errorCorrectionLevel = QrErrorCorrectLevel.L,
  this.errorStateBuilder,
  this.constrainErrorBounds = true,
  this.gapless = true,
  this.drawCircle = false,
  this.embeddedImage,
  this.embeddedImageStyle = const QrEmbeddedImageStyle(),
  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,
  this.gradient,
})  : assert(
        QrVersions.isSupportedVersion(version),
        'QR code version $version is not supported',
      ),
      _data = null,
      _qrCode = qr;