1
1
import 'dart:async' ;
2
2
3
+ import 'package:auth_repository/auth_repository.dart' ;
3
4
import 'package:bloc/bloc.dart' ;
5
+ import 'package:core/core.dart' ;
4
6
import 'package:equatable/equatable.dart' ;
5
- import 'package:ht_auth_repository/ht_auth_repository.dart' ;
6
- import 'package:ht_shared/ht_shared.dart' ;
7
7
8
8
part 'authentication_event.dart' ;
9
9
part 'authentication_state.dart' ;
@@ -14,7 +14,7 @@ part 'authentication_state.dart';
14
14
class AuthenticationBloc
15
15
extends Bloc <AuthenticationEvent , AuthenticationState > {
16
16
/// {@macro authentication_bloc}
17
- AuthenticationBloc ({required HtAuthRepository authenticationRepository})
17
+ AuthenticationBloc ({required AuthRepository authenticationRepository})
18
18
: _authenticationRepository = authenticationRepository,
19
19
super (const AuthenticationState ()) {
20
20
// Listen to authentication state changes from the repository
@@ -33,7 +33,7 @@ class AuthenticationBloc
33
33
on < AuthenticationSignOutRequested > (_onAuthenticationSignOutRequested);
34
34
}
35
35
36
- final HtAuthRepository _authenticationRepository;
36
+ final AuthRepository _authenticationRepository;
37
37
late final StreamSubscription <User ?> _userAuthSubscription;
38
38
39
39
/// Handles [_AuthenticationUserChanged] events.
@@ -72,7 +72,7 @@ class AuthenticationBloc
72
72
email: event.email,
73
73
),
74
74
);
75
- } on HtHttpException catch (e) {
75
+ } on HttpException catch (e) {
76
76
emit (state.copyWith (status: AuthenticationStatus .failure, exception: e));
77
77
} catch (e) {
78
78
emit (
@@ -94,7 +94,7 @@ class AuthenticationBloc
94
94
await _authenticationRepository.verifySignInCode (event.email, event.code);
95
95
// On success, the _AuthenticationUserChanged listener will handle
96
96
// emitting the authenticated state.
97
- } on HtHttpException catch (e) {
97
+ } on HttpException catch (e) {
98
98
emit (state.copyWith (status: AuthenticationStatus .failure, exception: e));
99
99
} catch (e) {
100
100
emit (
@@ -116,7 +116,7 @@ class AuthenticationBloc
116
116
await _authenticationRepository.signInAnonymously ();
117
117
// On success, the _AuthenticationUserChanged listener will handle
118
118
// emitting the authenticated state.
119
- } on HtHttpException catch (e) {
119
+ } on HttpException catch (e) {
120
120
emit (state.copyWith (status: AuthenticationStatus .failure, exception: e));
121
121
} catch (e) {
122
122
emit (
@@ -138,7 +138,7 @@ class AuthenticationBloc
138
138
await _authenticationRepository.signOut ();
139
139
// On success, the _AuthenticationUserChanged listener will handle
140
140
// emitting the unauthenticated state.
141
- } on HtHttpException catch (e) {
141
+ } on HttpException catch (e) {
142
142
emit (state.copyWith (status: AuthenticationStatus .failure, exception: e));
143
143
} catch (e) {
144
144
emit (
0 commit comments