QrGenerationOptions constructor

const QrGenerationOptions({
  1. int size = 512,
  2. ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.medium,
  3. Color foregroundColor = const Color(0xFF000000),
  4. Color backgroundColor = const Color(0xFFFFFFFF),
  5. int margin = 20,
  6. Uint8List? logoData,
  7. double logoSizeRatio = 0.2,
  8. bool roundedCorners = false,
  9. double cornerRadius = 4.0,
  10. List<Color>? gradientColors,
  11. double gradientDirection = 0.0,
  12. bool addBorder = false,
  13. int borderWidth = 2,
  14. Color borderColor = const Color(0xFF000000),
})

Implementation

const QrGenerationOptions({
  this.size = 512,
  this.errorCorrectionLevel = ErrorCorrectionLevel.medium,
  this.foregroundColor = const Color(0xFF000000),
  this.backgroundColor = const Color(0xFFFFFFFF),
  this.margin = 20,
  this.logoData,
  this.logoSizeRatio = 0.2,
  this.roundedCorners = false,
  this.cornerRadius = 4.0,
  this.gradientColors,
  this.gradientDirection = 0.0,
  this.addBorder = false,
  this.borderWidth = 2,
  this.borderColor = const Color(0xFF000000),
}) : assert(size > 0 && size <= 2048, 'Size must be between 1 and 2048'),
     assert(margin >= 0, 'Margin must be non-negative'),
     assert(
       logoSizeRatio >= 0.0 && logoSizeRatio <= 0.3,
       'Logo size ratio must be between 0.0 and 0.3',
     ),
     assert(cornerRadius >= 0.0, 'Corner radius must be non-negative'),
     assert(
       gradientDirection >= 0.0 && gradientDirection <= 1.0,
       'Gradient direction must be between 0.0 and 1.0',
     ),
     assert(borderWidth >= 0, 'Border width must be non-negative');