From 705639ae511dcbf9982aacfd1957a5f3b6f6c135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=98=95=EC=84=9D?= Date: Sat, 26 Apr 2025 01:39:20 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EC=9E=90=EA=B8=B0=EC=86=8C?= =?UTF-8?q?=EA=B0=9C=20=EC=9E=85=EB=A0=A5=20=ED=99=94=EB=A9=B4=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile_introduce_page.dart | 108 ++++++++++++++++++ .../profile_introduce_viewmodel.dart | 37 ++++++ .../pages/profile_introduce/providers.dart | 6 + 3 files changed, 151 insertions(+) create mode 100644 lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart create mode 100644 lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart create mode 100644 lib/sign_up/presentation/pages/profile_introduce/providers.dart diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart new file mode 100644 index 0000000..556eae6 --- /dev/null +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart @@ -0,0 +1,108 @@ +import 'package:code_l/core/utills/design/app_colors.dart'; +import 'package:code_l/core/utills/design/app_gaps.dart'; +import 'package:code_l/core/utills/design/app_typography.dart'; +import 'package:code_l/sign_up/presentation/pages/profile_introduce/providers.dart'; +import 'package:flutter/material.dart'; + +import '../../widgets/sign_up_app_bar.dart'; +import '../../widgets/sign_up_confirm_button.dart'; + +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'profile_introduce_viewmodel.dart'; + +class ProfileIntroducePage extends ConsumerWidget { + const ProfileIntroducePage({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final screenHeight = MediaQuery.of(context).size.height; + final state = ref.watch(profileIntroduceProvider); + final notifier = ref.read(profileIntroduceProvider.notifier); + + return Scaffold( + appBar: SignUpAppBar(currentPage:10), + body: SafeArea( + child: Padding( + padding: const EdgeInsets.all(AppGaps.gap24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: screenHeight * 0.05), + _buildHeaderText(), + SizedBox(height: AppGaps.gap40 + AppGaps.gap40), + _buildCodeNameInputField(state.introduction, notifier), + Spacer(), + ConfirmButton( + enabled: state.isValid, + onPressed: state.isValid ? () => _onConfirm() : null, + ), + ], + ), + ), + ), + ); + } + + Widget _buildHeaderText() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("간단하게", style: AppTypography.header1), + Text("나를 소개해주세요", style: AppTypography.header1), + SizedBox(height: AppGaps.gap12), + Text( + "자기소개로 다른 사람에게 나를 어필해보세요!", + style: AppTypography.body2.copyWith(color: AppColors.grey600), + ), + ], + ); + } + + Widget _buildCodeNameInputField( + String introduction, + ProfileIntroduceNotifier notifier, + ) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + onChanged: notifier.updateIntroduction, + decoration: InputDecoration( + hintText: '자기소개를 입력해주세요', + hintStyle: + AppTypography.header2.copyWith(color: AppColors.grey400), + contentPadding: EdgeInsets.symmetric(vertical: AppGaps.gap8), + border: UnderlineInputBorder( + borderSide: BorderSide(color: AppColors.grey400, width: 0.6), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: AppColors.grey400, + width: 0.6, + ), + ), + ), + ), + SizedBox(height: AppGaps.gap4), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + introduction.length.toString(), + style: AppTypography.caption3, + ), + Text( + " / 15", + style: AppTypography.caption3.copyWith(color: AppColors.grey500), + ), + ], + ), + ], + ); + } + + void _onConfirm() { + // 확인 버튼 동작 정의d + } +} + diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart new file mode 100644 index 0000000..337f147 --- /dev/null +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart @@ -0,0 +1,37 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class ProfileIntroduceState { + final String introduction; + final bool isValid; + + ProfileIntroduceState({ + this.introduction = '', + this.isValid = false, + }); + + ProfileIntroduceState copyWith({ + String? introduction, + bool? isValid, + }) { + return ProfileIntroduceState( + introduction: introduction ?? this.introduction, + isValid: isValid ?? this.isValid, + ); + } +} + +class ProfileIntroduceNotifier extends StateNotifier { + ProfileIntroduceNotifier() : super(ProfileIntroduceState()); + + void updateIntroduction(String introduction) { + state = state.copyWith( + introduction: introduction, + isValid: introduction.isNotEmpty, + ); + if (introduction.length > 15) { + state = state.copyWith(isValid: false); + } + } +} + + diff --git a/lib/sign_up/presentation/pages/profile_introduce/providers.dart b/lib/sign_up/presentation/pages/profile_introduce/providers.dart new file mode 100644 index 0000000..9e0da7d --- /dev/null +++ b/lib/sign_up/presentation/pages/profile_introduce/providers.dart @@ -0,0 +1,6 @@ +import 'package:code_l/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +final profileIntroduceProvider = +StateNotifierProvider( + (ref) => ProfileIntroduceNotifier()); \ No newline at end of file From 02e867c7fd4bf1da76c466b1123fd7fbcd50af72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=98=95=EC=84=9D?= Date: Sat, 26 Apr 2025 01:39:51 +0900 Subject: [PATCH 2/5] chore: dart format --- .../profile_introduce/profile_introduce_page.dart | 12 +++++------- .../profile_introduce_viewmodel.dart | 2 -- .../pages/profile_introduce/providers.dart | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart index 556eae6..6399d72 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart @@ -20,7 +20,7 @@ class ProfileIntroducePage extends ConsumerWidget { final notifier = ref.read(profileIntroduceProvider.notifier); return Scaffold( - appBar: SignUpAppBar(currentPage:10), + appBar: SignUpAppBar(currentPage: 10), body: SafeArea( child: Padding( padding: const EdgeInsets.all(AppGaps.gap24), @@ -59,9 +59,9 @@ class ProfileIntroducePage extends ConsumerWidget { } Widget _buildCodeNameInputField( - String introduction, - ProfileIntroduceNotifier notifier, - ) { + String introduction, + ProfileIntroduceNotifier notifier, + ) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -69,8 +69,7 @@ class ProfileIntroducePage extends ConsumerWidget { onChanged: notifier.updateIntroduction, decoration: InputDecoration( hintText: '자기소개를 입력해주세요', - hintStyle: - AppTypography.header2.copyWith(color: AppColors.grey400), + hintStyle: AppTypography.header2.copyWith(color: AppColors.grey400), contentPadding: EdgeInsets.symmetric(vertical: AppGaps.gap8), border: UnderlineInputBorder( borderSide: BorderSide(color: AppColors.grey400, width: 0.6), @@ -105,4 +104,3 @@ class ProfileIntroducePage extends ConsumerWidget { // 확인 버튼 동작 정의d } } - diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart index 337f147..a7d9442 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart @@ -33,5 +33,3 @@ class ProfileIntroduceNotifier extends StateNotifier { } } } - - diff --git a/lib/sign_up/presentation/pages/profile_introduce/providers.dart b/lib/sign_up/presentation/pages/profile_introduce/providers.dart index 9e0da7d..a5db48f 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/providers.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/providers.dart @@ -2,5 +2,5 @@ import 'package:code_l/sign_up/presentation/pages/profile_introduce/profile_intr import 'package:flutter_riverpod/flutter_riverpod.dart'; final profileIntroduceProvider = -StateNotifierProvider( - (ref) => ProfileIntroduceNotifier()); \ No newline at end of file + StateNotifierProvider( + (ref) => ProfileIntroduceNotifier()); From d724442a4445dd7ff6daaf0e737c66dad786ad14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=98=95=EC=84=9D?= Date: Sat, 26 Apr 2025 01:47:01 +0900 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20=ED=85=9C=ED=94=8C=EB=A6=BF=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 001df22..b7504a3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,3 +13,4 @@ close # ## 💬리뷰 요구사항 +## 다음 작업 계획 From bbfc699f863e8c228cb128ca4cb8d538e59701f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=98=95=EC=84=9D?= Date: Sat, 26 Apr 2025 02:16:51 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20page=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../profile_introduce_page.dart | 27 ++++++++++--------- .../pages/profile_mbti/profile_mbti_page.dart | 7 ++++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart index 6399d72..6c44de3 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart @@ -8,6 +8,7 @@ import '../../widgets/sign_up_app_bar.dart'; import '../../widgets/sign_up_confirm_button.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import '../profile_image/profile_image_page.dart'; import 'profile_introduce_viewmodel.dart'; class ProfileIntroducePage extends ConsumerWidget { @@ -34,7 +35,17 @@ class ProfileIntroducePage extends ConsumerWidget { Spacer(), ConfirmButton( enabled: state.isValid, - onPressed: state.isValid ? () => _onConfirm() : null, + onPressed: + state.isValid + ? () => { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ProfileImagePage(), + ), + ), + } + : null, ), ], ), @@ -75,10 +86,7 @@ class ProfileIntroducePage extends ConsumerWidget { borderSide: BorderSide(color: AppColors.grey400, width: 0.6), ), focusedBorder: UnderlineInputBorder( - borderSide: BorderSide( - color: AppColors.grey400, - width: 0.6, - ), + borderSide: BorderSide(color: AppColors.grey400, width: 0.6), ), ), ), @@ -86,10 +94,7 @@ class ProfileIntroducePage extends ConsumerWidget { Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Text( - introduction.length.toString(), - style: AppTypography.caption3, - ), + Text(introduction.length.toString(), style: AppTypography.caption3), Text( " / 15", style: AppTypography.caption3.copyWith(color: AppColors.grey500), @@ -99,8 +104,4 @@ class ProfileIntroducePage extends ConsumerWidget { ], ); } - - void _onConfirm() { - // 확인 버튼 동작 정의d - } } diff --git a/lib/sign_up/presentation/pages/profile_mbti/profile_mbti_page.dart b/lib/sign_up/presentation/pages/profile_mbti/profile_mbti_page.dart index 3a4d2b4..2e3d9ab 100644 --- a/lib/sign_up/presentation/pages/profile_mbti/profile_mbti_page.dart +++ b/lib/sign_up/presentation/pages/profile_mbti/profile_mbti_page.dart @@ -1,3 +1,4 @@ +import 'package:code_l/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart'; import 'package:code_l/sign_up/presentation/pages/profile_mbti/providers.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -34,7 +35,11 @@ class ProfileMBTIPage extends ConsumerWidget { child: ConfirmButton( enabled: mbtiState.isValid, onPressed: () { - // TODO: 다음 페이지 이동 로직 + Navigator.push( + context, + MaterialPageRoute(builder: + (context) => ProfileIntroducePage()), + ); }, ), ), From ca1af01486d71cebbb1aba1312d7565454198922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=98=95=EC=84=9D?= Date: Sun, 27 Apr 2025 18:08:32 +0900 Subject: [PATCH 5/5] =?UTF-8?q?refactor:=20PR=20=EC=9D=98=EA=B2=AC=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/profile_introduce/profile_introduce_page.dart | 2 +- .../profile_introduce/profile_introduce_viewmodel.dart | 9 +++------ .../presentation/pages/profile_introduce/providers.dart | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart index 6c44de3..10009b3 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_page.dart @@ -71,7 +71,7 @@ class ProfileIntroducePage extends ConsumerWidget { Widget _buildCodeNameInputField( String introduction, - ProfileIntroduceNotifier notifier, + ProfileIntroduceViewmodel notifier, ) { return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart index a7d9442..e23e02f 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/profile_introduce_viewmodel.dart @@ -20,16 +20,13 @@ class ProfileIntroduceState { } } -class ProfileIntroduceNotifier extends StateNotifier { - ProfileIntroduceNotifier() : super(ProfileIntroduceState()); +class ProfileIntroduceViewmodel extends StateNotifier { + ProfileIntroduceViewmodel() : super(ProfileIntroduceState()); void updateIntroduction(String introduction) { state = state.copyWith( introduction: introduction, - isValid: introduction.isNotEmpty, + isValid: introduction.isNotEmpty && introduction.length <= 15, ); - if (introduction.length > 15) { - state = state.copyWith(isValid: false); - } } } diff --git a/lib/sign_up/presentation/pages/profile_introduce/providers.dart b/lib/sign_up/presentation/pages/profile_introduce/providers.dart index a5db48f..1be260c 100644 --- a/lib/sign_up/presentation/pages/profile_introduce/providers.dart +++ b/lib/sign_up/presentation/pages/profile_introduce/providers.dart @@ -2,5 +2,5 @@ import 'package:code_l/sign_up/presentation/pages/profile_introduce/profile_intr import 'package:flutter_riverpod/flutter_riverpod.dart'; final profileIntroduceProvider = - StateNotifierProvider( - (ref) => ProfileIntroduceNotifier()); + StateNotifierProvider( + (ref) => ProfileIntroduceViewmodel());