performConditionCheck method

  1. @override
Future<bool> performConditionCheck()
override

Performs the condition check for this waiting step.

Checks if the loaded BuildContext is currently active.

Implementation

@override
Future<bool> performConditionCheck() async {
  return TutorialStepWithWaiting.conditionWithTimeout(timeout, () {
    BuildContext? buildContext = loadFromRepository?.call();
    if (buildContext == null) {
      return false;
    }
    return ModalRoute.of(buildContext)?.isCurrent ?? false;
  });
}