From ffa13ef77aa0853cdd463a498a6dbca34ce4f1cd Mon Sep 17 00:00:00 2001 From: jihye Date: Tue, 5 Dec 2023 23:09:43 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Setting:=20#15=20=EC=95=B1=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AC=EC=9A=A9=EB=90=98=EB=8A=94=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=A0=95?= =?UTF-8?q?=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/constants/text_style.dart | 74 +++++++++++++----------------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/lib/core/constants/text_style.dart b/lib/core/constants/text_style.dart index 739684f..d0c259c 100644 --- a/lib/core/constants/text_style.dart +++ b/lib/core/constants/text_style.dart @@ -1,52 +1,40 @@ import 'package:flutter/material.dart'; -import 'package:pets_next_door_flutter/core/constants/font_weight.dart'; -Color get defaultColor => Colors.black; +abstract class AppTextStyle { + static TextStyle pretendardStyle(double size, double? height) => TextStyle( + fontFamily: 'pretendard', + leadingDistribution: TextLeadingDistribution.even, + letterSpacing: -0.02, + fontSize: size, + height: height == null ? null : height / size, + ); + + static TextStyle pretendardRegularStyle(double size, double? height) => + pretendardStyle(size, height).copyWith( + fontWeight: FontWeight.w400, + ); -class PNDTextStyles { - TextStyle styleTT({ - Color? color, - TextDecoration decoration = TextDecoration.none, - }) => - TextStyle( - fontFamily: 'defaultFont', - color: color ?? defaultColor, - fontSize: 32, - fontWeight: PNDFontWeights.bold, //w700 - height: 40 / 32, - letterSpacing: 0, - decoration: decoration, + static TextStyle pretendardMediumStyle(double size, double? height) => + pretendardStyle(size, height).copyWith( + fontWeight: FontWeight.w500, ); - /// Headline - /// - TextStyle styleH0({ - Color? color, - TextDecoration decoration = TextDecoration.none, - }) => - TextStyle( - fontFamily: 'defaultFont', - color: color ?? defaultColor, - fontSize: 28, - fontWeight: PNDFontWeights.semiBold, - height: 39 / 28, - letterSpacing: 0, - decoration: decoration, + static TextStyle pretendardSemiBoldStyle(double size, double? height) => + pretendardStyle(size, height).copyWith( + fontWeight: FontWeight.w600, ); - /// Headline - /// - TextStyle styleH1({ - Color? color, - TextDecoration decoration = TextDecoration.none, - }) => - TextStyle( - fontFamily: 'defaultFont', - color: color ?? defaultColor, - fontSize: 24, - fontWeight: PNDFontWeights.semiBold, - height: 34 / 24, - letterSpacing: 0, - decoration: decoration, + static TextStyle pretendardBoldStyle(double size, double? height) => + pretendardStyle(size, height).copyWith( + fontWeight: FontWeight.w800, ); + + static final TextStyle headlineBold1 = pretendardBoldStyle(24, 33); + static final TextStyle headlineRegular1 = pretendardRegularStyle(24, 33); + static final TextStyle headlineBold2 = pretendardBoldStyle(20, 24); + static final TextStyle headlineRegular2 = pretendardRegularStyle(20, 24); + static final TextStyle bodyBold1 = pretendardSemiBoldStyle(16, 19); + static final TextStyle bodyRegular1 = pretendardSemiBoldStyle(16, 19); + static final TextStyle bodyBold2 = pretendardRegularStyle(12, 14); + static final TextStyle bodyRegular2 = pretendardRegularStyle(12, 14); } From deb2f74ae2804d70ef060ea5533799083a73cbd2 Mon Sep 17 00:00:00 2001 From: jihye Date: Tue, 5 Dec 2023 23:26:55 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Chore:=20[#15]=20font=20family=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/constants/text_style.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/core/constants/text_style.dart b/lib/core/constants/text_style.dart index d0c259c..7ef0b6c 100644 --- a/lib/core/constants/text_style.dart +++ b/lib/core/constants/text_style.dart @@ -2,9 +2,8 @@ import 'package:flutter/material.dart'; abstract class AppTextStyle { static TextStyle pretendardStyle(double size, double? height) => TextStyle( - fontFamily: 'pretendard', + fontFamily: 'Pretendard', leadingDistribution: TextLeadingDistribution.even, - letterSpacing: -0.02, fontSize: size, height: height == null ? null : height / size, ); From f4f3f796d18a24432ac72a8295958a2694d1fbdb Mon Sep 17 00:00:00 2001 From: Yellowtoast Date: Wed, 6 Dec 2023 13:53:59 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Setting:=20[Theme]=20=EC=95=B1=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=82=AC=EC=9A=A9=EB=90=98=EB=8A=94=20color,=20tex?= =?UTF-8?q?t=20style,=20theme=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app.dart | 21 ++-- lib/core/theme/app_theme.dart | 26 +++++ lib/core/theme/components/app_bar_theme.dart | 13 +++ lib/core/theme/extension/app_color.dart | 109 +++++++++++++++++++ lib/core/theme/extension/app_text_style.dart | 0 pubspec.yaml | 15 ++- 6 files changed, 172 insertions(+), 12 deletions(-) create mode 100644 lib/core/theme/app_theme.dart create mode 100644 lib/core/theme/components/app_bar_theme.dart create mode 100644 lib/core/theme/extension/app_color.dart create mode 100644 lib/core/theme/extension/app_text_style.dart diff --git a/lib/app.dart b/lib/app.dart index e8a8408..599ec7d 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -1,24 +1,31 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'package:pets_next_door_flutter/app/router/app_router.dart'; +import 'package:pets_next_door_flutter/core/theme/app_theme.dart'; +import 'package:pets_next_door_flutter/core/theme/extension/app_color.dart'; class App extends ConsumerWidget { const App({super.key}); - // This widget is the root of your application. @override Widget build(BuildContext context, WidgetRef ref) { final goRouter = ref.watch(goRouterProvider); return MaterialApp.router( routerConfig: goRouter, - title: 'Flutter Demo', - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - ), - builder: EasyLoading.init(), + title: '이웃집멍냥', + themeMode: ThemeMode.light, + theme: AppTheme.light, + builder: EasyLoading.init(builder: (context, child) { + AppColor.init(context); + + return FToastBuilder()( + context, + child, + ); + }), ); } } diff --git a/lib/core/theme/app_theme.dart b/lib/core/theme/app_theme.dart new file mode 100644 index 0000000..eef8530 --- /dev/null +++ b/lib/core/theme/app_theme.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:pets_next_door_flutter/core/constants/text_style.dart'; +import 'package:pets_next_door_flutter/core/theme/extension/app_color.dart'; + +part 'components/app_bar_theme.dart'; + +class AppTheme { + static final ThemeData light = ThemeData( + useMaterial3: true, + brightness: Brightness.light, + primarySwatch: Colors.blue, + splashFactory: NoSplash.splashFactory, + textTheme: ThemeData().textTheme.apply( + fontFamily: 'pretendard', + bodyColor: AppColor().black, + displayColor: AppColor().black, + ), + // filledButtonTheme: _FilledButtonTheme.light, + // inputDecorationTheme: _InputDecorationTheme.light, + appBarTheme: _AppBarTheme.light, + extensions: >[ + AppColor(), + ], + ); +} diff --git a/lib/core/theme/components/app_bar_theme.dart b/lib/core/theme/components/app_bar_theme.dart new file mode 100644 index 0000000..22bb924 --- /dev/null +++ b/lib/core/theme/components/app_bar_theme.dart @@ -0,0 +1,13 @@ +part of '../app_theme.dart'; + +abstract class _AppBarTheme { + static final light = AppBarTheme( + systemOverlayStyle: SystemUiOverlayStyle.dark, + elevation: 0, + scrolledUnderElevation: 0, + centerTitle: false, + titleTextStyle: AppTextStyle.headlineBold2.copyWith( + color: AppColor().black, + ), + ); +} diff --git a/lib/core/theme/extension/app_color.dart b/lib/core/theme/extension/app_color.dart new file mode 100644 index 0000000..df0fad9 --- /dev/null +++ b/lib/core/theme/extension/app_color.dart @@ -0,0 +1,109 @@ +import 'package:flutter/material.dart'; + +class AppColor extends ThemeExtension { + factory AppColor() => _light; + + AppColor._({ + required this.white, + required this.black, + required this.blue, + required this.red, + required this.primaryGreen, + required this.yellowGreen, + required this.lightGreen, + required this.gray90, + required this.gray50, + required this.gray30, + required this.gray20, + required this.gray10, + }); + + static final AppColor _light = AppColor._( + white: const Color(0xFFFFFFFF), + black: const Color(0xFF09090B), + blue: const Color(0xFF6A9DFF), + red: const Color(0xFFFF2727), + primaryGreen: const Color(0xFF10C200), + yellowGreen: const Color(0xFFB5E5A6), + lightGreen: const Color(0xFFE2F7E0), + gray90: const Color(0xFF333333), + gray50: const Color(0xFFACACAC), + gray30: const Color(0xFFD9D9D9), + gray20: const Color(0xFFF3F3F3), + gray10: const Color(0xFFF9F9F9), + ); + + final Color white; + final Color black; + final Color blue; + final Color red; + final Color primaryGreen; + final Color yellowGreen; + final Color lightGreen; + final Color gray90; + final Color gray50; + final Color gray30; + final Color gray20; + final Color gray10; + + static late BuildContext _context; + static void init(BuildContext context) => _context = context; + + static AppColor get of => Theme.of(_context).extension()!; + static AppColor? get maybeOf => Theme.of(_context).extension(); + + @override + ThemeExtension copyWith({ + Color? white, + Color? black, + Color? blue, + Color? red, + Color? primaryGreen, + Color? yellowGreen, + Color? lightGreen, + Color? gray90, + Color? gray50, + Color? gray30, + Color? gray20, + Color? gray10, + }) { + return AppColor._( + white: white ?? this.white, + black: black ?? this.black, + blue: blue ?? this.blue, + red: red ?? this.red, + primaryGreen: primaryGreen ?? this.primaryGreen, + yellowGreen: yellowGreen ?? this.yellowGreen, + lightGreen: lightGreen ?? this.lightGreen, + gray90: gray90 ?? this.gray90, + gray50: gray50 ?? this.gray50, + gray30: gray30 ?? this.gray30, + gray20: gray20 ?? this.gray20, + gray10: gray10 ?? this.gray10, + ); + } + + @override + ThemeExtension lerp( + covariant ThemeExtension? other, + double t, + ) { + if (other is! AppColor) { + return this; + } + return AppColor._( + white: Color.lerp(white, other.white, t)!, + black: Color.lerp(black, other.black, t)!, + blue: Color.lerp(black, other.black, t)!, + red: Color.lerp(red, other.red, t)!, + primaryGreen: Color.lerp(primaryGreen, other.primaryGreen, t)!, + yellowGreen: Color.lerp(yellowGreen, other.yellowGreen, t)!, + lightGreen: Color.lerp(lightGreen, other.lightGreen, t)!, + gray90: Color.lerp(gray90, other.gray90, t)!, + gray50: Color.lerp(gray50, other.gray50, t)!, + gray30: Color.lerp(gray30, other.gray30, t)!, + gray20: Color.lerp(gray20, other.gray20, t)!, + gray10: Color.lerp(gray10, other.gray10, t)!, + ); + } +} diff --git a/lib/core/theme/extension/app_text_style.dart b/lib/core/theme/extension/app_text_style.dart new file mode 100644 index 0000000..e69de29 diff --git a/pubspec.yaml b/pubspec.yaml index 19d5485..944d4fb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -20,18 +20,23 @@ dependencies: kakao_flutter_sdk_auth: ^1.5.0 kakao_flutter_sdk_user: ^1.4.1 go_router: ^10.0.0 - riverpod: ^2.3.6 - riverpod_annotation: ^2.1.1 intl: ^0.18.1 - flutter_svg: ^2.0.7 dio: ^5.2.1+1 - flutter_riverpod: ^2.3.6 freezed_annotation: ^2.4.1 google_maps_flutter: ^2.4.0 retrofit: ^4.0.3 - flutter_easyloading: ^3.0.5 infinite_scroll_pagination: ^4.0.0 + # UI + cupertino_will_pop_scope: ^1.2.1 #pop scope (스와이프 백 제스쳐 지원) + fluttertoast: ^8.2.2 + flutter_svg: ^2.0.7 + flutter_easyloading: ^3.0.5 + + # 상태관리 + flutter_riverpod: ^2.3.6 + riverpod_annotation: ^2.1.1 + dev_dependencies: bloc_test: ^9.1.2 flutter_test: From 2d56087edc3fcc5fae88cc815eb0680fab14eadc Mon Sep 17 00:00:00 2001 From: Yellowtoast Date: Thu, 7 Dec 2023 13:28:05 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Setting:=20[=EA=B3=B5=ED=86=B5]=20pubspec.y?= =?UTF-8?q?aml=EC=97=90=20font=EC=B6=94=EA=B0=80=20#18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pubspec.yaml b/pubspec.yaml index 944d4fb..abc8dd3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,7 @@ dev_dependencies: flutter: assets: + - assets/fonts/ - assets/imgs/ - assets/imgs/pet/ - assets/svgs/ From 6aded38838cbb1c4e796068c07b2bbfb637810f6 Mon Sep 17 00:00:00 2001 From: Yellowtoast Date: Thu, 7 Dec 2023 14:24:26 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Setting:=20[Git]=20main.yaml=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20workflow=20=EC=9E=84=EC=8B=9C=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yaml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0538aa0..870a10f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,29 +1,29 @@ -name: pets_next_door_flutter +# name: pets_next_door_flutter -concurrency: - group: $-$ - cancel-in-progress: true +# concurrency: +# group: $-$ +# cancel-in-progress: true -on: - push: - branches: - - main - pull_request: - branches: - - main +# on: +# push: +# branches: +# - main +# pull_request: +# branches: +# - main -jobs: - semantic-pull-request: - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 +# jobs: +# semantic-pull-request: +# uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 - build: - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 - with: - flutter_channel: stable +# build: +# uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 +# with: +# flutter_channel: stable - spell-check: - uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1 - with: - includes: | - **/*.md - modified_files_only: false +# spell-check: +# uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1 +# with: +# includes: | +# **/*.md +# modified_files_only: false From 26109c16a318ff62e010d3879971425c68022b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=A7=80=ED=98=9C?= <47681139+Yellowtoast@users.noreply.github.com> Date: Thu, 7 Dec 2023 18:05:56 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=08Chore:=20[AppTheme]=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/theme/app_theme.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/core/theme/app_theme.dart b/lib/core/theme/app_theme.dart index eef8530..cbefd95 100644 --- a/lib/core/theme/app_theme.dart +++ b/lib/core/theme/app_theme.dart @@ -16,8 +16,6 @@ class AppTheme { bodyColor: AppColor().black, displayColor: AppColor().black, ), - // filledButtonTheme: _FilledButtonTheme.light, - // inputDecorationTheme: _InputDecorationTheme.light, appBarTheme: _AppBarTheme.light, extensions: >[ AppColor(),