setExpansionState method
Updates the expansion state of node
to the value of expanded
.
When overriding this method, do not call notifyListeners
as this may be
called many times recursively in cascading operations.
Implementation
void setExpansionState(T node, bool expanded) {
expanded ^ defaultExpansionState
? toggledNodes.add(node)
: toggledNodes.remove(node);
}