copyWith method

TTreeNode<T> copyWith({
  1. String? key,
  2. String? label,
  3. T? data,
  4. dynamic icon,
  5. dynamic expandedIcon,
  6. List<TTreeNode<T>>? children,
  7. bool? isLeaf,
  8. bool? isLoading,
  9. String? badge,
  10. Widget? trailing,
  11. bool? isSelectable,
  12. bool? isDisabled,
})

Creates a copy of this node with updated attributes.

Implementation

TTreeNode<T> copyWith({
  String? key,
  String? label,
  T? data,
  dynamic icon,
  dynamic expandedIcon,
  List<TTreeNode<T>>? children,
  bool? isLeaf,
  bool? isLoading,
  String? badge,
  Widget? trailing,
  bool? isSelectable,
  bool? isDisabled,
}) {
  return TTreeNode<T>(
    key: key ?? this.key,
    label: label ?? this.label,
    data: data ?? this.data,
    icon: icon ?? this.icon,
    expandedIcon: expandedIcon ?? this.expandedIcon,
    children: children ?? this.children,
    isLeaf: isLeaf ?? this.isLeaf,
    isLoading: isLoading ?? this.isLoading,
    badge: badge ?? this.badge,
    trailing: trailing ?? this.trailing,
    isSelectable: isSelectable ?? this.isSelectable,
    isDisabled: isDisabled ?? this.isDisabled,
  );
}