navigator property

NavigatorState get navigator

Retrieves the root Navigator.

Implementation

NavigatorState get navigator {
  assert(
    _navigatorKey.currentState != null,
    'Navigator does not exist yet. Wait for the first build to finish before using [navigator].',
  );

  return _navigatorKey.currentState!;
}