toggle method
Toggles the expansion state of the given node.
Implementation
void toggle({required TKey key, bool animate = true}) {
if (_isExpandedKey(key)) {
collapse(key: key, animate: animate);
} else {
expand(key: key, animate: animate);
}
}