Skip to content

Commit

Permalink
Refactor: 회원가입 레이아웃 & 상태관리 리펙토링
Browse files Browse the repository at this point in the history
  • Loading branch information
sujinyang00 committed Nov 7, 2023
1 parent d4ba437 commit f6b55b1
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 10 deletions.
18 changes: 10 additions & 8 deletions lib/modules/signIn/view/new_pw_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ class NewPwScreen extends GetView<LoginController> {
),
),
SizedBox(height: 8.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: CommonButton.login(
text: "확인",
onTap: () async {
//TODO) 비밀번호 변경 api
Get.back();
},
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 6.w, right: 20),
child: CommonButton.login(
text: "확인",
onTap: () async {
//TODO) 비밀번호 변경 api
Get.back();
},
),
),
),
SizedBox(height: 24.h),
Expand Down
1 change: 1 addition & 0 deletions lib/modules/signUp/controller/signup_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class SignUpController extends GetxController {
//TODO) signUp controller
/// 회원가입 > id, pw, pw확인
Rx<TextEditingController> idTextController = TextEditingController().obs;
Rx<TextEditingController> idAuthNumTextController = TextEditingController().obs;
Rx<TextEditingController> pwTextController = TextEditingController().obs;
Rx<TextEditingController> pwConfirmTextController = TextEditingController().obs;

Expand Down
28 changes: 26 additions & 2 deletions lib/modules/signUp/view/signup_user_mail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,35 @@ class SignUpMailScreen extends GetView<SignUpController> {
),

SizedBox(height: 20.h),

Text(
'인증번호 입력',
style: AppTextStyles.T1Bold14,
),
SizedBox(height: 10.h),

Row(
children: [
Expanded(
child: CommonInputField.signUpIdConfirm(
textController : controller.idAuthNumTextController.value,
onChange: (value) async {
print(">>> 입력한 이메일 인증번호: $value");
}),
),
SizedBox(width: 10.w),
certinumButton(),
],
),

SizedBox(height: 20.h),

Text(
'비밀번호',
style: AppTextStyles.T1Bold14,
),
SizedBox(height: 10.h),
CommonInputField.signInPW(
CommonInputField.signUpPw(
textController : controller.pwTextController.value,
onChange: (value) async {
print(">>> 입력한 회원가입 pw: $value");
Expand All @@ -84,7 +107,7 @@ class SignUpMailScreen extends GetView<SignUpController> {
style: AppTextStyles.T1Bold14,
),
SizedBox(height: 10.h),
CommonInputField.signInPW(
CommonInputField.signUpPwConfirm(
textController : controller.pwConfirmTextController.value,
onChange: (value) async {
print(">>> 입력한 회원가입 확인pw: $value");
Expand All @@ -95,6 +118,7 @@ class SignUpMailScreen extends GetView<SignUpController> {
],
),
),

SizedBox(height: 8.h),
Padding(
padding: EdgeInsets.symmetric(horizontal: 20.w),
Expand Down
49 changes: 49 additions & 0 deletions lib/util/components/gloabl_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,56 @@ class CommonInputField extends StatelessWidget {
onChanged: onChange,
autoFocus: true);
}

//TODO) signUp 회원가입
/// id 입력
factory CommonInputField.signUpId(
{required TextEditingController textController,
required Future<void> Function(String) onChange}) {
return CommonInputField(
textController: textController,
placeHolder: "이메일을 입력해주세요.",
alwaysSuffix: false,
onSubmitted: (value) async {},
onChanged: onChange,
autoFocus: true);
}
/// id confirm num 입력
factory CommonInputField.signUpIdConfirm(
{required TextEditingController textController,
required Future<void> Function(String) onChange}) {
return CommonInputField(
textController: textController,
placeHolder: "인증번호를 입력해주세요.",
alwaysSuffix: false,
onSubmitted: (value) async {},
onChanged: onChange,
autoFocus: true);
}
/// pw 입력
factory CommonInputField.signUpPw(
{required TextEditingController textController,
required Future<void> Function(String) onChange}) {
return CommonInputField(
textController: textController,
placeHolder: "비밀번호를 입력해주세요.",
alwaysSuffix: false,
onSubmitted: (value) async {},
onChanged: onChange,
autoFocus: true);
}
/// pw confirm 입력
factory CommonInputField.signUpPwConfirm(
{required TextEditingController textController,
required Future<void> Function(String) onChange}) {
return CommonInputField(
textController: textController,
placeHolder: "비밀번호를 입력해주세요.",
alwaysSuffix: false,
onSubmitted: (value) async {},
onChanged: onChange,
autoFocus: true);
}
/// 이름 입력
factory CommonInputField.userName(
{required TextEditingController textController,
Expand Down

0 comments on commit f6b55b1

Please sign in to comment.