QrImageView constructor

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

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

Implementation

QrImageView({
  required String data,
  super.key,
  this.size,
  this.drawCircle = false,
  this.circleColor,
  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.embeddedImage,
  this.embeddedImageStyle = const QrEmbeddedImageStyle(),
  this.semanticsLabel = 'qr code',
  this.eyeStyle = const QrEyeStyle(
    eyeShape: QrEyeShape.square,
  ),
  this.dataModuleStyle = const QrDataModuleStyle(
    dataModuleShape: QrDataModuleShape.square,
  ),
  this.embeddedImageEmitsError = false,
  this.gradient,
})  : assert(
        QrVersions.isSupportedVersion(version),
        'QR code version $version is not supported',
      ),
      _data = data,
      _qrCode = null;