copyWith method

TListItem<T, K> copyWith({
  1. T? data,
  2. K? parentKey,
  3. List<K>? childrenKeys,
  4. int? level,
})

Implementation

TListItem<T, K> copyWith({
  T? data,
  K? parentKey,
  List<K>? childrenKeys,
  int? level,
}) {
  return TListItem<T, K>(
    key: key,
    data: data ?? this.data,
    parentKey: parentKey ?? this.parentKey,
    childrenKeys: childrenKeys ?? this.childrenKeys,
    level: level ?? this.level,
  );
}