TreeSyncController<TKey, TData> class
A controller that syncs a TreeController to a desired state using animated diffs.
This controller does not own the TreeController — it drives it. Dispose this controller before disposing the underlying TreeController.
Constructors
-
TreeSyncController({required TreeController<
TKey, TData> treeController, bool preserveExpansion = true, int maxExpansionMemorySize = 1024}) - Creates a sync controller.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxExpansionMemorySize → int
-
Maximum number of entries in
_expansionMemory. When exceeded, the oldest entries are evicted (FIFO via LinkedHashMap insertion order). Set to 0 to disable expansion memory entirely.final - preserveExpansion → bool
-
Whether to remember and restore expansion state across remove/re-add
cycles.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
treeController
→ TreeController<
TKey, TData> -
The underlying TreeController being driven.
no setter
Methods
-
clearExpansionMemory(
) → void - Clears all remembered expansion state.
-
dispose(
) → void - Releases resources. Call before disposing the underlying TreeController.
-
initializeTracking(
) → void - Initializes tracking state from the current tree controller.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
snapshotCurrentChildren(
) → Map< TKey, List< TKey> > - Returns a deep-copied snapshot of the current tracked child order.
-
snapshotRememberedKeys(
) → Set< TKey> - Returns the set of keys currently held in expansion memory.
-
syncChildren(
TKey parentKey, List< TreeNode< desired, {bool animate = true}) → voidTKey, TData> > -
Syncs the children of
parentKeyto matchdesired. -
syncMultipleChildren(
Map< TKey, List< desiredByParent, {bool animate = true}) → voidTreeNode< >TKey, TData> > - Syncs children for multiple parents in a single batch.
-
syncRoots(
List< TreeNode< desired, {List<TKey, TData> >TreeNode< childrenOf(TKey key)?, bool animate = true}) → voidTKey, TData> > -
Syncs the root nodes to match
desired. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited