navigatorContext property

BuildContext? get navigatorContext

The navigator context.

It is only defined when the router is active.

Useful when context is necessary out of a widget. Use at your own risk.

Implementation

BuildContext? get navigatorContext => _navigatorKey.currentState?.context;