copyWith method

TListItem<T, K> copyWith({
  1. T? data,
  2. bool? isSelected,
  3. bool? isExpanded,
  4. List<TListItem<T, K>>? children,
})

Implementation

TListItem<T, K> copyWith({
  T? data,
  bool? isSelected,
  bool? isExpanded,
  List<TListItem<T, K>>? children,
}) {
  return TListItem<T, K>(
    key: this.key,
    data: data ?? this.data,
    isSelected: isSelected ?? this.isSelected,
    isExpanded: isExpanded ?? this.isExpanded,
    children: children ?? this.children,
  );
}