onVerifyTap method

Future<void> onVerifyTap({
  1. bool fromSignUp = false,
  2. bool fromSignIn = false,
})

Implementation

Future<void> onVerifyTap({
  bool fromSignUp = false,
  bool fromSignIn = false,
}) async {
  if (otpController.text.isEmpty) return;
  isLoading.value = true;
  bool response = await authRepository.verifyOtp(otpController.text);
  if (response) {
    if (fromSignUp) {
      Get.offAllNamed(ERoutes.POST_SIGN_UP);
    } else if (fromSignIn) {
      Get.offAllNamed(ERoutes.HOME);
    } else {
      debugPrint("Auto: ${otpController.text}");
      Get.offAndToNamed(
        ERoutes.CREATE_PASSWORD,
        arguments: CreatePasswordViewParams(
          isChangingPassword: false,
          otp: otpController.text,
        ),
      );
    }
  }
  isLoading.value = false;
}