login method

void login()

Implementation

void login() async {
  LoginProvider loginProvider = Get.find<LoginProvider>();
  final Map<String, dynamic> responseLogin = await loginProvider.login(
      usernameController.text, passwordController.text);
  if (responseLogin.containsKey('access_token') == true) {
    Get.toNamed(Routes.HOME);
  } else if (responseLogin.containsKey("error_code") == true) {
    btnController1.reset();
  } else {
    btnController1.reset();
    loginError.value = true;
  }
}