Skip to content

Commit

Permalink
feat: [#17] 회원가입 UI 작업
Browse files Browse the repository at this point in the history
  • Loading branch information
Younggun-Kim committed Nov 23, 2024
1 parent 27a4df9 commit 0b86a5c
Show file tree
Hide file tree
Showing 22 changed files with 568 additions and 40 deletions.
13 changes: 12 additions & 1 deletion assets/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,16 @@
"enterVerificationCode": "인증번호 입력",
"verification": "인증",
"invalidVerificationCode": "인증번호가 틀립니다,",
"emailDuplicateError": "! 중복된 이메일입니다."
"emailDuplicateError": "! 중복된 이메일입니다.",
"name": "이름",
"enterTwoOrMoreChars": "2자 이상 이름을 입력하세요.",
"birthDate": "생년월일",
"enterEightChars": "8리를 입력하세요.",
"gender": "성별",
"man": "남자,",
"woman": "여자",
"phone": "휴대폰",
"email": "이메일",
"password": "비밀번호",
"verifyPassword": "비밀번호 확인"
}
4 changes: 4 additions & 0 deletions lib/core/router/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ class AppRouter extends RootStackRouter {
page: JobPostingWorkersRoute.page,
path: '/job-posting-workers',
),
AutoRoute(
page: SignUpRoute.page,
path: '/sign-up',
),
];
}
79 changes: 50 additions & 29 deletions lib/core/router/router.gr.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions lib/core/types/gender_type.dart
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();
}
1 change: 1 addition & 0 deletions lib/core/utils/extensions/extensions.dart
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';
7 changes: 7 additions & 0 deletions lib/core/utils/extensions/key_ext.dart
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');
}
}
11 changes: 11 additions & 0 deletions lib/core/utils/resource/string_res.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ enum StringRes {
verification,
invalidVerificationCode,
emailDuplicateError,
name,
enterTwoOrMoreChars,
birthDate,
enterEightChars,
gender,
man,
woman,
phone,
email,
password,
verifyPassword,
}

extension StringResEx on StringRes {
Expand Down
11 changes: 10 additions & 1 deletion lib/feature/account/presentation/bloc/sign_up/sign_up_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:withu_app/core/core.dart';
import 'package:withu_app/feature/account/account.dart';
Expand All @@ -17,5 +18,13 @@ class SignUpBloc extends BaseBloc<SignUpEvent, SignUpState> {
required this.signUpUseCase,
}) : super(
SignUpState(status: BaseBlocStatus.initial()),
);
) {
on<SignUpNameInputted>(_onNameInputted);
on<SignUpBirthDateInputted>(_onBirthDateInputted);
on<SignUpGenderSelected>(_onGenderSelected);
on<SignUpPasswordObscureToggled>(_onPasswordObscureToggled);
on<SignUpPasswordInputted>(_onPasswordInputted);
on<SignUpPasswordVerifyInputted>(_onPasswordVerifyInputted);
on<SignUpSubmitPressed>(_onSubmitPressed);
}
}
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,
) {}
}
Loading

0 comments on commit 0b86a5c

Please sign in to comment.