I have a problem, to determine the condition when the email and username entered is wrong it will display "username/password is wrong". Guess how to determine the conditions that match my source below how?
void login(BuildContext context) async {
AppFocus.unfocus(context);
if (loginFormKey.currentState!.validate()) {
final res = await apiRepository.login(
LoginRequest(
email: loginEmailController.text,
password: loginPasswordController.text,
),
);
final prefs = Get.find<SharedPreferences>();
if (res!.accessToken.isNotEmpty) {
prefs.setString(StorageConstants.token, res.accessToken);
Get.toNamed(Routes.HOME);
Get.snackbar("Berhasil", "Selamat Berhasil Login");
}
}
}

