FlattenService class

Constructors

FlattenService()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

collapseNode<T>({required List<FlatNode<T>> currentList, required String nodeId}) → ({int index, List<FlatNode<T>> list})?
Incrementally collapse a node: remove all descendants that follow it. Returns the new list and the index of the collapsed node, or null if the node was not found (caller should fall back to full rebuild).
expandNode<T>({required List<FlatNode<T>> currentList, required String nodeId, required Set<String>? expandedNodeIds}) → ({int index, List<FlatNode<T>> list})?
Incrementally expand a node: insert its flattened subtree right after it. Returns the new list and the index of the expanded node, or null if the node was not found (caller should fall back to full rebuild).
flatten<T>({required List<Node<T>> nodes, required Set<String>? expandedNodeIds, int depth = 0, bool isRoot = true, List<bool> ancestorIsLastFlags = const []}) List<FlatNode<T>>
Flattens a tree of nodes into a list of FlatNodes, only including children of expanded nodes.