navigatorKey property

GlobalKey<NavigatorState>? navigatorKey
final

A key to use when building this widget's Navigator.

If a navigatorKey is specified, the Navigator can be directly manipulated without first obtaining it from a BuildContext via Navigator.of: from the navigatorKey, use the GlobalKey.currentState getter.

If this is changed, a new Navigator will be created, losing all the tab's state in the process; in that case, the navigatorObservers must also be changed, since the previous observers will be attached to the previous navigator.

Implementation

final GlobalKey<NavigatorState>? navigatorKey;