maybeOf static method
Returns the NavigatorState from the closest Navigator ancestor,
or null if no Navigator ancestor exists.
Implementation
static NavigatorState? maybeOf(BuildContext context) {
return context.findAncestorStateOfType<NavigatorState>();
}