-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from pet-sitter/dev
Merge branch 'dev' into 'main'
- Loading branch information
Showing
8 changed files
with
225 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
); | ||
}), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,39 @@ | ||
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, | ||
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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, | ||
), | ||
appBarTheme: _AppBarTheme.light, | ||
extensions: <ThemeExtension<dynamic>>[ | ||
AppColor(), | ||
], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AppColor extends ThemeExtension<AppColor> { | ||
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<AppColor>()!; | ||
static AppColor? get maybeOf => Theme.of(_context).extension<AppColor>(); | ||
|
||
@override | ||
ThemeExtension<AppColor> 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<AppColor> lerp( | ||
covariant ThemeExtension<AppColor>? 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)!, | ||
); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters