Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
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 = "<group>"; };
5228AD5A2C2EE45D007635F5 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
522D48FF2DFD33EF0030AB0C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
522D49002DFD33F20030AB0C /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/InfoPlist.strings; sourceTree = "<group>"; };
529C27C92C93F7B900AAFAB6 /* zh */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh; path = zh.lproj/InfoPlist.strings; sourceTree = "<group>"; };
529C27CC2C93F7BC00AAFAB6 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/InfoPlist.strings; sourceTree = "<group>"; };
529C27CF2C947EFB00AAFAB6 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -491,8 +489,6 @@
529C27CC2C93F7BC00AAFAB6 /* ko */,
529C27CF2C947EFB00AAFAB6 /* ja */,
529C27DC2C97019E00AAFAB6 /* zh_TW */,
522D48FF2DFD33EF0030AB0C /* en */,
522D49002DFD33F20030AB0C /* vi */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
Expand Down
Empty file.
Empty file.
39 changes: 16 additions & 23 deletions lib/app/map/_lib/managers/radar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/app/map/_lib/managers/report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ class _ReportMapLayerSheetState extends State<ReportMapLayerSheet> {
margin: const EdgeInsets.only(right: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: DepthColor.depth(report.depth),
color: getDepthColor(report.depth),
),
),
Text(
Expand Down
3 changes: 2 additions & 1 deletion lib/app/settings/notify/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -97,7 +98,7 @@ class _SettingsNotifyPageState extends State<SettingsNotifyPage> {
}
})
.catchError((updateError) {
print('Failed to update location: $updateError');
TalkerManager.instance.error('Failed to update location: $updateError');
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/core/notify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ String? _pendingChannelKey;

@pragma('vm:entry-point')
Future<void> onActionReceivedMethod(ReceivedAction receivedAction) async {
print(receivedAction);
TalkerManager.instance.debug('Received action: $receivedAction');
final context = router.routerDelegate.navigatorKey.currentContext;
if (context == null) {
_pendingChannelKey = receivedAction.channelKey;
Expand Down
41 changes: 17 additions & 24 deletions lib/utils/depth_color.dart
Original file line number Diff line number Diff line change
@@ -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;
}
48 changes: 0 additions & 48 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading