copyWith method
NodeTheme
copyWith({
- Color? backgroundColor,
- Color? selectedBackgroundColor,
- Color? borderColor,
- Color? selectedBorderColor,
- double? borderWidth,
- double? selectedBorderWidth,
- BorderRadius? borderRadius,
- EdgeInsets? padding,
- TextStyle? titleStyle,
- 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,
);
}