signInWithEmail method
Implementation
Future<void> signInWithEmail(String email, String password, Function onSuccess, Function onError) async{
try {
await FirebaseAuth.instance.signInWithEmailAndPassword(
email: email,
password: password
);
onSuccess();
} on FirebaseAuthException catch (e) {
print('Failed with error code: ${e.code}');
AlertX.instance.showAlert(
title: "Error",
msg: e.message ?? "",
negativeButtonText: null,
positiveButtonText: "Done",
negativeButtonPressed: (){},
positiveButtonPressed: (){
Navigation.instance.goBack();
}
);
onError();
}
}