QrPainter constructor

QrPainter({
  1. required String data,
  2. required int version,
  3. int errorCorrectionLevel = QrErrorCorrectLevel.L,
  4. bool gapless = false,
  5. Image? embeddedImage,
  6. QrEmbeddedImageStyle? embeddedImageStyle,
  7. QrEyeStyle eyeStyle = const QrEyeStyle(eyeShape: QrEyeShape.square, color: Color(0xFF000000)),
  8. QrDataModuleStyle dataModuleStyle = const QrDataModuleStyle(dataModuleShape: QrDataModuleShape.square, color: Color(0xFF000000)),
  9. @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color? color = _qrDefaultColor,
  10. @Deprecated('You should use the background color value of your container widget') Color? emptyColor,
})

Create a new QRPainter with passed options (or defaults).

Implementation

QrPainter({
  required String data,
  required this.version,
  this.errorCorrectionLevel = QrErrorCorrectLevel.L,
  this.gapless = false,
  this.embeddedImage,
  this.embeddedImageStyle,
  this.eyeStyle = const QrEyeStyle(
    eyeShape: QrEyeShape.square,
    color: Color(0xFF000000),
  ),
  this.dataModuleStyle = const QrDataModuleStyle(
    dataModuleShape: QrDataModuleShape.square,
    color: Color(0xFF000000),
  ),
  @Deprecated('use colors in eyeStyle and dataModuleStyle instead')
      this.color = _qrDefaultColor,
  @Deprecated(
    'You should use the background color value of your container widget',
  )
      this.emptyColor,
}) : assert(
        QrVersions.isSupportedVersion(version),
        'QR code version $version is not supported',
      ) {
  _init(data);
}