From a3ad4a044768f6ee3fd56c7909bc2c5ec3d11dba Mon Sep 17 00:00:00 2001 From: Seungbin Oh Date: Mon, 5 Jun 2023 04:42:22 +0900 Subject: [PATCH 01/71] Chore: add build CI --- .github/workflows/build.yml | 55 ++++++++++++++++++++++++++++++++++++ android/.gitignore | 1 + android/app/ci.jks | Bin 0 -> 2688 bytes 3 files changed, 56 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 android/app/ci.jks diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f236609 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +name: Build + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + FLUTTER_VERSION: "3" + JAVA_VERSION: "11" + +jobs: + build-android: + name: Build Android + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: "adopt" + java-version: ${{ env.JAVA_VERSION }} + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Create key.properties + run: | + echo "storeFile=./ci.jks" > android/key.properties + echo "storePassword=123456" >> android/key.properties + echo "keyPassword=123456" >> android/key.properties + echo "keyAlias=ci" >> android/key.properties + - name: Create google-services.json + run: echo ${{ secrets.GOOGLE_SERVICES_JSON }} > android/app/google-services.json + - name: Install dependencies + run: flutter pub get + - name: Build APK + run: flutter build apk --release + + build-ios: + name: Build iOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Create GoogleService-Info.plist + run: echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} > ios/Runner/GoogleService-Info.plist + - name: Install dependencies + run: flutter pub get + - name: Build iOS + run: flutter build ios --release --no-codesign diff --git a/android/.gitignore b/android/.gitignore index 6f56801..13d1bf5 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java key.properties **/*.keystore **/*.jks +!/app/ci.jks diff --git a/android/app/ci.jks b/android/app/ci.jks new file mode 100644 index 0000000000000000000000000000000000000000..edcba2bb1eba41a051445454e64316dc66b16b52 GIT binary patch literal 2688 zcma);S5y-W5{1(VO}c;-sY=UFfY1>sQbI{YL<}g!0E&c;NK+v6BE1NRAiX6NDbgX* zi-3p(MWlmBS*kxx);+sN&pz!w%$YOaojZ^B43bC}00M%MM7m2bT8VJ|@E?po8elGw zjuS$pWBY}fkVI(Fe@W1E2oak63&;Pe7#RJ3TnuzTP%aUw@e8UU9ez8Yj7S_(>Cec3 zl!UPRUl?Paztwckb!9DhBDO4#jZSeE1iH)&0tz4*VDNum1kpkPNIn>?O}IYL9t;6W zK$t0wI+8;#qQFvqkK!D3N_`+i$f&^Br??E&Cm&2Wgf6or;^W7Cs#FIfzl()E1o~P( zU2L@{;mvC{f(#FryS%l5_|U-i)P@FGtYvwWWBnQX!@TtJjW*goR(eT=5C(u*+2IYZ z^NA_~)NoH^wQv6z=)safR4XFr8Si3Hf-9NLisZdFeDO$bD(1rLD+h+Ihe=0pN2z;w zH}&Sj7)D!MTBC7Q79?yX;$ciGw1+gxCecnD@UMlsn@5N@i*ng(sa(u%?e1E`gWvBv zAA+d~I8Fwt+wf%xy}2WYXGL9y>=z1zxD6j@qTNmXW_q$qcn{+N2q|g?$v1SqF4QT( z_6sI9vem9}(AlT!t(p!d_4>4Sf-awFot!aTsI1fLSYyy_ezNk!$7Sga+HO)RVA5Je zSumiWQxnv5OLV!a?U*^6ZB>V0!zG+lE6v_HfSu-4%SkhbKVFX2j=6TjQhw(^US&d2DAFbH{DrJ37J7?Jc)X>~uJ-qKuVczZTSqEo4n0Dn*J^YVwtV}amBFycltBvtA~frPw)1K3 zJVC-wI5M55{mRmC&L%bI1$zhEf^oUJNrY=UA~HUmFS;`dQKPo&eZ`vyXHP6y{8miP z&!*tMx^_9I8KHDaxozs1hWCaTAsr1@hD3sk8*D3>mBg*8r{z8}@N^pmcSn=I&o(i$ zw`9FWDkQ}I%-6#`W{LnjY&|k-Q>S>I&cZKg(QI<)b|GRi@rB(Pd)M(vqb8jU{9c7l<}rqAvOV?T74vM<_nAw7GogY zMTs)gM%9qTwWsjcZ4&@#CmuKYC?oZi1-XPCFhAOCg|SmJ7@PZ{PmQ?mEr*C@Kf-ZLo?>jN(Gr7zc(Tm91tw; z$tWS&e#a#(y9|sU0>A?tk%E69hYUM}^`@hOzdChXqe>FfL&-YG;OzOCk2vz3P{mGfckW$C!b?2s(Gb z8+UnnNUcI&@9fN#Ds6eMGcN*!ma7DCR@ZT!ufhdxhKm zw==^zV*b)j?PQ^iddso%LG059XKyJ#P@lX0)+^OAP4UU%Jn!?W+Hsb=y)a4&U*dSP zz%3Udtxt$9S}nTGELopytkdR-3GXk*iPEABk}uIU=7}QCJ=M^aOnW!VcOLB&kx3&x z5F(f3bSM9dV25QwPm|pyZC~cM!guO#2*4b+y*IbdT2h-U7@ZK-Lrih2Dj@Ym{$BlI z+hf|g%OCKbX|rKjkg1r&SLKnOh7e_9J zbmgamj}O;BZRg$;>?jO5Q@B6L#IdPu9>PH5*gT8Sxz9`WwoiMGU z;qk3_O%eN9Fn|(gmD3n^yAs8e~<>0jUic~rE;Mh&7jqU4z9KBBV-f|EZF z0T+dN!rXHUQWS&a@>S)naJKJlI>_LpkAnDSmR-Q|41$!Q zo?_iesL>etIzhwtb~G6@@PU+9M(a?jTd6?9uuw|TqWF9Dmt2!mdAb=3;0hUd^#oJP zauFK6lue0v)$A$gPX#B?-~O=}_o%e>NoWvtU#ErnN3mH@K{>Dynm!xqZ9^b>OB{5+F?LJUnNB2iHDa9I;jXOuy~Ce- zirwxsx@kLfx~C+oSl`8&cZ%}`h)$d6ckYt==AFsgVnXG)BrG z8GnCeARrU~5m2s?heP*d>H^m}T2x+!V@1)Oa>1+`;$X4lge`ZqMF=~JTT@92H#1Y~ SD}haeP4Ieg7Q_A(DgOk?CeQ)^ literal 0 HcmV?d00001 From 4bf4e5ec4b6f7d84817b130b3a9c81f6a1073965 Mon Sep 17 00:00:00 2001 From: Seungbin Oh Date: Mon, 5 Jun 2023 04:54:50 +0900 Subject: [PATCH 02/71] fix firebase files with base64 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f236609..240fc5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: echo "keyPassword=123456" >> android/key.properties echo "keyAlias=ci" >> android/key.properties - name: Create google-services.json - run: echo ${{ secrets.GOOGLE_SERVICES_JSON }} > android/app/google-services.json + run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' | base64 --decode > android/app/google-services.json - name: Install dependencies run: flutter pub get - name: Build APK @@ -48,7 +48,7 @@ jobs: with: flutter-version: ${{ env.FLUTTER_VERSION }} - name: Create GoogleService-Info.plist - run: echo ${{ secrets.GOOGLE_SERVICE_INFO_PLIST }} > ios/Runner/GoogleService-Info.plist + run: echo '${{ secrets.GOOGLE_SERVICE_INFO_PLIST }}' | base64 --decode > ios/Runner/GoogleService-Info.plist - name: Install dependencies run: flutter pub get - name: Build iOS From 9084f6de8771451a91f04b24a396decb0b6ce374 Mon Sep 17 00:00:00 2001 From: Seungbin Oh Date: Mon, 5 Jun 2023 05:03:48 +0900 Subject: [PATCH 03/71] change directory of ci.jks --- .github/workflows/build.yml | 2 +- android/.gitignore | 2 +- android/{app => }/ci.jks | Bin 3 files changed, 2 insertions(+), 2 deletions(-) rename android/{app => }/ci.jks (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 240fc5d..a339697 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} - name: Create key.properties run: | - echo "storeFile=./ci.jks" > android/key.properties + echo "storeFile=../ci.jks" > android/key.properties echo "storePassword=123456" >> android/key.properties echo "keyPassword=123456" >> android/key.properties echo "keyAlias=ci" >> android/key.properties diff --git a/android/.gitignore b/android/.gitignore index 13d1bf5..7d27f31 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -11,4 +11,4 @@ GeneratedPluginRegistrant.java key.properties **/*.keystore **/*.jks -!/app/ci.jks +!/ci.jks diff --git a/android/app/ci.jks b/android/ci.jks similarity index 100% rename from android/app/ci.jks rename to android/ci.jks From 34a3db89c907bf3c9bc7f565e42edd40a256d27e Mon Sep 17 00:00:00 2001 From: Seungbin Oh Date: Mon, 5 Jun 2023 05:19:01 +0900 Subject: [PATCH 04/71] add step creating .env --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a339697..2d4adfd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,10 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Create .env + run: | + echo "FRONT_ADDRESS=https://taxi.sparcs.org" > .env + echo "BACK_ADDRESS=https://taxi.sparcs.org" >> .env - name: Create key.properties run: | echo "storeFile=../ci.jks" > android/key.properties @@ -47,6 +51,10 @@ jobs: uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Create .env + run: | + echo "FRONT_ADDRESS=https://taxi.sparcs.org" > .env + echo "BACK_ADDRESS=https://taxi.sparcs.org" >> .env - name: Create GoogleService-Info.plist run: echo '${{ secrets.GOOGLE_SERVICE_INFO_PLIST }}' | base64 --decode > ios/Runner/GoogleService-Info.plist - name: Install dependencies From 6665317731e987f96621b0fb7cfb3aebed09e699 Mon Sep 17 00:00:00 2001 From: Seungbin Oh Date: Mon, 5 Jun 2023 05:26:29 +0900 Subject: [PATCH 05/71] change property name --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d4adfd..8f5f664 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,10 +31,10 @@ jobs: echo "BACK_ADDRESS=https://taxi.sparcs.org" >> .env - name: Create key.properties run: | - echo "storeFile=../ci.jks" > android/key.properties - echo "storePassword=123456" >> android/key.properties - echo "keyPassword=123456" >> android/key.properties - echo "keyAlias=ci" >> android/key.properties + echo "UPLOAD_STORE_FILE=../ci.jks" > android/key.properties + echo "UPLOAD_STORE_PASSWORD=123456" >> android/key.properties + echo "UPLOAD_KEY_PASSWORD=123456" >> android/key.properties + echo "UPLOAD_KEY_ALIAS=ci" >> android/key.properties - name: Create google-services.json run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' | base64 --decode > android/app/google-services.json - name: Install dependencies From 6072e65b4cdabdff0e74c74c078f06a68e34407f Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 2 Aug 2023 01:14:42 +0900 Subject: [PATCH 06/71] Style: Disallow over scroll --- lib/views/taxiView.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 0af51c2..4504a24 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -283,7 +283,8 @@ class TaxiView extends HookWidget { android: AndroidInAppWebViewOptions( useHybridComposition: true, overScrollMode: - AndroidOverScrollMode.OVER_SCROLL_NEVER)), + AndroidOverScrollMode.OVER_SCROLL_NEVER), + ios: IOSInAppWebViewOptions(disallowOverScroll: true)), // initialUrlRequest: URLRequest(url: Uri.parse(address)), onWebViewCreated: (InAppWebViewController webcontroller) async { _controller.value = webcontroller; From d561e02855b35b46ef9bbe41aee2824d504f035e Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 2 Aug 2023 23:29:23 +0900 Subject: [PATCH 07/71] Add: UserAgent --- lib/views/taxiView.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 0af51c2..5047a74 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -234,6 +234,7 @@ class TaxiView extends HookWidget { useEffect(() { if (isAuthLogin.value && !isLogin.value && isFcmInit.value) { Token().getSession().then((value) async { + print("세션 수정" + value.toString()); if (value == null) { if (Token().accessToken != '') { await Token().deleteAll(); @@ -279,6 +280,8 @@ class TaxiView extends HookWidget { initialOptions: InAppWebViewGroupOptions( crossPlatform: InAppWebViewOptions( useShouldOverrideUrlLoading: true, + applicationNameForUserAgent: "taxi-app-webview/" + + (Platform.isAndroid ? "android" : "ios"), resourceCustomSchemes: ['intent']), android: AndroidInAppWebViewOptions( useHybridComposition: true, @@ -297,7 +300,6 @@ class TaxiView extends HookWidget { } // 로그인 성공 시 / 기존 토큰 삭제 후 새로운 토큰 저장 if (!isAuthLogin.value) { - print("IS AUTH 변경됨"); await Token().setAccessToken( accessToken: arguments[0]['accessToken']); await Token().setRefreshToken( From 8345d03a9d21c2063ab218da77e60fc6636b0fb2 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 2 Aug 2023 23:46:50 +0900 Subject: [PATCH 08/71] Refactor: Remove prints --- lib/views/taxiView.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 5047a74..a2263e7 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -234,7 +234,6 @@ class TaxiView extends HookWidget { useEffect(() { if (isAuthLogin.value && !isLogin.value && isFcmInit.value) { Token().getSession().then((value) async { - print("세션 수정" + value.toString()); if (value == null) { if (Token().accessToken != '') { await Token().deleteAll(); @@ -256,7 +255,6 @@ class TaxiView extends HookWidget { LoadCount.value += 1; } } catch (e) { - print(e); Fluttertoast.showToast( msg: "로그인에 실패했습니다.", backgroundColor: Colors.white, From c7524cc11cc55033fffa966985ab67cc335cb409 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Thu, 3 Aug 2023 00:15:02 +0900 Subject: [PATCH 09/71] Refactor: remove unused cookie --- lib/views/taxiView.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index a2263e7..c034349 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -375,11 +375,6 @@ class TaxiView extends HookWidget { name: "connect.sid", value: sessionToken.value, ); - await _cookieManager.setCookie( - url: Uri.parse(address), - name: "deviceToken", - value: FcmToken().fcmToken, - ); await _controller.value?.reload(); } catch (e) { // TODO : handle error From 1f349419d679517ab110622562e5edf838f2bfed Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Thu, 3 Aug 2023 00:16:49 +0900 Subject: [PATCH 10/71] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 89edac8..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+3 +version: 1.0.3+26 environment: sdk: ">=2.17.5 <3.0.0" From e86e216408e51016eaad501a4c860a2a8a5bce0b Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:05:41 +0900 Subject: [PATCH 11/71] Refactor: Remove unused config --- 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 ++++++---- 5 files changed, 15 insertions(+), 32 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 81b3bf7..0000000 --- a/lib/constants/constants.dart +++ /dev/null @@ -1,11 +0,0 @@ -import "package:dio/dio.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: Duration(seconds: 150), - receiveTimeout: 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, From 64e9011547192c7764d60566c48efe62a937c5cc Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:10:07 +0900 Subject: [PATCH 12/71] Refactor: Remove unused logout url handler --- lib/views/taxiView.dart | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 1b80ef7..3b550a2 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -388,30 +388,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: Colors.black, - backgroundColor: Colors.white); - isAuthLogin.value = false; - } - } - }, onLoadResourceCustomScheme: (controller, url) async { if (Platform.isAndroid) { if (url.scheme == 'intent') { From 632d1b7a019915a9278f0867c41a0b4a9db8bb2e Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:54:46 +0900 Subject: [PATCH 13/71] Fix: Remove error Code Check --- lib/views/taxiView.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 1b80ef7..36a987b 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -441,9 +441,7 @@ class TaxiView extends HookWidget { // 될 때까지 리로드 if (!isLoaded.value && LoadCount.value < 10) { LoadCount.value++; - } - - if (code == -2) { + } else if (isServerError.value == false) { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, From 464d2acd2e3aeb4616d212fcdf4a7f57bacde3fa Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 23 Aug 2023 23:27:07 +0900 Subject: [PATCH 14/71] Refactor: Change Kotlin Version --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 88720e4..9f980fc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.9.10' repositories { google() mavenCentral() From 2856bdc11c12488106a10e487f36524a56dd126d Mon Sep 17 00:00:00 2001 From: ybminm Date: Thu, 24 Aug 2023 00:16:08 +0900 Subject: [PATCH 15/71] =?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 16/71] =?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 17/71] =?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 18/71] 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 19/71] =?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 20/71] 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 21/71] =?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 22/71] 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 23/71] 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 24/71] =?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 25/71] =?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 2ae024ee0d14403a1b5c49727d496bb7ffc6b2b3 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Wed, 6 Sep 2023 00:15:48 +0900 Subject: [PATCH 26/71] Add Header --- ios/Runner.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- lib/utils/fcmToken.dart | 9 +++++++ lib/utils/remoteConfigController.dart | 6 +++-- lib/utils/token.dart | 15 ++++++++++- lib/views/taxiView.dart | 25 ++++++++++++++++++- 6 files changed, 53 insertions(+), 6 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index bfcca70..8533716 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -160,7 +160,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..a6b826d 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ init() async { final token = await FirebaseMessaging.instance.getToken(); + _dio.interceptors + .add(InterceptorsWrapper(onRequest: (options, handler) async { + options.headers["origin"] = options.uri.origin; + return handler.next(options); + }, onResponse: (response, handler) async { + return handler.next(response); + }, onError: (error, handler) async { + return handler.next(error); + })); if (token == null) { this.token = ''; diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index 2754eab..0ce3371 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -62,8 +62,10 @@ class RemoteConfigController { await remoteConfig.fetchAndActivate(); - this.backUrl = remoteConfig.getString("back_url"); - this.frontUrl = remoteConfig.getString("front_url"); + this.backUrl = + "https://api.taxi.dev.sparcs.org/"; // remoteConfig.getString("back_url"); + this.frontUrl = + "https://taxi.dev.sparcs.org"; // remoteConfig.getString("front_url"); this.android_version = remoteConfig.getString("version"); this.ios_version = remoteConfig.getString("ios_version"); diff --git a/lib/utils/token.dart b/lib/utils/token.dart index c58c12b..462d3fb 100644 --- a/lib/utils/token.dart +++ b/lib/utils/token.dart @@ -6,6 +6,7 @@ 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; @@ -30,6 +31,16 @@ class Token { Future init() async { accessToken = (await getAccessTokenFromStorage()) ?? ''; refreshToken = (await getRefreshTokenFromStorage()) ?? ''; + _dio.interceptors.add(CookieManager(_cookieJar)); + _dio.interceptors + .add(InterceptorsWrapper(onRequest: (options, handler) async { + options.headers["Origin"] = options.uri.origin; + return handler.next(options); + }, onResponse: (response, handler) async { + return handler.next(response); + }, onError: (error, handler) async { + return handler.next(error); + })); } Future setAccessToken({required String accessToken}) async { @@ -56,13 +67,15 @@ class Token { } Future getSession() async { - _dio.interceptors.add(CookieManager(_cookieJar)); return _dio.get("/auth/app/token/login", queryParameters: { "accessToken": accessToken, "deviceToken": FcmToken().fcmToken }, options: Options(validateStatus: ((status) { return (status ?? 200) < 500; }))).then((response) async { + print(accessToken); + print(response.statusCode); + print(response.data); if (response.statusCode == 403) { return null; } diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 1b80ef7..f60b6d2 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -235,11 +235,13 @@ class TaxiView extends HookWidget { if (isAuthLogin.value && !isLogin.value && isFcmInit.value) { Token().getSession().then((value) async { if (value == null) { + print(value); + print("왜 이게 문제야....."); if (Token().accessToken != '') { await Token().deleteAll(); } - isLogin.value = false; isAuthLogin.value = false; + isLogin.value = false; isFirstLogin.value = false; LoadCount.value += 1; } else { @@ -287,6 +289,27 @@ class TaxiView extends HookWidget { AndroidOverScrollMode.OVER_SCROLL_NEVER), ios: IOSInAppWebViewOptions(disallowOverScroll: true)), // initialUrlRequest: URLRequest(url: Uri.parse(address)), + shouldOverrideUrlLoading: (controller, navigationAction) async { + var newHeaders = Map.from( + navigationAction.request.headers ?? {}); + print("HERE"); + if (!newHeaders.containsKey("Referer") && + navigationAction.request.url.toString() != + 'about:blank') { + print(newHeaders.toString()); + print(navigationAction.request.url.toString()); + newHeaders['Referer'] = + navigationAction.request.url.toString(); + print(newHeaders.toString()); + var newRequest = navigationAction.request; + newRequest.headers = newHeaders; + await controller.loadUrl(urlRequest: newRequest); + + return NavigationActionPolicy.CANCEL; + } + + return NavigationActionPolicy.ALLOW; + }, onWebViewCreated: (InAppWebViewController webcontroller) async { _controller.value = webcontroller; _controller.value?.addJavaScriptHandler( From 977805a16375e441738b7d28f984b8b9a06045fb Mon Sep 17 00:00:00 2001 From: ybminm Date: Wed, 6 Sep 2023 02:08:08 +0900 Subject: [PATCH 27/71] 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 28/71] =?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 29/71] =?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 30/71] =?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 31/71] =?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 32/71] =?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 33/71] 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 34/71] 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 49b429ac4ddf505b6317409aa93a2f9757faf751 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 00:45:43 +0900 Subject: [PATCH 35/71] Fix: login origin header --- .../kotlin/com/example/taxi_app/MainActivity.kt | 1 + android/build.gradle | 2 +- lib/utils/fcmToken.dart | 7 ++++--- lib/utils/remoteConfigController.dart | 14 +++++++------- lib/utils/token.dart | 10 ++++------ lib/views/taxiView.dart | 9 +++------ 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/android/app/src/main/kotlin/com/example/taxi_app/MainActivity.kt b/android/app/src/main/kotlin/com/example/taxi_app/MainActivity.kt index bfe5e35..fee0a26 100644 --- a/android/app/src/main/kotlin/com/example/taxi_app/MainActivity.kt +++ b/android/app/src/main/kotlin/com/example/taxi_app/MainActivity.kt @@ -22,6 +22,7 @@ class MainActivity: FlutterActivity() { val intent = Intent.parseUri(call.arguments as String, Intent.URI_INTENT_SCHEME) if (intent.resolveActivity(packageManager) != null) { + packageManager.getLaunchIntentForPackage(""+intent.getPackage()) startActivity(intent) result.success(null) } else { diff --git a/android/build.gradle b/android/build.gradle index 88720e4..9f980fc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.9.10' repositories { google() mavenCentral() diff --git a/lib/utils/fcmToken.dart b/lib/utils/fcmToken.dart index f177215..8d2d4ec 100644 --- a/lib/utils/fcmToken.dart +++ b/lib/utils/fcmToken.dart @@ -1,13 +1,12 @@ import "package:dio/dio.dart"; import 'package:firebase_messaging/firebase_messaging.dart'; -import 'package:taxiapp/constants/constants.dart'; class FcmToken { String token; static FcmToken? _instance; - final Dio _dio = Dio(connectionOptions); + final Dio _dio = Dio(); FcmToken._internal({required this.token}); @@ -23,7 +22,9 @@ class FcmToken { final token = await FirebaseMessaging.instance.getToken(); _dio.interceptors .add(InterceptorsWrapper(onRequest: (options, handler) async { - options.headers["origin"] = options.uri.origin; + options.baseUrl = + "https://taxi.dev.sparcs.org/"; //TODO: remove hardcoding + options.headers["Origin"] = options.uri.origin; return handler.next(options); }, onResponse: (response, handler) async { return handler.next(response); diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index 0ce3371..8b1a8fe 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -29,8 +29,8 @@ class RemoteConfigController { ios_version == null || android_version == null) { return _instance ??= RemoteConfigController._internal( - backUrl: 'https://taxi.sparcs.org/api/', - frontUrl: 'https://taxi.sparcs.org', + backUrl: 'https://api.taxi.dev.sparcs.org/', + frontUrl: 'https://taxi.dev.sparcs.org/', ios_version: '', android_version: ''); } @@ -40,8 +40,8 @@ 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', + backUrl: 'https://api.taxi.dev.sparcs.org/', + frontUrl: 'https://taxi.dev.sparcs.org/', ios_version: '', android_version: ''); } @@ -54,8 +54,8 @@ class RemoteConfigController { minimumFetchInterval: Duration.zero, )); await remoteConfig.setDefaults({ - "back_url": "https://taxi.sparcs.org/api/", - "front_url": "https://taxi.sparcs.org", + "back_url": "https://api.taxi.dev.sparcs.org/", + "front_url": "https://taxi.dev.sparcs.org/", "version": value.version, "ios_version": value.version, }); @@ -65,7 +65,7 @@ class RemoteConfigController { this.backUrl = "https://api.taxi.dev.sparcs.org/"; // remoteConfig.getString("back_url"); this.frontUrl = - "https://taxi.dev.sparcs.org"; // remoteConfig.getString("front_url"); + "https://taxi.dev.sparcs.org/"; // remoteConfig.getString("front_url"); this.android_version = remoteConfig.getString("version"); this.ios_version = remoteConfig.getString("ios_version"); diff --git a/lib/utils/token.dart b/lib/utils/token.dart index 462d3fb..c2e01c1 100644 --- a/lib/utils/token.dart +++ b/lib/utils/token.dart @@ -6,7 +6,6 @@ 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; @@ -14,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}); @@ -34,6 +33,8 @@ class Token { _dio.interceptors.add(CookieManager(_cookieJar)); _dio.interceptors .add(InterceptorsWrapper(onRequest: (options, handler) async { + options.baseUrl = + "https://taxi.dev.sparcs.org/"; //TODO: remove hardcoding options.headers["Origin"] = options.uri.origin; return handler.next(options); }, onResponse: (response, handler) async { @@ -73,9 +74,6 @@ class Token { }, options: Options(validateStatus: ((status) { return (status ?? 200) < 500; }))).then((response) async { - print(accessToken); - print(response.statusCode); - print(response.data); if (response.statusCode == 403) { return null; } @@ -88,7 +86,7 @@ class Token { } if (response.statusCode == 200) { List cookies = await _cookieJar.loadForRequest( - Uri.parse(connectionOptions.baseUrl + "auth/app/token/login")); + Uri.parse(connectionOptions.baseUrl + "/auth/app/token/login")); for (Cookie cookie in cookies) { if (cookie.name == "connect.sid") { return cookie.value; diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index f60b6d2..eb6a4f9 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -235,8 +235,6 @@ class TaxiView extends HookWidget { if (isAuthLogin.value && !isLogin.value && isFcmInit.value) { Token().getSession().then((value) async { if (value == null) { - print(value); - print("왜 이게 문제야....."); if (Token().accessToken != '') { await Token().deleteAll(); } @@ -292,15 +290,13 @@ class TaxiView extends HookWidget { shouldOverrideUrlLoading: (controller, navigationAction) async { var newHeaders = Map.from( navigationAction.request.headers ?? {}); - print("HERE"); if (!newHeaders.containsKey("Referer") && navigationAction.request.url.toString() != 'about:blank') { - print(newHeaders.toString()); - print(navigationAction.request.url.toString()); newHeaders['Referer'] = navigationAction.request.url.toString(); - print(newHeaders.toString()); + newHeaders['Origin'] = + "https://taxi.dev.sparcs.org/"; //TODO: remove hardcoding var newRequest = navigationAction.request; newRequest.headers = newHeaders; await controller.loadUrl(urlRequest: newRequest); @@ -438,6 +434,7 @@ class TaxiView extends HookWidget { onLoadResourceCustomScheme: (controller, url) async { if (Platform.isAndroid) { if (url.scheme == 'intent') { + print("살려줘.. 카톡만 작동해"); try { await controller.stopLoading(); const MethodChannel channel = From c97cc9da20122dfa0cca9498f5462623e238f0ba Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 01:11:17 +0900 Subject: [PATCH 36/71] Add: package for deep link --- android/app/src/main/AndroidManifest.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 12a0001..93f6a9a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,11 @@ + + + + + Date: Sat, 9 Sep 2023 01:12:21 +0900 Subject: [PATCH 37/71] Test: change dev to pub url --- lib/views/taxiView.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 73213ae..c3f31a2 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -296,7 +296,7 @@ class TaxiView extends HookWidget { newHeaders['Referer'] = navigationAction.request.url.toString(); newHeaders['Origin'] = - "https://taxi.dev.sparcs.org/"; //TODO: remove hardcoding + "https://taxi.sparcs.org/"; //TODO: remove hardcoding var newRequest = navigationAction.request; newRequest.headers = newHeaders; await controller.loadUrl(urlRequest: newRequest); From 372aefa99d23dc8f958488d775aae397a84ddb15 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 01:24:02 +0900 Subject: [PATCH 38/71] Add: url launcher --- lib/views/taxiView.dart | 40 ++++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 1 + 2 files changed, 41 insertions(+) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 3440c3d..233dca9 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -21,6 +21,8 @@ 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:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); @@ -287,6 +289,44 @@ class TaxiView extends HookWidget { AndroidOverScrollMode.OVER_SCROLL_NEVER), ios: IOSInAppWebViewOptions(disallowOverScroll: true)), // initialUrlRequest: URLRequest(url: Uri.parse(address)), + shouldOverrideUrlLoading: (controller, navigationAction) async { + var url = navigationAction.request.url.toString(); + var uri = Uri.parse(url); + if (![ + "http", + "https", + "file", + "chrome", + "data", + "javascript", + "about" + ].contains(uri.scheme)) { + if (await canLaunchUrlString(url)) { + await launchUrlString( + url, + ); + return NavigationActionPolicy.CANCEL; + } + } + + var newHeaders = Map.from( + navigationAction.request.headers ?? {}); + if (!newHeaders.containsKey("Referer") && + navigationAction.request.url.toString() != + 'about:blank') { + newHeaders['Referer'] = + navigationAction.request.url.toString(); + newHeaders['Origin'] = + "https://taxi.sparcs.org/"; //TODO: remove hardcoding + var newRequest = navigationAction.request; + newRequest.headers = newHeaders; + await controller.loadUrl(urlRequest: newRequest); + + return NavigationActionPolicy.CANCEL; + } + + return NavigationActionPolicy.ALLOW; + }, onWebViewCreated: (InAppWebViewController webcontroller) async { _controller.value = webcontroller; _controller.value?.addJavaScriptHandler( diff --git a/pubspec.yaml b/pubspec.yaml index ac509e9..1ede1d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,6 +53,7 @@ dependencies: firebase_dynamic_links: ^5.1.1 app_links: ^3.4.3 firebase_crashlytics: ^3.3.1 + url_launcher: ^6.1.14 dev_dependencies: flutter_test: From 49c84ed5f04f6a1b4f8eac519bc56f8cb280f026 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 02:38:02 +0900 Subject: [PATCH 39/71] =?UTF-8?q?Fix:=20=EB=94=A5=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EC=95=B1=20=EB=AF=B8=EC=84=A4=EC=B9=98=EC=8B=9C=20toast=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/views/taxiView.dart | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 233dca9..46e41f6 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -299,29 +299,19 @@ class TaxiView extends HookWidget { "chrome", "data", "javascript", + "intent", "about" ].contains(uri.scheme)) { if (await canLaunchUrlString(url)) { - await launchUrlString( - url, - ); + await launchUrlString(url, + mode: LaunchMode.externalApplication); return NavigationActionPolicy.CANCEL; } - } - - var newHeaders = Map.from( - navigationAction.request.headers ?? {}); - if (!newHeaders.containsKey("Referer") && - navigationAction.request.url.toString() != - 'about:blank') { - newHeaders['Referer'] = - navigationAction.request.url.toString(); - newHeaders['Origin'] = - "https://taxi.sparcs.org/"; //TODO: remove hardcoding - var newRequest = navigationAction.request; - newRequest.headers = newHeaders; - await controller.loadUrl(urlRequest: newRequest); - + Fluttertoast.showToast( + msg: "앱이 설치되어 있지 않아 실행에 실패했습니다", + toastLength: Toast.LENGTH_SHORT, + textColor: Colors.black, + backgroundColor: Colors.white); return NavigationActionPolicy.CANCEL; } From 19efafbd522f9d0d53c7d8264ad89262a1388589 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 02:40:20 +0900 Subject: [PATCH 40/71] Refactor: refactor hardcoding --- lib/utils/fcmToken.dart | 2 +- lib/utils/token.dart | 2 +- lib/views/taxiView.dart | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/utils/fcmToken.dart b/lib/utils/fcmToken.dart index 8abd166..eeb687c 100644 --- a/lib/utils/fcmToken.dart +++ b/lib/utils/fcmToken.dart @@ -23,7 +23,7 @@ class FcmToken { final token = await FirebaseMessaging.instance.getToken(); _dio.interceptors .add(InterceptorsWrapper(onRequest: (options, handler) async { - options.baseUrl = "https://taxi.sparcs.org/"; //TODO: remove hardcoding + options.baseUrl = RemoteConfigController().frontUrl; options.headers["Origin"] = options.uri.origin; return handler.next(options); }, onResponse: (response, handler) async { diff --git a/lib/utils/token.dart b/lib/utils/token.dart index 97f73e1..0a0a896 100644 --- a/lib/utils/token.dart +++ b/lib/utils/token.dart @@ -33,7 +33,7 @@ class Token { _dio.interceptors.add(CookieManager(_cookieJar)); _dio.interceptors .add(InterceptorsWrapper(onRequest: (options, handler) async { - options.baseUrl = "https://taxi.sparcs.org/"; //TODO: remove hardcoding + options.baseUrl = RemoteConfigController().frontUrl; options.headers["Origin"] = options.uri.origin; return handler.next(options); }, onResponse: (response, handler) async { diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index c3f31a2..1f643b3 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -295,8 +295,7 @@ class TaxiView extends HookWidget { 'about:blank') { newHeaders['Referer'] = navigationAction.request.url.toString(); - newHeaders['Origin'] = - "https://taxi.sparcs.org/"; //TODO: remove hardcoding + newHeaders['Origin'] = RemoteConfigController().frontUrl; var newRequest = navigationAction.request; newRequest.headers = newHeaders; await controller.loadUrl(urlRequest: newRequest); From c7c290ec188cf41cc59fa728a6994efcc56963e9 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 03:31:29 +0900 Subject: [PATCH 41/71] 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 a9faa306cb78ef392c5b50035592c2bdd3ee3047 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 03:50:45 +0900 Subject: [PATCH 42/71] Remove: print --- lib/views/taxiView.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 1f643b3..81c0568 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -409,7 +409,6 @@ class TaxiView extends HookWidget { onLoadResourceCustomScheme: (controller, url) async { if (Platform.isAndroid) { if (url.scheme == 'intent') { - print("살려줘.. 카톡만 작동해"); try { await controller.stopLoading(); const MethodChannel channel = From e139ae9d1c3137908c80abc8317b8f3142fb6eac Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 04:50:38 +0900 Subject: [PATCH 43/71] Remove: remove unnecessary init --- lib/utils/fcmToken.dart | 2 +- lib/utils/remoteConfigController.dart | 8 +++----- lib/utils/token.dart | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/utils/fcmToken.dart b/lib/utils/fcmToken.dart index eeb687c..bdcc43b 100644 --- a/lib/utils/fcmToken.dart +++ b/lib/utils/fcmToken.dart @@ -1,3 +1,4 @@ +import 'dart:io'; import "package:dio/dio.dart"; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:taxiapp/utils/remoteConfigController.dart'; @@ -23,7 +24,6 @@ class FcmToken { final token = await FirebaseMessaging.instance.getToken(); _dio.interceptors .add(InterceptorsWrapper(onRequest: (options, handler) async { - options.baseUrl = RemoteConfigController().frontUrl; options.headers["Origin"] = options.uri.origin; return handler.next(options); }, onResponse: (response, handler) async { diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index caf5ccb..308614f 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -46,7 +46,7 @@ class RemoteConfigController { minimumFetchInterval: Duration.zero, )); await remoteConfig.setDefaults({ - "back_url": "https://taxi.sparcs.org/api/", + "back_url": "https://taxi.sparcs.org/", "front_url": "https://taxi.sparcs.org/", "version": value.version, "ios_version": value.version, @@ -54,10 +54,8 @@ class RemoteConfigController { await remoteConfig.fetchAndActivate(); - this.backUrl = - "https://taxi.sparcs.org/api/"; // remoteConfig.getString("back_url"); - this.frontUrl = - "https://taxi.sparcs.org/"; // remoteConfig.getString("front_url"); + this.backUrl = remoteConfig.getString("back_url"); + this.frontUrl = remoteConfig.getString("front_url"); this.android_version = remoteConfig.getString("version"); this.ios_version = remoteConfig.getString("ios_version"); diff --git a/lib/utils/token.dart b/lib/utils/token.dart index 0a0a896..31e5b1a 100644 --- a/lib/utils/token.dart +++ b/lib/utils/token.dart @@ -33,7 +33,6 @@ class Token { _dio.interceptors.add(CookieManager(_cookieJar)); _dio.interceptors .add(InterceptorsWrapper(onRequest: (options, handler) async { - options.baseUrl = RemoteConfigController().frontUrl; options.headers["Origin"] = options.uri.origin; return handler.next(options); }, onResponse: (response, handler) async { From b12186a74dd5387d9047bdedb32812fa8dc29541 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 04:51:01 +0900 Subject: [PATCH 44/71] Remove: remove unused library --- lib/utils/fcmToken.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/utils/fcmToken.dart b/lib/utils/fcmToken.dart index bdcc43b..dbedeb6 100644 --- a/lib/utils/fcmToken.dart +++ b/lib/utils/fcmToken.dart @@ -1,4 +1,3 @@ -import 'dart:io'; import "package:dio/dio.dart"; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:taxiapp/utils/remoteConfigController.dart'; From 186f60a4c11047286c4230e9e37d2c3c9ca19a3d Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 9 Sep 2023 13:57:08 +0900 Subject: [PATCH 45/71] Fix: back url --- lib/utils/remoteConfigController.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index 308614f..7cac513 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -46,7 +46,7 @@ class RemoteConfigController { minimumFetchInterval: Duration.zero, )); await remoteConfig.setDefaults({ - "back_url": "https://taxi.sparcs.org/", + "back_url": "https://taxi.sparcs.org/api/", "front_url": "https://taxi.sparcs.org/", "version": value.version, "ios_version": value.version, From b4f318df5444e2558105e9003b7633e5e1c6e51a Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Sun, 10 Sep 2023 02:47:26 +0900 Subject: [PATCH 46/71] Fix: Login EventHandler + Referer --- lib/utils/remoteConfigController.dart | 6 ++++-- lib/views/taxiView.dart | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index 7cac513..453f33a 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -54,8 +54,10 @@ class RemoteConfigController { await remoteConfig.fetchAndActivate(); - this.backUrl = remoteConfig.getString("back_url"); - this.frontUrl = remoteConfig.getString("front_url"); + // this.backUrl = remoteConfig.getString("back_url"); + // this.frontUrl = remoteConfig.getString("front_url"); + this.backUrl = "http://192.168.0.85:9000/"; + this.frontUrl = "http://192.168.0.85:3000"; this.android_version = remoteConfig.getString("version"); this.ios_version = remoteConfig.getString("ios_version"); diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 81c0568..8af01db 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -238,6 +238,7 @@ class TaxiView extends HookWidget { if (Token().accessToken != '') { await Token().deleteAll(); } + _cookieManager.deleteAllCookies(); isAuthLogin.value = false; isLogin.value = false; isFirstLogin.value = false; @@ -317,13 +318,17 @@ class TaxiView extends HookWidget { } // 로그인 성공 시 / 기존 토큰 삭제 후 새로운 토큰 저장 if (!isAuthLogin.value) { - await Token().setAccessToken( - accessToken: arguments[0]['accessToken']); - await Token().setRefreshToken( - refreshToken: arguments[0]['refreshToken']); - await FcmToken() - .registerToken(arguments[0]['accessToken']); - isAuthLogin.value = true; + if (arguments[0]['accessToken'] != null && + arguments[0]['refreshToken'] != null) { + await Token().deleteAll(); + await Token().setAccessToken( + accessToken: arguments[0]['accessToken']); + await Token().setRefreshToken( + refreshToken: arguments[0]['refreshToken']); + await FcmToken() + .registerToken(arguments[0]['accessToken']); + isAuthLogin.value = true; + } } return; }, @@ -435,7 +440,7 @@ class TaxiView extends HookWidget { // 될 때까지 리로드 if (!isLoaded.value && LoadCount.value < 10) { LoadCount.value++; - } else if (isServerError.value == false) { + } else if (isServerError.value == false && code != 102) { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, From 05a97506d38432c5e594182bebaf6886bd35c021 Mon Sep 17 00:00:00 2001 From: ybminm Date: Sun, 10 Sep 2023 17:12:44 +0900 Subject: [PATCH 47/71] =?UTF-8?q?Refactor:=20onLoadResourceCustomScheme?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EC=A0=84=EB=B0=8F=20=EB=AF=B8=EC=84=A4?= =?UTF-8?q?=EC=B9=98=EC=8B=9C=20=EC=8A=A4=ED=86=A0=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/src/main/AndroidManifest.xml | 1 - lib/views/taxiView.dart | 82 +++++++++++++++--------- 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 93f6a9a..eb5af36 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -11,7 +11,6 @@ - diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 46e41f6..0a17f89 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -21,8 +21,8 @@ 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:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart'; +import 'package:open_store/open_store.dart'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); @@ -282,41 +282,20 @@ class TaxiView extends HookWidget { useShouldOverrideUrlLoading: true, applicationNameForUserAgent: "taxi-app-webview/" + (Platform.isAndroid ? "android" : "ios"), - resourceCustomSchemes: ['intent']), + resourceCustomSchemes: [ + 'intent', + 'supertoss', + 'uber', + 'tmoneyonda', + 'kakaotalk', + 'kakaot' + ]), android: AndroidInAppWebViewOptions( useHybridComposition: true, overScrollMode: AndroidOverScrollMode.OVER_SCROLL_NEVER), ios: IOSInAppWebViewOptions(disallowOverScroll: true)), // initialUrlRequest: URLRequest(url: Uri.parse(address)), - shouldOverrideUrlLoading: (controller, navigationAction) async { - var url = navigationAction.request.url.toString(); - var uri = Uri.parse(url); - if (![ - "http", - "https", - "file", - "chrome", - "data", - "javascript", - "intent", - "about" - ].contains(uri.scheme)) { - if (await canLaunchUrlString(url)) { - await launchUrlString(url, - mode: LaunchMode.externalApplication); - return NavigationActionPolicy.CANCEL; - } - Fluttertoast.showToast( - msg: "앱이 설치되어 있지 않아 실행에 실패했습니다", - toastLength: Toast.LENGTH_SHORT, - textColor: Colors.black, - backgroundColor: Colors.white); - return NavigationActionPolicy.CANCEL; - } - - return NavigationActionPolicy.ALLOW; - }, onWebViewCreated: (InAppWebViewController webcontroller) async { _controller.value = webcontroller; _controller.value?.addJavaScriptHandler( @@ -419,6 +398,49 @@ class TaxiView extends HookWidget { } }, onLoadResourceCustomScheme: (controller, url) async { + if (!['intent'].contains(url.scheme)) { + await controller.stopLoading(); + if (await canLaunchUrlString(url.toString())) { + await launchUrlString(url.toString(), + mode: LaunchMode.externalApplication); + return; + } + switch (url.scheme) { + case 'supertoss': + OpenStore.instance.open( + androidAppBundleId: "viva.republica.toss", + appStoreId: "839333328"); + break; + case 'uber': + OpenStore.instance.open( + androidAppBundleId: "com.ubercab", + appStoreId: "368677368"); + break; + case 'tmoneyonda': + OpenStore.instance.open( + androidAppBundleId: "kr.co.orangetaxi.passenger", + appStoreId: "1489918157"); + break; + case 'kakaotalk': //카카오페이 결제시 + OpenStore.instance.open( + androidAppBundleId: "com.kakao.talk", + appStoreId: "362057947"); + break; + case 'kakaot': + OpenStore.instance.open( + androidAppBundleId: "com.kakao.taxi", + appStoreId: "981110422"); + break; + default: + await Fluttertoast.showToast( + msg: "해당 앱을 실행할 수 없습니다.", + toastLength: Toast.LENGTH_SHORT, + textColor: Colors.black, + backgroundColor: Colors.white); + break; + } + return null; + } if (Platform.isAndroid) { if (url.scheme == 'intent') { try { From 391ab219c3516d0128c03c4b3c8f89fa7bdd227d Mon Sep 17 00:00:00 2001 From: ybminm Date: Sun, 10 Sep 2023 17:17:31 +0900 Subject: [PATCH 48/71] Refactor: snake_case to lowCamelCase --- lib/utils/remoteConfigController.dart | 34 +++++++++++++-------------- lib/views/taxiView.dart | 4 ++-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/lib/utils/remoteConfigController.dart b/lib/utils/remoteConfigController.dart index 453f33a..ade4ee4 100644 --- a/lib/utils/remoteConfigController.dart +++ b/lib/utils/remoteConfigController.dart @@ -4,8 +4,8 @@ import 'package:package_info/package_info.dart'; class RemoteConfigController { String backUrl; String frontUrl; - String ios_version; - String android_version; + String iosVersion; + String androidVersion; static RemoteConfigController? _instance; @@ -14,28 +14,28 @@ class RemoteConfigController { RemoteConfigController._internal( {required this.backUrl, required this.frontUrl, - required this.ios_version, - required this.android_version}); + required this.iosVersion, + required this.androidVersion}); factory RemoteConfigController( {String? backUrl, String? frontUrl, - String? ios_version, - String? android_version}) { + String? iosVersion, + String? androidVersion}) { if (frontUrl == null || backUrl == null || - ios_version == null || - android_version == null) { + iosVersion == null || + androidVersion == null) { return _instance ??= RemoteConfigController._internal( - backUrl: '', frontUrl: '', ios_version: '', android_version: ''); + backUrl: '', frontUrl: '', iosVersion: '', androidVersion: ''); } _instance = RemoteConfigController._internal( backUrl: backUrl, frontUrl: frontUrl, - ios_version: ios_version, - android_version: android_version); + iosVersion: iosVersion, + androidVersion: androidVersion); return _instance ??= RemoteConfigController._internal( - backUrl: '', frontUrl: '', ios_version: '', android_version: ''); + backUrl: '', frontUrl: '', iosVersion: '', androidVersion: ''); } Future init() async { @@ -54,12 +54,10 @@ class RemoteConfigController { await remoteConfig.fetchAndActivate(); - // this.backUrl = remoteConfig.getString("back_url"); - // this.frontUrl = remoteConfig.getString("front_url"); - this.backUrl = "http://192.168.0.85:9000/"; - this.frontUrl = "http://192.168.0.85:3000"; - this.android_version = remoteConfig.getString("version"); - this.ios_version = remoteConfig.getString("ios_version"); + this.backUrl = remoteConfig.getString("back_url"); + this.frontUrl = remoteConfig.getString("front_url"); + this.androidVersion = remoteConfig.getString("version"); + this.iosVersion = remoteConfig.getString("ios_version"); return; } diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 8af01db..bebdc9b 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -207,13 +207,13 @@ class TaxiView extends HookWidget { try { if (Platform.isIOS) { if (int.parse( - RemoteConfigController().ios_version.replaceAll(".", "")) > + RemoteConfigController().iosVersion.replaceAll(".", "")) > int.parse(value.version.replaceAll(".", ""))) { isMustUpdate.value = true; } } else { if (int.parse(RemoteConfigController() - .android_version + .androidVersion .replaceAll(".", "")) > int.parse(value.version.replaceAll(".", ""))) { isMustUpdate.value = true; From 369ffa40f8d4a24d536775b0e3f9316ecd038a5a Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 11 Sep 2023 01:26:26 +0900 Subject: [PATCH 49/71] Add: add material banner --- lib/constants/theme.dart | 128 ++++++++++++++++++++++++++++++++ lib/views/taxiNotification.dart | 90 ++++++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 lib/constants/theme.dart create mode 100644 lib/views/taxiNotification.dart diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart new file mode 100644 index 0000000..d3809b8 --- /dev/null +++ b/lib/constants/theme.dart @@ -0,0 +1,128 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +//primaryColor 지정 (색상코드: #6E3647) +final Map primaryColor1 = { + 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), +}; +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); +final Color dialogBarrierColor = Colors.black.withOpacity(0.6); + +const defaultDialogButtonSize = Size(128, 43); + +const defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 10); + +final defaultDialogButtonBorderRadius = BorderRadius.circular(8.0); + +final defaultTaxiMarginDouble = 20.0; + +final defaultTaxiMargin = + EdgeInsets.symmetric(horizontal: defaultTaxiMarginDouble); + +final defaultNotificationButtonSize = const Size(88, 24); +const defaultNotificationButtonInnerPadding = + EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0); +final defaultNotificationButtonBorderRadius = BorderRadius.circular(30.0); + +ThemeData taxiTheme() { + final base = ThemeData( + primarySwatch: taxiPrimaryMaterialColor, + primaryColor: const Color(0xFF6E3678), + + //dialog 테마 + dialogTheme: DialogTheme( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + backgroundColor: Colors.white, + actionsPadding: const EdgeInsets.all(10.0), + surfaceTintColor: Colors.black, + ), + dialogBackgroundColor: Colors.white, + + //dialog 버튼 + elevatedButtonTheme: ElevatedButtonThemeData( + style: ElevatedButton.styleFrom( + elevation: 0.5, + fixedSize: defaultDialogButtonSize, + padding: defaultDialogButtonInnerPadding, + backgroundColor: const Color.fromARGB(255, 238, 238, 238), + shape: RoundedRectangleBorder( + borderRadius: defaultDialogButtonBorderRadius, + ), + ), + ), + outlinedButtonTheme: OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + fixedSize: defaultDialogButtonSize, + padding: defaultDialogButtonInnerPadding, + backgroundColor: taxiPrimaryMaterialColor, + shape: RoundedRectangleBorder( + borderRadius: defaultDialogButtonBorderRadius, + side: const BorderSide(color: Colors.black), + ), + ), + ), + bannerTheme: MaterialBannerThemeData( + backgroundColor: Colors.white, + ), + + //텍스트 테마 + textTheme: TextTheme( + //Dialog 제목 + titleSmall: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFF323232), + fontSize: 16, + fontWeight: FontWeight.normal)), + + //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)), + + //Dialog Elevated 버튼 텍스트 + labelMedium: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color.fromARGB(255, 129, 129, 129), + fontSize: 14, + fontWeight: FontWeight.normal)), + labelSmall: GoogleFonts.roboto( + textStyle: const TextStyle( + color: Color(0xFFEEEEEE), + fontSize: 12, + fontWeight: FontWeight.w700, + letterSpacing: 0.4, + )), + ), + + bottomNavigationBarTheme: BottomNavigationBarThemeData( + type: BottomNavigationBarType.fixed, + backgroundColor: Colors.white, + selectedItemColor: Color(0xFF6E3678), + ), + ); + return base; +} diff --git a/lib/views/taxiNotification.dart b/lib/views/taxiNotification.dart new file mode 100644 index 0000000..7230bbe --- /dev/null +++ b/lib/views/taxiNotification.dart @@ -0,0 +1,90 @@ +import "package:flutter/material.dart"; + +import 'package:taxi_flutter_app/constants/theme.dart'; + +class TaxiNotification extends StatelessWidget { + TaxiNotification( + {super.key, + required this.title, + required this.subTitle, + required this.content, + required this.button, + required this.imageUrl}); + late final String title; + late final String subTitle; + late final String content; + late final Map button; + late final Uri imageUrl; + + @override + Widget build(BuildContext context) { + return Stack(children: [ + MaterialBanner( + leadingPadding: const EdgeInsets.only(right: 20), + forceActionsBelow: true, + padding: EdgeInsets.only( + left: 20, right: 20, top: MediaQuery.of(context).padding.top + 20), + content: Column( + mainAxisAlignment: MainAxisAlignment.start, + verticalDirection: VerticalDirection.down, + textBaseline: TextBaseline.alphabetic, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: title, + style: Theme.of(context).textTheme.bodySmall, + ), + TextSpan( + text: " / " + subTitle, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith(fontWeight: FontWeight.w400)), + ], + ), + ), + const SizedBox(height: 5), + Text( + content, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Colors.black, + fontSize: 12, + fontWeight: FontWeight.w400), + ), + ], + ), + leading: + Image(image: NetworkImage("https://via.placeholder.com/40x40")), + backgroundColor: Colors.white, + actions: [ + Positioned( + bottom: 20, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + fixedSize: defaultNotificationButtonSize, + padding: defaultNotificationButtonInnerPadding, + backgroundColor: taxiPrimaryMaterialColor, + shape: RoundedRectangleBorder( + borderRadius: defaultNotificationButtonBorderRadius, + side: const BorderSide(color: Colors.black), + ), + ), + child: Text(button.keys.first, + style: Theme.of(context).textTheme.labelSmall), + onPressed: () {}), + ), + ], + ), + Positioned( + top: MediaQuery.of(context).padding.top, + child: Container( + width: 430, + height: 5, + color: taxiPrimaryColor, + )) + ]); + } +} From 3e2bb3de932777ee4e4a3f8dd4ff514b25f8ac0d Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 11 Sep 2023 03:05:24 +0900 Subject: [PATCH 50/71] 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: "되었습니다!") ]), ), From cefdb9a43f4d75385d39cf008cbfe84e0d04fc72 Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 11 Sep 2023 20:43:36 +0900 Subject: [PATCH 51/71] Add:add instagram deepLink intent(1) --- android/app/src/main/AndroidManifest.xml | 1 + lib/views/taxiView.dart | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index eb5af36..2d7b2ee 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ + Date: Mon, 11 Sep 2023 21:06:07 +0900 Subject: [PATCH 52/71] Revert "Add:add instagram deepLink intent(1)" This reverts commit cefdb9a43f4d75385d39cf008cbfe84e0d04fc72. --- android/app/src/main/AndroidManifest.xml | 1 - lib/views/taxiView.dart | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2d7b2ee..eb5af36 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,7 +15,6 @@ - Date: Mon, 11 Sep 2023 22:16:00 +0900 Subject: [PATCH 53/71] Add: notification widget (1) --- lib/constants/theme.dart | 90 +++++++++++++++++++++++---------- lib/views/taxiNotification.dart | 38 +++++++++----- 2 files changed, 88 insertions(+), 40 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index d3809b8..a9a60e4 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -22,10 +22,32 @@ const Color toastBackgroundColor = Colors.white; const Color toastTextColor = Colors.black; const Color notiColor = Color(0x66C8C8C8); final Color dialogBarrierColor = Colors.black.withOpacity(0.6); +double devicePixelRatio = 3.0; +const double taxiDialogPadding = 15.0; +const double taxiNotificationPadding = 20.0; +final defaultDialogUpperTitlePadding = + Padding(padding: EdgeInsets.symmetric(vertical: 36.0 / devicePixelRatio)); -const defaultDialogButtonSize = Size(128, 43); +final defaultDialogMedianTitlePadding = + Padding(padding: EdgeInsets.all(6 / devicePixelRatio)); -const defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 10); +final defaultDialogLowerTitlePadding = + Padding(padding: EdgeInsets.symmetric(vertical: 24 / devicePixelRatio)); + +final defaultDialogVerticalMedianButtonPadding = Padding( + padding: + EdgeInsets.symmetric(horizontal: taxiDialogPadding / devicePixelRatio)); + +final defaultDialogLowerButtonPadding = Padding( + padding: + EdgeInsets.only(bottom: (taxiDialogPadding / 2) / devicePixelRatio)); + +final defaultDialogPadding = + Padding(padding: EdgeInsets.all(taxiDialogPadding / devicePixelRatio)); + +final defaultDialogButtonSize = Size(147.50, 35); + +final defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 9); final defaultDialogButtonBorderRadius = BorderRadius.circular(8.0); @@ -34,7 +56,7 @@ final defaultTaxiMarginDouble = 20.0; final defaultTaxiMargin = EdgeInsets.symmetric(horizontal: defaultTaxiMarginDouble); -final defaultNotificationButtonSize = const Size(88, 24); +const defaultNotificationButtonSize = Size(90, 30); const defaultNotificationButtonInnerPadding = EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0); final defaultNotificationButtonBorderRadius = BorderRadius.circular(30.0); @@ -81,47 +103,59 @@ ThemeData taxiTheme() { ), //텍스트 테마 - 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)), + bodySmall: TextStyle( + fontFamily: 'NanumSquare_acB', + color: Color(0xFF888888), + fontSize: 10, + fontWeight: FontWeight.w700), - //Dialog Elevated 버튼 텍스트 - labelLarge: GoogleFonts.roboto( - textStyle: const TextStyle( - color: Color(0xFFEEEEEE), - fontSize: 14, - fontWeight: FontWeight.bold)), + //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)), - labelSmall: GoogleFonts.roboto( - textStyle: const TextStyle( + labelMedium: TextStyle( + fontFamily: 'NanumSquare', + color: Color.fromARGB(255, 129, 129, 129), + fontSize: 14, + fontWeight: FontWeight.w400), + labelSmall: TextStyle( color: Color(0xFFEEEEEE), + fontFamily: 'NanumSquare_acB', fontSize: 12, fontWeight: FontWeight.w700, letterSpacing: 0.4, - )), + ), ), bottomNavigationBarTheme: BottomNavigationBarThemeData( type: BottomNavigationBarType.fixed, backgroundColor: Colors.white, selectedItemColor: Color(0xFF6E3678), + selectedLabelStyle: TextStyle( + fontFamily: 'NanumSquare', + fontSize: 12, + fontWeight: FontWeight.w700, + letterSpacing: 0.4, + ), + unselectedLabelStyle: TextStyle( + fontFamily: 'NanumSquare', + fontSize: 12, + fontWeight: FontWeight.w700, + letterSpacing: 0.4, + ), ), ); return base; diff --git a/lib/views/taxiNotification.dart b/lib/views/taxiNotification.dart index 7230bbe..c625dc4 100644 --- a/lib/views/taxiNotification.dart +++ b/lib/views/taxiNotification.dart @@ -1,6 +1,6 @@ import "package:flutter/material.dart"; -import 'package:taxi_flutter_app/constants/theme.dart'; +import 'package:taxiapp/constants/theme.dart'; class TaxiNotification extends StatelessWidget { TaxiNotification( @@ -20,10 +20,15 @@ class TaxiNotification extends StatelessWidget { Widget build(BuildContext context) { return Stack(children: [ MaterialBanner( - leadingPadding: const EdgeInsets.only(right: 20), + leadingPadding: EdgeInsets.symmetric( + horizontal: taxiNotificationPadding, + vertical: taxiNotificationPadding / 2), forceActionsBelow: true, padding: EdgeInsets.only( - left: 20, right: 20, top: MediaQuery.of(context).padding.top + 20), + left: taxiNotificationPadding / devicePixelRatio, + right: taxiNotificationPadding / devicePixelRatio, + bottom: taxiNotificationPadding / devicePixelRatio, + top: MediaQuery.of(context).padding.top + 20), content: Column( mainAxisAlignment: MainAxisAlignment.start, verticalDirection: VerticalDirection.down, @@ -35,35 +40,39 @@ class TaxiNotification extends StatelessWidget { children: [ TextSpan( text: title, - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: 12, + ), ), TextSpan( text: " / " + subTitle, style: Theme.of(context) .textTheme .bodySmall! - .copyWith(fontWeight: FontWeight.w400)), + .copyWith(fontSize: 12, fontWeight: FontWeight.w400)), ], ), ), - const SizedBox(height: 5), + const SizedBox(height: 10), Text( content, style: Theme.of(context).textTheme.bodySmall!.copyWith( color: Colors.black, - fontSize: 12, - fontWeight: FontWeight.w400), + fontSize: 14, + fontWeight: FontWeight.w400, + letterSpacing: 0.4), ), ], ), - leading: - Image(image: NetworkImage("https://via.placeholder.com/40x40")), + leading: const Icon(Icons.notifications, size: 40), //40x40 backgroundColor: Colors.white, actions: [ Positioned( bottom: 20, + right: 20, child: OutlinedButton( style: OutlinedButton.styleFrom( + minimumSize: Size.zero, fixedSize: defaultNotificationButtonSize, padding: defaultNotificationButtonInnerPadding, backgroundColor: taxiPrimaryMaterialColor, @@ -72,8 +81,13 @@ class TaxiNotification extends StatelessWidget { side: const BorderSide(color: Colors.black), ), ), - child: Text(button.keys.first, - style: Theme.of(context).textTheme.labelSmall), + child: Text( + button.keys.first, + style: Theme.of(context) + .textTheme + .labelSmall! + .copyWith(fontSize: 14), + ), onPressed: () {}), ), ], From c15e633e29c4322e7971c1098e8e2b9c56954338 Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 11 Sep 2023 23:12:20 +0900 Subject: [PATCH 54/71] =?UTF-8?q?Add:=20=EB=8A=A5=EB=8F=99=EC=A0=81=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/views/taxiNotification.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/views/taxiNotification.dart b/lib/views/taxiNotification.dart index c625dc4..2842352 100644 --- a/lib/views/taxiNotification.dart +++ b/lib/views/taxiNotification.dart @@ -31,8 +31,6 @@ class TaxiNotification extends StatelessWidget { top: MediaQuery.of(context).padding.top + 20), content: Column( mainAxisAlignment: MainAxisAlignment.start, - verticalDirection: VerticalDirection.down, - textBaseline: TextBaseline.alphabetic, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text.rich( @@ -45,7 +43,7 @@ class TaxiNotification extends StatelessWidget { ), ), TextSpan( - text: " / " + subTitle, + text: (subTitle.isNotEmpty) ? " / $subTitle" : "", style: Theme.of(context) .textTheme .bodySmall! @@ -64,7 +62,9 @@ class TaxiNotification extends StatelessWidget { ), ], ), - leading: const Icon(Icons.notifications, size: 40), //40x40 + leading: (imageUrl != Uri.parse("")) + ? const Icon(Icons.notifications, size: 40) + : null, //TODO: 40x40 image backgroundColor: Colors.white, actions: [ Positioned( @@ -88,7 +88,7 @@ class TaxiNotification extends StatelessWidget { .labelSmall! .copyWith(fontSize: 14), ), - onPressed: () {}), + onPressed: () {}), //TODO: 버튼 작용 처리 ), ], ), From 83b7f2eea6f9aa052e3d5d88b280ef218a2eaa65 Mon Sep 17 00:00:00 2001 From: ybminm Date: Mon, 11 Sep 2023 23:37:50 +0900 Subject: [PATCH 55/71] Add: image url support --- lib/views/taxiNotification.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/taxiNotification.dart b/lib/views/taxiNotification.dart index 2842352..ebe71a8 100644 --- a/lib/views/taxiNotification.dart +++ b/lib/views/taxiNotification.dart @@ -63,7 +63,7 @@ class TaxiNotification extends StatelessWidget { ], ), leading: (imageUrl != Uri.parse("")) - ? const Icon(Icons.notifications, size: 40) + ? Image.network(imageUrl.toString(), width: 40, height: 40) : null, //TODO: 40x40 image backgroundColor: Colors.white, actions: [ From 38b2a889f20ebce354929d06c7ea69cff3b84ecd Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:53:16 +0900 Subject: [PATCH 56/71] Refactor: Change Cookie URL --- lib/views/taxiView.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 04be740..8b0b8de 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -396,15 +396,18 @@ class TaxiView extends HookWidget { sessionToken.value != '' && uri?.origin == Uri.parse(address).origin && (await _cookieManager.getCookie( - url: Uri.parse(address), name: "connect.sid")) + url: Uri.parse( + RemoteConfigController().backUrl), + name: "connect.sid")) ?.value != sessionToken.value) { try { await _controller.value?.stopLoading(); await _cookieManager.deleteCookie( - url: Uri.parse(address), name: "connect.sid"); + url: Uri.parse(RemoteConfigController().backUrl), + name: "connect.sid"); await _cookieManager.setCookie( - url: Uri.parse(address), + url: Uri.parse(RemoteConfigController().backUrl), name: "connect.sid", value: sessionToken.value, ); From 10627dddfd705c0d43f73d0f95db011977ac4e4e Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 12 Sep 2023 21:47:36 +0900 Subject: [PATCH 57/71] Fix: taxiDialog button expanded --- lib/constants/theme.dart | 7 +++--- lib/views/taxiDialog.dart | 50 +++++++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 78fece3..9afaba3 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -47,7 +47,8 @@ final defaultDialogPadding = final defaultDialogButtonSize = Size(147.50, 35); -final defaultDialogButtonInnerPadding = EdgeInsets.only(top: 9, bottom: 9); +final defaultDialogButtonInnerPadding = + EdgeInsets.symmetric(vertical: 9, horizontal: 15); final defaultDialogButtonBorderRadius = BorderRadius.circular(8.0); @@ -109,14 +110,14 @@ ThemeData buildTheme() { labelLarge: TextStyle( fontFamily: 'NanumSquare_acB', color: Color(0xFFEEEEEE), - fontSize: 14, + fontSize: 13, fontWeight: FontWeight.w700), //Dialog Elevated 버튼 텍스트 labelMedium: TextStyle( fontFamily: 'NanumSquare', color: Color.fromARGB(255, 129, 129, 129), - fontSize: 14, + fontSize: 13, fontWeight: FontWeight.w400)), ); return base; diff --git a/lib/views/taxiDialog.dart b/lib/views/taxiDialog.dart index f1636ee..2f7aa70 100644 --- a/lib/views/taxiDialog.dart +++ b/lib/views/taxiDialog.dart @@ -44,27 +44,37 @@ class TaxiDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ defaultDialogPadding, - 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(); - } - }), + Expanded( + child: ElevatedButton( + style: Theme.of(context).elevatedButtonTheme.style, + child: Text( + leftButtonContent, + style: Theme.of(context).textTheme.labelMedium, + overflow: TextOverflow.visible, + ), + 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")); - }), + Expanded( + child: OutlinedButton( + style: Theme.of(context).outlinedButtonTheme.style, + child: Text( + rightButtonContent, + style: Theme.of(context).textTheme.labelLarge, + overflow: TextOverflow.visible, + ), + onPressed: () async { + OpenStore.instance.open( + androidAppBundleId: dotenv.get("ANDROID_APPID"), + appStoreId: dotenv.get("IOS_APPID")); + }), + ), defaultDialogPadding, ], ), From 9b6cdcd95e191d088e184598986e407c63fd924f Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Tue, 12 Sep 2023 22:44:03 +0900 Subject: [PATCH 58/71] Refactor: Error Code --- lib/views/taxiView.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 8b0b8de..cd1ae60 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -495,7 +495,9 @@ class TaxiView extends HookWidget { // 될 때까지 리로드 if (!isLoaded.value && LoadCount.value < 10) { LoadCount.value++; - } else if (isServerError.value == false && code != 102) { + } else if (isServerError.value == false && + code != 102 && + code != -999) { Fluttertoast.showToast( msg: "서버와의 연결에 실패했습니다.", toastLength: Toast.LENGTH_SHORT, From b9b8a53ffbe0a554d0b556b82dcf86303def0c26 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Tue, 12 Sep 2023 22:51:38 +0900 Subject: [PATCH 59/71] Update Version --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 1ede1d2..4f9842b 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.4+27 environment: sdk: ">=2.17.5 <3.0.0" From b5951c7cee2cc21b820f56482643005265a542df Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Tue, 12 Sep 2023 23:25:37 +0900 Subject: [PATCH 60/71] Fix: iOS Error Fix --- ios/Runner/Info.plist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f561992..16122a0 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -57,6 +57,11 @@ itms-beta itms + supertoss + uber + tmoneyonda + kakaotalk + kakaot LSRequiresIPhoneOS From ccc7cd17d9ea187d427b4315638ea2972adfdad4 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Tue, 12 Sep 2023 23:27:15 +0900 Subject: [PATCH 61/71] Fix: Substrate urls --- lib/views/taxiView.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index cd1ae60..3d4cd70 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -300,9 +300,15 @@ class TaxiView extends HookWidget { shouldOverrideUrlLoading: (controller, navigationAction) async { var newHeaders = Map.from( navigationAction.request.headers ?? {}); - if (!newHeaders.containsKey("Referer") && + if (Platform.isAndroid && + !newHeaders.containsKey("Referer") && navigationAction.request.url.toString() != - 'about:blank') { + 'about:blank' && + (navigationAction.request.url?.origin == + Uri.parse(address).origin || + navigationAction.request.url?.origin == + Uri.parse(RemoteConfigController().backUrl) + .origin)) { newHeaders['Referer'] = navigationAction.request.url.toString(); newHeaders['Origin'] = RemoteConfigController().frontUrl; From 91f8aa91aa2f8408a07be2237e5be2be4b2444e1 Mon Sep 17 00:00:00 2001 From: ybminm Date: Wed, 13 Sep 2023 04:35:10 +0900 Subject: [PATCH 62/71] Add: notification & event handler --- lib/constants/theme.dart | 1 + lib/views/taxiNotification.dart | 104 ------------------------ lib/views/taxiView.dart | 140 ++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 104 deletions(-) delete mode 100644 lib/views/taxiNotification.dart diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index a9a60e4..840b9dd 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -22,6 +22,7 @@ const Color toastBackgroundColor = Colors.white; const Color toastTextColor = Colors.black; const Color notiColor = Color(0x66C8C8C8); final Color dialogBarrierColor = Colors.black.withOpacity(0.6); + double devicePixelRatio = 3.0; const double taxiDialogPadding = 15.0; const double taxiNotificationPadding = 20.0; diff --git a/lib/views/taxiNotification.dart b/lib/views/taxiNotification.dart deleted file mode 100644 index ebe71a8..0000000 --- a/lib/views/taxiNotification.dart +++ /dev/null @@ -1,104 +0,0 @@ -import "package:flutter/material.dart"; - -import 'package:taxiapp/constants/theme.dart'; - -class TaxiNotification extends StatelessWidget { - TaxiNotification( - {super.key, - required this.title, - required this.subTitle, - required this.content, - required this.button, - required this.imageUrl}); - late final String title; - late final String subTitle; - late final String content; - late final Map button; - late final Uri imageUrl; - - @override - Widget build(BuildContext context) { - return Stack(children: [ - MaterialBanner( - leadingPadding: EdgeInsets.symmetric( - horizontal: taxiNotificationPadding, - vertical: taxiNotificationPadding / 2), - forceActionsBelow: true, - padding: EdgeInsets.only( - left: taxiNotificationPadding / devicePixelRatio, - right: taxiNotificationPadding / devicePixelRatio, - bottom: taxiNotificationPadding / devicePixelRatio, - top: MediaQuery.of(context).padding.top + 20), - content: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: title, - style: Theme.of(context).textTheme.bodySmall!.copyWith( - fontSize: 12, - ), - ), - TextSpan( - text: (subTitle.isNotEmpty) ? " / $subTitle" : "", - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith(fontSize: 12, fontWeight: FontWeight.w400)), - ], - ), - ), - const SizedBox(height: 10), - Text( - content, - style: Theme.of(context).textTheme.bodySmall!.copyWith( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.w400, - letterSpacing: 0.4), - ), - ], - ), - leading: (imageUrl != Uri.parse("")) - ? Image.network(imageUrl.toString(), width: 40, height: 40) - : null, //TODO: 40x40 image - backgroundColor: Colors.white, - actions: [ - Positioned( - bottom: 20, - right: 20, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - minimumSize: Size.zero, - fixedSize: defaultNotificationButtonSize, - padding: defaultNotificationButtonInnerPadding, - backgroundColor: taxiPrimaryMaterialColor, - shape: RoundedRectangleBorder( - borderRadius: defaultNotificationButtonBorderRadius, - side: const BorderSide(color: Colors.black), - ), - ), - child: Text( - button.keys.first, - style: Theme.of(context) - .textTheme - .labelSmall! - .copyWith(fontSize: 14), - ), - onPressed: () {}), //TODO: 버튼 작용 처리 - ), - ], - ), - Positioned( - top: MediaQuery.of(context).padding.top, - child: Container( - width: 430, - height: 5, - color: taxiPrimaryColor, - )) - ]); - } -} diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 3440c3d..2bb3c55 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -21,6 +21,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/theme.dart'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); @@ -32,6 +33,7 @@ class TaxiView extends HookWidget { @override Widget build(BuildContext context) { String address = RemoteConfigController().frontUrl; + OverlayEntry? overlayEntry; // States // 로딩 여부 확인 @@ -268,6 +270,119 @@ class TaxiView extends HookWidget { return; }, [isAuthLogin.value, isFcmInit.value]); + void createOverlayBar() { + assert(overlayEntry == null); + + overlayEntry = OverlayEntry(builder: (BuildContext context) { + return SafeArea( + child: Align( + alignment: Alignment.topCenter, + heightFactor: 1.0, + child: Container( + height: 5.0, + width: double.infinity, + color: taxiPrimaryColor, + ), + )); + }); + Overlay.of(context).insert(overlayEntry!); + } + + void removeOverlayBar() { + overlayEntry?.remove(); + overlayEntry = null; + } + + //TODO: 배너 위에 보라색 바가 필요합니다. + void showMaterialBanner( + {required String title, + required String subTitle, + required String content, + required Map button, + Uri? imageUrl}) { + ScaffoldMessenger.of(context).showMaterialBanner(MaterialBanner( + leadingPadding: const EdgeInsets.symmetric( + horizontal: taxiNotificationPadding, + vertical: taxiNotificationPadding / 2), + forceActionsBelow: true, + padding: EdgeInsets.only( + left: taxiNotificationPadding / devicePixelRatio, + right: taxiNotificationPadding / devicePixelRatio, + bottom: taxiNotificationPadding / devicePixelRatio, + top: MediaQuery.of(context).padding.top + 20), + content: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: title, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: 12, + ), + ), + TextSpan( + text: (subTitle.isNotEmpty) ? " / $subTitle" : "", + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith(fontSize: 12, fontWeight: FontWeight.w400)), + ], + ), + ), + const SizedBox(height: 10), + Text( + content, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.w400, + letterSpacing: 0.4), + ), + ], + ), + leading: (imageUrl != Uri.parse("")) + ? Image( + image: NetworkImage(imageUrl.toString()), + width: 40, + height: 40, + fit: BoxFit.cover, + ) + : null, + backgroundColor: Colors.white, + actions: [ + Positioned( + bottom: 20, + right: 20, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + minimumSize: Size.zero, + fixedSize: defaultNotificationButtonSize, + padding: defaultNotificationButtonInnerPadding, + backgroundColor: taxiPrimaryMaterialColor, + shape: RoundedRectangleBorder( + borderRadius: defaultNotificationButtonBorderRadius, + side: const BorderSide(color: Colors.black), + ), + ), + child: Text( + button.keys.first, + style: Theme.of(context) + .textTheme + .labelSmall! + .copyWith(fontSize: 14), + ), + onPressed: () { + ScaffoldMessenger.of(context).clearMaterialBanners(); + removeOverlayBar(); + }), //TODO: 버튼 작용 처리 + ), + ], + )); + } + return SafeArea( child: Stack(children: [ WillPopScope( @@ -357,6 +472,31 @@ class TaxiView extends HookWidget { await Clipboard.setData(ClipboardData(text: args[0])); } }); + + // Web -> App + _controller.value?.addJavaScriptHandler( + handlerName: "popup_inAppNotification", + callback: (args) async { + showMaterialBanner( + title: args[0]['title'], + subTitle: args[0]['subTitle'], + content: args[0]['content'], + button: { + args[0]['button']['text']: + Uri.parse(args[0]['button']['path']) + }, + imageUrl: (args[0]['type'] == + "default") //TODO: type showMaterialBanner 함수에서 관리 + ? Uri.parse(args[0]['imageUrl']) + : Uri.parse("")); + createOverlayBar(); + }); + // App -> Web + _controller.value?.addJavaScriptHandler( + handlerName: "pushHistory", + callback: (args) async { + return {'path'}; + }); }, onLoadStart: (controller, uri) async { if (isFcmInit.value && From 20e36e0ca0077d7ce4d73c777b6a8a0c22e890c5 Mon Sep 17 00:00:00 2001 From: ybminm Date: Fri, 15 Sep 2023 02:10:41 +0900 Subject: [PATCH 63/71] Refactor: overlayable notification --- lib/views/taxiView.dart | 206 +++++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 99 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 2bb3c55..579e6fe 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -270,117 +270,126 @@ class TaxiView extends HookWidget { return; }, [isAuthLogin.value, isFcmInit.value]); - void createOverlayBar() { - assert(overlayEntry == null); - - overlayEntry = OverlayEntry(builder: (BuildContext context) { - return SafeArea( - child: Align( - alignment: Alignment.topCenter, - heightFactor: 1.0, - child: Container( - height: 5.0, - width: double.infinity, - color: taxiPrimaryColor, - ), - )); - }); - Overlay.of(context).insert(overlayEntry!); - } - void removeOverlayBar() { overlayEntry?.remove(); overlayEntry = null; } - //TODO: 배너 위에 보라색 바가 필요합니다. - void showMaterialBanner( + void createOverlayNotification( {required String title, required String subTitle, required String content, required Map button, Uri? imageUrl}) { - ScaffoldMessenger.of(context).showMaterialBanner(MaterialBanner( - leadingPadding: const EdgeInsets.symmetric( - horizontal: taxiNotificationPadding, - vertical: taxiNotificationPadding / 2), - forceActionsBelow: true, - padding: EdgeInsets.only( - left: taxiNotificationPadding / devicePixelRatio, - right: taxiNotificationPadding / devicePixelRatio, - bottom: taxiNotificationPadding / devicePixelRatio, - top: MediaQuery.of(context).padding.top + 20), - content: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: title, - style: Theme.of(context).textTheme.bodySmall!.copyWith( - fontSize: 12, - ), - ), - TextSpan( - text: (subTitle.isNotEmpty) ? " / $subTitle" : "", - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith(fontSize: 12, fontWeight: FontWeight.w400)), - ], - ), - ), - const SizedBox(height: 10), - Text( - content, - style: Theme.of(context).textTheme.bodySmall!.copyWith( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.w400, - letterSpacing: 0.4), + assert(overlayEntry == null); + + overlayEntry = OverlayEntry(builder: (BuildContext context) { + return Positioned( + top: MediaQuery.of(context).padding.top + 10, + left: MediaQuery.of(context).size.width * 0.05, + height: MediaQuery.of(context).size.height * 0.15, + width: MediaQuery.of(context).size.width * 0.9, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), ), - ], - ), - leading: (imageUrl != Uri.parse("")) - ? Image( - image: NetworkImage(imageUrl.toString()), - width: 40, - height: 40, - fit: BoxFit.cover, - ) - : null, - backgroundColor: Colors.white, - actions: [ - Positioned( - bottom: 20, - right: 20, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - minimumSize: Size.zero, - fixedSize: defaultNotificationButtonSize, - padding: defaultNotificationButtonInnerPadding, - backgroundColor: taxiPrimaryMaterialColor, - shape: RoundedRectangleBorder( - borderRadius: defaultNotificationButtonBorderRadius, - side: const BorderSide(color: Colors.black), + child: Stack( + children: [ + Container( + alignment: Alignment.topCenter, + height: 5.0, + width: double.infinity, + decoration: const BoxDecoration( + color: taxiPrimaryColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15), + topRight: Radius.circular(15), + ), + )), + Positioned( + left: 20, + top: 25, + child: (imageUrl != Uri.parse("")) + ? Image( + image: NetworkImage(imageUrl.toString()), + width: 40, + height: 40, + fit: BoxFit.cover, + ) + : const Padding(padding: EdgeInsets.zero)), + Positioned( + left: 80, + top: 25, + child: Column(children: [ + Text.rich( + TextSpan( + children: [ + TextSpan( + text: title, + style: + Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: 12, + ), + ), + TextSpan( + text: (subTitle.isNotEmpty) ? " / $subTitle" : "", + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: 12, + fontWeight: FontWeight.w400)), + ], + ), + ), + ]), + ), + Positioned( + left: 80, + top: 40, + child: Text( + content, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.w400, + letterSpacing: 0.4), ), ), - child: Text( - button.keys.first, - style: Theme.of(context) - .textTheme - .labelSmall! - .copyWith(fontSize: 14), + Positioned( + bottom: 20 / devicePixelRatio, + right: 20 / devicePixelRatio, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + minimumSize: Size.zero, + fixedSize: defaultNotificationButtonSize, + padding: defaultNotificationButtonInnerPadding, + backgroundColor: taxiPrimaryMaterialColor, + shape: RoundedRectangleBorder( + borderRadius: defaultNotificationButtonBorderRadius, + side: const BorderSide(color: Colors.black), + ), + ), + child: Text( + button.keys.first, + style: Theme.of(context) + .textTheme + .labelSmall! + .copyWith(fontSize: 14), + ), + onPressed: () { + ScaffoldMessenger.of(context).clearMaterialBanners(); + removeOverlayBar(); + }), //TODO: 버튼 작용 처리 ), - onPressed: () { - ScaffoldMessenger.of(context).clearMaterialBanners(); - removeOverlayBar(); - }), //TODO: 버튼 작용 처리 + ], + ), ), - ], - )); + ); + }); + Overlay.of(context).insert(overlayEntry!); } return SafeArea( @@ -477,7 +486,7 @@ class TaxiView extends HookWidget { _controller.value?.addJavaScriptHandler( handlerName: "popup_inAppNotification", callback: (args) async { - showMaterialBanner( + createOverlayNotification( title: args[0]['title'], subTitle: args[0]['subTitle'], content: args[0]['content'], @@ -489,9 +498,8 @@ class TaxiView extends HookWidget { "default") //TODO: type showMaterialBanner 함수에서 관리 ? Uri.parse(args[0]['imageUrl']) : Uri.parse("")); - createOverlayBar(); }); - // App -> Web + // TODO: App -> Web _controller.value?.addJavaScriptHandler( handlerName: "pushHistory", callback: (args) async { From d18eacab2095853c0056c7e7b786170fb4e98e4c Mon Sep 17 00:00:00 2001 From: ybminm Date: Sat, 16 Sep 2023 08:42:32 +0900 Subject: [PATCH 64/71] Refactor: swipe(incomplete) --- lib/constants/theme.dart | 4 +- lib/views/taxiView.dart | 96 +++++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 840b9dd..1f85a70 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -57,9 +57,9 @@ final defaultTaxiMarginDouble = 20.0; final defaultTaxiMargin = EdgeInsets.symmetric(horizontal: defaultTaxiMarginDouble); -const defaultNotificationButtonSize = Size(90, 30); +const defaultNotificationButtonSize = Size(90, 25); const defaultNotificationButtonInnerPadding = - EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0); + EdgeInsets.symmetric(horizontal: 15.0, vertical: 2.0); final defaultNotificationButtonBorderRadius = BorderRadius.circular(30.0); ThemeData taxiTheme() { diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 579e6fe..4320be1 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -2,12 +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'; @@ -22,10 +20,12 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:taxiapp/views/taxiDialog.dart'; import 'package:app_links/app_links.dart'; import 'package:taxiapp/constants/theme.dart'; +import 'dart:math'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); // late InAppWebViewController _controller; + late AnimationController _aniController; FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); @@ -34,6 +34,8 @@ class TaxiView extends HookWidget { Widget build(BuildContext context) { String address = RemoteConfigController().frontUrl; OverlayEntry? overlayEntry; + late Animation _animation; + final double offsetDy = 0.3; // States // 로딩 여부 확인 @@ -270,43 +272,48 @@ class TaxiView extends HookWidget { return; }, [isAuthLogin.value, isFcmInit.value]); - void removeOverlayBar() { + void removeOverlayNotification() { overlayEntry?.remove(); overlayEntry = null; } + void runAnimation({required details}) { + _animation = Tween(begin: const Offset(0, 0), end: Offset(0.0, -offsetDy)) + .animate(CurvedAnimation( + parent: _aniController, curve: Curves.decelerate)); + + _aniController.forward().whenComplete(() { + removeOverlayNotification(); + }); + } + void createOverlayNotification( {required String title, required String subTitle, required String content, required Map button, Uri? imageUrl}) { + if (overlayEntry != null) { + removeOverlayNotification(); + } assert(overlayEntry == null); overlayEntry = OverlayEntry(builder: (BuildContext context) { - return Positioned( - top: MediaQuery.of(context).padding.top + 10, - left: MediaQuery.of(context).size.width * 0.05, - height: MediaQuery.of(context).size.height * 0.15, - width: MediaQuery.of(context).size.width * 0.9, + return Container( + margin: EdgeInsets.only( + top: MediaQuery.of(context).padding.top, + ), + height: min(MediaQuery.of(context).size.height * 0.15, 200), + width: MediaQuery.of(context).size.width, child: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - ), + color: Colors.white, child: Stack( children: [ Container( - alignment: Alignment.topCenter, - height: 5.0, - width: double.infinity, - decoration: const BoxDecoration( - color: taxiPrimaryColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(15), - topRight: Radius.circular(15), - ), - )), + alignment: Alignment.topCenter, + height: 5.0, + color: taxiPrimaryColor, + ), Positioned( left: 20, top: 25, @@ -321,29 +328,26 @@ class TaxiView extends HookWidget { Positioned( left: 80, top: 25, - child: Column(children: [ - Text.rich( - TextSpan( - children: [ - TextSpan( - text: title, - style: - Theme.of(context).textTheme.bodySmall!.copyWith( - fontSize: 12, - ), - ), - TextSpan( - text: (subTitle.isNotEmpty) ? " / $subTitle" : "", - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith( - fontSize: 12, - fontWeight: FontWeight.w400)), - ], - ), + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: title, + style: + Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: 12, + ), + ), + TextSpan( + text: (subTitle.isNotEmpty) ? " / $subTitle" : "", + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: 12, fontWeight: FontWeight.w400)), + ], ), - ]), + ), ), Positioned( left: 80, @@ -360,7 +364,7 @@ class TaxiView extends HookWidget { ), Positioned( bottom: 20 / devicePixelRatio, - right: 20 / devicePixelRatio, + right: 25 / devicePixelRatio, child: OutlinedButton( style: OutlinedButton.styleFrom( minimumSize: Size.zero, @@ -381,7 +385,7 @@ class TaxiView extends HookWidget { ), onPressed: () { ScaffoldMessenger.of(context).clearMaterialBanners(); - removeOverlayBar(); + removeOverlayNotification(); }), //TODO: 버튼 작용 처리 ), ], From cf86d03547774245abc8bf58b4c62eb012070c76 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Mon, 18 Sep 2023 21:03:28 +0900 Subject: [PATCH 65/71] Restore: Restore Cookie URL --- lib/views/taxiView.dart | 13 +++++++++---- pubspec.yaml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 3d4cd70..c9c7298 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -240,7 +240,9 @@ class TaxiView extends HookWidget { if (Token().accessToken != '') { await Token().deleteAll(); } - _cookieManager.deleteAllCookies(); + await _cookieManager.deleteCookie( + url: Uri.parse(RemoteConfigController().backUrl), + name: "connect.sid"); isAuthLogin.value = false; isLogin.value = false; isFirstLogin.value = false; @@ -356,11 +358,14 @@ class TaxiView extends HookWidget { await FcmToken() .removeToken(Token().getAccessToken()); await Token().deleteAll(); + await _cookieManager.deleteAllCookies(); isLogin.value = false; isAuthLogin.value = false; - await _cookieManager.deleteAllCookies(); - await _controller.value!.loadUrl( - urlRequest: URLRequest(url: Uri.parse(address))); + await _controller.value?.loadUrl( + urlRequest: URLRequest( + url: Uri.parse(RemoteConfigController() + .frontUrl + .toString()))); } catch (e) { // TODO Fluttertoast.showToast( diff --git a/pubspec.yaml b/pubspec.yaml index 4f9842b..ac2eb62 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.4+27 +version: 1.0.4+29 environment: sdk: ">=2.17.5 <3.0.0" From b4c94589311cab7f239f7d7d4ea80662c6d5a49e Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:30:54 +0900 Subject: [PATCH 66/71] Add: Add Social_Share library --- pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pubspec.yaml b/pubspec.yaml index 1ede1d2..f2f4a0c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,6 +54,7 @@ dependencies: app_links: ^3.4.3 firebase_crashlytics: ^3.3.1 url_launcher: ^6.1.14 + social_share: ^2.3.1 dev_dependencies: flutter_test: From ef46e11035f6a995e1564abd04e46c16c535df37 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:37:03 +0900 Subject: [PATCH 67/71] Add: Native Settings --- android/app/src/main/AndroidManifest.xml | 12 +++++++++++- android/app/src/main/res/xml/filepaths.xml | 4 ++++ ios/Runner/Info.plist | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 android/app/src/main/res/xml/filepaths.xml diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index eb5af36..d6b38f5 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - @@ -81,5 +81,15 @@ android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" /> + + + diff --git a/android/app/src/main/res/xml/filepaths.xml b/android/app/src/main/res/xml/filepaths.xml new file mode 100644 index 0000000..c0f3b31 --- /dev/null +++ b/android/app/src/main/res/xml/filepaths.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f561992..0576c24 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -53,10 +53,19 @@ ITSAppUsesNonExemptEncryption + FacebookAppID + 278480901639073 LSApplicationQueriesSchemes itms-beta itms + instagram-stories + facebook-stories + facebook + instagram + twitter + whatsapp + tg LSRequiresIPhoneOS From 9cdf75bd3ddb635e409572024450f0cdb5a44683 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 19 Sep 2023 00:42:25 +0900 Subject: [PATCH 68/71] Add: swipe & animation --- lib/constants/theme.dart | 10 ++ lib/views/taxiView.dart | 231 ++++++++++++++++++++++----------------- 2 files changed, 140 insertions(+), 101 deletions(-) diff --git a/lib/constants/theme.dart b/lib/constants/theme.dart index 1f85a70..2870a0e 100644 --- a/lib/constants/theme.dart +++ b/lib/constants/theme.dart @@ -61,6 +61,16 @@ const defaultNotificationButtonSize = Size(90, 25); const defaultNotificationButtonInnerPadding = EdgeInsets.symmetric(horizontal: 15.0, vertical: 2.0); final defaultNotificationButtonBorderRadius = BorderRadius.circular(30.0); +final defaultNotificatonOutlinedButtonStyle = OutlinedButton.styleFrom( + minimumSize: Size.zero, + fixedSize: defaultNotificationButtonSize, + padding: defaultNotificationButtonInnerPadding, + backgroundColor: taxiPrimaryMaterialColor, + shape: RoundedRectangleBorder( + borderRadius: defaultNotificationButtonBorderRadius, + side: const BorderSide(color: Colors.black), + ), +); // TODO: ThemeData에 있는 OutlinedButtonThemeData 분리 ThemeData taxiTheme() { final base = ThemeData( diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 4320be1..462df72 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -25,8 +25,6 @@ import 'dart:math'; class TaxiView extends HookWidget { final CookieManager _cookieManager = CookieManager.instance(); // late InAppWebViewController _controller; - late AnimationController _aniController; - FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); @@ -34,8 +32,9 @@ class TaxiView extends HookWidget { Widget build(BuildContext context) { String address = RemoteConfigController().frontUrl; OverlayEntry? overlayEntry; + late AnimationController _aniController; late Animation _animation; - final double offsetDy = 0.3; + bool isBannerShow = false; // States // 로딩 여부 확인 @@ -272,19 +271,30 @@ class TaxiView extends HookWidget { return; }, [isAuthLogin.value, isFcmInit.value]); - void removeOverlayNotification() { + // 오버레이 알림 애니메이션 초기화 + useEffect(() { + _aniController = useAnimationController( + duration: const Duration(milliseconds: 300), + vsync: useSingleTickerProvider()); + _animation = + Tween(begin: const Offset(0, -0.5), end: const Offset(0.0, 0)) + .animate(CurvedAnimation( + parent: _aniController, curve: Curves.decelerate)); + }, []); + + void removeOverlayNotification({required Uri? uri}) { + if (uri != Uri.parse("")) { + url.value = uri.toString(); + LoadCount.value += 1; + } overlayEntry?.remove(); overlayEntry = null; } - void runAnimation({required details}) { - _animation = Tween(begin: const Offset(0, 0), end: Offset(0.0, -offsetDy)) - .animate(CurvedAnimation( - parent: _aniController, curve: Curves.decelerate)); - - _aniController.forward().whenComplete(() { - removeOverlayNotification(); - }); + void removeAnimation() { + _aniController.reverse(); //TODO: 일정 dy 미만시 배너 삭제 취소 및 애니메이션 다시 재생 + isBannerShow = false; + // removeOverlayNotification(); } void createOverlayNotification( @@ -294,101 +304,126 @@ class TaxiView extends HookWidget { required Map button, Uri? imageUrl}) { if (overlayEntry != null) { - removeOverlayNotification(); + removeOverlayNotification(uri: Uri.parse("")); } assert(overlayEntry == null); + isBannerShow = true; overlayEntry = OverlayEntry(builder: (BuildContext context) { - return Container( - margin: EdgeInsets.only( - top: MediaQuery.of(context).padding.top, - ), - height: min(MediaQuery.of(context).size.height * 0.15, 200), - width: MediaQuery.of(context).size.width, - child: Container( - color: Colors.white, - child: Stack( - children: [ - Container( - alignment: Alignment.topCenter, - height: 5.0, - color: taxiPrimaryColor, - ), - Positioned( - left: 20, - top: 25, - child: (imageUrl != Uri.parse("")) - ? Image( - image: NetworkImage(imageUrl.toString()), - width: 40, - height: 40, - fit: BoxFit.cover, - ) - : const Padding(padding: EdgeInsets.zero)), - Positioned( - left: 80, - top: 25, - child: Text.rich( - TextSpan( - children: [ + _aniController.reset(); + _animation = + Tween(begin: const Offset(0, -0.5), end: const Offset(0, 0)) + .animate(CurvedAnimation( + parent: _aniController, curve: Curves.decelerate)); + _aniController.forward(); + + return SlideTransition( + position: _animation, + child: GestureDetector( + onPanUpdate: (details) { + if (details.delta.dy < -1 && isBannerShow) { + removeAnimation(); + } + }, + onPanEnd: (details) { + if (!isBannerShow) { + removeOverlayNotification(uri: button.values.first); + } + }, + child: UnconstrainedBox( + alignment: Alignment.topCenter, + child: Container( + width: MediaQuery.of(context).size.width, + height: min(MediaQuery.of(context).size.height * 0.15, 200), + margin: + EdgeInsets.only(top: MediaQuery.of(context).padding.top), + color: Colors.white, + child: Stack( + children: [ + Container( + alignment: Alignment.topCenter, + height: 5.0, + color: taxiPrimaryColor, + ), + Positioned( + left: 20, + top: 25, + child: (imageUrl != Uri.parse("")) + ? Image( + image: NetworkImage(imageUrl.toString()), + width: 40, + height: 40, + fit: BoxFit.cover, + ) + : const Padding(padding: EdgeInsets.zero)), + Positioned( + left: 20 + + ((imageUrl != Uri.parse("")) + ? 60 + : 0), // 이미지 없을 시 마진 20으로 변경 + top: 25, + child: Text.rich( TextSpan( - text: title, - style: - Theme.of(context).textTheme.bodySmall!.copyWith( + children: [ + TextSpan( + text: title, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( fontSize: 12, ), - ), - TextSpan( - text: (subTitle.isNotEmpty) ? " / $subTitle" : "", - style: Theme.of(context) - .textTheme - .bodySmall! - .copyWith( - fontSize: 12, fontWeight: FontWeight.w400)), - ], - ), - ), - ), - Positioned( - left: 80, - top: 40, - child: Text( - content, - overflow: TextOverflow.ellipsis, - style: Theme.of(context).textTheme.bodySmall!.copyWith( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.w400, - letterSpacing: 0.4), - ), - ), - Positioned( - bottom: 20 / devicePixelRatio, - right: 25 / devicePixelRatio, - child: OutlinedButton( - style: OutlinedButton.styleFrom( - minimumSize: Size.zero, - fixedSize: defaultNotificationButtonSize, - padding: defaultNotificationButtonInnerPadding, - backgroundColor: taxiPrimaryMaterialColor, - shape: RoundedRectangleBorder( - borderRadius: defaultNotificationButtonBorderRadius, - side: const BorderSide(color: Colors.black), + ), + TextSpan( + text: + (subTitle.isNotEmpty) ? " / $subTitle" : "", + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: 12, + fontWeight: FontWeight.w400)), + ], ), ), + ), + Positioned( + left: 20 + ((imageUrl != Uri.parse("")) ? 60 : 0), + top: 40, child: Text( - button.keys.first, - style: Theme.of(context) - .textTheme - .labelSmall! - .copyWith(fontSize: 14), + content, + overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.w400, + letterSpacing: 0.4), ), - onPressed: () { - ScaffoldMessenger.of(context).clearMaterialBanners(); - removeOverlayNotification(); - }), //TODO: 버튼 작용 처리 + ), + Positioned( + bottom: 20 / devicePixelRatio, + right: 25 / devicePixelRatio, + child: OutlinedButton( + style: defaultNotificatonOutlinedButtonStyle, + child: Text( + button.keys.first, + style: Theme.of(context) + .textTheme + .labelSmall! + .copyWith(fontSize: 14), + ), + onPressed: () { + removeAnimation(); + Future.delayed(const Duration(milliseconds: 300), + () { + removeOverlayNotification( + uri: button.values.first); + }); + }), + ), + ], ), - ], + ), ), ), ); @@ -503,12 +538,6 @@ class TaxiView extends HookWidget { ? Uri.parse(args[0]['imageUrl']) : Uri.parse("")); }); - // TODO: App -> Web - _controller.value?.addJavaScriptHandler( - handlerName: "pushHistory", - callback: (args) async { - return {'path'}; - }); }, onLoadStart: (controller, uri) async { if (isFcmInit.value && From f99dc6cc2b930cfddb9892e7aa76f692989096e0 Mon Sep 17 00:00:00 2001 From: happycastle <41810556+happycastle114@users.noreply.github.com> Date: Tue, 19 Sep 2023 00:48:31 +0900 Subject: [PATCH 69/71] Add: Add Instagram Share --- android/app/src/main/AndroidManifest.xml | 1 + lib/views/taxiView.dart | 46 ++++++++++++++++++++++++ pubspec.yaml | 2 ++ 3 files changed, 49 insertions(+) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d6b38f5..8a76fc3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ + Date: Tue, 19 Sep 2023 01:44:30 +0900 Subject: [PATCH 70/71] Fix: build error --- lib/main.dart | 2 +- lib/views/taxiView.dart | 43 ++++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index c560a8a..40b3bd9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -83,7 +83,7 @@ class MyHome extends HookWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Taxi App', - theme: buildTheme(), + theme: taxiTheme(), home: Container( color: Theme.of(context).primaryColor, child: Container( diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index a7a79d1..8eff38c 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -34,8 +34,11 @@ class TaxiView extends HookWidget { Widget build(BuildContext context) { String address = RemoteConfigController().frontUrl; OverlayEntry? overlayEntry; - late AnimationController _aniController; - late Animation _animation; + AnimationController _aniController = + useAnimationController(duration: const Duration(milliseconds: 300)); + Animation _animation = + Tween(begin: const Offset(0, -0.5), end: const Offset(0.0, 0)).animate( + CurvedAnimation(parent: _aniController, curve: Curves.decelerate)); bool isBannerShow = false; // States @@ -278,17 +281,6 @@ class TaxiView extends HookWidget { return; }, [isAuthLogin.value, isFcmInit.value]); - // 오버레이 알림 애니메이션 초기화 - useEffect(() { - _aniController = useAnimationController( - duration: const Duration(milliseconds: 300), - vsync: useSingleTickerProvider()); - _animation = - Tween(begin: const Offset(0, -0.5), end: const Offset(0.0, 0)) - .animate(CurvedAnimation( - parent: _aniController, curve: Curves.decelerate)); - }, []); - void removeOverlayNotification({required Uri? uri}) { if (uri != Uri.parse("")) { url.value = uri.toString(); @@ -310,6 +302,7 @@ class TaxiView extends HookWidget { required String content, required Map button, Uri? imageUrl}) { + print("asd"); if (overlayEntry != null) { removeOverlayNotification(uri: Uri.parse("")); } @@ -571,16 +564,26 @@ class TaxiView extends HookWidget { handlerName: "popup_inAppNotification", callback: (args) async { createOverlayNotification( - title: args[0]['title'], - subTitle: args[0]['subTitle'], - content: args[0]['content'], + title: "title", + subTitle: "subTitle", + content: "content", + button: {"확인하기": Uri.parse("")}, + imageUrl: Uri.parse(""), + ); + createOverlayNotification( + title: args[0]['title'].toString(), + subTitle: args[0]['subtitle'].toString(), + content: args[0]['content'].toString(), button: { - args[0]['button']['text']: - Uri.parse(args[0]['button']['path']) + args[0]['button']['text'].toString(): + (args[0]['button']['path'].toString() != "") + ? Uri.parse( + args[0]['button']['path'].toString()) + : Uri.parse("") }, - imageUrl: (args[0]['type'] == + imageUrl: (args[0]['type'].toString() == "default") //TODO: type showMaterialBanner 함수에서 관리 - ? Uri.parse(args[0]['imageUrl']) + ? Uri.parse(args[0]['imageUrl'].toString()) : Uri.parse("")); }); }, From b294f0e4c93626564af5ef41db2b5e50deabc670 Mon Sep 17 00:00:00 2001 From: ybminm Date: Tue, 19 Sep 2023 01:57:02 +0900 Subject: [PATCH 71/71] =?UTF-8?q?Fix:=20=EA=B4=84=ED=98=B8=20=EC=A7=9D=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=94=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/views/taxiView.dart | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/views/taxiView.dart b/lib/views/taxiView.dart index 769ba50..03661f9 100644 --- a/lib/views/taxiView.dart +++ b/lib/views/taxiView.dart @@ -567,13 +567,6 @@ class TaxiView extends HookWidget { _controller.value?.addJavaScriptHandler( handlerName: "popup_inAppNotification", callback: (args) async { - createOverlayNotification( - title: "title", - subTitle: "subTitle", - content: "content", - button: {"확인하기": Uri.parse("")}, - imageUrl: Uri.parse(""), - ); createOverlayNotification( title: args[0]['title'].toString(), subTitle: args[0]['subtitle'].toString(), @@ -589,6 +582,8 @@ class TaxiView extends HookWidget { "default") //TODO: type showMaterialBanner 함수에서 관리 ? Uri.parse(args[0]['imageUrl'].toString()) : Uri.parse("")); + }); + _controller.value?.addJavaScriptHandler( handlerName: "popup_instagram_story_share", callback: (args) async {