clone method

SelectionController<T> clone(
  1. {SelectionMode? newMode}
)

Return new SelectionController initialized with same arguments. But you can define the newMode for the new SelectionController.

Implementation

SelectionController<T> clone({SelectionMode? newMode}) {
  SelectionController<T> a = SelectionController(
    indexGetter: indexGetter,
    selectableOptions: _options.values,
    groupNameGetter: groupNameGetter,
    initiallySelected: _constrainedSelected(forceMode: newMode),
    mode: newMode ?? mode,
  );
  return a;
}