copyWith method

CodeBlockStyle copyWith({
  1. Color? backgroundColor,
  2. Color? borderColor,
  3. double? borderWidth,
  4. Radius? borderRadius,
  5. EdgeInsetsGeometry? padding,
  6. EdgeInsetsGeometry? headerPadding,
  7. String? fontFamily,
  8. String? fontFamilyPackage,
  9. double? fontSize,
  10. Color? textColor,
  11. bool? showLanguageLabel,
  12. TextStyle? languageStyle,
  13. bool? showCopyButton,
  14. String? copyLabel,
  15. String? copiedLabel,
})

A copy with the given fields replaced.

Implementation

CodeBlockStyle copyWith({
  Color? backgroundColor,
  Color? borderColor,
  double? borderWidth,
  Radius? borderRadius,
  EdgeInsetsGeometry? padding,
  EdgeInsetsGeometry? headerPadding,
  String? fontFamily,
  String? fontFamilyPackage,
  double? fontSize,
  Color? textColor,
  bool? showLanguageLabel,
  TextStyle? languageStyle,
  bool? showCopyButton,
  String? copyLabel,
  String? copiedLabel,
}) {
  return CodeBlockStyle(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    borderColor: borderColor ?? this.borderColor,
    borderWidth: borderWidth ?? this.borderWidth,
    borderRadius: borderRadius ?? this.borderRadius,
    padding: padding ?? this.padding,
    headerPadding: headerPadding ?? this.headerPadding,
    fontFamily: fontFamily ?? this.fontFamily,
    fontFamilyPackage: fontFamilyPackage ?? this.fontFamilyPackage,
    fontSize: fontSize ?? this.fontSize,
    textColor: textColor ?? this.textColor,
    showLanguageLabel: showLanguageLabel ?? this.showLanguageLabel,
    languageStyle: languageStyle ?? this.languageStyle,
    showCopyButton: showCopyButton ?? this.showCopyButton,
    copyLabel: copyLabel ?? this.copyLabel,
    copiedLabel: copiedLabel ?? this.copiedLabel,
  );
}