copyWith method Null safety
Creates a copy of this object but with the given fields replaced with the new values.
Implementation
Node<T> copyWith({
String? key,
String? label,
List<Node>? children,
bool? expanded,
bool? parent,
IconData? icon,
Color? iconColor,
Color? selectedIconColor,
T? data,
}) =>
Node<T>(
key: key ?? this.key,
label: label ?? this.label,
icon: icon ?? this.icon,
iconColor: iconColor ?? this.iconColor,
selectedIconColor: selectedIconColor ?? this.selectedIconColor,
expanded: expanded ?? this.expanded,
parent: parent ?? this.parent,
children: children ?? this.children,
data: data ?? this.data,
);