From 2856bdc11c12488106a10e487f36524a56dd126d Mon Sep 17 00:00:00 2001 From: ybminm Date: Thu, 24 Aug 2023 00:16:08 +0900 Subject: [PATCH 01/21] =?UTF-8?q?Add:=20theme=20data=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 2 +- lib/constants/theme.dart | 26 ++++++++++++++++++++++++++ lib/main.dart | 5 ++--- lib/views/taxiView.dart | 24 ++++-------------------- 4 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 lib/constants/theme.dart diff --git a/android/build.gradle b/android/build.gradle index 88720e4..7474a24 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart new file mode 100644 index 0000000..5719363 --- /dev/null +++ b/lib/constants/theme.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +ThemeData buildTheme() { + final base = ThemeData( + primarySwatch: Colors.blue, + textTheme: TextTheme( + //Dialog 제목 + bodyLarge: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFF323232), + fontSize: 22, + fontWeight: FontWeight.bold)), + + //TODO: Dialog 내용 + + //Dialog 상세 추가 설명 + bodySmall: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFF888888), + fontSize: 12, + fontWeight: FontWeight.bold)), + ), + ); + return base; +} diff --git a/lib/main.dart b/lib/main.dart index f408d7c..a772fb2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,6 +14,7 @@ import 'package:taxiapp/utils/token.dart'; import 'package:taxiapp/views/taxiView.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:taxiapp/firebase_options.dart'; +import 'constants/theme.dart'; late AndroidNotificationChannel channel; late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; @@ -82,9 +83,7 @@ class MyHome extends HookWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Taxi App', - theme: ThemeData( - primarySwatch: Colors.blue, - ), + theme: buildTheme(), home: Container( color: const Color(0xFF6E3647), child: Container( diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 1b80ef7..b0fa876 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -472,11 +472,7 @@ class TaxiView extends HookWidget { textAlign: TextAlign.center, text: TextSpan( text: "새로운 ", - style: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF323232), - fontSize: 22, - fontWeight: FontWeight.bold)), + style: Theme.of(context).textTheme.bodyLarge, children: const [ TextSpan(text: "버전"), TextSpan( @@ -492,11 +488,7 @@ class TaxiView extends HookWidget { ), Text("정상적인 사용을 위해 앱을 업데이트 해주세요.", textAlign: TextAlign.center, - style: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF888888), - fontSize: 12, - fontWeight: FontWeight.bold))), + style: Theme.of(context).textTheme.bodySmall), }, rightButtonContent: "업데이트 하러가기", leftButtonContent: "앱 종료하기", @@ -513,11 +505,7 @@ class TaxiView extends HookWidget { textAlign: TextAlign.center, text: TextSpan( text: "서버", - style: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF323232), - fontSize: 22, - fontWeight: FontWeight.bold)), + style: Theme.of(context).textTheme.bodyLarge, children: const [ TextSpan(text: "와의 "), TextSpan( @@ -534,11 +522,7 @@ class TaxiView extends HookWidget { Padding(padding: EdgeInsets.only(top: 5)), Text("일시적인 오류일 수 있습니다.", textAlign: TextAlign.center, - style: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF888888), - fontSize: 12, - fontWeight: FontWeight.bold))), + style: Theme.of(context).textTheme.bodySmall), }, rightButtonContent: "스토어로 가기", leftButtonContent: "앱 종료하기", From 29a77fc074271561cd2b015f652996a63307f0d4 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 29 Aug 2023 20:09:28 +0900 Subject: [PATCH 02/21] =?UTF-8?q?Fix:=20taxiDialog=20=ED=8C=A8=EB=94=A9=20?= =?UTF-8?q?=EC=B0=A8=EC=9D=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/theme.dart | 8 +++----- lib/views/taxiDialog.dart | 5 +++-- lib/views/taxiView.dart | 33 ++++++++++++++++----------------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 5719363..49e73e4 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -5,14 +5,12 @@ ThemeData buildTheme() { final base = ThemeData( primarySwatch: Colors.blue, textTheme: TextTheme( - //Dialog 제목 - bodyLarge: GoogleFonts.roboto( + //Dialog 제목 강조 + titleMedium: GoogleFonts.roboto( textStyle: const TextStyle( color: Color(0xFF323232), fontSize: 22, - fontWeight: FontWeight.bold)), - - //TODO: Dialog 내용 + fontWeight: FontWeight.normal)), //Dialog 상세 추가 설명 bodySmall: GoogleFonts.roboto( diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index 5d91e70..def25ca 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -20,7 +20,7 @@ class TaxiDialog extends StatelessWidget { Widget build(BuildContext context) { return Container( width: 350, - height: 165, + height: 172, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15)), child: Column( @@ -85,7 +85,8 @@ class TaxiDialog extends StatelessWidget { appStoreId: dotenv.get("IOS_APPID")); }), ], - ) + ), + const Padding(padding: EdgeInsets.only(bottom: 15)), ]), ); } diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index b0fa876..e7ae1c0 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -471,19 +471,19 @@ class TaxiView extends HookWidget { RichText( textAlign: TextAlign.center, text: TextSpan( - text: "새로운 ", - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.titleMedium, children: const [ - TextSpan(text: "버전"), TextSpan( - text: "이 ", - style: TextStyle(fontWeight: FontWeight.normal)), + text: "새로운 버전", + style: TextStyle(fontWeight: FontWeight.bold), + ), + TextSpan(text: "이 "), TextSpan( text: "출시", - style: TextStyle(color: Color(0xFF6E3678))), - TextSpan( - text: "되었습니다!", - style: TextStyle(fontWeight: FontWeight.normal)) + style: TextStyle( + color: Color(0xFF6E3678), + fontWeight: FontWeight.bold)), + TextSpan(text: "되었습니다!") ]), ), Text("정상적인 사용을 위해 앱을 업데이트 해주세요.", @@ -504,19 +504,18 @@ class TaxiView extends HookWidget { RichText( textAlign: TextAlign.center, text: TextSpan( - text: "서버", - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.titleMedium, children: const [ - TextSpan(text: "와의 "), TextSpan( - text: "연결에 ", - style: TextStyle(fontWeight: FontWeight.normal)), + text: "서버", + style: TextStyle(fontWeight: FontWeight.bold), + ), + TextSpan(text: "와의 "), + TextSpan(text: "연결에 "), TextSpan( text: "실패", style: TextStyle(color: Color(0xFF6E3678))), - TextSpan( - text: "했습니다.", - style: TextStyle(fontWeight: FontWeight.normal)) + TextSpan(text: "했습니다.") ]), ), Padding(padding: EdgeInsets.only(top: 5)), From 682e22a46155b59ffc914c74558fa02e21fd1511 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 29 Aug 2023 20:24:48 +0900 Subject: [PATCH 03/21] =?UTF-8?q?Style:=20primary=20color=20=EC=A7=80?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/theme.dart | 16 +++++++++++++++- lib/main.dart | 2 +- lib/views/taxiView.dart | 9 +++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 49e73e4..06f4ce0 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -1,9 +1,23 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +final Map primaryColor1 = { + 50: const Color.fromRGBO(110, 54, 71, .1), + 100: const Color.fromRGBO(110, 54, 71, .2), + 200: const Color.fromRGBO(110, 54, 71, .3), + 300: const Color.fromRGBO(110, 54, 71, .4), + 400: const Color.fromRGBO(110, 54, 71, .5), + 500: const Color.fromRGBO(110, 54, 71, .6), + 600: const Color.fromRGBO(110, 54, 71, .7), + 700: const Color.fromRGBO(110, 54, 71, .8), + 800: const Color.fromRGBO(110, 54, 71, .9), + 900: const Color.fromRGBO(110, 54, 71, 1), +}; +MaterialColor taxiPrimaryColor = MaterialColor(0xFF6E3647, primaryColor1); + ThemeData buildTheme() { final base = ThemeData( - primarySwatch: Colors.blue, + primarySwatch: taxiPrimaryColor, textTheme: TextTheme( //Dialog 제목 강조 titleMedium: GoogleFonts.roboto( diff --git a/lib/main.dart b/lib/main.dart index a772fb2..329bae1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -85,7 +85,7 @@ class MyHome extends HookWidget { title: 'Taxi App', theme: buildTheme(), home: Container( - color: const Color(0xFF6E3647), + color: Theme.of(context).primaryColor, child: Container( color: Colors.white, child: TaxiView(), diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index e7ae1c0..a5ed342 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -507,18 +507,19 @@ class TaxiView extends HookWidget { style: Theme.of(context).textTheme.titleMedium, children: const [ TextSpan( - text: "서버", + text: "서버와의 ", style: TextStyle(fontWeight: FontWeight.bold), ), - TextSpan(text: "와의 "), TextSpan(text: "연결에 "), TextSpan( text: "실패", - style: TextStyle(color: Color(0xFF6E3678))), + style: TextStyle( + color: Color(0xFF6E3678), + fontWeight: FontWeight.bold)), TextSpan(text: "했습니다.") ]), ), - Padding(padding: EdgeInsets.only(top: 5)), + const Padding(padding: EdgeInsets.only(top: 5)), Text("일시적인 오류일 수 있습니다.", textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodySmall), From d72e8308b62e366baceed188bcf8b6ae0e253945 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 29 Aug 2023 20:51:42 +0900 Subject: [PATCH 04/21] Remove: unused libraries --- lib/constants/theme.dart | 2 ++ lib/views/taxiView.dart | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 06f4ce0..a39b848 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +//primaryColor 지정 (색상코드: #6E3647) final Map primaryColor1 = { 50: const Color.fromRGBO(110, 54, 71, .1), 100: const Color.fromRGBO(110, 54, 71, .2), @@ -18,6 +19,7 @@ MaterialColor taxiPrimaryColor = MaterialColor(0xFF6E3647, primaryColor1); ThemeData buildTheme() { final base = ThemeData( primarySwatch: taxiPrimaryColor, + primaryColor: const Color(0xFF6E3647), textTheme: TextTheme( //Dialog 제목 강조 titleMedium: GoogleFonts.roboto( diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index a5ed342..5d4046f 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -2,13 +2,10 @@ import 'dart:async'; import 'dart:io'; import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; -import 'package:firebase_remote_config/firebase_remote_config.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:package_info/package_info.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:taxiapp/utils/fcmToken.dart'; @@ -459,7 +456,7 @@ class TaxiView extends HookWidget { }), )), isTimerUp.value && isLoaded.value && isFcmInit.value - ? Stack() + ? const Stack() : Scaffold( body: FadeTransition(opacity: animation, child: loadingView())), isMustUpdate.value @@ -481,7 +478,8 @@ class TaxiView extends HookWidget { TextSpan( text: "출시", style: TextStyle( - color: Color(0xFF6E3678), + color: Color( + 0xFF6E3678), // TODO: primaryColor로 지정 fontWeight: FontWeight.bold)), TextSpan(text: "되었습니다!") ]), @@ -494,7 +492,7 @@ class TaxiView extends HookWidget { leftButtonContent: "앱 종료하기", )), ) - : Stack(), + : const Stack(), isServerError.value ? Container( color: const Color(0x66C8C8C8), @@ -514,7 +512,8 @@ class TaxiView extends HookWidget { TextSpan( text: "실패", style: TextStyle( - color: Color(0xFF6E3678), + color: Color( + 0xFF6E3678), // TODO: primaryColor로 지정 fontWeight: FontWeight.bold)), TextSpan(text: "했습니다.") ]), @@ -528,7 +527,7 @@ class TaxiView extends HookWidget { leftButtonContent: "앱 종료하기", )), ) - : Stack() + : const Stack() ])); } From 7396dbd480efa4d347f99470766ac19d13ffdb45 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 29 Aug 2023 21:51:52 +0900 Subject: [PATCH 05/21] =?UTF-8?q?Add:=20contants=EC=97=90=20dialog=20?= =?UTF-8?q?=EA=B3=B5=ED=86=B5=20=EB=B6=80=EB=B6=84=20=EC=A0=95=EB=A6=AC=20?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/constants.dart | 7 ++++ lib/constants/theme.dart | 63 ++++++++++++++++++++++-------------- lib/views/taxiDialog.dart | 31 +++++++----------- pubspec.yaml | 2 +- 4 files changed, 58 insertions(+), 45 deletions(-) diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index 81b3bf7..795ce54 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -1,4 +1,5 @@ import "package:dio/dio.dart"; +import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:taxiapp/utils/remoteConfigController.dart'; @@ -9,3 +10,9 @@ final BaseOptions connectionOptions = BaseOptions( connectTimeout: Duration(seconds: 150), receiveTimeout: Duration(seconds: 130), ); + +const defaultDialogPadding = Padding(padding: EdgeInsets.all(15)); + +const defaultDialogButtonSize = Size(150, 45); + +final defaultDialogButtonBorderRadius = BorderRadius.circular(12.0); diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index a39b848..64909c9 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -3,38 +3,51 @@ import 'package:google_fonts/google_fonts.dart'; //primaryColor 지정 (색상코드: #6E3647) final Map primaryColor1 = { - 50: const Color.fromRGBO(110, 54, 71, .1), - 100: const Color.fromRGBO(110, 54, 71, .2), - 200: const Color.fromRGBO(110, 54, 71, .3), - 300: const Color.fromRGBO(110, 54, 71, .4), - 400: const Color.fromRGBO(110, 54, 71, .5), - 500: const Color.fromRGBO(110, 54, 71, .6), - 600: const Color.fromRGBO(110, 54, 71, .7), - 700: const Color.fromRGBO(110, 54, 71, .8), - 800: const Color.fromRGBO(110, 54, 71, .9), - 900: const Color.fromRGBO(110, 54, 71, 1), + 50: const Color.fromRGBO(110, 54, 120, .1), + 100: const Color.fromRGBO(110, 54, 120, .2), + 200: const Color.fromRGBO(110, 54, 120, .3), + 300: const Color.fromRGBO(110, 54, 120, .4), + 400: const Color.fromRGBO(110, 54, 120, .5), + 500: const Color.fromRGBO(110, 54, 120, .6), + 600: const Color.fromRGBO(110, 54, 120, .7), + 700: const Color.fromRGBO(110, 54, 120, .8), + 800: const Color.fromRGBO(110, 54, 120, .9), + 900: const Color.fromRGBO(110, 54, 120, 1), }; -MaterialColor taxiPrimaryColor = MaterialColor(0xFF6E3647, primaryColor1); +MaterialColor taxiPrimaryColor = MaterialColor(0xFF6E3678, primaryColor1); ThemeData buildTheme() { final base = ThemeData( primarySwatch: taxiPrimaryColor, - primaryColor: const Color(0xFF6E3647), + primaryColor: const Color(0xFF6E3678), textTheme: TextTheme( - //Dialog 제목 강조 - titleMedium: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF323232), - fontSize: 22, - fontWeight: FontWeight.normal)), + //Dialog 제목 + titleMedium: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFF323232), + fontSize: 22, + fontWeight: FontWeight.normal)), - //Dialog 상세 추가 설명 - bodySmall: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF888888), - fontSize: 12, - fontWeight: FontWeight.bold)), - ), + //Dialog 상세 설명 + bodySmall: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFF888888), + fontSize: 12, + fontWeight: FontWeight.bold)), + + //Dialog Elevated 버튼 텍스트 + labelLarge: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFFEEEEEE), + fontSize: 13, + fontWeight: FontWeight.bold)), + + //Dialog Elevated 버튼 텍스트 + labelMedium: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFFC8C8C8), + fontSize: 13, + fontWeight: FontWeight.normal))), ); return base; } diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index def25ca..aa02e07 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:open_store/open_store.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; +import 'package:taxiapp/constants/constants.dart'; class TaxiDialog extends StatelessWidget { late Set boxContent; @@ -27,30 +28,24 @@ class TaxiDialog extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - const Padding(padding: EdgeInsets.all(15)), + defaultDialogPadding, ...boxContent, - const Padding( - padding: EdgeInsets.all(15), - ), + defaultDialogPadding, Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( style: ElevatedButton.styleFrom( elevation: 0.5, - fixedSize: const Size(150, 45), + fixedSize: defaultDialogButtonSize, backgroundColor: const Color(0xFFFAF8FB), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.0), + borderRadius: defaultDialogButtonBorderRadius, side: const BorderSide(color: Colors.white), ), ), child: Text(leftButtonContent, - style: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFFC8C8C8), - fontSize: 13, - fontWeight: FontWeight.normal))), + style: Theme.of(context).textTheme.labelMedium), onPressed: () async { if (Platform.isIOS) { exit(0); @@ -63,22 +58,19 @@ class TaxiDialog extends StatelessWidget { ), OutlinedButton( style: ButtonStyle( - fixedSize: MaterialStateProperty.all(const Size(150, 45)), + fixedSize: + MaterialStateProperty.all(defaultDialogButtonSize), backgroundColor: MaterialStateProperty.all( - const Color(0xFF6E3678)), + Theme.of(context).primaryColor), shape: MaterialStateProperty.all( RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.0), + borderRadius: defaultDialogButtonBorderRadius, side: const BorderSide(color: Colors.black), ), ), ), child: Text(rightButtonContent, - style: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFFEEEEEE), - fontSize: 13, - fontWeight: FontWeight.bold))), + style: Theme.of(context).textTheme.labelLarge), onPressed: () async { OpenStore.instance.open( androidAppBundleId: dotenv.get("ANDROID_APPID"), @@ -86,6 +78,7 @@ class TaxiDialog extends StatelessWidget { }), ], ), + //하단 패딩 const Padding(padding: EdgeInsets.only(bottom: 15)), ]), ); diff --git a/pubspec.yaml b/pubspec.yaml index ac509e9..a93d052 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.3+26 +version: 1.0.2+26 environment: sdk: ">=2.17.5 <3.0.0" From 27d1d9d45ff3b451b2f66658a3c36cd044e7b78c Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 29 Aug 2023 22:18:49 +0900 Subject: [PATCH 06/21] Remove: unused library --- lib/views/taxiDialog.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index aa02e07..b3890fa 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:open_store/open_store.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:taxiapp/constants/constants.dart'; From d6b09536e5a6fd18c1646cfbec80fb5e2375c836 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 29 Aug 2023 22:26:02 +0900 Subject: [PATCH 07/21] =?UTF-8?q?Fix:=20=EC=95=B1=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EC=9A=A9=20=EB=B2=84=EC=A0=84=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index a93d052..ac509e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.2+26 +version: 1.0.3+26 environment: sdk: ">=2.17.5 <3.0.0" From 6a3fac7aca6beae39192141cd68f227bb05b992e Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 4 Sep 2023 21:58:19 +0900 Subject: [PATCH 08/21] Refactor: Button intervel & color minor changes --- lib/constants/constants.dart | 2 +- lib/constants/theme.dart | 2 +- lib/views/taxiDialog.dart | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index 795ce54..57e2366 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -11,7 +11,7 @@ final BaseOptions connectionOptions = BaseOptions( receiveTimeout: Duration(seconds: 130), ); -const defaultDialogPadding = Padding(padding: EdgeInsets.all(15)); +const defaultDialogPadding = Padding(padding: EdgeInsets.all(10)); const defaultDialogButtonSize = Size(150, 45); diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 64909c9..40ea5fa 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -45,7 +45,7 @@ ThemeData buildTheme() { //Dialog Elevated 버튼 텍스트 labelMedium: GoogleFonts.roboto( textStyle: const TextStyle( - color: Color(0xFFC8C8C8), + color: Color.fromARGB(255, 129, 129, 129), fontSize: 13, fontWeight: FontWeight.normal))), ); diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index b3890fa..d5655cc 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -20,7 +20,7 @@ class TaxiDialog extends StatelessWidget { Widget build(BuildContext context) { return Container( width: 350, - height: 172, + height: 155, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15)), child: Column( @@ -37,10 +37,11 @@ class TaxiDialog extends StatelessWidget { style: ElevatedButton.styleFrom( elevation: 0.5, fixedSize: defaultDialogButtonSize, - backgroundColor: const Color(0xFFFAF8FB), + backgroundColor: Color.fromARGB(255, 238, 238, 238), shape: RoundedRectangleBorder( borderRadius: defaultDialogButtonBorderRadius, - side: const BorderSide(color: Colors.white), + side: const BorderSide( + color: Color.fromARGB(255, 238, 238, 238)), ), ), child: Text(leftButtonContent, @@ -53,7 +54,8 @@ class TaxiDialog extends StatelessWidget { } }), const Padding( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all( + 7), //피그마 기준 상으로 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 7로 설정 ), OutlinedButton( style: ButtonStyle( @@ -78,7 +80,7 @@ class TaxiDialog extends StatelessWidget { ], ), //하단 패딩 - const Padding(padding: EdgeInsets.only(bottom: 15)), + const Padding(padding: EdgeInsets.only(bottom: 10)), ]), ); } From 46ff77983da7a2df0688e894c755fbbd59c18a19 Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 4 Sep 2023 22:00:16 +0900 Subject: [PATCH 09/21] Refactor: dialog nodal width change --- lib/views/taxiDialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index d5655cc..f1c60ec 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -19,7 +19,7 @@ class TaxiDialog extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 350, + width: 340, height: 155, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(15)), From fad9286417ca6c907ad1bd4f886b6548003efc2b Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 4 Sep 2023 22:14:37 +0900 Subject: [PATCH 10/21] =?UTF-8?q?Refactor:=20theme=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EB=B3=B4=EA=B0=95=20=EB=B0=8F=20dialog=20=ED=85=8C=EB=A7=88=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EA=B2=BD=EA=B0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/theme.dart | 24 ++++++++++++++++++++++++ lib/views/taxiDialog.dart | 24 ++---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 40ea5fa..7c60582 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'constants.dart'; import 'package:google_fonts/google_fonts.dart'; //primaryColor 지정 (색상코드: #6E3647) @@ -20,6 +21,29 @@ ThemeData buildTheme() { final base = ThemeData( primarySwatch: taxiPrimaryColor, primaryColor: const Color(0xFF6E3678), + //dialog 버튼 + elevatedButtonTheme: ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + elevation: 0.5, + fixedSize: defaultDialogButtonSize, + backgroundColor: Color.fromARGB(255, 238, 238, 238), + shape: RoundedRectangleBorder( + borderRadius: defaultDialogButtonBorderRadius, + ), + ), + ), + outlinedButtonTheme: OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + fixedSize: defaultDialogButtonSize, + backgroundColor: taxiPrimaryColor, + shape: RoundedRectangleBorder( + borderRadius: defaultDialogButtonBorderRadius, + side: const BorderSide(color: Colors.black), + ), + ), + ), + + //텍스트 테마 textTheme: TextTheme( //Dialog 제목 titleMedium: GoogleFonts.roboto( diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index f1c60ec..c968b1e 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -34,16 +34,7 @@ class TaxiDialog extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( - style: ElevatedButton.styleFrom( - elevation: 0.5, - fixedSize: defaultDialogButtonSize, - backgroundColor: Color.fromARGB(255, 238, 238, 238), - shape: RoundedRectangleBorder( - borderRadius: defaultDialogButtonBorderRadius, - side: const BorderSide( - color: Color.fromARGB(255, 238, 238, 238)), - ), - ), + style: Theme.of(context).elevatedButtonTheme.style, child: Text(leftButtonContent, style: Theme.of(context).textTheme.labelMedium), onPressed: () async { @@ -58,18 +49,7 @@ class TaxiDialog extends StatelessWidget { 7), //피그마 기준 상으로 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 7로 설정 ), OutlinedButton( - style: ButtonStyle( - fixedSize: - MaterialStateProperty.all(defaultDialogButtonSize), - backgroundColor: MaterialStateProperty.all( - Theme.of(context).primaryColor), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: defaultDialogButtonBorderRadius, - side: const BorderSide(color: Colors.black), - ), - ), - ), + style: Theme.of(context).outlinedButtonTheme.style, child: Text(rightButtonContent, style: Theme.of(context).textTheme.labelLarge), onPressed: () async { From 69ca70a857801c509cec9e0797d1be0f3d5f58e5 Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 4 Sep 2023 22:17:38 +0900 Subject: [PATCH 11/21] =?UTF-8?q?Docs:=20=EC=A3=BC=EC=84=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/views/taxiDialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index c968b1e..1e8a4b1 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -46,7 +46,7 @@ class TaxiDialog extends StatelessWidget { }), const Padding( padding: EdgeInsets.all( - 7), //피그마 기준 상으로 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 7로 설정 + 7), //피그마 기준 상, 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 7로 설정 ), OutlinedButton( style: Theme.of(context).outlinedButtonTheme.style, From 977805a16375e441738b7d28f984b8b9a06045fb Mon Sep 17 00:00:00 2001 From: ybminm Date: Wed, 6 Sep 2023 02:08:08 +0900 Subject: [PATCH 12/21] Refactor: taxiDialog dialog standard & style --- lib/constants/constants.dart | 10 +++++++--- lib/constants/theme.dart | 14 +++++++++++--- lib/views/taxiDialog.dart | 25 ++++++++++++++----------- lib/views/taxiView.dart | 14 +++++++++----- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index 57e2366..f6f6540 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -11,8 +11,12 @@ final BaseOptions connectionOptions = BaseOptions( receiveTimeout: Duration(seconds: 130), ); -const defaultDialogPadding = Padding(padding: EdgeInsets.all(10)); +const defaultDialogUpperTitlePadding = Padding(padding: EdgeInsets.all(15)); -const defaultDialogButtonSize = Size(150, 45); +const defaultDialogMedianTitlePadding = Padding(padding: EdgeInsets.all(2)); -final defaultDialogButtonBorderRadius = BorderRadius.circular(12.0); +const defaultDialogLowerTitlePadding = Padding(padding: EdgeInsets.all(10)); + +const defaultDialogButtonSize = Size(150, 35); + +final defaultDialogButtonBorderRadius = BorderRadius.circular(5.0); diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 7c60582..6d5a4ca 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -21,6 +21,14 @@ ThemeData buildTheme() { final base = ThemeData( primarySwatch: taxiPrimaryColor, primaryColor: const Color(0xFF6E3678), + //dialog 테마 + dialogTheme: DialogTheme( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + backgroundColor: Colors.white, + actionsPadding: EdgeInsets.all(10.0), + surfaceTintColor: Colors.black, + ), + dialogBackgroundColor: Colors.white, //dialog 버튼 elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( @@ -46,17 +54,17 @@ ThemeData buildTheme() { //텍스트 테마 textTheme: TextTheme( //Dialog 제목 - titleMedium: GoogleFonts.roboto( + titleSmall: GoogleFonts.roboto( textStyle: const TextStyle( color: Color(0xFF323232), - fontSize: 22, + fontSize: 16, fontWeight: FontWeight.normal)), //Dialog 상세 설명 bodySmall: GoogleFonts.roboto( textStyle: const TextStyle( color: Color(0xFF888888), - fontSize: 12, + fontSize: 10, fontWeight: FontWeight.bold)), //Dialog Elevated 버튼 텍스트 diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index 1e8a4b1..d2d8394 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -7,29 +7,32 @@ import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:taxiapp/constants/constants.dart'; class TaxiDialog extends StatelessWidget { - late Set boxContent; + late Set boxMainContent; + late Set boxSecondaryContent; late String leftButtonContent; late String rightButtonContent; TaxiDialog( {super.key, - required this.boxContent, + required this.boxMainContent, + required this.boxSecondaryContent, required this.leftButtonContent, required this.rightButtonContent}); @override Widget build(BuildContext context) { - return Container( - width: 340, - height: 155, - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(15)), + return Dialog( + alignment: Alignment.center, + shape: Theme.of(context).dialogTheme.shape, child: Column( + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - defaultDialogPadding, - ...boxContent, - defaultDialogPadding, + defaultDialogUpperTitlePadding, + ...boxMainContent, + defaultDialogMedianTitlePadding, + ...boxSecondaryContent, + defaultDialogLowerTitlePadding, Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -46,7 +49,7 @@ class TaxiDialog extends StatelessWidget { }), const Padding( padding: EdgeInsets.all( - 7), //피그마 기준 상, 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 7로 설정 + 5), //피그마 기준 상, 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 5로 설정 ), OutlinedButton( style: Theme.of(context).outlinedButtonTheme.style, diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 5d4046f..1d54c63 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -18,6 +18,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:taxiapp/views/taxiDialog.dart'; import 'package:app_links/app_links.dart'; +import 'package:taxiapp/constants/constants.dart'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); @@ -464,11 +465,11 @@ class TaxiView extends HookWidget { color: const Color(0x66C8C8C8), child: Center( child: TaxiDialog( - boxContent: { + boxMainContent: { RichText( textAlign: TextAlign.center, text: TextSpan( - style: Theme.of(context).textTheme.titleMedium, + style: Theme.of(context).textTheme.titleSmall, children: const [ TextSpan( text: "새로운 버전", @@ -484,6 +485,8 @@ class TaxiView extends HookWidget { TextSpan(text: "되었습니다!") ]), ), + }, + boxSecondaryContent: { Text("정상적인 사용을 위해 앱을 업데이트 해주세요.", textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodySmall), @@ -498,11 +501,11 @@ class TaxiView extends HookWidget { color: const Color(0x66C8C8C8), child: Center( child: TaxiDialog( - boxContent: { + boxMainContent: { RichText( textAlign: TextAlign.center, text: TextSpan( - style: Theme.of(context).textTheme.titleMedium, + style: Theme.of(context).textTheme.titleSmall, children: const [ TextSpan( text: "서버와의 ", @@ -518,7 +521,8 @@ class TaxiView extends HookWidget { TextSpan(text: "했습니다.") ]), ), - const Padding(padding: EdgeInsets.only(top: 5)), + }, + boxSecondaryContent: { Text("일시적인 오류일 수 있습니다.", textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodySmall), From ec3cd85db0148afc267f1ab4f448ae7985d5a95e Mon Sep 17 00:00:00 2001 From: ybminm Date: Wed, 6 Sep 2023 02:23:56 +0900 Subject: [PATCH 13/21] =?UTF-8?q?Refactor:=20=EB=82=A8=EC=9D=80=20constant?= =?UTF-8?q?s=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/constants.dart | 9 ++++++++- lib/views/taxiDialog.dart | 8 ++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index f6f6540..cf8e63a 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -11,12 +11,19 @@ final BaseOptions connectionOptions = BaseOptions( receiveTimeout: Duration(seconds: 130), ); +//아래의 상수들은 피그마 기준 상의 패딩 픽셀과는 차이를 두고 있지만, +//이는 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 설정한 값들입니다. const defaultDialogUpperTitlePadding = Padding(padding: EdgeInsets.all(15)); const defaultDialogMedianTitlePadding = Padding(padding: EdgeInsets.all(2)); const defaultDialogLowerTitlePadding = Padding(padding: EdgeInsets.all(10)); +const defaultDialogVerticalMedianButtonPadding = + Padding(padding: EdgeInsets.all(5)); + +const defaultDialogLowerButtonPadding = Padding(padding: EdgeInsets.all(3)); + const defaultDialogButtonSize = Size(150, 35); -final defaultDialogButtonBorderRadius = BorderRadius.circular(5.0); +final defaultDialogButtonBorderRadius = BorderRadius.circular(10.0); diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index d2d8394..c6b5f4c 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -47,10 +47,7 @@ class TaxiDialog extends StatelessWidget { SystemNavigator.pop(); } }), - const Padding( - padding: EdgeInsets.all( - 5), //피그마 기준 상, 버튼 간의 간격은 10px이나 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 5로 설정 - ), + defaultDialogVerticalMedianButtonPadding, OutlinedButton( style: Theme.of(context).outlinedButtonTheme.style, child: Text(rightButtonContent, @@ -62,8 +59,7 @@ class TaxiDialog extends StatelessWidget { }), ], ), - //하단 패딩 - const Padding(padding: EdgeInsets.only(bottom: 10)), + defaultDialogLowerButtonPadding, ]), ); } From ef63616f43d4ca4d3afc34c1b27d2c0ff1933a5c Mon Sep 17 00:00:00 2001 From: ybminm Date: Thu, 7 Sep 2023 20:02:23 +0900 Subject: [PATCH 14/21] =?UTF-8?q?Refactor:=20=EC=BB=AC=EB=9F=AC=20?= =?UTF-8?q?=EC=83=81=EC=88=98=ED=99=94=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/theme.dart | 17 +++++++++----- lib/main.dart | 2 +- lib/views/taxiView.dart | 48 +++++++++++++++++++--------------------- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 6d5a4ca..f8ffcba 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -15,17 +15,24 @@ final Map primaryColor1 = { 800: const Color.fromRGBO(110, 54, 120, .9), 900: const Color.fromRGBO(110, 54, 120, 1), }; -MaterialColor taxiPrimaryColor = MaterialColor(0xFF6E3678, primaryColor1); +final MaterialColor taxiPrimaryMaterialColor = + MaterialColor(0xFF6E3678, primaryColor1); +const Color taxiPrimaryColor = Color(0xFF6E3678); +const Color taxiMainBackgroundColor = Colors.white; +const Color toastBackgroundColor = Colors.white; +const Color toastTextColor = Colors.black; +const Color notiColor = Color(0x66C8C8C8); ThemeData buildTheme() { final base = ThemeData( - primarySwatch: taxiPrimaryColor, + primarySwatch: taxiPrimaryMaterialColor, primaryColor: const Color(0xFF6E3678), + //dialog 테마 dialogTheme: DialogTheme( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), backgroundColor: Colors.white, - actionsPadding: EdgeInsets.all(10.0), + actionsPadding: const EdgeInsets.all(10.0), surfaceTintColor: Colors.black, ), dialogBackgroundColor: Colors.white, @@ -34,7 +41,7 @@ ThemeData buildTheme() { style: ElevatedButton.styleFrom( elevation: 0.5, fixedSize: defaultDialogButtonSize, - backgroundColor: Color.fromARGB(255, 238, 238, 238), + backgroundColor: const Color.fromARGB(255, 238, 238, 238), shape: RoundedRectangleBorder( borderRadius: defaultDialogButtonBorderRadius, ), @@ -43,7 +50,7 @@ ThemeData buildTheme() { outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( fixedSize: defaultDialogButtonSize, - backgroundColor: taxiPrimaryColor, + backgroundColor: taxiPrimaryMaterialColor, shape: RoundedRectangleBorder( borderRadius: defaultDialogButtonBorderRadius, side: const BorderSide(color: Colors.black), diff --git a/lib/main.dart b/lib/main.dart index 329bae1..c560a8a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -87,7 +87,7 @@ class MyHome extends HookWidget { home: Container( color: Theme.of(context).primaryColor, child: Container( - color: Colors.white, + color: taxiMainBackgroundColor, child: TaxiView(), ), ), diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 1d54c63..5b18c36 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -8,6 +8,7 @@ import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:package_info/package_info.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:taxiapp/constants/theme.dart'; import 'package:taxiapp/utils/fcmToken.dart'; import 'package:taxiapp/utils/pushHandler.dart'; import 'package:taxiapp/utils/remoteConfigController.dart'; @@ -18,7 +19,6 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:taxiapp/views/taxiDialog.dart'; import 'package:app_links/app_links.dart'; -import 'package:taxiapp/constants/constants.dart'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); @@ -220,9 +220,9 @@ class TaxiView extends HookWidget { } catch (e) { Fluttertoast.showToast( msg: "버전 체크에 실패했습니다. " + e.toString(), - backgroundColor: Colors.white, + backgroundColor: toastBackgroundColor, toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, + textColor: toastTextColor, ); } }); @@ -255,9 +255,9 @@ class TaxiView extends HookWidget { } catch (e) { Fluttertoast.showToast( msg: "로그인에 실패했습니다.", - backgroundColor: Colors.white, + backgroundColor: toastBackgroundColor, toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, + textColor: toastTextColor, ); } } @@ -326,8 +326,8 @@ class TaxiView extends HookWidget { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); + textColor: toastTextColor, + backgroundColor: toastBackgroundColor); isAuthLogin.value = false; } }); @@ -342,8 +342,8 @@ class TaxiView extends HookWidget { Fluttertoast.showToast( msg: "알림 권한을 허용해주세요.", toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); + textColor: toastTextColor, + backgroundColor: toastBackgroundColor); return false; } }); @@ -380,8 +380,8 @@ class TaxiView extends HookWidget { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); + textColor: toastTextColor, + backgroundColor: toastBackgroundColor); isAuthLogin.value = false; } } @@ -404,8 +404,8 @@ class TaxiView extends HookWidget { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); + textColor: toastTextColor, + backgroundColor: toastBackgroundColor); isAuthLogin.value = false; } } @@ -428,8 +428,8 @@ class TaxiView extends HookWidget { await Fluttertoast.showToast( msg: "카카오톡을 실행할 수 없습니다.", toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); + textColor: toastTextColor, + backgroundColor: toastBackgroundColor); } } } @@ -445,8 +445,8 @@ class TaxiView extends HookWidget { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); + textColor: toastTextColor, + backgroundColor: toastBackgroundColor); isServerError.value = true; } }, @@ -462,7 +462,7 @@ class TaxiView extends HookWidget { body: FadeTransition(opacity: animation, child: loadingView())), isMustUpdate.value ? Container( - color: const Color(0x66C8C8C8), + color: notiColor, child: Center( child: TaxiDialog( boxMainContent: { @@ -479,8 +479,7 @@ class TaxiView extends HookWidget { TextSpan( text: "출시", style: TextStyle( - color: Color( - 0xFF6E3678), // TODO: primaryColor로 지정 + color: taxiPrimaryColor, fontWeight: FontWeight.bold)), TextSpan(text: "되었습니다!") ]), @@ -498,7 +497,7 @@ class TaxiView extends HookWidget { : const Stack(), isServerError.value ? Container( - color: const Color(0x66C8C8C8), + color: notiColor, child: Center( child: TaxiDialog( boxMainContent: { @@ -515,8 +514,7 @@ class TaxiView extends HookWidget { TextSpan( text: "실패", style: TextStyle( - color: Color( - 0xFF6E3678), // TODO: primaryColor로 지정 + color: taxiPrimaryColor, fontWeight: FontWeight.bold)), TextSpan(text: "했습니다.") ]), @@ -559,8 +557,8 @@ class TaxiView extends HookWidget { backCount.value = true; Fluttertoast.showToast( msg: "한번 더 누르시면 앱을 종료합니다.", - backgroundColor: Colors.white, - textColor: Colors.black, + backgroundColor: toastBackgroundColor, + textColor: toastTextColor, toastLength: Toast.LENGTH_SHORT, ); return false; From 0e5e961ec6afd678e571df3f8a9636bd83dce6f7 Mon Sep 17 00:00:00 2001 From: ybminm Date: Fri, 8 Sep 2023 01:40:02 +0900 Subject: [PATCH 15/21] =?UTF-8?q?CSS:=20=EC=83=89=EC=83=81=20=EB=B0=8F=20?= =?UTF-8?q?=ED=8F=B0=ED=8A=B8=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/theme.dart | 4 ++-- lib/views/taxiDialog.dart | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index f8ffcba..cb65aae 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -78,14 +78,14 @@ ThemeData buildTheme() { labelLarge: GoogleFonts.roboto( textStyle: const TextStyle( color: Color(0xFFEEEEEE), - fontSize: 13, + fontSize: 12, fontWeight: FontWeight.bold)), //Dialog Elevated 버튼 텍스트 labelMedium: GoogleFonts.roboto( textStyle: const TextStyle( color: Color.fromARGB(255, 129, 129, 129), - fontSize: 13, + fontSize: 12, fontWeight: FontWeight.normal))), ); return base; diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index c6b5f4c..6485493 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -21,7 +21,9 @@ class TaxiDialog extends StatelessWidget { @override Widget build(BuildContext context) { return Dialog( + //TODO:barrier Color를 Colors.black.withOpacity(0.5)로 설정해야 피그마 기준에 부합합니다. alignment: Alignment.center, + backgroundColor: Theme.of(context).dialogBackgroundColor, shape: Theme.of(context).dialogTheme.shape, child: Column( mainAxisSize: MainAxisSize.min, From 19d6e6a7b2bc6fa4ded3e79ffd840fb17e5c49e1 Mon Sep 17 00:00:00 2001 From: ybminm Date: Fri, 8 Sep 2023 01:46:59 +0900 Subject: [PATCH 16/21] =?UTF-8?q?Refactor:=20const=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/constants.dart | 4 ++-- lib/constants/theme.dart | 1 + lib/views/taxiDialog.dart | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index cf8e63a..b3ff201 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -7,8 +7,8 @@ String address = RemoteConfigController().backUrl; final BaseOptions connectionOptions = BaseOptions( baseUrl: address, - connectTimeout: Duration(seconds: 150), - receiveTimeout: Duration(seconds: 130), + connectTimeout: const Duration(seconds: 150), + receiveTimeout: const Duration(seconds: 130), ); //아래의 상수들은 피그마 기준 상의 패딩 픽셀과는 차이를 두고 있지만, diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index cb65aae..f6d13f6 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -36,6 +36,7 @@ ThemeData buildTheme() { surfaceTintColor: Colors.black, ), dialogBackgroundColor: Colors.white, + //dialog 버튼 elevatedButtonTheme: ElevatedButtonThemeData( style: ElevatedButton.styleFrom( diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index 6485493..6d8f76a 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -21,7 +21,7 @@ class TaxiDialog extends StatelessWidget { @override Widget build(BuildContext context) { return Dialog( - //TODO:barrier Color를 Colors.black.withOpacity(0.5)로 설정해야 피그마 기준에 부합합니다. + //TODO: barrier Color를 Colors.black.withOpacity(0.5)로 설정해야 피그마 기준에 부합합니다. alignment: Alignment.center, backgroundColor: Theme.of(context).dialogBackgroundColor, shape: Theme.of(context).dialogTheme.shape, From 4783ed084f1a3bb3a45bbb572d4854aea31a9dd8 Mon Sep 17 00:00:00 2001 From: ybminm Date: Fri, 8 Sep 2023 03:08:33 +0900 Subject: [PATCH 17/21] =?UTF-8?q?Refactor:=20=EB=8B=A4=EC=9D=B4=EC=96=BC?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EB=B0=B0=EB=A6=AC=EC=96=B4=20=EC=83=89?= =?UTF-8?q?=EC=83=81=20=ED=88=AC=EB=AA=85=EB=8F=84=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/theme.dart | 1 + lib/views/taxiDialog.dart | 91 +++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 43 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index f6d13f6..8729ce6 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -22,6 +22,7 @@ const Color taxiMainBackgroundColor = Colors.white; const Color toastBackgroundColor = Colors.white; const Color toastTextColor = Colors.black; const Color notiColor = Color(0x66C8C8C8); +final Color dialogBarrierColor = Colors.black.withOpacity(0.6); ThemeData buildTheme() { final base = ThemeData( diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index 6d8f76a..4a84bd1 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import 'package:open_store/open_store.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:taxiapp/constants/constants.dart'; +import 'package:taxiapp/constants/theme.dart'; class TaxiDialog extends StatelessWidget { late Set boxMainContent; @@ -20,49 +21,53 @@ class TaxiDialog extends StatelessWidget { @override Widget build(BuildContext context) { - return Dialog( - //TODO: barrier Color를 Colors.black.withOpacity(0.5)로 설정해야 피그마 기준에 부합합니다. - alignment: Alignment.center, - backgroundColor: Theme.of(context).dialogBackgroundColor, - shape: Theme.of(context).dialogTheme.shape, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - defaultDialogUpperTitlePadding, - ...boxMainContent, - defaultDialogMedianTitlePadding, - ...boxSecondaryContent, - defaultDialogLowerTitlePadding, - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ElevatedButton( - style: Theme.of(context).elevatedButtonTheme.style, - child: Text(leftButtonContent, - style: Theme.of(context).textTheme.labelMedium), - onPressed: () async { - if (Platform.isIOS) { - exit(0); - } else { - SystemNavigator.pop(); - } - }), - defaultDialogVerticalMedianButtonPadding, - OutlinedButton( - style: Theme.of(context).outlinedButtonTheme.style, - child: Text(rightButtonContent, - style: Theme.of(context).textTheme.labelLarge), - onPressed: () async { - OpenStore.instance.open( - androidAppBundleId: dotenv.get("ANDROID_APPID"), - appStoreId: dotenv.get("IOS_APPID")); - }), - ], - ), - defaultDialogLowerButtonPadding, - ]), + return Container( + height: double.infinity, + width: double.infinity, + color: dialogBarrierColor, + child: Dialog( + alignment: Alignment.center, + backgroundColor: Theme.of(context).dialogBackgroundColor, + shape: Theme.of(context).dialogTheme.shape, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + defaultDialogUpperTitlePadding, + ...boxMainContent, + defaultDialogMedianTitlePadding, + ...boxSecondaryContent, + defaultDialogLowerTitlePadding, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + style: Theme.of(context).elevatedButtonTheme.style, + child: Text(leftButtonContent, + style: Theme.of(context).textTheme.labelMedium), + onPressed: () async { + if (Platform.isIOS) { + exit(0); + } else { + SystemNavigator.pop(); + } + }), + defaultDialogVerticalMedianButtonPadding, + OutlinedButton( + style: Theme.of(context).outlinedButtonTheme.style, + child: Text(rightButtonContent, + style: Theme.of(context).textTheme.labelLarge), + onPressed: () async { + OpenStore.instance.open( + androidAppBundleId: dotenv.get("ANDROID_APPID"), + appStoreId: dotenv.get("IOS_APPID")); + }), + ], + ), + defaultDialogLowerButtonPadding, + ]), + ), ); } } From 77741daab1ba7fa0c5a84c9ae685eb536aa0cc09 Mon Sep 17 00:00:00 2001 From: ybminm Date: Fri, 8 Sep 2023 21:03:21 +0900 Subject: [PATCH 18/21] Fix: newest main branch apply --- lib/constants/constants.dart | 11 ----------- lib/utils/fcmToken.dart | 6 ++++-- lib/utils/pushHandler.dart | 8 +++----- lib/utils/remoteConfigController.dart | 12 ++---------- lib/utils/token.dart | 10 ++++++---- lib/views/taxiView.dart | 24 ------------------------ 6 files changed, 15 insertions(+), 56 deletions(-) diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index b3ff201..d3c4da2 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -1,15 +1,4 @@ -import "package:dio/dio.dart"; import 'package:flutter/material.dart'; -import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:taxiapp/utils/remoteConfigController.dart'; - -String address = RemoteConfigController().backUrl; - -final BaseOptions connectionOptions = BaseOptions( - baseUrl: address, - connectTimeout: const Duration(seconds: 150), - receiveTimeout: const Duration(seconds: 130), -); //아래의 상수들은 피그마 기준 상의 패딩 픽셀과는 차이를 두고 있지만, //이는 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 설정한 값들입니다. diff --git a/lib/utils/fcmToken.dart b/lib/utils/fcmToken.dart index c591753..3be83dc 100644 --- a/lib/utils/fcmToken.dart +++ b/lib/utils/fcmToken.dart @@ -1,13 +1,13 @@ import "package:dio/dio.dart"; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:taxiapp/constants/constants.dart'; +import 'package:taxiapp/utils/remoteConfigController.dart'; class FcmToken { String token; static FcmToken? _instance; - final Dio _dio = Dio(connectionOptions); + final Dio _dio = Dio(); FcmToken._internal({required this.token}); @@ -32,6 +32,7 @@ class FcmToken { String get fcmToken => token; Future registerToken(String accessToken) async { + _dio.options.baseUrl = RemoteConfigController().backUrl; return _dio.post("auth/app/device", data: { "accessToken": accessToken, "deviceToken": token, @@ -43,6 +44,7 @@ class FcmToken { } Future removeToken(String accessToken) async { + _dio.options.baseUrl = RemoteConfigController().backUrl; return _dio.delete("auth/app/device", data: { "accessToken": accessToken, "deviceToken": token, diff --git a/lib/utils/pushHandler.dart b/lib/utils/pushHandler.dart index bb8c0ae..f92094f 100644 --- a/lib/utils/pushHandler.dart +++ b/lib/utils/pushHandler.dart @@ -33,11 +33,9 @@ Future handleMessage(RemoteMessage message) async { var details = NotificationDetails(android: androidNotiDetails, iOS: iOSNotiDetails); - if (message.data != null) { - flutterLocalNotificationsPlugin.show(Random().nextInt(100000000), - message.data['title'], message.data['body'], details, - payload: message.data['url']); - } + flutterLocalNotificationsPlugin.show(Random().nextInt(100000000), + message.data['title'], message.data['body'], details, + payload: message.data['url']); } Future _getByteArrayFromUrl(String url) async { diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index 2754eab..7d035c3 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -1,5 +1,3 @@ -import "package:dio/dio.dart"; -import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_remote_config/firebase_remote_config.dart'; import 'package:package_info/package_info.dart'; @@ -29,10 +27,7 @@ class RemoteConfigController { ios_version == null || android_version == null) { return _instance ??= RemoteConfigController._internal( - backUrl: 'https://taxi.sparcs.org/api/', - frontUrl: 'https://taxi.sparcs.org', - ios_version: '', - android_version: ''); + backUrl: '', frontUrl: '', ios_version: '', android_version: ''); } _instance = RemoteConfigController._internal( backUrl: backUrl, @@ -40,10 +35,7 @@ class RemoteConfigController { ios_version: ios_version, android_version: android_version); return _instance ??= RemoteConfigController._internal( - backUrl: 'https://taxi.sparcs.org/api/', - frontUrl: 'https://taxi.sparcs.org', - ios_version: '', - android_version: ''); + backUrl: '', frontUrl: '', ios_version: '', android_version: ''); } Future init() async { diff --git a/lib/utils/token.dart b/lib/utils/token.dart index c58c12b..4755516 100644 --- a/lib/utils/token.dart +++ b/lib/utils/token.dart @@ -1,11 +1,11 @@ import 'dart:io'; import "package:dio/dio.dart"; -import 'package:taxiapp/constants/constants.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:cookie_jar/cookie_jar.dart'; import 'package:dio_cookie_manager/dio_cookie_manager.dart'; import 'package:taxiapp/utils/fcmToken.dart'; +import 'package:taxiapp/utils/remoteConfigController.dart'; class Token { String accessToken; @@ -13,7 +13,7 @@ class Token { static Token? _instance; static final _storage = FlutterSecureStorage(); - final Dio _dio = Dio(connectionOptions); + final Dio _dio = Dio(); final CookieJar _cookieJar = CookieJar(); Token._internal({required this.accessToken, required this.refreshToken}); @@ -56,6 +56,7 @@ class Token { } Future getSession() async { + _dio.options.baseUrl = RemoteConfigController().backUrl; _dio.interceptors.add(CookieManager(_cookieJar)); return _dio.get("/auth/app/token/login", queryParameters: { "accessToken": accessToken, @@ -74,8 +75,8 @@ class Token { return null; } if (response.statusCode == 200) { - List cookies = await _cookieJar.loadForRequest( - Uri.parse(connectionOptions.baseUrl + "auth/app/token/login")); + List cookies = await _cookieJar.loadForRequest(Uri.parse( + RemoteConfigController().backUrl + "auth/app/token/login")); for (Cookie cookie in cookies) { if (cookie.name == "connect.sid") { return cookie.value; @@ -90,6 +91,7 @@ class Token { } Future updateAccessTokenUsingRefreshToken() { + _dio.options.baseUrl = RemoteConfigController().backUrl; return _dio.get("/auth/app/token/refresh", queryParameters: { "accessToken": accessToken, "refreshToken": refreshToken, diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 5b18c36..bcbe596 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -386,30 +386,6 @@ class TaxiView extends HookWidget { } } }, - onUpdateVisitedHistory: - (controller, url, androidIsReload) async { - // 로그아웃 링크 감지 - if (url.toString().contains("logout") && isAuthLogin.value) { - await controller.stopLoading(); - try { - await FcmToken().removeToken(Token().getAccessToken()); - await Token().deleteAll(); - isLogin.value = false; - isAuthLogin.value = false; - await _cookieManager.deleteAllCookies(); - await _controller.value!.loadUrl( - urlRequest: URLRequest(url: Uri.parse(address))); - } catch (e) { - // TODO - Fluttertoast.showToast( - msg: "서버와의 연결에 실패했습니다.", - toastLength: Toast.LENGTH_SHORT, - textColor: toastTextColor, - backgroundColor: toastBackgroundColor); - isAuthLogin.value = false; - } - } - }, onLoadResourceCustomScheme: (controller, url) async { if (Platform.isAndroid) { if (url.scheme == 'intent') { From 279e6835bd75df585d57bd85dcce1416009d8731 Mon Sep 17 00:00:00 2001 From: ybminm Date: Fri, 8 Sep 2023 21:34:58 +0900 Subject: [PATCH 19/21] Remove: remove constants.dart --- lib/constants/constants.dart | 18 ------------------ lib/constants/theme.dart | 18 +++++++++++++++++- lib/views/taxiDialog.dart | 1 - 3 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 lib/constants/constants.dart diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart deleted file mode 100644 index d3c4da2..0000000 --- a/lib/constants/constants.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:flutter/material.dart'; - -//아래의 상수들은 피그마 기준 상의 패딩 픽셀과는 차이를 두고 있지만, -//이는 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 설정한 값들입니다. -const defaultDialogUpperTitlePadding = Padding(padding: EdgeInsets.all(15)); - -const defaultDialogMedianTitlePadding = Padding(padding: EdgeInsets.all(2)); - -const defaultDialogLowerTitlePadding = Padding(padding: EdgeInsets.all(10)); - -const defaultDialogVerticalMedianButtonPadding = - Padding(padding: EdgeInsets.all(5)); - -const defaultDialogLowerButtonPadding = Padding(padding: EdgeInsets.all(3)); - -const defaultDialogButtonSize = Size(150, 35); - -final defaultDialogButtonBorderRadius = BorderRadius.circular(10.0); diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 8729ce6..4223c4b 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'constants.dart'; import 'package:google_fonts/google_fonts.dart'; //primaryColor 지정 (색상코드: #6E3647) @@ -24,6 +23,23 @@ const Color toastTextColor = Colors.black; const Color notiColor = Color(0x66C8C8C8); final Color dialogBarrierColor = Colors.black.withOpacity(0.6); +//아래의 상수들은 피그마 기준 상의 패딩 픽셀과는 차이를 두고 있지만, +//이는 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 설정한 값들입니다. +const defaultDialogUpperTitlePadding = Padding(padding: EdgeInsets.all(15)); + +const defaultDialogMedianTitlePadding = Padding(padding: EdgeInsets.all(2)); + +const defaultDialogLowerTitlePadding = Padding(padding: EdgeInsets.all(10)); + +const defaultDialogVerticalMedianButtonPadding = + Padding(padding: EdgeInsets.all(5)); + +const defaultDialogLowerButtonPadding = Padding(padding: EdgeInsets.all(3)); + +const defaultDialogButtonSize = Size(150, 35); + +final defaultDialogButtonBorderRadius = BorderRadius.circular(10.0); + ThemeData buildTheme() { final base = ThemeData( primarySwatch: taxiPrimaryMaterialColor, diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index 4a84bd1..9ca3a70 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:open_store/open_store.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:taxiapp/constants/constants.dart'; import 'package:taxiapp/constants/theme.dart'; class TaxiDialog extends StatelessWidget { From c7c290ec188cf41cc59fa728a6994efcc56963e9 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 03:31:29 +0900 Subject: [PATCH 20/21] CSS: inner padding change --- lib/constants/theme.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 4223c4b..50a7304 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -36,9 +36,11 @@ const defaultDialogVerticalMedianButtonPadding = const defaultDialogLowerButtonPadding = Padding(padding: EdgeInsets.all(3)); -const defaultDialogButtonSize = Size(150, 35); +const defaultDialogButtonSize = Size(147.50, 35); -final defaultDialogButtonBorderRadius = BorderRadius.circular(10.0); +const defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 10); + +final defaultDialogButtonBorderRadius = BorderRadius.circular(8.0); ThemeData buildTheme() { final base = ThemeData( @@ -59,6 +61,7 @@ ThemeData buildTheme() { style: ElevatedButton.styleFrom( elevation: 0.5, fixedSize: defaultDialogButtonSize, + padding: defaultDialogButtonInnerPadding, backgroundColor: const Color.fromARGB(255, 238, 238, 238), shape: RoundedRectangleBorder( borderRadius: defaultDialogButtonBorderRadius, @@ -68,6 +71,7 @@ ThemeData buildTheme() { outlinedButtonTheme: OutlinedButtonThemeData( style: OutlinedButton.styleFrom( fixedSize: defaultDialogButtonSize, + padding: defaultDialogButtonInnerPadding, backgroundColor: taxiPrimaryMaterialColor, shape: RoundedRectangleBorder( borderRadius: defaultDialogButtonBorderRadius, @@ -96,14 +100,14 @@ ThemeData buildTheme() { labelLarge: GoogleFonts.roboto( textStyle: const TextStyle( color: Color(0xFFEEEEEE), - fontSize: 12, + fontSize: 14, fontWeight: FontWeight.bold)), //Dialog Elevated 버튼 텍스트 labelMedium: GoogleFonts.roboto( textStyle: const TextStyle( color: Color.fromARGB(255, 129, 129, 129), - fontSize: 12, + fontSize: 14, fontWeight: FontWeight.normal))), ); return base; From 3e2bb3de932777ee4e4a3f8dd4ff514b25f8ac0d Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 11 Sep 2023 03:05:24 +0900 Subject: [PATCH 21/21] Refactor: change dialog font & padding --- lib/constants/theme.dart | 75 ++++++++++++++++++++++----------------- lib/views/taxiDialog.dart | 6 +++- lib/views/taxiView.dart | 9 +++-- 3 files changed, 54 insertions(+), 36 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 50a7304..78fece3 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; //primaryColor 지정 (색상코드: #6E3647) final Map primaryColor1 = { @@ -25,20 +24,30 @@ final Color dialogBarrierColor = Colors.black.withOpacity(0.6); //아래의 상수들은 피그마 기준 상의 패딩 픽셀과는 차이를 두고 있지만, //이는 모바일 환경상 웹뷰와 같은 간격을 제시하기 위해 설정한 값들입니다. -const defaultDialogUpperTitlePadding = Padding(padding: EdgeInsets.all(15)); +double devicePixelRatio = 3.0; +const double dialogPadding = 15.0; +final defaultDialogUpperTitlePadding = + Padding(padding: EdgeInsets.symmetric(vertical: 36.0 / devicePixelRatio)); -const defaultDialogMedianTitlePadding = Padding(padding: EdgeInsets.all(2)); +final defaultDialogMedianTitlePadding = + Padding(padding: EdgeInsets.all(6 / devicePixelRatio)); -const defaultDialogLowerTitlePadding = Padding(padding: EdgeInsets.all(10)); +final defaultDialogLowerTitlePadding = + Padding(padding: EdgeInsets.symmetric(vertical: 24 / devicePixelRatio)); -const defaultDialogVerticalMedianButtonPadding = - Padding(padding: EdgeInsets.all(5)); +final defaultDialogVerticalMedianButtonPadding = Padding( + padding: + EdgeInsets.symmetric(horizontal: dialogPadding / devicePixelRatio)); -const defaultDialogLowerButtonPadding = Padding(padding: EdgeInsets.all(3)); +final defaultDialogLowerButtonPadding = Padding( + padding: EdgeInsets.only(bottom: (dialogPadding / 2) / devicePixelRatio)); -const defaultDialogButtonSize = Size(147.50, 35); +final defaultDialogPadding = + Padding(padding: EdgeInsets.all(dialogPadding / devicePixelRatio)); -const defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 10); +final defaultDialogButtonSize = Size(147.50, 35); + +final defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 9); final defaultDialogButtonBorderRadius = BorderRadius.circular(8.0); @@ -51,7 +60,7 @@ ThemeData buildTheme() { dialogTheme: DialogTheme( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), backgroundColor: Colors.white, - actionsPadding: const EdgeInsets.all(10.0), + actionsPadding: EdgeInsets.all(dialogPadding / devicePixelRatio), surfaceTintColor: Colors.black, ), dialogBackgroundColor: Colors.white, @@ -81,34 +90,34 @@ ThemeData buildTheme() { ), //텍스트 테마 - textTheme: TextTheme( + textTheme: const TextTheme( //Dialog 제목 - titleSmall: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF323232), - fontSize: 16, - fontWeight: FontWeight.normal)), + titleSmall: TextStyle( + fontFamily: 'NanumSquare', + color: Color(0xFF323232), + fontSize: 16, + fontWeight: FontWeight.w400), //Dialog 상세 설명 - bodySmall: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFF888888), - fontSize: 10, - fontWeight: FontWeight.bold)), - - //Dialog Elevated 버튼 텍스트 - labelLarge: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFFEEEEEE), - fontSize: 14, - fontWeight: FontWeight.bold)), + bodySmall: TextStyle( + fontFamily: 'NanumSquare_acB', + color: Color(0xFF888888), + fontSize: 10, + fontWeight: FontWeight.w700), + + //Dialog Outlined 버튼 텍스트 + labelLarge: TextStyle( + fontFamily: 'NanumSquare_acB', + color: Color(0xFFEEEEEE), + fontSize: 14, + fontWeight: FontWeight.w700), //Dialog Elevated 버튼 텍스트 - labelMedium: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color.fromARGB(255, 129, 129, 129), - fontSize: 14, - fontWeight: FontWeight.normal))), + labelMedium: TextStyle( + fontFamily: 'NanumSquare', + color: Color.fromARGB(255, 129, 129, 129), + fontSize: 14, + fontWeight: FontWeight.w400)), ); return base; } diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index 9ca3a70..f1636ee 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -39,8 +39,11 @@ class TaxiDialog extends StatelessWidget { ...boxSecondaryContent, defaultDialogLowerTitlePadding, Row( + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ + defaultDialogPadding, ElevatedButton( style: Theme.of(context).elevatedButtonTheme.style, child: Text(leftButtonContent, @@ -62,9 +65,10 @@ class TaxiDialog extends StatelessWidget { androidAppBundleId: dotenv.get("ANDROID_APPID"), appStoreId: dotenv.get("IOS_APPID")); }), + defaultDialogPadding, ], ), - defaultDialogLowerButtonPadding, + defaultDialogLowerButtonPadding ]), ), ); diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index a5299c8..d20b0f2 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -59,6 +59,8 @@ class TaxiView extends HookWidget { // FCM init 여부 확인 final isFcmInit = useState(false); + devicePixelRatio = MediaQuery.of(context).devicePixelRatio; + useEffect(() { if (isTimerUp.value) { FcmToken().init().then((value) { @@ -447,14 +449,17 @@ class TaxiView extends HookWidget { children: const [ TextSpan( text: "새로운 버전", - style: TextStyle(fontWeight: FontWeight.bold), + style: TextStyle( + fontFamily: 'NanumSquare_acB', + fontWeight: FontWeight.w700), ), TextSpan(text: "이 "), TextSpan( text: "출시", style: TextStyle( + fontFamily: 'NanumSquare_acB', color: taxiPrimaryColor, - fontWeight: FontWeight.bold)), + fontWeight: FontWeight.w700)), TextSpan(text: "되었습니다!") ]), ),