loginWithEmailPassword static method

Future<bool> loginWithEmailPassword(
  1. String email,
  2. String password,
  3. dynamic authProvider
)

Implementation

static Future<bool> loginWithEmailPassword(String email, String password, AuthProvider authProvider)async{
  bool isLoginSuccess = false;
  try {
    final userCredentials = await FirebaseAuth.instance.signInWithEmailAndPassword(email: email, password: password);
    if(userCredentials.user != null){
      isLoginSuccess = true;
    }
  } on FirebaseAuthException catch (e) {
    authProvider.authExceptionType = AuthExceptions.typeOf[e.code];
  }catch (e) {
    printToConsole("Exception in FirebaseManageUsers.loginWithEmailPassword: ${e.toString()}");
    authProvider.authExceptionType = AuthExceptionType.unknown;
  }
  return isLoginSuccess;
}