getCurrentContextAndState method

(BuildContext, NavigatorState)? getCurrentContextAndState()

Implementation

(BuildContext, NavigatorState)? getCurrentContextAndState() {
  if (_tutorialRepository.globalNavigatorKey.currentContext == null) {
    if (kDebugMode) {
      print("TUTORIAL SYSTEM WARNING: Could not find current context to create overlay!");
    }
    return null;
  }
  if (_tutorialRepository.globalNavigatorKey.currentState == null) {
    if (kDebugMode) {
      print("TUTORIAL SYSTEM WARNING: Could not find current state to create overlay!");
    }
    return null;
  }
  BuildContext context = _tutorialRepository.globalNavigatorKey.currentContext!;
  NavigatorState state = _tutorialRepository.globalNavigatorKey.currentState!;
  return (context, state);
}