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. Color? color = _qrDefaultColor,
  10. 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(
        QRVersion.isSupportedVersion(version),
        'QR code version $version is not supported',
      ) {
  _init(data);
}