handleStepCallbacks method

Future<void> handleStepCallbacks(
  1. SurveyStep currentStep
)

Implementation

Future<void> handleStepCallbacks(SurveyStep<dynamic> currentStep) async {
  if (currentStep.beforeComplete != null) {
    currentStep.isLoading = true;
    notifyListeners();
    await currentStep.beforeComplete!(currentStep.answer);
    currentStep.isLoading = false;
    notifyListeners();
  }
  currentStep.onCompleted?.call(currentStep.answer);
}