of static method

The controller from the closest instance of this class that encloses the given context.

Implementation

static NavigatorListenerController of(BuildContext context) {
  _Scope scope = context.dependOnInheritedWidgetOfExactType<_Scope>()!;
  return scope.navigatorListenerState;
}