Skip to content

Commit

Permalink
feat: [#17] 회원가입 Bloc 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
Younggun-Kim committed Nov 22, 2024
1 parent ab043fa commit 27a4df9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/feature/account/init_injections.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ void initAccountPresentationInjections() {
getIt.registerFactory<EmailDuplicateCheckBloc>(
() => EmailDuplicateCheckBloc(useCase: getIt()),
);
getIt.registerFactory<SignUpBloc>(
() => SignUpBloc(signUpUseCase: getIt()),
);
}
1 change: 1 addition & 0 deletions lib/feature/account/presentation/bloc/bloc.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export 'login/login_bloc.dart';
export 'phone_auth/phone_auth_bloc.dart';
export 'email_duplicate_check/email_duplicate_check_bloc.dart';
export 'sign_up/sign_up_bloc.dart';
21 changes: 21 additions & 0 deletions lib/feature/account/presentation/bloc/sign_up/sign_up_bloc.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:withu_app/core/core.dart';
import 'package:withu_app/feature/account/account.dart';

part 'sign_up_event.dart';

part 'sign_up_state.dart';

part 'sign_up_bloc.freezed.dart';

part 'sign_up_bloc.handler.dart';

class SignUpBloc extends BaseBloc<SignUpEvent, SignUpState> {
final SignUpUseCase signUpUseCase;

SignUpBloc({
required this.signUpUseCase,
}) : super(
SignUpState(status: BaseBlocStatus.initial()),
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
part of 'sign_up_bloc.dart';

extension SignUpBlocHandler on SignUpBloc {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
part of 'sign_up_bloc.dart';

abstract class SignUpEvent extends BaseBlocEvent {}
16 changes: 16 additions & 0 deletions lib/feature/account/presentation/bloc/sign_up/sign_up_state.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
part of 'sign_up_bloc.dart';

@freezed
class SignUpState extends BaseBlocState with _$SignUpState {
factory SignUpState({
required BaseBlocStatus status,
@Default('') String message,
@Default(Name.empty) Name name,
@Default(BirthDate.empty) BirthDate birthDate,
@Default(GenderType.none) GenderType gender,
@Default(Phone.empty) Phone phone,
@Default(Email.empty) LoginId loginId,
@Default(Password.empty) Password password,
@Default(Password.empty) Password passwordVerify,
}) = _SignUpState;
}

0 comments on commit 27a4df9

Please sign in to comment.