QrImageView constructor

QrImageView({
  1. required String data,
  2. Key? key,
  3. double? size,
  4. EdgeInsets padding = const EdgeInsets.all(10.0),
  5. Color backgroundColor = Colors.transparent,
  6. int version = QrVersions.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 String data and the passed options (or using the default options).

Implementation

QrImageView({
  required String data,
  super.key,
  this.size,
  this.padding = const EdgeInsets.all(10.0),
  this.backgroundColor = Colors.transparent,
  this.version = QrVersions.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(
        QrVersions.isSupportedVersion(version),
        'QR code version $version is not supported',
      ),
      _data = data,
      _qrCode = null;