From 08d3cfd358df863058f7f0f8736df45c96320ab2 Mon Sep 17 00:00:00 2001 From: sm-amoled Date: Tue, 17 Dec 2024 11:42:20 +0900 Subject: [PATCH] =?UTF-8?q?[#346]=20refactor:=20Colors=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20PointColor=20=EC=A7=80=EC=A0=95=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/constants/app_colors.dart | 97 ++++++++++--------- .../resolution_list_cell_widget.dart | 8 +- .../entrance/view/edit_user_detail_view.dart | 2 +- .../entrance/view/log_in_view.dart | 2 +- .../entrance/view/sign_up_view.dart | 4 +- .../group/view/create_group_view.dart | 4 +- .../group/view/done_creating_group_view.dart | 2 +- .../view/group_list_view_cell_widget.dart | 12 +-- .../my_page/view/my_page_view.dart | 6 +- .../my_page/view/resolution_detail_view.dart | 12 +-- .../write_post/view/add_resolution_view.dart | 4 +- .../write_post/view/resolution_list_view.dart | 4 +- .../view/writing_confirm_post_view.dart | 2 +- .../writing_confirm_post_view_widget.dart | 2 +- 14 files changed, 81 insertions(+), 80 deletions(-) diff --git a/lib/common/constants/app_colors.dart b/lib/common/constants/app_colors.dart index aff76c2f..18eba3ee 100644 --- a/lib/common/constants/app_colors.dart +++ b/lib/common/constants/app_colors.dart @@ -1,30 +1,35 @@ import 'package:flutter/material.dart'; -class AppColors { - static const Color veryDarkGrey = Color.fromARGB(255, 18, 18, 18); - static const Color darkGrey = Color.fromARGB(255, 45, 45, 45); - static const Color grey = Color.fromARGB(255, 139, 139, 139); - static const Color middleGrey = Color.fromARGB(255, 171, 171, 171); - static const Color brightGrey = Color.fromARGB(255, 228, 228, 228); - static const Color blueGreen = Color.fromARGB(255, 0, 185, 206); - static const Color green = Color.fromARGB(255, 132, 206, 191); - static const Color darkGreen = Color.fromARGB(255, 101, 160, 149); - static const Color blue = Color.fromARGB(255, 0, 125, 203); - static const Color darkBlue = Color.fromARGB(255, 0, 70, 111); - static const Color mediumBlue = Color.fromARGB(255, 60, 140, 180); - static const Color darkOrange = Color.fromARGB(255, 222, 112, 48); - static const Color faleBlue = Color.fromARGB(255, 160, 206, 222); - static const Color brightBlue = Color.fromARGB(255, 123, 182, 212); - static const Color salmon = Color(0xffff6666); -} - class CustomColors { + static const Color whWhite = Color(0xFFFEFEFE); + static const Color whBalck = Color(0xFF040404); + + static const Color whGrey100 = Color(0xFF111111); + static const Color whGrey200 = Color(0xFF2B2B2B); + static const Color whGrey300 = Color(0xFF404040); + static const Color whGrey400 = Color(0xFF555555); + static const Color whGrey500 = Color(0xFF777777); + static const Color whGrey600 = Color(0xFFA2A2A2); + static const Color whGrey700 = Color(0xFFC2C2C2); + static const Color whGrey800 = Color(0xFFE2E2E2); + static const Color whGrey900 = Color(0xFFF2F2F2); + + static const Color whRed300 = Color(0xFFC11E1E); + static const Color whRed500 = Color(0xFFF55748); + static const Color whRed700 = Color(0xFFFF8F84); + static const Color whYellow100 = Color(0xFF564626); + static const Color whYellow200 = Color(0xFF8C6500); + static const Color whYellow300 = Color(0xFFB18000); + static const Color whYellow500 = Color(0xFFFFB700); + static const Color whYellow700 = Color(0xFFFFDC85); + + // legacy static const Color whBlack = Color(0xff2b2b2b); static const Color whDarkBlack = Color(0xff1F1F1F); static const Color whSemiBlack = Color(0xff404040); static const Color whGrey = Color(0xff404040); static const Color whBrightGrey = Color(0xff838383); - static const Color whWhite = Color(0xffFFFFFF); + // static const Color whWhite = Color(0xffFFFFFF); static const Color whSemiWhite = Color(0xffEEEEEE); // static const Color textCol = Color(0xffa2a2a2); static const Color whYellow = Color(0xffFFB800); @@ -35,44 +40,40 @@ class CustomColors { static const Color whUnSelectedTextColor = Color(0xffA2A2A2); static const Color whSelectedTextColor = Color(0xff000000); static const Color whPlaceholderGrey = Color(0xffC3C2C7); + + // Gradients static const LinearGradient toastMessageGradient = LinearGradient( - begin: Alignment.topRight, - end: Alignment.bottomLeft, + begin: Alignment.bottomLeft, + end: Alignment.topRight, colors: [ - Color(0xffA37E3A), - Color( - 0xff564626, - ), + whYellow100, + whYellow300, ], ); static const LinearGradient bottomSheetGradient = LinearGradient( - begin: Alignment.topRight, - end: Alignment.bottomLeft, + begin: Alignment.bottomLeft, + end: Alignment.topRight, colors: [ - Color(0xff606060), - Color( - 0xff201a1a, - ), + whGrey200, + whGrey400, ], ); -} -class PointColors { - static const Color red = Color(0xffF55748); - static const Color orange = Color(0xffe56229); - static const Color yellow = Color(0xffe6ae1c); - static const Color green = Color(0xff28a954); - static const Color blue = Color(0xff2f74db); - static const Color purple = Color.fromARGB(255, 136, 98, 253); - static const Color pink = Color(0xffed7087); + static const Color pointRed = Color(0xFFF74F3F); + static const Color pointOrange = Color(0xFFE56229); + static const Color pointYellow = Color(0xFFE6AE1C); + static const Color pointGreen = Color(0xFF28A954); + static const Color pointBlue = Color(0xFF2F74DB); + static const Color pointPurple = Color(0xFF8861FD); + static const Color pointPink = Color(0xFFED7087); - static const List colorList = [ - red, - orange, - yellow, - green, - blue, - purple, - pink, + static const List pointColorList = [ + pointRed, + pointOrange, + pointYellow, + pointGreen, + pointBlue, + pointPurple, + pointPink, ]; } diff --git a/lib/presentation/common_components/resolution_list_cell_widget.dart b/lib/presentation/common_components/resolution_list_cell_widget.dart index 343fb0cf..bb8de935 100644 --- a/lib/presentation/common_components/resolution_list_cell_widget.dart +++ b/lib/presentation/common_components/resolution_list_cell_widget.dart @@ -52,7 +52,7 @@ class _ResolutionListCellWidgetState extends ConsumerState { text: toastMessage, icon: const Icon( Icons.not_interested, - color: PointColors.red, + color: CustomColors.pointRed, ), ); }, diff --git a/lib/presentation/entrance/view/log_in_view.dart b/lib/presentation/entrance/view/log_in_view.dart index c778a089..19a61454 100644 --- a/lib/presentation/entrance/view/log_in_view.dart +++ b/lib/presentation/entrance/view/log_in_view.dart @@ -175,7 +175,7 @@ class _LogInViewState extends ConsumerState { text: toastMessage, icon: const Icon( Icons.not_interested, - color: PointColors.red, + color: CustomColors.pointRed, ), ); }, diff --git a/lib/presentation/entrance/view/sign_up_view.dart b/lib/presentation/entrance/view/sign_up_view.dart index 318d9485..df1de032 100644 --- a/lib/presentation/entrance/view/sign_up_view.dart +++ b/lib/presentation/entrance/view/sign_up_view.dart @@ -167,7 +167,7 @@ class _SignUpAuthDataViewState extends ConsumerState { style: TextStyle( fontWeight: FontWeight.w400, color: viewmodel.isPasswordValid != null - ? (viewmodel.isPasswordValid! ? PointColors.green : PointColors.red) + ? (viewmodel.isPasswordValid! ? CustomColors.pointGreen : CustomColors.pointRed) : CustomColors.whPlaceholderGrey, fontSize: 14, ), @@ -240,7 +240,7 @@ class _SignUpAuthDataViewState extends ConsumerState { viewmodel.isPasswordMatched ? '일치합니다' : '비밀번호와 일치하지 않습니다', style: TextStyle( fontWeight: FontWeight.w400, - color: viewmodel.isPasswordMatched ? PointColors.green : PointColors.red, + color: viewmodel.isPasswordMatched ? CustomColors.pointGreen : CustomColors.pointRed, fontSize: 14, ), ), diff --git a/lib/presentation/group/view/create_group_view.dart b/lib/presentation/group/view/create_group_view.dart index 71ac509a..dab9b481 100644 --- a/lib/presentation/group/view/create_group_view.dart +++ b/lib/presentation/group/view/create_group_view.dart @@ -186,7 +186,7 @@ class CreateGroupColorSelectorWidget extends StatelessWidget { scrollDirection: Axis.horizontal, child: Row( children: List.generate( - PointColors.colorList.length, + CustomColors.pointColorList.length, (index) => Padding( padding: const EdgeInsets.only( right: 8.0, @@ -203,7 +203,7 @@ class CreateGroupColorSelectorWidget extends StatelessWidget { Container( decoration: BoxDecoration( shape: BoxShape.circle, - color: PointColors.colorList[index], + color: CustomColors.pointColorList[index], ), width: 36, height: 36, diff --git a/lib/presentation/group/view/done_creating_group_view.dart b/lib/presentation/group/view/done_creating_group_view.dart index da1d92d2..50cb32df 100644 --- a/lib/presentation/group/view/done_creating_group_view.dart +++ b/lib/presentation/group/view/done_creating_group_view.dart @@ -70,7 +70,7 @@ class DoneCreatingGroupView extends ConsumerWidget { style: TextStyle( fontSize: 28.0, fontWeight: FontWeight.w700, - color: PointColors.colorList[groupEntity.groupColor], + color: CustomColors.pointColorList[groupEntity.groupColor], ), ), Padding( diff --git a/lib/presentation/group/view/group_list_view_cell_widget.dart b/lib/presentation/group/view/group_list_view_cell_widget.dart index 434794ef..7f79fa67 100644 --- a/lib/presentation/group/view/group_list_view_cell_widget.dart +++ b/lib/presentation/group/view/group_list_view_cell_widget.dart @@ -47,7 +47,7 @@ class GroupListViewCellContentWidget extends StatelessWidget { // ignore: lines_longer_than_80_chars '함께한 지 ${DateTime.now().difference(cellModel.groupEntity.groupCreatedAt).inDays + 1}일 째', style: TextStyle( - color: PointColors.colorList[cellModel.groupEntity.groupColor], + color: CustomColors.pointColorList[cellModel.groupEntity.groupColor], fontWeight: FontWeight.w500, fontSize: 14, ), @@ -55,7 +55,7 @@ class GroupListViewCellContentWidget extends StatelessWidget { Text( cellModel.groupEntity.groupName, style: TextStyle( - color: PointColors.colorList[cellModel.groupEntity.groupColor], + color: CustomColors.pointColorList[cellModel.groupEntity.groupColor], fontWeight: FontWeight.w700, fontSize: 24, ), @@ -69,7 +69,7 @@ class GroupListViewCellContentWidget extends StatelessWidget { VerticalDivider( thickness: 4, width: 16, - color: PointColors.colorList[cellModel.groupEntity.groupColor], + color: CustomColors.pointColorList[cellModel.groupEntity.groupColor], ), const SizedBox(width: 8), Padding( @@ -150,7 +150,7 @@ class GroupListViewFriendCellContentWidget extends StatelessWidget { // // ignore: lines_longer_than_80_chars // '함께한 지 ${DateTime.now().difference(cellModel.groupEntity.groupCreatedAt).inDays + 1}일 째', // style: TextStyle( - // color: PointColors.colorList[cellModel.groupEntity.groupColor], + // color: CustomColors.pointColorList[cellModel.groupEntity.groupColor], // fontWeight: FontWeight.w500, // fontSize: 14, // ), @@ -158,7 +158,7 @@ class GroupListViewFriendCellContentWidget extends StatelessWidget { const Text( '내 친구들', style: TextStyle( - color: PointColors.yellow, + color: CustomColors.pointYellow, fontWeight: FontWeight.w700, fontSize: 24, ), @@ -172,7 +172,7 @@ class GroupListViewFriendCellContentWidget extends StatelessWidget { const VerticalDivider( thickness: 4, width: 16, - color: PointColors.yellow, + color: CustomColors.pointYellow, ), const SizedBox(width: 8), Padding( diff --git a/lib/presentation/my_page/view/my_page_view.dart b/lib/presentation/my_page/view/my_page_view.dart index 36df72fc..04ab0bca 100644 --- a/lib/presentation/my_page/view/my_page_view.dart +++ b/lib/presentation/my_page/view/my_page_view.dart @@ -117,7 +117,7 @@ class MyPageScreenState extends ConsumerState with AutomaticKeepAliv backgroundColor: CustomColors.whSemiBlack, shadowColor: Colors.transparent, surfaceTintColor: Colors.transparent, - overlayColor: PointColors.colorList[resolutionList[index].colorIndex ?? 0], + overlayColor: CustomColors.pointColorList[resolutionList[index].colorIndex ?? 0], padding: const EdgeInsets.all(0), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), @@ -226,7 +226,7 @@ class MyPageScreenState extends ConsumerState with AutomaticKeepAliv WideColoredButton( buttonTitle: '회원탈퇴', buttonIcon: Icons.no_accounts_outlined, - foregroundColor: PointColors.red, + foregroundColor: CustomColors.pointRed, onPressed: () async { showCupertinoDialog( context: context, @@ -237,7 +237,7 @@ class MyPageScreenState extends ConsumerState with AutomaticKeepAliv actions: [ CupertinoDialogAction( textStyle: const TextStyle( - color: PointColors.blue, + color: CustomColors.blue, ), isDefaultAction: true, child: const Text('취소'), diff --git a/lib/presentation/my_page/view/resolution_detail_view.dart b/lib/presentation/my_page/view/resolution_detail_view.dart index ea7e9f54..0aac18c7 100644 --- a/lib/presentation/my_page/view/resolution_detail_view.dart +++ b/lib/presentation/my_page/view/resolution_detail_view.dart @@ -122,7 +122,7 @@ class _ResolutionDetailViewState extends ConsumerState { '⛳️ 나의 목표', style: TextStyle( fontWeight: FontWeight.w600, - color: PointColors.colorList[widget.entity.colorIndex ?? 0], + color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0], fontSize: 16, ), ), @@ -147,7 +147,7 @@ class _ResolutionDetailViewState extends ConsumerState { '📋 나의 실천 계획', style: TextStyle( fontWeight: FontWeight.w600, - color: PointColors.colorList[widget.entity.colorIndex ?? 0], + color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0], fontSize: 16, ), ), @@ -173,7 +173,7 @@ class _ResolutionDetailViewState extends ConsumerState { '📅 도전 시작일', style: TextStyle( fontWeight: FontWeight.w600, - color: PointColors.colorList[widget.entity.colorIndex ?? 0], + color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0], fontSize: 16, ), ), @@ -291,7 +291,7 @@ class _ResolutionDetailViewState extends ConsumerState { fontWeight: FontWeight.w500, ), ), - color: PointColors.colorList[widget.entity.colorIndex ?? 0], + color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0], dataSource: List.generate( widget.entity.weeklyPostCountList?.length ?? 0, (index) => ChartData( @@ -723,7 +723,7 @@ class _ResolutionDetailViewState extends ConsumerState { WideColoredButton( buttonTitle: '목표 삭제하기', buttonIcon: Icons.flag_outlined, - foregroundColor: PointColors.red, + foregroundColor: CustomColors.pointRed, onPressed: () async { showCupertinoDialog( context: context, @@ -734,7 +734,7 @@ class _ResolutionDetailViewState extends ConsumerState { actions: [ CupertinoDialogAction( textStyle: const TextStyle( - color: PointColors.blue, + color: CustomColors.pointBlue, ), isDefaultAction: true, child: const Text('취소'), diff --git a/lib/presentation/write_post/view/add_resolution_view.dart b/lib/presentation/write_post/view/add_resolution_view.dart index 4fdaf3f8..8cb20996 100644 --- a/lib/presentation/write_post/view/add_resolution_view.dart +++ b/lib/presentation/write_post/view/add_resolution_view.dart @@ -315,7 +315,7 @@ class _AddResolutionViewState extends ConsumerState { SingleChildScrollView( child: Row( children: List.generate( - PointColors.colorList.length, + CustomColors.pointColorList.length, (int index) => TextButton( style: TextButton.styleFrom( minimumSize: Size.zero, @@ -335,7 +335,7 @@ class _AddResolutionViewState extends ConsumerState { width: 36, height: 36, decoration: BoxDecoration( - color: PointColors.colorList[index], + color: CustomColors.pointColorList[index], shape: BoxShape.circle, ), child: Visibility( diff --git a/lib/presentation/write_post/view/resolution_list_view.dart b/lib/presentation/write_post/view/resolution_list_view.dart index b66e086f..e8918e24 100644 --- a/lib/presentation/write_post/view/resolution_list_view.dart +++ b/lib/presentation/write_post/view/resolution_list_view.dart @@ -73,7 +73,7 @@ class _ResolutionListViewState extends ConsumerState shadowColor: Colors.transparent, surfaceTintColor: Colors.transparent, overlayColor: - PointColors.colorList[viewModel.resolutionModelList![index].entity.colorIndex ?? 0], + CustomColors.pointColorList[viewModel.resolutionModelList![index].entity.colorIndex ?? 0], padding: const EdgeInsets.all(0), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), @@ -224,7 +224,7 @@ class WritingResolutionBottomSheetWidget extends StatelessWidget { viewModel.resolutionModelList![index].entity.resolutionName ?? '', textAlign: TextAlign.center, style: TextStyle( - color: PointColors.colorList[viewModel.resolutionModelList![index].entity.colorIndex ?? 0], + color: CustomColors.pointColorList[viewModel.resolutionModelList![index].entity.colorIndex ?? 0], fontSize: 18.0, fontWeight: FontWeight.w600, ), diff --git a/lib/presentation/write_post/view/writing_confirm_post_view.dart b/lib/presentation/write_post/view/writing_confirm_post_view.dart index 8707cb7f..bdc9a51c 100644 --- a/lib/presentation/write_post/view/writing_confirm_post_view.dart +++ b/lib/presentation/write_post/view/writing_confirm_post_view.dart @@ -114,7 +114,7 @@ class _WritingConfirmPostViewState extends ConsumerState Text( widget.entity.goalStatement ?? '', style: TextStyle( - color: PointColors.colorList[widget.entity.colorIndex ?? 0], + color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0], fontSize: 16.0, fontWeight: FontWeight.w600, ), diff --git a/lib/presentation/write_post/view/writing_confirm_post_view_widget.dart b/lib/presentation/write_post/view/writing_confirm_post_view_widget.dart index 2d49e714..47a585af 100644 --- a/lib/presentation/write_post/view/writing_confirm_post_view_widget.dart +++ b/lib/presentation/write_post/view/writing_confirm_post_view_widget.dart @@ -124,7 +124,7 @@ class ShareTargetGroupListCellWidget extends StatelessWidget { Text( groupModel.groupEntity.groupName, style: TextStyle( - color: PointColors.colorList[groupModel.groupEntity.groupColor], + color: CustomColors.pointColorList[groupModel.groupEntity.groupColor], fontSize: 16.0, fontWeight: FontWeight.w700, ),