copyWith method

Node<T> copyWith({
  1. String? key,
  2. String? label,
  3. List<Node<T>>? children,
  4. bool? expanded,
  5. bool? parent,
  6. IconData? icon,
  7. T? data,
})

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<T>>? children,
  bool? expanded,
  bool? parent,
  IconData? icon,
  T? data,
}) =>
    Node<T>(
      key: key ?? this.key,
      label: label ?? this.label,
      icon: icon ?? this.icon,
      expanded: expanded ?? this.expanded,
      parent: parent ?? this.parent,
      children: children ?? this.children,
      data: data ?? this.data,
    );