maybeOf static method

NavigatorState? maybeOf(
  1. BuildContext context
)

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>();
}