TreeSelectionOptions<T>.fromList constructor
TreeSelectionOptions<T>.fromList (
- List<
TreeSelectionOptionData< listOfOptions, {T> > - ItemRenderer<
T> ? itemRenderer, - Comparator<
T> ? comparator,
Implementation
TreeSelectionOptions.fromList(List<TreeSelectionOptionData<T>> listOfOptions,
{ItemRenderer<T>? itemRenderer, Comparator<T>? comparator})
: _itemRenderer = itemRenderer ?? defaultItemRenderer,
_itemsOptions = Map<T, TreeSelectionOptionData<T>>.fromIterable(
listOfOptions,
key: (item) => (item as TreeSelectionOptionData<T>).value),
super(const []) {
_comparator = comparator ?? _defaultComparator;
_parentToChildrenMap = _generateParentToChildrenMap(listOfOptions)
as Map<T, List<OptionGroup<T>>>;
/// Sets the actual options to start from.
optionGroups = _parentToChildrenMap.remove(null) ?? [OptionGroup<T>([])];
}