diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 92a922e97..0eb7ef800 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -65,8 +65,6 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 4B4531DD011F7A688ACAA691 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 5228AD5A2C2EE45D007635F5 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 522D48FF2DFD33EF0030AB0C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 522D49002DFD33F20030AB0C /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/InfoPlist.strings; sourceTree = ""; }; 529C27C92C93F7B900AAFAB6 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh; path = zh.lproj/InfoPlist.strings; sourceTree = ""; }; 529C27CC2C93F7BC00AAFAB6 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = ""; }; 529C27CF2C947EFB00AAFAB6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -491,8 +489,6 @@ 529C27CC2C93F7BC00AAFAB6 /* ko */, 529C27CF2C947EFB00AAFAB6 /* ja */, 529C27DC2C97019E00AAFAB6 /* zh_TW */, - 522D48FF2DFD33EF0030AB0C /* en */, - 522D49002DFD33F20030AB0C /* vi */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/ios/Runner/en.lproj/InfoPlist.strings b/ios/Runner/en.lproj/InfoPlist.strings deleted file mode 100644 index e69de29bb..000000000 diff --git a/ios/Runner/vi.lproj/InfoPlist.strings b/ios/Runner/vi.lproj/InfoPlist.strings deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/app/map/_lib/managers/radar.dart b/lib/app/map/_lib/managers/radar.dart index 51c25a517..1f5a3e245 100644 --- a/lib/app/map/_lib/managers/radar.dart +++ b/lib/app/map/_lib/managers/radar.dart @@ -793,35 +793,28 @@ class _AutoScrollingTimeListState extends State<_AutoScrollingTimeList> { final key = _chipKeys[widget.currentTime]; if (key?.currentContext == null) return; - try { - final RenderBox? renderBox = key!.currentContext!.findRenderObject() as RenderBox?; - if (renderBox == null) return; + final RenderBox? renderBox = key!.currentContext!.findRenderObject() as RenderBox?; + if (renderBox == null) return; - final RenderBox? scrollViewBox = - _scrollController.position.context.storageContext.findRenderObject() as RenderBox?; - if (scrollViewBox == null) return; + final RenderBox? scrollViewBox = _scrollController.position.context.storageContext.findRenderObject() as RenderBox?; + if (scrollViewBox == null) return; - if (!renderBox.attached) return; + if (!renderBox.attached) return; - final position = renderBox.localToGlobal(Offset.zero); - final localPosition = scrollViewBox.globalToLocal(position); + final position = renderBox.localToGlobal(Offset.zero); + final localPosition = scrollViewBox.globalToLocal(position); - final targetOffset = - _scrollController.offset + localPosition.dx - (scrollViewBox.size.width / 2) + (renderBox.size.width / 2); + final targetOffset = + _scrollController.offset + localPosition.dx - (scrollViewBox.size.width / 2) + (renderBox.size.width / 2); - final clampedOffset = targetOffset.clamp( - _scrollController.position.minScrollExtent, - _scrollController.position.maxScrollExtent, - ); + final clampedOffset = targetOffset.clamp( + _scrollController.position.minScrollExtent, + _scrollController.position.maxScrollExtent, + ); - if ((clampedOffset - _scrollController.offset).abs() > 20) { - _scrollController.animateTo( - clampedOffset, - duration: const Duration(milliseconds: 300), - curve: Curves.easeInOut, - ); - } - } catch (e) {} + if ((clampedOffset - _scrollController.offset).abs() > 20) { + _scrollController.animateTo(clampedOffset, duration: const Duration(milliseconds: 300), curve: Curves.easeInOut); + } } @override diff --git a/lib/app/map/_lib/managers/report.dart b/lib/app/map/_lib/managers/report.dart index e906e46c9..fb71fa5ce 100644 --- a/lib/app/map/_lib/managers/report.dart +++ b/lib/app/map/_lib/managers/report.dart @@ -684,7 +684,7 @@ class _ReportMapLayerSheetState extends State { margin: const EdgeInsets.only(right: 6), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - color: DepthColor.depth(report.depth), + color: getDepthColor(report.depth), ), ), Text( diff --git a/lib/app/settings/notify/page.dart b/lib/app/settings/notify/page.dart index 82378cfdd..a65356b9f 100644 --- a/lib/app/settings/notify/page.dart +++ b/lib/app/settings/notify/page.dart @@ -15,6 +15,7 @@ import 'package:dpip/core/providers.dart'; import 'package:dpip/models/settings/location.dart'; import 'package:dpip/models/settings/notify.dart'; import 'package:dpip/utils/extensions/build_context.dart'; +import 'package:dpip/utils/log.dart'; import 'package:dpip/widgets/list/list_section.dart'; import 'package:dpip/widgets/list/list_tile.dart'; import 'package:flutter/material.dart'; @@ -97,7 +98,7 @@ class _SettingsNotifyPageState extends State { } }) .catchError((updateError) { - print('Failed to update location: $updateError'); + TalkerManager.instance.error('Failed to update location: $updateError'); }); }); } diff --git a/lib/core/notify.dart b/lib/core/notify.dart index d7bfc22d0..fb5b715c8 100644 --- a/lib/core/notify.dart +++ b/lib/core/notify.dart @@ -12,7 +12,7 @@ String? _pendingChannelKey; @pragma('vm:entry-point') Future onActionReceivedMethod(ReceivedAction receivedAction) async { - print(receivedAction); + TalkerManager.instance.debug('Received action: $receivedAction'); final context = router.routerDelegate.navigatorKey.currentContext; if (context == null) { _pendingChannelKey = receivedAction.channelKey; diff --git a/lib/utils/depth_color.dart b/lib/utils/depth_color.dart index 2349ee7d7..5e538355b 100644 --- a/lib/utils/depth_color.dart +++ b/lib/utils/depth_color.dart @@ -1,33 +1,26 @@ import 'dart:ui'; -class DepthColor { - static const depth0 = Color(0xFF000000); - static const depth1 = Color(0xFFFF0000); - static const depth2 = Color(0xFFFF6400); - static const depth3 = Color(0xFFFFC800); - static const depth4 = Color(0xFF00C800); - static const depth5 = Color(0xFF00C8C8); - static const depth6 = Color(0xFF0000C8); +const kDepthColor0 = Color(0xFF000000); +const kDepthColor1 = Color(0xFFFF0000); +const kDepthColor2 = Color(0xFFFF6400); +const kDepthColor3 = Color(0xFFFFC800); +const kDepthColor4 = Color(0xFF00C800); +const kDepthColor5 = Color(0xFF00C8C8); +const kDepthColor6 = Color(0xFF0000C8); - static Color depth(double depth) { - final depthList = [5, 15, 30, 50, 100, 150]; - final colorList = [depth1, depth2, depth3, depth4, depth5, depth6]; +Color getDepthColor(double depth) { + final depthList = [5, 15, 30, 50, 100, 150]; + final colorList = [kDepthColor1, kDepthColor2, kDepthColor3, kDepthColor4, kDepthColor5, kDepthColor6]; - if (depth <= depthList.first) { - return colorList.first; - } + if (depth <= depthList.first) return colorList.first; - if (depth >= depthList.last) { - return colorList.last; - } + if (depth >= depthList.last) return colorList.last; - for (int i = 0; i < depthList.length - 1; i++) { - if (depth >= depthList[i] && depth < depthList[i + 1]) { - final double localT = (depth - depthList[i]) / (depthList[i + 1] - depthList[i]); - return Color.lerp(colorList[i], colorList[i + 1], localT)!; - } + for (int i = 0; i < depthList.length - 1; i++) { + if (depth >= depthList[i] && depth < depthList[i + 1]) { + final double localT = (depth - depthList[i]) / (depthList[i + 1] - depthList[i]); + return Color.lerp(colorList[i], colorList[i + 1], localT)!; } - - return depth0; } + return kDepthColor0; } diff --git a/pubspec.lock b/pubspec.lock index f7ee0821e..8a44d7553 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -520,14 +520,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.7" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - sha256: d44bf546b13025ec7353091516f6881f1d4c633993cb109c3916c3a0159dadf1 - url: "https://pub.dev" - source: hosted - version: "2.1.0" flutter_test: dependency: "direct dev" description: flutter @@ -971,14 +963,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" - url: "https://pub.dev" - source: hosted - version: "1.1.0" path_provider: dependency: "direct main" description: @@ -1432,14 +1416,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.2" - tutorial_coach_mark: - dependency: "direct main" - description: - name: tutorial_coach_mark - sha256: "9cdb721165d1cfb6e9b1910a1af1b3570fa6caa5059cf1506fcbd00bf7102abf" - url: "https://pub.dev" - source: hosted - version: "1.3.0" typed_data: dependency: transitive description: @@ -1520,30 +1496,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.5.1" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "44cc7104ff32563122a929e4620cf3efd584194eec6d1d913eb5ba593dbcf6de" - url: "https://pub.dev" - source: hosted - version: "1.1.18" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" - url: "https://pub.dev" - source: hosted - version: "1.1.13" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" - url: "https://pub.dev" - source: hosted - version: "1.1.16" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2f1fc03a4..8a2804ef2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,6 @@ dependencies: flutter_localizations: sdk: flutter flutter_markdown: ^0.7.7 - flutter_svg: ^2.1.0 fluttertoast: 8.2.12 freezed_annotation: ^3.0.0 gal: ^2.3.0 @@ -63,7 +62,6 @@ dependencies: styled_text: ^8.1.0 talker_flutter: ^4.7.2 timezone: ^0.10.0 - tutorial_coach_mark: ^1.3.0 url_launcher: ^6.3.1 ip_country_lookup: ^1.0.0 flutter_icmp_ping: ^3.1.3