navigatorKey top-level property

GlobalKey<NavigatorState>? navigatorKey
getter/setter pair

navigatorKey method to set the value of navigatorKey This key is used to navigate between the screens This is very useful for navigation This is a global key This is used in main.dart file

Example:

navigatorKey = GlobalKey<NavigatorState>();

Implementation

GlobalKey<NavigatorState>? navigatorKey;