QrGenerationOptions constructor
const
QrGenerationOptions({
- int size = 512,
- ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.medium,
- Color foregroundColor = const Color(0xFF000000),
- Color backgroundColor = const Color(0xFFFFFFFF),
- int margin = 20,
- Uint8List? logoData,
- double logoSizeRatio = 0.2,
- bool roundedCorners = false,
- double cornerRadius = 4.0,
- List<
Color> ? gradientColors, - double gradientDirection = 0.0,
- bool addBorder = false,
- int borderWidth = 2,
- 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');