copyWith method

NodeTheme copyWith({
  1. Color? backgroundColor,
  2. Color? selectedBackgroundColor,
  3. Color? borderColor,
  4. Color? selectedBorderColor,
  5. double? borderWidth,
  6. double? selectedBorderWidth,
  7. BorderRadius? borderRadius,
  8. EdgeInsets? padding,
  9. TextStyle? titleStyle,
  10. TextStyle? contentStyle,
})

Creates a copy of this theme with the specified properties overridden.

Any properties not provided will use the values from the current theme. This is useful for creating variations of existing themes.

Example:

final customTheme = NodeTheme.light.copyWith(
  selectedBorderColor: Colors.red,
  selectedBorderWidth: 3.0,
);

Implementation

NodeTheme copyWith({
  Color? backgroundColor,
  Color? selectedBackgroundColor,
  Color? borderColor,
  Color? selectedBorderColor,
  double? borderWidth,
  double? selectedBorderWidth,
  BorderRadius? borderRadius,
  EdgeInsets? padding,
  TextStyle? titleStyle,
  TextStyle? contentStyle,
}) {
  return NodeTheme(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    selectedBackgroundColor:
        selectedBackgroundColor ?? this.selectedBackgroundColor,
    borderColor: borderColor ?? this.borderColor,
    selectedBorderColor: selectedBorderColor ?? this.selectedBorderColor,
    borderWidth: borderWidth ?? this.borderWidth,
    selectedBorderWidth: selectedBorderWidth ?? this.selectedBorderWidth,
    borderRadius: borderRadius ?? this.borderRadius,
    padding: padding ?? this.padding,
    titleStyle: titleStyle ?? this.titleStyle,
    contentStyle: contentStyle ?? this.contentStyle,
  );
}