-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27a4df9
commit 0b86a5c
Showing
22 changed files
with
568 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:withu_app/core/utils/mixins/l10n_key_provider.dart'; | ||
|
||
/// 계정 타입 | ||
@JsonEnum(valueField: 'serverKey') | ||
enum GenderType { | ||
none(serverKey: ''), | ||
enum GenderType with L10nKeyProvider { | ||
none(l10nKey: '', serverKey: ''), | ||
woman(l10nKey: 'woman', serverKey: 'WOMAN'), | ||
man(l10nKey: 'man', serverKey: 'MAN'); | ||
|
||
man(serverKey: 'MAN'), | ||
final String serverKey; | ||
|
||
woman(serverKey: 'WOMAN'); | ||
@override | ||
final String l10nKey; | ||
|
||
final String serverKey; | ||
const GenderType({ | ||
required this.l10nKey, | ||
required this.serverKey, | ||
}); | ||
|
||
const GenderType({required this.serverKey}); | ||
static List<GenderType> get valuesWithoutNone => values | ||
.where( | ||
(type) => type != none, | ||
) | ||
.toList(); | ||
} |
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,3 +1,4 @@ | ||
export 'date_ext.dart'; | ||
export 'theme_ext.dart'; | ||
export 'string_ext.dart'; | ||
export 'key_ext.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
extension KeyExt on Key { | ||
Key makeChildKey(String childKey) { | ||
return Key('${(this as ValueKey).value}_$childKey'); | ||
} | ||
} |
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
61 changes: 60 additions & 1 deletion
61
lib/feature/account/presentation/bloc/sign_up/sign_up_bloc.handler.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,3 +1,62 @@ | ||
part of 'sign_up_bloc.dart'; | ||
|
||
extension SignUpBlocHandler on SignUpBloc {} | ||
extension SignUpBlocHandler on SignUpBloc { | ||
void _onNameInputted( | ||
SignUpNameInputted event, | ||
Emitter<SignUpState> emit, | ||
) { | ||
emit(state.copyWith(name: event.name)); | ||
} | ||
|
||
void _onBirthDateInputted( | ||
SignUpBirthDateInputted event, | ||
Emitter<SignUpState> emit, | ||
) { | ||
emit(state.copyWith(birthDate: event.birthDate)); | ||
} | ||
|
||
void _onGenderSelected( | ||
SignUpGenderSelected event, | ||
Emitter<SignUpState> emit, | ||
) { | ||
emit(state.copyWith(gender: event.gender)); | ||
} | ||
|
||
void _onPasswordObscureToggled( | ||
SignUpPasswordObscureToggled event, | ||
Emitter<SignUpState> emit, | ||
) { | ||
emit(state.copyWith(isPasswordObscure: !state.isPasswordObscure)); | ||
} | ||
|
||
void _onPasswordInputted( | ||
SignUpPasswordInputted event, | ||
Emitter<SignUpState> emit, | ||
) { | ||
emit(state.copyWith( | ||
password: event.password, | ||
)); | ||
|
||
emit(state.copyWith( | ||
isPasswordErrorVisible: state.getPasswordErrorVisible(), | ||
)); | ||
} | ||
|
||
void _onPasswordVerifyInputted( | ||
SignUpPasswordVerifyInputted event, | ||
Emitter<SignUpState> emit, | ||
) { | ||
emit(state.copyWith( | ||
passwordVerify: event.password, | ||
)); | ||
|
||
emit(state.copyWith( | ||
isPasswordErrorVisible: state.getPasswordErrorVisible(), | ||
)); | ||
} | ||
|
||
void _onSubmitPressed( | ||
SignUpSubmitPressed event, | ||
Emitter<SignUpState> emit, | ||
) {} | ||
} |
Oops, something went wrong.