Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch 'dev' into 'main' #21

Merged
merged 9 commits into from
Dec 8, 2023
48 changes: 24 additions & 24 deletions .github/workflows/main.yaml
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
21 changes: 14 additions & 7 deletions lib/app.dart
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,
);
}),
);
}
}
73 changes: 30 additions & 43 deletions lib/core/constants/text_style.dart
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);
}
24 changes: 24 additions & 0 deletions lib/core/theme/app_theme.dart
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(),
],
);
}
13 changes: 13 additions & 0 deletions lib/core/theme/components/app_bar_theme.dart
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,
),
);
}
109 changes: 109 additions & 0 deletions lib/core/theme/extension/app_color.dart
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.
16 changes: 11 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -55,6 +60,7 @@ dev_dependencies:

flutter:
assets:
- assets/fonts/
- assets/imgs/
- assets/imgs/pet/
- assets/svgs/
Expand Down