currentNavigatorContext property

BuildContext get currentNavigatorContext

Retrieves the BuildContext of the current Navigator.

Implementation

BuildContext get currentNavigatorContext {
  final tKey = currentNavigatorKey;

  assert(
    tKey?.currentContext != null,
    'Navigator does not exist yet. Wait for the first build to finish before using [navigatorContext].',
  );

  return tKey!.currentContext!;
}