router property

RouterWidgetState? get router

The state of root router.

Useful to navigate when the context isn't available.

Implementation

RouterWidgetState? get router =>
    navigatorContext != null ? Router.of(navigatorContext!) : null;