copyWith method

QrGenerationOptions copyWith({
  1. int? size,
  2. ErrorCorrectionLevel? errorCorrectionLevel,
  3. Color? foregroundColor,
  4. Color? backgroundColor,
  5. int? margin,
  6. Uint8List? logoData,
  7. double? logoSizeRatio,
  8. bool? roundedCorners,
  9. double? cornerRadius,
  10. List<Color>? gradientColors,
  11. double? gradientDirection,
  12. bool? addBorder,
  13. int? borderWidth,
  14. Color? borderColor,
})

Creates a copy of this options with the given fields replaced

Implementation

QrGenerationOptions copyWith({
  int? size,
  ErrorCorrectionLevel? errorCorrectionLevel,
  Color? foregroundColor,
  Color? backgroundColor,
  int? margin,
  Uint8List? logoData,
  double? logoSizeRatio,
  bool? roundedCorners,
  double? cornerRadius,
  List<Color>? gradientColors,
  double? gradientDirection,
  bool? addBorder,
  int? borderWidth,
  Color? borderColor,
}) {
  return QrGenerationOptions(
    size: size ?? this.size,
    errorCorrectionLevel: errorCorrectionLevel ?? this.errorCorrectionLevel,
    foregroundColor: foregroundColor ?? this.foregroundColor,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    margin: margin ?? this.margin,
    logoData: logoData ?? this.logoData,
    logoSizeRatio: logoSizeRatio ?? this.logoSizeRatio,
    roundedCorners: roundedCorners ?? this.roundedCorners,
    cornerRadius: cornerRadius ?? this.cornerRadius,
    gradientColors: gradientColors ?? this.gradientColors,
    gradientDirection: gradientDirection ?? this.gradientDirection,
    addBorder: addBorder ?? this.addBorder,
    borderWidth: borderWidth ?? this.borderWidth,
    borderColor: borderColor ?? this.borderColor,
  );
}