Skip to content

Commit

Permalink
fix: vxse51 crash bug (#548)
Browse files Browse the repository at this point in the history
* update flutter to 3.19.0-0.4-beta

* fix
  • Loading branch information
YumNumm authored Feb 4, 2024
1 parent 900ffd6 commit 16d6f1b
Show file tree
Hide file tree
Showing 20 changed files with 1,296 additions and 397 deletions.
2 changes: 1 addition & 1 deletion .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.19.0-0.2.pre@beta",
"flutterSdkVersion": "3.19.0-0.4.pre@beta",
"flavors": {}
}
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1110</string>
<string>1113</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>FLTEnableImpeller</key>
Expand Down
131 changes: 74 additions & 57 deletions lib/core/component/intenisty/jma_lg_intensity_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
],
],
),
),
),
),
),
),
);
};
}
}
13 changes: 13 additions & 0 deletions lib/core/extension/lat_lng_bounds_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ extension LatLngBoundsListEx on List<LatLngBounds> {
);
}
}

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),
);
}
}
28 changes: 28 additions & 0 deletions lib/core/provider/capture/intensity_icon_render.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@ class IntensityIconFillRender extends _$IntensityIconFillRender {
Map<JmaIntensity, Uint8List> 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<JmaLgIntensity, Uint8List> 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<JmaLgIntensity, Uint8List> build() => {};
}

@Riverpod(keepAlive: true)
class HypocenterIconRender extends _$HypocenterIconRender {
@override
Expand All @@ -50,3 +74,7 @@ class HypocenterLowPreciseIconRender extends _$HypocenterLowPreciseIconRender {
extension IntensityIconRenderEx on Map<JmaIntensity, Uint8List> {
bool isAllRendered() => length == JmaIntensity.values.length;
}

extension LpgmIntensityIconRenderEx on Map<JmaLgIntensity, Uint8List> {
bool isAllRendered() => length == JmaLgIntensity.values.length;
}
35 changes: 35 additions & 0 deletions lib/core/provider/capture/intensity_icon_render.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,20 @@ class EarthquakeHistoryConfig extends _$EarthquakeHistoryConfig {
}
}

void updateListConfig(EarthquakeHistoryListConfig config) {
Future<void> updateListConfig(EarthquakeHistoryListConfig config) async {
state = state.copyWith(list: config);
_save();
return _save();
}

void updateDetailConfig(EarthquakeHistoryDetailConfig config) {
Future<void> updateDetailConfig(EarthquakeHistoryDetailConfig config) async {
state = state.copyWith(detail: config);
_save();
return _save();
}

Future<void> updateIntensityIcon({required bool value}) async {
state = state.copyWith(
detail: state.detail.copyWith(showIntensityIcon: value),
);
await _save();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,24 @@ class EarthquakeHistoryListConfig with _$EarthquakeHistoryListConfig {
class EarthquakeHistoryDetailConfig with _$EarthquakeHistoryDetailConfig {
const factory EarthquakeHistoryDetailConfig({
/// 震度の表示方法
@Default(IntensityDisplayMode.fillCity)
IntensityDisplayMode intensityDisplayMode,
@Default(IntensityFillMode.fillCity) IntensityFillMode intensityFillMode,

/// 震度観測点のアイコン表示
@Default(true) bool showIntensityIcon,

/// fromJsonでは、常にfalseを返す
@Default(false) bool showingLpgmIntensity,
}) = _EarthquakeHistoryDetailConfig;

factory EarthquakeHistoryDetailConfig.fromJson(Map<String, dynamic> json) =>
_$EarthquakeHistoryDetailConfigFromJson(json);
_$EarthquakeHistoryDetailConfigFromJson(json).copyWith(
showingLpgmIntensity: false,
);
}

/// 地震履歴詳細画面における震度の表示方法
enum IntensityDisplayMode {
/// 震度観測点のアイコンを表示
icon,

/// 市区町村レベルの震度塗りつぶし
enum IntensityFillMode {
fillCity,

/// 都道府県レベルの震度塗りつぶし
fillPrefecture,

/// 震度観測点のアイコンと都道府県レベルの震度塗りつぶし
iconAndFillPrefecture,
;
fillRegion,
none;
}
Loading

0 comments on commit 16d6f1b

Please sign in to comment.