-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'cevheri:main' into main
- Loading branch information
Showing
23 changed files
with
1,070 additions
and
445 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 18 additions & 12 deletions
30
lib/presentation/screen/register/bloc/register_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,47 @@ | ||
part of 'register_bloc.dart'; | ||
|
||
enum RegisterStatus { none, authenticating, authenticated, failure } | ||
enum RegisterStatus { initial, loading, success, error } | ||
|
||
class RegisterState extends Equatable { | ||
final String email; | ||
final User? user; | ||
final RegisterStatus status; | ||
|
||
static const String authenticationFailKey = 'error.authenticate'; | ||
|
||
const RegisterState({ | ||
this.email = '', | ||
this.status = RegisterStatus.none, | ||
this.user, | ||
this.status = RegisterStatus.initial, | ||
}); | ||
|
||
RegisterState copyWith({ | ||
String? email, | ||
User? user, | ||
RegisterStatus? status, | ||
}) { | ||
return RegisterState( | ||
email: email ?? this.email, | ||
user: user ?? this.user, | ||
status: status ?? this.status, | ||
); | ||
} | ||
|
||
@override | ||
List<Object> get props => [email, status]; | ||
List<Object> get props => [status, user ?? '']; | ||
|
||
@override | ||
bool get stringify => true; | ||
} | ||
|
||
class RegisterInitialState extends RegisterState {} | ||
class RegisterInitialState extends RegisterState { | ||
const RegisterInitialState() : super(status: RegisterStatus.initial); | ||
} | ||
|
||
class RegisterCompletedState extends RegisterState {} | ||
class RegisterLoadingState extends RegisterState { | ||
const RegisterLoadingState() : super(status: RegisterStatus.loading); | ||
} | ||
|
||
class RegisterCompletedState extends RegisterState { | ||
const RegisterCompletedState({required User user}) : super(user: user, status: RegisterStatus.success); | ||
} | ||
|
||
class RegisterErrorState extends RegisterState { | ||
final String message; | ||
|
||
const RegisterErrorState({required this.message}); | ||
const RegisterErrorState({required this.message}) : super(status: RegisterStatus.error); | ||
} |
Oops, something went wrong.