onSignInTap method

Future<void> onSignInTap()

Implementation

Future<void> onSignInTap() async {
  Utils().clearKeyboardFocus();
  final bool isValid = checkForError();
  if (!isValid) return;
  isLoading.value = true;
  final RepositoryResponse<User> response = await authRepository.signIn(
      emailController.text, passwordController.text);
  if (response.isSuccess) {
    if (!response.data!.verified) {
      Get.offAllNamed(
        ERoutes.VERIFY_OTP,
        arguments: [false, true, emailController.text],
      );
    } else {
      Get.offAllNamed(ERoutes.HOME);
    }
  }

  isLoading.value = false;
}