Skip to content

Commit

Permalink
[#346] refactor: Colors 추가 및 PointColor 지정 경로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sm-amoled committed Dec 22, 2024
1 parent 47dcfb6 commit 08d3cfd
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 80 deletions.
97 changes: 49 additions & 48 deletions lib/common/constants/app_colors.dart
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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<Color> colorList = [
red,
orange,
yellow,
green,
blue,
purple,
pink,
static const List<Color> pointColorList = [
pointRed,
pointOrange,
pointYellow,
pointGreen,
pointBlue,
pointPurple,
pointPink,
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _ResolutionListCellWidgetState extends ConsumerState<ResolutionListCellWid
goalStatement: widget.resolutionEntity.goalStatement ?? '',
resolutionName: widget.resolutionEntity.resolutionName ?? '',
showGoalStatement: widget.showDetails,
pointColor: PointColors.colorList[widget.resolutionEntity.colorIndex ?? 0],
pointColor: CustomColors.pointColorList[widget.resolutionEntity.colorIndex ?? 0],
iconIndex: widget.resolutionEntity.iconIndex ?? 0,
),
const SizedBox(
Expand Down Expand Up @@ -80,7 +80,7 @@ class _ResolutionListCellWidgetState extends ConsumerState<ResolutionListCellWid
),
ResolutionListWeeklyDoneWidget(
futureDoneList: futureDoneList,
pointColor: PointColors.colorList[widget.resolutionEntity.colorIndex ?? 0],
pointColor: CustomColors.pointColorList[widget.resolutionEntity.colorIndex ?? 0],
),
],
),
Expand Down Expand Up @@ -344,7 +344,7 @@ class ResolutionLinearGaugeWidget extends StatelessWidget {
),
LinearProgressIndicator(
minHeight: 7,
color: PointColors.colorList[resolutionEntity?.colorIndex ?? 0],
color: CustomColors.pointColorList[resolutionEntity?.colorIndex ?? 0],
backgroundColor: CustomColors.whDarkBlack,
borderRadius: BorderRadius.circular(4.0),
),
Expand Down Expand Up @@ -436,7 +436,7 @@ class ResolutionLinearGaugeWidget extends StatelessWidget {
flex: successCount,
child: Container(
height: 7,
color: PointColors.colorList[resolutionEntity?.colorIndex ?? 0],
color: CustomColors.pointColorList[resolutionEntity?.colorIndex ?? 0],
),
),
Flexible(
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/entrance/view/edit_user_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class _EditUserDetailViewState extends ConsumerState<EditUserDetailView> {
text: toastMessage,
icon: const Icon(
Icons.not_interested,
color: PointColors.red,
color: CustomColors.pointRed,
),
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/entrance/view/log_in_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class _LogInViewState extends ConsumerState<LogInView> {
text: toastMessage,
icon: const Icon(
Icons.not_interested,
color: PointColors.red,
color: CustomColors.pointRed,
),
);
},
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/entrance/view/sign_up_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class _SignUpAuthDataViewState extends ConsumerState<SignUpAuthDataView> {
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,
),
Expand Down Expand Up @@ -240,7 +240,7 @@ class _SignUpAuthDataViewState extends ConsumerState<SignUpAuthDataView> {
viewmodel.isPasswordMatched ? '일치합니다' : '비밀번호와 일치하지 않습니다',
style: TextStyle(
fontWeight: FontWeight.w400,
color: viewmodel.isPasswordMatched ? PointColors.green : PointColors.red,
color: viewmodel.isPasswordMatched ? CustomColors.pointGreen : CustomColors.pointRed,
fontSize: 14,
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/group/view/create_group_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class CreateGroupColorSelectorWidget extends StatelessWidget {
scrollDirection: Axis.horizontal,
child: Row(
children: List<Widget>.generate(
PointColors.colorList.length,
CustomColors.pointColorList.length,
(index) => Padding(
padding: const EdgeInsets.only(
right: 8.0,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/group/view/done_creating_group_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 6 additions & 6 deletions lib/presentation/group/view/group_list_view_cell_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ 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,
),
),
Text(
cellModel.groupEntity.groupName,
style: TextStyle(
color: PointColors.colorList[cellModel.groupEntity.groupColor],
color: CustomColors.pointColorList[cellModel.groupEntity.groupColor],
fontWeight: FontWeight.w700,
fontSize: 24,
),
Expand All @@ -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(
Expand Down Expand Up @@ -150,15 +150,15 @@ 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,
// ),
// ),
const Text(
'내 친구들',
style: TextStyle(
color: PointColors.yellow,
color: CustomColors.pointYellow,
fontWeight: FontWeight.w700,
fontSize: 24,
),
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions lib/presentation/my_page/view/my_page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class MyPageScreenState extends ConsumerState<MyPageView> 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),
Expand Down Expand Up @@ -226,7 +226,7 @@ class MyPageScreenState extends ConsumerState<MyPageView> with AutomaticKeepAliv
WideColoredButton(
buttonTitle: '회원탈퇴',
buttonIcon: Icons.no_accounts_outlined,
foregroundColor: PointColors.red,
foregroundColor: CustomColors.pointRed,
onPressed: () async {
showCupertinoDialog(
context: context,
Expand All @@ -237,7 +237,7 @@ class MyPageScreenState extends ConsumerState<MyPageView> with AutomaticKeepAliv
actions: [
CupertinoDialogAction(
textStyle: const TextStyle(
color: PointColors.blue,
color: CustomColors.blue,
),
isDefaultAction: true,
child: const Text('취소'),
Expand Down
12 changes: 6 additions & 6 deletions lib/presentation/my_page/view/resolution_detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class _ResolutionDetailViewState extends ConsumerState<ResolutionDetailView> {
'⛳️ 나의 목표',
style: TextStyle(
fontWeight: FontWeight.w600,
color: PointColors.colorList[widget.entity.colorIndex ?? 0],
color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0],
fontSize: 16,
),
),
Expand All @@ -147,7 +147,7 @@ class _ResolutionDetailViewState extends ConsumerState<ResolutionDetailView> {
'📋 나의 실천 계획',
style: TextStyle(
fontWeight: FontWeight.w600,
color: PointColors.colorList[widget.entity.colorIndex ?? 0],
color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0],
fontSize: 16,
),
),
Expand All @@ -173,7 +173,7 @@ class _ResolutionDetailViewState extends ConsumerState<ResolutionDetailView> {
'📅 도전 시작일',
style: TextStyle(
fontWeight: FontWeight.w600,
color: PointColors.colorList[widget.entity.colorIndex ?? 0],
color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0],
fontSize: 16,
),
),
Expand Down Expand Up @@ -291,7 +291,7 @@ class _ResolutionDetailViewState extends ConsumerState<ResolutionDetailView> {
fontWeight: FontWeight.w500,
),
),
color: PointColors.colorList[widget.entity.colorIndex ?? 0],
color: CustomColors.pointColorList[widget.entity.colorIndex ?? 0],
dataSource: List<ChartData>.generate(
widget.entity.weeklyPostCountList?.length ?? 0,
(index) => ChartData(
Expand Down Expand Up @@ -723,7 +723,7 @@ class _ResolutionDetailViewState extends ConsumerState<ResolutionDetailView> {
WideColoredButton(
buttonTitle: '목표 삭제하기',
buttonIcon: Icons.flag_outlined,
foregroundColor: PointColors.red,
foregroundColor: CustomColors.pointRed,
onPressed: () async {
showCupertinoDialog(
context: context,
Expand All @@ -734,7 +734,7 @@ class _ResolutionDetailViewState extends ConsumerState<ResolutionDetailView> {
actions: [
CupertinoDialogAction(
textStyle: const TextStyle(
color: PointColors.blue,
color: CustomColors.pointBlue,
),
isDefaultAction: true,
child: const Text('취소'),
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/write_post/view/add_resolution_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class _AddResolutionViewState extends ConsumerState<AddResolutionView> {
SingleChildScrollView(
child: Row(
children: List<Widget>.generate(
PointColors.colorList.length,
CustomColors.pointColorList.length,
(int index) => TextButton(
style: TextButton.styleFrom(
minimumSize: Size.zero,
Expand All @@ -335,7 +335,7 @@ class _AddResolutionViewState extends ConsumerState<AddResolutionView> {
width: 36,
height: 36,
decoration: BoxDecoration(
color: PointColors.colorList[index],
color: CustomColors.pointColorList[index],
shape: BoxShape.circle,
),
child: Visibility(
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/write_post/view/resolution_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _ResolutionListViewState extends ConsumerState<ResolutionListView>
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),
Expand Down Expand Up @@ -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,
),
Expand Down
Loading

0 comments on commit 08d3cfd

Please sign in to comment.