QRPainter.withQr constructor

QRPainter.withQr({
  1. required QRCodeGenerate qr,
  2. bool gapless = false,
  3. Image? embeddedImage,
  4. QREmbeddedImageStyle? embeddedImageStyle,
  5. QREyeStyle eyeStyle = const QREyeStyle(eyeShape: QREyeShape.square, color: Color(0xFF000000)),
  6. QRDataModuleStyle dataModuleStyle = const QRDataModuleStyle(dataModuleShape: QRDataModuleShape.square, color: Color(0xFF000000)),
  7. Color? color = _qrDefaultColor,
  8. Color? emptyColor,
})

Create a new QrPainter with a pre-validated/created QRCodeGenerate object. This constructor is useful when you have a custom validation / error handling flow or for when you need to pre-validate the QR data.

Implementation

QRPainter.withQr({
  required QRCodeGenerate qr,
  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,
})  : _qr = qr,
      version = qr.typeNumber,
      errorCorrectionLevel = qr.errorCorrectLevel {
  _calcVersion = version;
  _initPaints();
}