copyWith method

NiceNestableItem<T> copyWith({
  1. String? id,
  2. T? data,
  3. List<NiceNestableItem<T>>? children,
  4. bool? expanded,
})

Implementation

NiceNestableItem<T> copyWith({
  String? id,
  T? data,
  List<NiceNestableItem<T>>? children,
  bool? expanded,
}) {
  return NiceNestableItem<T>(
    id: id ?? this.id,
    data: data ?? this.data,
    children: children ?? this.children,
    expanded: expanded ?? this.expanded,
  );
}