From cdcf6f368961ce71d921b14e589bfe8071dc79fb Mon Sep 17 00:00:00 2001 From: toass Date: Mon, 22 Apr 2024 15:21:39 +0900 Subject: [PATCH 1/2] fix: native package error --- .firebase/hosting.YnVpbGQvd2Vi.cache | 24 +++++++++---------- android/app/build.gradle | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- firebase.json | 4 ++++ ios/Runner/Info.plist | 2 +- lib/core/network/firestore_base.dart | 10 ++++---- lib/core/network/network_status.dart | 15 ++++++++---- .../chats/presentation/view/chat_screen.dart | 10 ++++++-- lib/feature/home/view/home_screen.dart | 4 +++- lib/feature/setting/view/setting_dialog.dart | 2 +- lib/main.dart | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 2 +- pubspec.lock | 8 +++---- pubspec.yaml | 2 +- web/index.html | 8 +++---- 15 files changed, 59 insertions(+), 38 deletions(-) diff --git a/.firebase/hosting.YnVpbGQvd2Vi.cache b/.firebase/hosting.YnVpbGQvd2Vi.cache index 2fff076..058b187 100644 --- a/.firebase/hosting.YnVpbGQvd2Vi.cache +++ b/.firebase/hosting.YnVpbGQvd2Vi.cache @@ -1,5 +1,6 @@ favicon.ico,1712637073838,71ee8e9861af2e2968cb1b561271e1ba95d599e3eba4754bada7f1aa4a378e10 flutter.js,1711515606000,2b0bce331d7b18fe27d917413033092f950fc776b039c7b5ec17eafca56cd48e +main.dart.js,1713728073584,bef49ec42fd87a226f804756630c9736fb1a35bbac56f3d14733fbb2e88c06ba manifest.json,1706540521921,8df4ad8a1d7ef263a4394c18d2abed3783d3990ee3c8970c1c4f79e7cfa04e9f assets/assets/audio/Chapter%20Book.mp3,1713688023509,94b517421bb7726d03f25e4bc605b6743bf977a16fdc26bd4312733732610a27 assets/assets/audio/send_chat.mp3,1713688023510,9aab6179bad0aa33345000b12c8036c4fd0e7a12de80d0c7407390221bf5adbe @@ -108,15 +109,14 @@ canvaskit/chromium/canvaskit.js.symbols,1711515782000,e4a3bea6115f7c4a05cfccadac canvaskit/chromium/canvaskit.wasm,1711515784000,814e41fcb7cf6972c7a9157da99e1ba10897834c562111f1bc9abc10be1c40bd splash/img/ic-launch.png,1712637073817,20f7fa4f61a69a18c92677b80cdd13570028394a258e351e5cdeccd1131e9c30 splash/img/ic-launch_x4.png,1712637073840,41d695aed2232e7c7e32ff37922e45d55e7703918aca6bbd327546ffaf4cdb4f -index.html,1713724538610,cd50ce3a25115a10eafc95ea7077eabbdb69fd2a6c7493c37e72830c5f66d0fe -version.json,1713724537576,33c5602025f03c5f3c0d005bcb206cc45d5f75bc50f2c540e0634b90d2ced9b6 -flutter_service_worker.js,1713724539131,5c109a59ef5fad0665919bdd12c83387458fb5afffe4f6a519704bee8be6277f -assets/AssetManifest.bin,1713724537699,fd73695cafbe11bd47f61ed3dee3064065bbb08c18996e4c258325363f3b5690 -assets/AssetManifest.bin.json,1713724537699,84de1a9b8a2f5ab4caafeeb81c6da983f0f569663206c53e0123c0fc5363a8f5 -assets/AssetManifest.json,1713724537699,a8662afb40ea74983aa27563afd9f810790088d01c667b5790d841516aa3fced -assets/fonts/MaterialIcons-Regular.otf,1713724538605,078d4a8ad7b2dfc73c171fc3032ab105f74ca9e0c68b6aabe8465399116b8cbc -assets/FontManifest.json,1713724537699,edfa9439b0a36679c90bb7a4eab0d50955a392814827dad10fd2b118cc696e3a -assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1713724538605,24f1f997e171e315f5758bf5e732cca83372490761c9a176979f23c53deeb3ae -assets/shaders/ink_sparkle.frag,1713724537789,80c6e65c75f1de434b1b22dba61e96ad82dba0f2fc5e8b3b59c2def46d794354 -assets/NOTICES,1713724537700,f78e243b8831f39f48d3ac1cc42cad8bd31851b42fd24056d3a87120cdda20b2 -main.dart.js,1713724537103,cec973e35ce7b906f52a62a8976ba73878a002a05037539bc338ebb6e6707db9 +version.json,1713729369520,33c5602025f03c5f3c0d005bcb206cc45d5f75bc50f2c540e0634b90d2ced9b6 +index.html,1713729370679,70d51ed5c9c77cc484a0a117d9f32f84814d35a0bfba7ec200152fd842dcaba2 +assets/AssetManifest.bin,1713729369625,fd73695cafbe11bd47f61ed3dee3064065bbb08c18996e4c258325363f3b5690 +assets/AssetManifest.bin.json,1713729369626,84de1a9b8a2f5ab4caafeeb81c6da983f0f569663206c53e0123c0fc5363a8f5 +assets/FontManifest.json,1713729369626,edfa9439b0a36679c90bb7a4eab0d50955a392814827dad10fd2b118cc696e3a +assets/AssetManifest.json,1713729369626,a8662afb40ea74983aa27563afd9f810790088d01c667b5790d841516aa3fced +flutter_service_worker.js,1713729371213,d104f8db99a27740771f085a46a59cd28533043a8f9e3a0f3f77f30781b1f508 +assets/fonts/MaterialIcons-Regular.otf,1713729370673,078d4a8ad7b2dfc73c171fc3032ab105f74ca9e0c68b6aabe8465399116b8cbc +assets/shaders/ink_sparkle.frag,1713729369745,80c6e65c75f1de434b1b22dba61e96ad82dba0f2fc5e8b3b59c2def46d794354 +assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1713729370673,24f1f997e171e315f5758bf5e732cca83372490761c9a176979f23c53deeb3ae +assets/NOTICES,1713729369627,f78e243b8831f39f48d3ac1cc42cad8bd31851b42fd24056d3a87120cdda20b2 diff --git a/android/app/build.gradle b/android/app/build.gradle index 17982a4..1f5f8be 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -56,7 +56,7 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 5b0c7f3..991eda7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Sinking Us + Sinking Earth CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/lib/core/network/firestore_base.dart b/lib/core/network/firestore_base.dart index 0659b2f..1f49d1d 100644 --- a/lib/core/network/firestore_base.dart +++ b/lib/core/network/firestore_base.dart @@ -67,16 +67,18 @@ class FirestoreBase { } Future getDownloadApkLink() async { + String? link; await _firestore!.collection("download").doc("android").get().then((value) { - return value['apk']; + link = value['apk']; }); - return null; + return link; } Future getDownloadIosLink() async { + String? link; await _firestore!.collection("download").doc("ios").get().then((value) { - return value['ios']; + link = value['ios']; }); - return null; + return link; } } \ No newline at end of file diff --git a/lib/core/network/network_status.dart b/lib/core/network/network_status.dart index 2f579e7..b1ebe8c 100644 --- a/lib/core/network/network_status.dart +++ b/lib/core/network/network_status.dart @@ -5,15 +5,18 @@ import 'package:sinking_us/config/routes/app_router.dart'; import 'package:sinking_us/config/routes/routes.dart'; import 'package:sinking_us/feature/game/domain/match_domain.dart'; import 'package:sinking_us/helpers/extensions/showdialog_helper.dart'; +import 'dart:async'; // Import for StreamSubscription @immutable class NetWorkStatusManagement { + static final Connectivity _connectivity = Connectivity(); + static late StreamSubscription> _connectivitySubscription; + const NetWorkStatusManagement._(); static void init(WidgetRef ref) { - Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { - if (result != ConnectivityResult.mobile || - result != ConnectivityResult.wifi) { + _connectivitySubscription = _connectivity.onConnectivityChanged.listen((List results) { + if (!results.contains(ConnectivityResult.mobile) && !results.contains(ConnectivityResult.wifi)) { ShowDialogHelper.showAlertWithAction( onPressed: () { ref.read(matchDomainControllerProvider.notifier).leaveMatch(); @@ -24,4 +27,8 @@ class NetWorkStatusManagement { } }); } -} + + static void dispose() { + _connectivitySubscription.cancel(); + } +} \ No newline at end of file diff --git a/lib/feature/game/chats/presentation/view/chat_screen.dart b/lib/feature/game/chats/presentation/view/chat_screen.dart index ee8a379..cd90c5e 100644 --- a/lib/feature/game/chats/presentation/view/chat_screen.dart +++ b/lib/feature/game/chats/presentation/view/chat_screen.dart @@ -22,7 +22,7 @@ class ChatScreen extends ConsumerStatefulWidget { } class _ChatScreenState extends ConsumerState { - bool soundPlayed = false; + @override void initState() { super.initState(); @@ -35,6 +35,7 @@ class _ChatScreenState extends ConsumerState { Widget build(BuildContext context) { final chatViewModel = ref.watch(openChatViewModelControllerProvider); final userInfo = ref.read(userDomainControllerProvider).userInfo; + ChatModel? lastChat; return Container( width: 240.w, @@ -51,7 +52,6 @@ class _ChatScreenState extends ConsumerState { stream: chatViewModel.chatStream, builder: (context, AsyncSnapshot snapshot) { if(snapshot.data != null) { - FlameAudio.play("send_chat.mp3"); return ScrollConfiguration( behavior: ScrollConfiguration.of(context).copyWith( dragDevices: { @@ -65,6 +65,12 @@ class _ChatScreenState extends ConsumerState { itemCount: snapshot.data!.docs.length, itemBuilder: (context, index) { final ChatModel chat = ChatModel.fromJson(Map.from(snapshot.data!.docs[index].data() as Map)); + if(index == 0) { // 마지막 채팅 + if(chat.role != "server" && lastChat?.content != chat.content) { + lastChat = chat; + FlameAudio.play("send_chat.mp3"); + } + } if(chat.role == "server") { return serverChatBubble(chat); } else if(chat.nick == userInfo!.nick) { diff --git a/lib/feature/home/view/home_screen.dart b/lib/feature/home/view/home_screen.dart index 7f89b11..74f37f7 100644 --- a/lib/feature/home/view/home_screen.dart +++ b/lib/feature/home/view/home_screen.dart @@ -57,6 +57,8 @@ class _HomeScreenState extends ConsumerState { @override Widget build(BuildContext context) { + final homeViewModel = ref.watch(homeScreenControllerProvider); + return PopScope( canPop: false, child: Scaffold( @@ -144,7 +146,7 @@ class _HomeScreenState extends ConsumerState { height: 102.h, child: SingleChildScrollView( child: Text( - ref.read(homeScreenControllerProvider).bottomText, + homeViewModel.bottomText, style: AppTypography .blackPixel .copyWith(fontSize: 12.sp), diff --git a/lib/feature/setting/view/setting_dialog.dart b/lib/feature/setting/view/setting_dialog.dart index 8c259f1..11b6811 100644 --- a/lib/feature/setting/view/setting_dialog.dart +++ b/lib/feature/setting/view/setting_dialog.dart @@ -39,7 +39,7 @@ class _SettingDialogContentState extends ConsumerState { width: 140.w, height: 40.h, alignment: Alignment.center, - margin: EdgeInsets.only(top: 16.h), + margin: EdgeInsets.only(top: 8.h), decoration: const BoxDecoration( image: DecorationImage( image: AssetImage(AppImages.roomName), fit: BoxFit.fill)), diff --git a/lib/main.dart b/lib/main.dart index c206932..d258b10 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,7 +47,7 @@ class SinkingUs extends StatelessWidget { child: AspectRatio( aspectRatio: 844 / 390, child: MaterialApp( - title: "Sinking US", + title: "Sinking Earth", debugShowCheckedModeBanner: false, initialRoute: Routes.initialRoute, theme: AppTheme.light(), diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index bdc219f..cef1c33 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -27,7 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) FLTFirebaseFunctionsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFunctionsPlugin")) - ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin")) diff --git a/pubspec.lock b/pubspec.lock index 4901928..398945f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -325,18 +325,18 @@ packages: dependency: "direct main" description: name: connectivity_plus - sha256: "224a77051d52a11fbad53dd57827594d3bd24f945af28bd70bab376d68d437f0" + sha256: ebe15d94de9dd7c31dc2ac54e42780acdf3384b1497c69290c9f3c5b0279fc57 url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "6.0.2" connectivity_plus_platform_interface: dependency: transitive description: name: connectivity_plus_platform_interface - sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + sha256: b6a56efe1e6675be240de39107281d4034b64ac23438026355b4234042a35adb url: "https://pub.dev" source: hosted - version: "1.2.4" + version: "2.0.0" convert: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2284c28..581d67e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,7 +50,7 @@ dependencies: flutter_svg: ^2.0.9 #svg 사용하기 위함 shared_preferences: ^2.2.2 #tinydb flutter_secure_storage: ^9.0.0 #난독화 tinydb - connectivity_plus: ^5.0.2 #인터넷 연결 상태 감지 + connectivity_plus: ^6.0.2 #인터넷 연결 상태 감지 easy_localization: ^3.0.5 #지역 위치 파악 및 언어팩 연결 intl: ^0.18.0 #다국어 및 다국 시간 animated_text_kit: ^4.2.2 #애니메이션 텍스트 diff --git a/web/index.html b/web/index.html index d532589..dbb096a 100644 --- a/web/index.html +++ b/web/index.html @@ -5,26 +5,26 @@ - + - + - + - Sinking US + Sinking Earth