copyWith method

TreeTheme copyWith({
  1. ValueGetter<BranchLine?>? branchLine,
  2. ValueGetter<EdgeInsetsGeometry?>? padding,
  3. ValueGetter<bool?>? expandIcon,
  4. ValueGetter<bool?>? allowMultiSelect,
  5. ValueGetter<bool?>? recursiveSelection,
})

Creates a copy of this theme with the given fields replaced.

Parameters:

  • branchLine (ValueGetter<BranchLine?>?, optional): New branch line style.
  • padding (ValueGetter<EdgeInsetsGeometry?>?, optional): New padding.
  • expandIcon (ValueGetter<bool?>?, optional): New expand icon visibility.
  • allowMultiSelect (ValueGetter<bool?>?, optional): New multi-select setting.
  • recursiveSelection (ValueGetter<bool?>?, optional): New recursive selection setting.

Returns: A new TreeTheme with updated properties.

Implementation

TreeTheme copyWith({
  ValueGetter<BranchLine?>? branchLine,
  ValueGetter<EdgeInsetsGeometry?>? padding,
  ValueGetter<bool?>? expandIcon,
  ValueGetter<bool?>? allowMultiSelect,
  ValueGetter<bool?>? recursiveSelection,
}) {
  return TreeTheme(
    branchLine: branchLine == null ? this.branchLine : branchLine(),
    padding: padding == null ? this.padding : padding(),
    expandIcon: expandIcon == null ? this.expandIcon : expandIcon(),
    allowMultiSelect:
        allowMultiSelect == null ? this.allowMultiSelect : allowMultiSelect(),
    recursiveSelection: recursiveSelection == null
        ? this.recursiveSelection
        : recursiveSelection(),
  );
}