fromFlat<T> static method
List<Tree<T>>
fromFlat<
T>( - List<T> flatItems,
- int? parentKey(
- T node
),
- int getKey(
- T node
)
)
Implementation
static List<Tree<T>> fromFlat<T>(List<T> flatItems, int? Function(T node) parentKey, int Function(T node) getKey) {
// ignore: prefer_for_elements_to_map_fromiterable
var _lookUp = Map<int, Tree<T>>.fromIterable(
flatItems,
key: (object) => getKey(object),
value: (object) => Tree(value: object),
);
return _generateTree<T>(_lookUp, parentKey, getKey, flatItems);
}