maybeOf static method
Finds the TreeView from the closest instance of this class that encloses the given context and returns its TreeViewController.
If no TreeView encloses the given context then return null. To throw an exception instead, use of instead of this function.
See also:
Implementation
static TreeViewController? maybeOf(BuildContext context) {
return context
.findAncestorStateOfType<_TreeViewState<Object?>>()
?.controller;
}