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 ? _expandedNodes.add(node) : _expandedNodes.remove(node);
}