From 16d6f1bdaf84640a82a8ca12b75995657ad64a3f Mon Sep 17 00:00:00 2001
From: Ryotaro Onoue <73390859+YumNumm@users.noreply.github.com>
Date: Sun, 4 Feb 2024 11:58:54 +0900
Subject: [PATCH] fix: vxse51 crash bug (#548)
* update flutter to 3.19.0-0.4-beta
* fix
---
.fvm/fvm_config.json | 2 +-
ios/Runner.xcodeproj/project.pbxproj | 12 +-
ios/Runner/Info.plist | 2 +-
.../intenisty/jma_lg_intensity_icon.dart | 131 +--
lib/core/extension/lat_lng_bounds_list.dart | 13 +
.../capture/intensity_icon_render.dart | 28 +
.../capture/intensity_icon_render.g.dart | 35 +
.../earthquake_history_config_provider.dart | 15 +-
.../earthquake_history_config_provider.g.dart | 2 +-
.../earthquake_history_config_model.dart | 28 +-
...rthquake_history_config_model.freezed.dart | 103 +-
.../earthquake_history_config_model.g.dart | 27 +-
lib/core/provider/map/map_style.dart | 2 -
.../page/earthquake_history.dart | 6 +
.../use_case/earthquake_history_use_case.dart | 2 +-
.../component/earthquake_map.dart | 918 +++++++++++++-----
.../screen/earthquake_history_details.dart | 20 +-
.../render/intensity_renderer_widget.dart | 60 ++
.../home/features/map/view/main_map_view.dart | 11 +
.../earthquake_history_config_page.dart | 276 +++++-
20 files changed, 1296 insertions(+), 397 deletions(-)
diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json
index dbec753e8..79421ad57 100644
--- a/.fvm/fvm_config.json
+++ b/.fvm/fvm_config.json
@@ -1,4 +1,4 @@
{
- "flutterSdkVersion": "3.19.0-0.2.pre@beta",
+ "flutterSdkVersion": "3.19.0-0.4.pre@beta",
"flavors": {}
}
\ No newline at end of file
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 85f5680dd..49341c07a 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -524,7 +524,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1110;
+ CURRENT_PROJECT_VERSION = 1113;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = CPL7H8SHVM;
ENABLE_BITCODE = NO;
@@ -559,7 +559,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1110;
+ CURRENT_PROJECT_VERSION = 1113;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = CPL7H8SHVM;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -601,7 +601,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1110;
+ CURRENT_PROJECT_VERSION = 1113;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = CPL7H8SHVM;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -642,7 +642,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1110;
+ CURRENT_PROJECT_VERSION = 1113;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = CPL7H8SHVM;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -788,7 +788,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1110;
+ CURRENT_PROJECT_VERSION = 1113;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = CPL7H8SHVM;
ENABLE_BITCODE = NO;
@@ -820,7 +820,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1110;
+ CURRENT_PROJECT_VERSION = 1113;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = CPL7H8SHVM;
ENABLE_BITCODE = NO;
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 51c287cb1..86b388931 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -23,7 +23,7 @@
CFBundleSignature
????
CFBundleVersion
- 1110
+ 1113
LSApplicationCategoryType
FLTEnableImpeller
diff --git a/lib/core/component/intenisty/jma_lg_intensity_icon.dart b/lib/core/component/intenisty/jma_lg_intensity_icon.dart
index fbf3da268..53d9c669a 100644
--- a/lib/core/component/intenisty/jma_lg_intensity_icon.dart
+++ b/lib/core/component/intenisty/jma_lg_intensity_icon.dart
@@ -24,68 +24,85 @@ class JmaLgIntensityIcon extends ConsumerWidget {
final intensityColorModel = ref.watch(intensityColorProvider);
final colorScheme = intensityColorModel.fromJmaLgIntensity(intensity);
final (fg, bg) = (colorScheme.foreground, colorScheme.background);
- // 震度の整数部分
- final intensityMainText =
- intensity.type.replaceAll('-', '').replaceAll('+', '');
- // 震度の弱・強の表記
- final intensitySubText = intensity.type.contains('-')
- ? '弱'
- : intensity.type.contains('+')
- ? '強'
- : '';
- return SizedBox(
- height: 50,
- width: 50,
- child: DecoratedBox(
- decoration: BoxDecoration(
- color: bg,
- // 角丸にする
- borderRadius: BorderRadius.circular(10),
- ),
- child: Center(
- child: FittedBox(
- fit: BoxFit.scaleDown,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.baseline,
- textBaseline: TextBaseline.alphabetic,
- children: [
- if (customText != null)
- Text(
- customText!,
- style: TextStyle(
- color: fg,
- fontSize: 100,
- fontWeight: FontWeight.w900,
- fontFamily: FontFamily.jetBrainsMono,
- ),
- )
- else ...[
- Text(
- intensityMainText,
- style: TextStyle(
- color: fg,
- fontSize: 100,
- fontWeight: FontWeight.w900,
- fontFamily: FontFamily.jetBrainsMono,
- ),
- ),
- Text(
- intensitySubText,
- style: TextStyle(
- color: fg,
- fontSize: 50,
- fontWeight: FontWeight.w900,
- fontFamily: FontFamily.jetBrainsMono,
- fontFamilyFallback: const [FontFamily.notoSansJP],
+ final borderColor = Color.lerp(
+ bg,
+ fg,
+ 0.3,
+ )!;
+ return switch (type) {
+ IntensityIconType.small => SizedBox(
+ height: size,
+ width: size,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: bg,
+ border: Border.all(
+ color: borderColor,
+ width: 5,
+ ),
+ ),
+ child: Center(
+ child: FittedBox(
+ fit: BoxFit.scaleDown,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ intensity.type,
+ style: TextStyle(
+ color: fg,
+ fontSize: 100,
+ fontWeight: FontWeight.w900,
+ fontFamily: FontFamily.jetBrainsMono,
+ ),
),
+ ],
+ ),
+ ),
+ ),
+ ),
+ ),
+ IntensityIconType.smallWithoutText => SizedBox(
+ height: size,
+ width: size,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: bg,
+ border: Border.all(
+ color: borderColor,
+ width: 5,
+ ),
+ ),
+ ),
+ ),
+ IntensityIconType.filled => SizedBox(
+ height: 50,
+ width: 50,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ color: bg,
+ // 角丸にする
+ borderRadius: BorderRadius.circular(10),
+ ),
+ child: Center(
+ child: FittedBox(
+ fit: BoxFit.scaleDown,
+ child: Text(
+ customText!,
+ style: TextStyle(
+ color: fg,
+ fontSize: 100,
+ fontWeight: FontWeight.w900,
+ fontFamily: FontFamily.jetBrainsMono,
),
- ],
- ],
+ ),
+ ),
),
),
),
- ),
- );
+ };
}
}
diff --git a/lib/core/extension/lat_lng_bounds_list.dart b/lib/core/extension/lat_lng_bounds_list.dart
index fb08be543..d26bfb8dd 100644
--- a/lib/core/extension/lat_lng_bounds_list.dart
+++ b/lib/core/extension/lat_lng_bounds_list.dart
@@ -21,3 +21,16 @@ extension LatLngBoundsListEx on List {
);
}
}
+
+extension LatLngBoundsEx on LatLngBounds {
+ LatLngBounds add(LatLng latLng) {
+ final minLat = min(southWest.lat, latLng.lat);
+ final minLng = min(southWest.lng, latLng.lng);
+ final maxLat = max(northEast.lat, latLng.lat);
+ final maxLng = max(northEast.lng, latLng.lng);
+ return LatLngBounds(
+ southWest: LatLng(lat: minLat, lng: minLng),
+ northEast: LatLng(lat: maxLat, lng: maxLng),
+ );
+ }
+}
diff --git a/lib/core/provider/capture/intensity_icon_render.dart b/lib/core/provider/capture/intensity_icon_render.dart
index e6d2c6c79..971818dc0 100644
--- a/lib/core/provider/capture/intensity_icon_render.dart
+++ b/lib/core/provider/capture/intensity_icon_render.dart
@@ -29,6 +29,30 @@ class IntensityIconFillRender extends _$IntensityIconFillRender {
Map build() => {};
}
+@Riverpod(keepAlive: true)
+class LpgmIntensityIconRender extends _$LpgmIntensityIconRender {
+ void onRendered(Uint8List data, JmaLgIntensity intensity) {
+ state = {...state, intensity: data};
+ }
+
+ Uint8List? get(JmaLgIntensity intensity) => state.getOrNull(intensity);
+
+ @override
+ Map build() => {};
+}
+
+@Riverpod(keepAlive: true)
+class LpgmIntensityIconFillRender extends _$LpgmIntensityIconFillRender {
+ void onRendered(Uint8List data, JmaLgIntensity intensity) {
+ state = {...state, intensity: data};
+ }
+
+ Uint8List? get(JmaLgIntensity intensity) => state.getOrNull(intensity);
+
+ @override
+ Map build() => {};
+}
+
@Riverpod(keepAlive: true)
class HypocenterIconRender extends _$HypocenterIconRender {
@override
@@ -50,3 +74,7 @@ class HypocenterLowPreciseIconRender extends _$HypocenterLowPreciseIconRender {
extension IntensityIconRenderEx on Map {
bool isAllRendered() => length == JmaIntensity.values.length;
}
+
+extension LpgmIntensityIconRenderEx on Map {
+ bool isAllRendered() => length == JmaLgIntensity.values.length;
+}
diff --git a/lib/core/provider/capture/intensity_icon_render.g.dart b/lib/core/provider/capture/intensity_icon_render.g.dart
index 0849e99a5..e31515047 100644
--- a/lib/core/provider/capture/intensity_icon_render.g.dart
+++ b/lib/core/provider/capture/intensity_icon_render.g.dart
@@ -42,6 +42,41 @@ final intensityIconFillRenderProvider = NotifierProvider<
);
typedef _$IntensityIconFillRender = Notifier