comp
This commit is contained in:
@@ -13,6 +13,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
super(AuthStateInitial()) {
|
||||
on<AuthEventLoginOAuth>(_onAuthEventLoginOAuth);
|
||||
on<AuthEventVerifyOAuth>(_onAuthEventVerifyOAuth);
|
||||
on<AuthEventAddEmailAndPassword>(_onAuthEventAddEmailAndPassword);
|
||||
}
|
||||
|
||||
void _onAuthEventLoginOAuth(
|
||||
@@ -46,4 +47,14 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
emit(const AuthStateFailure());
|
||||
}
|
||||
}
|
||||
|
||||
void _onAuthEventAddEmailAndPassword(
|
||||
AuthEventAddEmailAndPassword event, Emitter<AuthState> emit) async {
|
||||
emit(AuthStateProcess());
|
||||
try {
|
||||
await _userRepository.addEmailAndPassword(event.email, event.password);
|
||||
} catch (e) {
|
||||
emit(const AuthStateFailure());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user