QrImage constructor

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

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

Implementation

QrImage({
  required String data,
  Key? key,
  this.size,
  this.padding = const EdgeInsets.all(10.0),
  this.backgroundColor = Colors.transparent,
  this.foregroundColor,
  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,
})  : assert(QrVersions.isSupportedVersion(version)),
      _data = data,
      _qrCode = null,
      super(key: key);