QrPainter.withQr constructor

QrPainter.withQr({
  1. required QrCode qr,
  2. @Deprecated('use colors in eyeStyle and dataModuleStyle instead') Color color = _qrDefaultColor,
  3. @Deprecated('You should use the background color value of your container widget') Color emptyColor = _qrDefaultEmptyColor,
  4. bool gapless = false,
  5. bool drawCircle = false,
  6. Image? embeddedImage,
  7. Color? circleColor,
  8. QrEmbeddedImageStyle embeddedImageStyle = const QrEmbeddedImageStyle(),
  9. QrEyeStyle eyeStyle = const QrEyeStyle(),
  10. QrDataModuleStyle dataModuleStyle = const QrDataModuleStyle(),
  11. Gradient? gradient,
})

Create a new QrPainter with a pre-validated/created QrCode 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 QrCode qr,
  @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 = _qrDefaultEmptyColor,
  this.gapless = false,
  this.drawCircle = false,
  this.embeddedImage,
  this.circleColor,
  this.embeddedImageStyle = const QrEmbeddedImageStyle(),
  this.eyeStyle = const QrEyeStyle(),
  this.dataModuleStyle = const QrDataModuleStyle(),
  this.gradient,
})  : _qr = qr,
      version = qr.typeNumber,
      errorCorrectionLevel = qr.errorCorrectLevel {
  _calcVersion = version;
  _initPaints();
}