From bbcf9dfa7edcf68a0d7602a30ac6918ae34e05ee Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 16:32:19 +0900 Subject: [PATCH 01/70] refactor: Enhance Kyoshin Monitor scale and map components - Update KyoshinMonitorScale with new orientation, text positioning, and gradient direction options - Modify home map view to use new scale component with dynamic configuration - Remove deprecated kyoshin_monitor_scale_widget.dart - Improve DeclarativeMap component with more flexible map controller handling - Add support for vertical and horizontal scale rendering --- .../utils/map_camera_position_helper.dart | 68 +++++ .../home/component/map/home_map_view.dart | 151 ++++++++--- .../components/kyoshin_monitor_scale.dart | 250 +++++++++++++----- .../kyoshin_monitor_scale_widget.dart | 243 ----------------- .../declarative_map_controller.dart | 30 +++ app/lib/feature/map/ui/declarative_map.dart | 68 ++--- 6 files changed, 444 insertions(+), 366 deletions(-) create mode 100644 app/lib/core/utils/map_camera_position_helper.dart delete mode 100644 app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale_widget.dart create mode 100644 app/lib/feature/map/data/controller/declarative_map_controller.dart diff --git a/app/lib/core/utils/map_camera_position_helper.dart b/app/lib/core/utils/map_camera_position_helper.dart new file mode 100644 index 00000000..e2b74fab --- /dev/null +++ b/app/lib/core/utils/map_camera_position_helper.dart @@ -0,0 +1,68 @@ +import 'dart:math' as math; + +import 'package:maplibre_gl/maplibre_gl.dart'; + +/// 画面サイズに応じて地図のカメラ位置を計算するヘルパークラス +class MapCameraPositionHelper { + const MapCameraPositionHelper._(); + + static const _japanBounds = ( + north: 45.7, + south: 31.0, + east: 146.5, + west: 128.0, + ); + + /// メルカトル図法でのY座標を計算 + static double _latitudeToMercatorY(double latitude) { + final latRad = latitude * math.pi / 180; + return math.log(math.tan(math.pi / 4 + latRad / 2)); + } + + /// 日本全体を表示するためのカメラ位置を計算する + /// + /// [screenWidth] 画面の幅 + /// [screenHeight] 画面の高さ + static LatLng calculateJapanCenterPosition( + double screenWidth, + double screenHeight, + ) { + // メルカトル図法での日本の中心を計算 + final northY = _latitudeToMercatorY(_japanBounds.north); + final southY = _latitudeToMercatorY(_japanBounds.south); + final centerY = (northY + southY) / 2; + + // メルカトル座標から緯度に戻す + final centerLat = + (2 * math.atan(math.exp(centerY)) - math.pi / 2) * 180 / math.pi; + final centerLng = (_japanBounds.east + _japanBounds.west) / 2; + + return LatLng(centerLat, centerLng); + } + + /// 日本全体を表示するためのズームレベルを計算する + /// + /// [screenWidth] 画面の幅 + /// [screenHeight] 画面の高さ + static double calculateJapanZoomLevel( + double screenWidth, + double screenHeight, + ) { + // メルカトル図法での日本の縦幅を計算 + final northY = _latitudeToMercatorY(_japanBounds.north); + final southY = _latitudeToMercatorY(_japanBounds.south); + final mercatorHeight = (northY - southY).abs(); + + // 経度方向の幅(度) + final longitudeWidth = _japanBounds.east - _japanBounds.west; + + // 画面サイズと地理的な範囲から基本ズームレベルを計算 + final latitudeBasedZoom = + math.log(screenHeight / mercatorHeight) / math.ln2; + final longitudeBasedZoom = + math.log(screenWidth / longitudeWidth) / math.ln2; + + // 縦横の小さい方のズームレベルを採用し、マージンを考慮 + return math.min(latitudeBasedZoom, longitudeBasedZoom) - 0.5; + } +} diff --git a/app/lib/feature/home/component/map/home_map_view.dart b/app/lib/feature/home/component/map/home_map_view.dart index 58f6be9e..d311eeb2 100644 --- a/app/lib/feature/home/component/map/home_map_view.dart +++ b/app/lib/feature/home/component/map/home_map_view.dart @@ -1,13 +1,19 @@ +import 'package:eqmonitor/core/utils/map_camera_position_helper.dart'; import 'package:eqmonitor/feature/home/component/map/home_map_layer_modal.dart'; +import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart'; +import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; +import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; import 'package:eqmonitor/feature/map/ui/components/controller/map_layer_controller_card.dart'; import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; import 'package:eqmonitor/gen/fonts.gen.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; class HomeMapView extends HookConsumerWidget { @@ -17,14 +23,44 @@ class HomeMapView extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { // 強震モニタレイヤーの監視 final kyoshinLayer = ref.watch(kyoshinMonitorLayerControllerProvider); + final size = MediaQuery.sizeOf(context); + final mapController = useMemoized(DeclarativeMapController.new); + + final cameraPosition = useMemoized( + () => MapCameraPosition( + target: MapCameraPositionHelper.calculateJapanCenterPosition( + size.width, + size.height, + ), + zoom: MapCameraPositionHelper.calculateJapanZoomLevel( + size.width, + size.height, + ), + ), + [size.width, size.height], + ); + + // スタイルの監視 + final configurationState = ref.watch(mapConfigurationNotifierProvider); + final configuration = configurationState.valueOrNull; + + if (configuration == null) { + return const Center( + child: CircularProgressIndicator.adaptive(), + ); + } + + final styleString = configuration.styleString; + if (styleString == null) { + throw ArgumentError('styleString is null'); + } return Stack( children: [ DeclarativeMap( - initialCameraPosition: const MapCameraPosition( - target: LatLng(35.681236, 139.767125), - zoom: 3, - ), + styleString: styleString, + controller: mapController, + initialCameraPosition: cameraPosition, layers: [ if (kyoshinLayer != null) kyoshinLayer, ], @@ -36,41 +72,38 @@ class HomeMapView extends HookConsumerWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( + const Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - const KyoshinMonitorStatusCard(), - const SizedBox(height: 10), - for (final type in KyoshinMonitorScaleType.values) - Card( - color: Colors.white, - child: Padding( - padding: const EdgeInsets.all(24), - child: Row( - children: [ - KyoshinMonitorScale( - type: type, - width: 180, - height: 20, - tickInterval: 1, - ), - Text( - type.name, - style: const TextStyle( - fontFamily: FontFamily.jetBrainsMono, - color: Colors.black, - ), - ), - ], - ), - ), + KyoshinMonitorStatusCard(), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, ), + child: _KyoshinMonitorScale(), + ), ], ), const Column(), MapLayerControllerCard( onLayerButtonTap: () async => HomeMapLayerModal.show(context), + onLocationButtonTap: () async { + await mapController.moveCameraToPosition( + CameraPosition( + target: MapCameraPositionHelper + .calculateJapanCenterPosition( + size.width, + size.height, + ), + zoom: MapCameraPositionHelper.calculateJapanZoomLevel( + size.width, + size.height, + ), + ), + ); + }, ), ], ), @@ -80,3 +113,61 @@ class HomeMapView extends HookConsumerWidget { ); } } + +class _KyoshinMonitorScale extends ConsumerWidget { + const _KyoshinMonitorScale(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final realtimeDataType = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.realtimeDataType), + ); + final type = switch (realtimeDataType) { + RealtimeDataType.shindo => KyoshinMonitorScaleType.intensity, + RealtimeDataType.pga => KyoshinMonitorScaleType.pga, + RealtimeDataType.pgv || + RealtimeDataType.response0125Hz || + RealtimeDataType.response025Hz || + RealtimeDataType.response05Hz || + RealtimeDataType.response1Hz || + RealtimeDataType.response2Hz || + RealtimeDataType.response4Hz => + KyoshinMonitorScaleType.pgv, + RealtimeDataType.pgd => KyoshinMonitorScaleType.pgd, + _ => throw ArgumentError( + 'Invalid realtimeDataType: $realtimeDataType)', + ), + }; + final theme = Theme.of(context); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 8, + children: [ + Text( + type.unit == '' + ? type.title + : '${type.title.toUpperCase()} [${type.unit}]', + style: theme.textTheme.bodySmall!.copyWith( + fontFamily: FontFamily.jetBrainsMono, + textBaseline: TextBaseline.alphabetic, + fontWeight: FontWeight.bold, + ), + ), + KyoshinMonitorScale( + type: type, + width: 15, + height: 150, + gradientDirection: KyoshinMonitorScaleGradientDirection.reverse, + orientation: KyoshinMonitorScaleOrientation.vertical, + textColor: theme.colorScheme.onSurface, + tickInterval: 3, + textStyle: theme.textTheme.bodySmall!.copyWith( + fontFamily: FontFamily.jetBrainsMono, + textBaseline: TextBaseline.alphabetic, + fontSize: 10, + ), + ), + ], + ); + } +} diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart index 995c452a..b4e6456a 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart @@ -2,18 +2,55 @@ import 'dart:math'; import 'package:flutter/material.dart'; +/// スケールの向き +enum KyoshinMonitorScaleOrientation { + /// 横向き + horizontal, + + /// 縦向き + vertical, +} + +/// 文字の位置 +enum KyoshinMonitorScaleTextPosition { + /// 左 or 上 + start, + + /// 右 or 下 + end, +} + +/// グラデーションの方向 +enum KyoshinMonitorScaleGradientDirection { + /// 正方向(上から下、左から右) + forward, + + /// 逆方向(下から上、右から左) + reverse, +} + /// 強震モニタのカラースケールを表示するWidget /// /// [type] スケールの種類(震度、PGA、PGV、PGD) /// [width] スケールの幅 /// [height] スケールの高さ /// [tickInterval] 目盛りの間隔(震度の場合は1固定) +/// [orientation] スケールの向き +/// [textPosition] 文字の位置 +/// [textColor] テキストの色 +/// [textStyle] テキストのスタイル +/// [gradientDirection] グラデーションの方向 class KyoshinMonitorScale extends StatelessWidget { const KyoshinMonitorScale({ required this.type, required this.width, required this.height, this.tickInterval = 4, + this.orientation = KyoshinMonitorScaleOrientation.horizontal, + this.textPosition = KyoshinMonitorScaleTextPosition.end, + this.textColor = Colors.black, + this.textStyle, + this.gradientDirection = KyoshinMonitorScaleGradientDirection.forward, super.key, }); @@ -21,6 +58,11 @@ class KyoshinMonitorScale extends StatelessWidget { final double width; final double height; final int tickInterval; + final KyoshinMonitorScaleOrientation orientation; + final KyoshinMonitorScaleTextPosition textPosition; + final Color textColor; + final TextStyle? textStyle; + final KyoshinMonitorScaleGradientDirection gradientDirection; /// カラーストップの計算 /// @@ -50,6 +92,14 @@ class KyoshinMonitorScale extends StatelessWidget { type: type, colorStops: colorStops, tickInterval: tickInterval, + orientation: orientation, + textPosition: textPosition, + textColor: textColor, + textStyle: textStyle ?? + const TextStyle( + fontSize: 10, + ), + gradientDirection: gradientDirection, ), ); } @@ -144,16 +194,16 @@ enum KyoshinMonitorScaleType { String get unit => switch (this) { KyoshinMonitorScaleType.intensity => '', KyoshinMonitorScaleType.pga => 'gal', - KyoshinMonitorScaleType.pgv => 'kine', + KyoshinMonitorScaleType.pgv => 'cm/s', KyoshinMonitorScaleType.pgd => 'cm', }; /// タイトルを取得 String get title => switch (this) { KyoshinMonitorScaleType.intensity => '震度', - KyoshinMonitorScaleType.pga => '最大加速度', - KyoshinMonitorScaleType.pgv => '最大速度', - KyoshinMonitorScaleType.pgd => '最大変位', + KyoshinMonitorScaleType.pga => 'PGA', + KyoshinMonitorScaleType.pgv => 'PGV', + KyoshinMonitorScaleType.pgd => 'PGD', }; /// 最小値を取得 @@ -210,19 +260,82 @@ class _KyoshinMonitorScalePainter extends CustomPainter { required this.type, required this.colorStops, required this.tickInterval, + required this.orientation, + required this.textPosition, + required this.textColor, + required this.textStyle, + required this.gradientDirection, }); final KyoshinMonitorScaleType type; final List<({double position, double value, Color color})> colorStops; final int tickInterval; + final KyoshinMonitorScaleOrientation orientation; + final KyoshinMonitorScaleTextPosition textPosition; + final Color textColor; + final TextStyle textStyle; + final KyoshinMonitorScaleGradientDirection gradientDirection; @override void paint(Canvas canvas, Size size) { // グラデーションの描画 final rect = Offset.zero & size; + final colors = colorStops.map((e) => e.color).toList(); + final stops = colorStops.map((e) => e.position).toList(); + + // グラデーションの方向が逆の場合は、色とストップ位置を反転 + if (gradientDirection == KyoshinMonitorScaleGradientDirection.reverse) { + colors.reversed.toList(); + stops.reversed.toList(); + } + final gradient = LinearGradient( - colors: colorStops.map((e) => e.color).toList(), - stops: colorStops.map((e) => e.position).toList(), + colors: colors, + stops: stops, + begin: switch ((orientation, gradientDirection)) { + ( + KyoshinMonitorScaleOrientation.horizontal, + KyoshinMonitorScaleGradientDirection.forward + ) => + Alignment.centerLeft, + ( + KyoshinMonitorScaleOrientation.horizontal, + KyoshinMonitorScaleGradientDirection.reverse + ) => + Alignment.centerRight, + ( + KyoshinMonitorScaleOrientation.vertical, + KyoshinMonitorScaleGradientDirection.forward + ) => + Alignment.topCenter, + ( + KyoshinMonitorScaleOrientation.vertical, + KyoshinMonitorScaleGradientDirection.reverse + ) => + Alignment.bottomCenter, + }, + end: switch ((orientation, gradientDirection)) { + ( + KyoshinMonitorScaleOrientation.horizontal, + KyoshinMonitorScaleGradientDirection.forward + ) => + Alignment.centerRight, + ( + KyoshinMonitorScaleOrientation.horizontal, + KyoshinMonitorScaleGradientDirection.reverse + ) => + Alignment.centerLeft, + ( + KyoshinMonitorScaleOrientation.vertical, + KyoshinMonitorScaleGradientDirection.forward + ) => + Alignment.bottomCenter, + ( + KyoshinMonitorScaleOrientation.vertical, + KyoshinMonitorScaleGradientDirection.reverse + ) => + Alignment.topCenter, + }, ); final paint = Paint() ..shader = gradient.createShader(rect) @@ -238,7 +351,7 @@ class _KyoshinMonitorScalePainter extends CustomPainter { // 目盛り線の描画用のペイント final tickPaint = Paint() - ..color = Colors.black + ..color = textColor ..strokeWidth = 1.0 ..style = PaintingStyle.stroke; @@ -246,47 +359,55 @@ class _KyoshinMonitorScalePainter extends CustomPainter { final interval = type == KyoshinMonitorScaleType.intensity ? 1 : tickInterval; - // 文字の重なりを検出するために、前の文字の範囲を保持 - double? previousTextRight; - var isOverlapping = false; - - // まず全ての目盛りをチェックして重なりがあるか確認 - for (var i = 0; i < colorStops.length; i += interval) { - final stop = colorStops[i]; - final x = stop.position * size.width; - final text = _formatValue(stop.value); - - textPainter - ..text = TextSpan( - text: text, - style: const TextStyle( - color: Colors.black, - fontSize: 10, - ), - ) - ..layout(); - - final textLeft = x - textPainter.width / 2; - final textRight = x + textPainter.width / 2; - - if (previousTextRight != null && textLeft < previousTextRight) { - isOverlapping = true; - break; - } - previousTextRight = textRight; + // 描画する目盛りのインデックスを準備 + var indices = List.generate( + (colorStops.length / interval).ceil(), + (i) => i * interval, + ); + // 縦向きで逆方向の場合は、インデックスを反転 + if (gradientDirection == KyoshinMonitorScaleGradientDirection.reverse) { + indices = indices.reversed.toList(); } - // 目盛りの描画 - for (var i = 0; i < colorStops.length; i += interval) { + for (final i in indices) { + if (i >= colorStops.length) { + continue; + } final stop = colorStops[i]; - final x = stop.position * size.width; + final basePosition = + gradientDirection == KyoshinMonitorScaleGradientDirection.reverse + ? 1 - stop.position + : stop.position; + final position = basePosition * + (orientation == KyoshinMonitorScaleOrientation.horizontal + ? size.width + : size.height); // 目盛り線を描画 - canvas.drawLine( - Offset(x, size.height), - Offset(x, size.height + 4), - tickPaint, - ); + switch (orientation) { + case KyoshinMonitorScaleOrientation.horizontal: + canvas.drawLine( + Offset(position, size.height), + Offset(position, size.height + 4), + tickPaint, + ); + case KyoshinMonitorScaleOrientation.vertical: + canvas.drawLine( + Offset( + textPosition == KyoshinMonitorScaleTextPosition.start + ? 0 + : size.width, + position, + ), + Offset( + textPosition == KyoshinMonitorScaleTextPosition.start + ? -4 + : size.width + 4, + position, + ), + tickPaint, + ); + } // 値のテキストを描画 final text = _formatValue(stop.value); @@ -294,26 +415,28 @@ class _KyoshinMonitorScalePainter extends CustomPainter { textPainter ..text = TextSpan( text: text, - style: const TextStyle( - color: Colors.black, - fontSize: 10, + style: textStyle.copyWith( + color: textColor, ), ) ..layout(); - if (isOverlapping) { - // 文字が重なる場合は右上に向かって斜めに表示 - canvas.save(); - canvas.translate(x - textPainter.width / 2, size.height + 8); - canvas.rotate(-0.8); - textPainter.paint(canvas, Offset.zero); - canvas.restore(); - } else { - // 重ならない場合は通常通り表示 - textPainter.paint( - canvas, - Offset(x - textPainter.width / 2, size.height + 6), - ); + switch (orientation) { + case KyoshinMonitorScaleOrientation.horizontal: + // 重ならない場合は通常通り表示 + textPainter.paint( + canvas, + Offset(position - textPainter.width / 2, size.height + 6), + ); + case KyoshinMonitorScaleOrientation.vertical: + // 重ならない場合は通常通り表示 + final x = textPosition == KyoshinMonitorScaleTextPosition.start + ? -textPainter.width - 6 + : size.width + 6; + textPainter.paint( + canvas, + Offset(x, position - textPainter.height / 2), + ); } } } @@ -342,5 +465,12 @@ class _KyoshinMonitorScalePainter extends CustomPainter { @override bool shouldRepaint(covariant _KyoshinMonitorScalePainter oldDelegate) => - false; + type != oldDelegate.type || + colorStops != oldDelegate.colorStops || + tickInterval != oldDelegate.tickInterval || + orientation != oldDelegate.orientation || + textPosition != oldDelegate.textPosition || + textColor != oldDelegate.textColor || + textStyle != oldDelegate.textStyle || + gradientDirection != oldDelegate.gradientDirection; } diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale_widget.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale_widget.dart deleted file mode 100644 index 4c9995c4..00000000 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale_widget.dart +++ /dev/null @@ -1,243 +0,0 @@ -import 'dart:ui' as ui; - -import 'package:collection/collection.dart'; -import 'package:eqapi_types/eqapi_types.dart'; -import 'package:eqmonitor/core/extension/double_to_jma_forecast_intensity.dart'; -import 'package:eqmonitor/core/extension/kyoshin_color_map_model.dart'; -import 'package:eqmonitor/core/theme/build_theme.dart'; -import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.dart'; -import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart'; -import 'package:flutter/material.dart'; -import 'package:hooks_riverpod/hooks_riverpod.dart'; - -class KyoshinMonitorScaleWidget extends ConsumerWidget { - const KyoshinMonitorScaleWidget({ - super.key, - this.showText = true, - this.markers = const [], - this.position = KmoniIntensityPosition.inside, - }); - - final bool showText; - final List markers; - final KmoniIntensityPosition position; - - @override - Widget build(BuildContext context, WidgetRef ref) { - final colorMap = ref.watch(kyoshinColorMapProvider); - final theme = Theme.of(context); - final colorScheme = theme.colorScheme; - return CustomPaint( - size: Size.infinite, - painter: _KmoniScalePainter( - colorMap: colorMap, - lineColor: colorScheme.onSurface, - showText: showText, - markers: markers, - position: position, - onSurface: colorScheme.onSurface, - ), - ); - } -} - -class _KmoniScalePainter extends CustomPainter { - _KmoniScalePainter({ - required this.colorMap, - required this.lineColor, - required this.onSurface, - required this.showText, - required this.markers, - required this.position, - }); - - final List colorMap; - - /// 区切り線の色 - final Color lineColor; - - final bool showText; - final List markers; - - final KmoniIntensityPosition position; - final Color onSurface; - - static const _kUnderPadding = 8; - - @override - void paint(Canvas canvas, Size size) { - final rect = switch (position) { - KmoniIntensityPosition.inside => - Rect.fromLTWH(0, 0, size.width, size.height), - KmoniIntensityPosition.under => - Rect.fromLTWH(0, 0, size.width, size.height - _kUnderPadding), - }; - - drawBackground(canvas, rect); - drawRealtimeIntensityChange( - canvas, - rect, - drawText: showText, - position: position, - ); - for (final e in markers) { - drawMarker(canvas, rect, e); - } - } - - // 背景のグラデーションを描画 - void drawBackground(Canvas canvas, Rect rect) => canvas.drawRect( - rect, - Paint() - ..shader = ui.Gradient.linear( - rect.centerLeft, - rect.centerRight, - colorMap.map((e) => Color.fromARGB(255, e.r, e.g, e.b)).toList(), - colorMap.mapIndexed((index, e) => index / colorMap.length).toList(), - ), - ); - - // 震度の切り替わりに線を描画 - void drawIntensityChangeLine(Canvas canvas, Rect rect) { - final paint = Paint() - ..color = Colors.black - ..strokeWidth = 1; - // 震度の切り替わりを描画 - JmaForecastIntensity? lastIntensity; - colorMap.forEachIndexed((index, element) { - final intensity = element.intensity.toJmaForecastIntensity; - if (lastIntensity != null && lastIntensity != intensity) { - final x = rect.width * (index / colorMap.length); - final shouldAdd = position == KmoniIntensityPosition.under; - canvas.drawLine( - Offset(x, rect.top), - Offset(x, rect.bottom + (shouldAdd ? 4 : 0)), - paint, - ); - } - lastIntensity = intensity; - }); - } - - // リアルタイム震度が整数値の場合、その震度を描画 - void drawRealtimeIntensityChange( - Canvas canvas, - Rect rect, { - bool drawText = true, - KmoniIntensityPosition position = KmoniIntensityPosition.inside, - }) { - final paint = Paint() - ..color = lineColor - ..strokeWidth = 1; - // 震度の切り替わりを描画 - colorMap.forEachIndexed((index, element) { - if (element.intensity % 1 != 0) { - return; - } - final color = (element.color.computeLuminance() > 0.5 - ? Colors.black - : Colors.white); - final x = rect.width * (index / colorMap.length) + rect.left; - final width = rect.width / colorMap.length; - final shouldAdd = position == KmoniIntensityPosition.under; - canvas.drawLine( - Offset(x + width / 2, rect.top), - Offset(x + width / 2, rect.bottom), - paint..color = color, - ); - if (shouldAdd) { - canvas.drawLine( - Offset(x + width / 2, rect.bottom), - Offset(x + width / 2, rect.bottom + (shouldAdd ? 4 : 0)), - paint..color = onSurface, - ); - } - - if (drawText) { - final textPainter = TextPainter( - text: TextSpan( - text: element.intensity.toStringAsFixed(0), - style: TextStyle( - color: shouldAdd ? onSurface : color, - fontSize: 10, - fontFamily: monoFont, - fontWeight: FontWeight.bold, - ), - ), - textDirection: TextDirection.ltr, - )..layout(); - final offset = switch (position) { - KmoniIntensityPosition.inside => Offset( - x + - switch (element.intensity) { - 7.0 => -textPainter.width, - _ => 4, - } + - rect.left, - rect.bottom - textPainter.height, - ), - KmoniIntensityPosition.under => Offset( - x + rect.left - textPainter.width / 2, - rect.bottom + _kUnderPadding / 2, - ), - }; - textPainter.paint( - canvas, - offset, - ); - } - }); - } - - // 赤三角 - void drawMarker(Canvas canvas, Rect rect, double intensity) { - final lower = colorMap.lastWhereOrNull((e) => e.intensity <= intensity); - final upper = colorMap.firstWhereOrNull((e) => e.intensity >= intensity); - - final double x; - if (lower == null) { - x = 0; - } else if (upper == null) { - x = 1; - } else { - x = (colorMap.indexOf(lower) + - (intensity - lower.intensity) / - (upper.intensity - lower.intensity)) / - colorMap.length; - } - - final paint = Paint() - ..color = Colors.red - ..style = PaintingStyle.fill; - final outlinePaint = Paint() - ..color = Colors.white - ..style = PaintingStyle.stroke - ..strokeWidth = 0; - - final path = Path() - ..moveTo(rect.width * x - 5, rect.top) - ..lineTo(rect.width * x + 5, rect.top) - ..lineTo(rect.width * x, rect.top + 10) - ..close(); - - canvas - ..drawPath(path, paint) - ..drawPath(path, outlinePaint); - } - - @override - bool shouldRepaint(_KmoniScalePainter oldDelegate) => - oldDelegate.colorMap != colorMap || - oldDelegate.showText != showText || - !const ListEquality().equals(oldDelegate.markers, markers) || - oldDelegate.position != position; - - @override - bool shouldRebuildSemantics(_KmoniScalePainter oldDelegate) => false; -} - -enum KmoniIntensityPosition { - inside, - under, - ; -} diff --git a/app/lib/feature/map/data/controller/declarative_map_controller.dart b/app/lib/feature/map/data/controller/declarative_map_controller.dart new file mode 100644 index 00000000..3a9a555f --- /dev/null +++ b/app/lib/feature/map/data/controller/declarative_map_controller.dart @@ -0,0 +1,30 @@ +import 'package:maplibre_gl/maplibre_gl.dart'; + +/// 宣言的な地図コントローラー +class DeclarativeMapController { + MapLibreMapController? _controller; + + /// コントローラーを取得 + MapLibreMapController? get controller => _controller; + + /// コントローラーを設定 + void setController(MapLibreMapController controller) { + _controller = controller; + } + + /// カメラを移動 + Future moveCamera(CameraUpdate update) async { + final controller = _controller; + if (controller == null) { + return; + } + await controller.animateCamera(update); + } + + /// カメラの位置を設定 + Future moveCameraToPosition(CameraPosition position) async { + await moveCamera( + CameraUpdate.newCameraPosition(position), + ); + } +} diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 18a6a8c5..bc434dc4 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -1,19 +1,20 @@ import 'dart:async'; import 'dart:developer'; +import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/layer/base/i_map_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; -import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; /// 宣言的なMapLibreMapのラッパー -class DeclarativeMap extends ConsumerStatefulWidget { +class DeclarativeMap extends StatefulHookConsumerWidget { const DeclarativeMap({ required this.initialCameraPosition, + required this.controller, + required this.styleString, super.key, - this.onMapCreated, this.onStyleLoadedCallback, this.onCameraIdle, this.layers = const [], @@ -28,8 +29,8 @@ class DeclarativeMap extends ConsumerStatefulWidget { /// 初期カメラ位置 final MapCameraPosition initialCameraPosition; - /// マップ作成時のコールバック - final void Function(MapLibreMapController)? onMapCreated; + /// マップコントローラー + final DeclarativeMapController controller; /// スタイル読み込み完了時のコールバック final void Function()? onStyleLoadedCallback; @@ -58,39 +59,25 @@ class DeclarativeMap extends ConsumerStatefulWidget { /// ダブルタップズームの有効化 final bool doubleClickZoomEnabled; + /// スタイル文字列 + final String styleString; + @override ConsumerState createState() => _DeclarativeMapState(); } class _DeclarativeMapState extends ConsumerState { - MapLibreMapController? _controller; final Map _addedLayers = {}; // レイヤー操作のロック bool _isUpdatingLayers = false; @override Widget build(BuildContext context) { - // スタイルの監視 - final configurationState = ref.watch(mapConfigurationNotifierProvider); - final configuration = configurationState.valueOrNull; - - if (configuration == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); - } - - final styleString = configuration.styleString; - if (styleString == null) { - throw ArgumentError('styleString is null'); - } - return MapLibreMap( - styleString: styleString, + styleString: widget.styleString, initialCameraPosition: widget.initialCameraPosition.toMapLibre(), onMapCreated: (controller) { - _controller = controller; - widget.onMapCreated?.call(controller); + widget.controller.setController(controller); }, onStyleLoadedCallback: () { widget.onStyleLoadedCallback?.call(); @@ -99,7 +86,7 @@ class _DeclarativeMapState extends ConsumerState { ); }, onCameraIdle: () { - final position = _controller?.cameraPosition; + final position = widget.controller.controller?.cameraPosition; if (position != null) { widget.onCameraIdle?.call( MapCameraPosition.fromMapLibre(position), @@ -116,7 +103,8 @@ class _DeclarativeMapState extends ConsumerState { } Future _updateLayers() async { - if (_controller == null) { + final controller = widget.controller.controller; + if (controller == null) { log('controller is null'); return; } @@ -132,8 +120,8 @@ class _DeclarativeMapState extends ConsumerState { final newLayerIds = widget.layers.map((l) => l.id).toSet(); for (final id in _addedLayers.keys.toSet()) { if (!newLayerIds.contains(id)) { - await _controller!.removeLayer(id); - await _controller!.removeSource(_addedLayers[id]!.layer.sourceId); + await controller.removeLayer(id); + await controller.removeSource(_addedLayers[id]!.layer.sourceId); _addedLayers.remove(id); } } @@ -149,8 +137,8 @@ class _DeclarativeMapState extends ConsumerState { final layerProperties = layer.layerPropertiesHash; if (cachedLayerProperties != layerProperties) { log('layer properties changed'); - await _controller!.removeLayer(layer.id); - await _controller!.removeSource(layer.sourceId); + await controller.removeLayer(layer.id); + await controller.removeSource(layer.sourceId); await _addLayer(layer); _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); @@ -161,7 +149,7 @@ class _DeclarativeMapState extends ConsumerState { final geoJsonSource = layer.geoJsonSourceHash; if (cachedGeoJsonSource != geoJsonSource) { // update geojson - await _controller!.setGeoJsonSource( + await controller.setGeoJsonSource( layer.sourceId, layer.toGeoJsonSource(), ); @@ -180,7 +168,7 @@ class _DeclarativeMapState extends ConsumerState { } Future _addLayer(IMapLayer layer) async { - final controller = _controller!; + final controller = widget.controller.controller!; await controller.addGeoJsonSource( layer.sourceId, layer.toGeoJsonSource(), @@ -192,10 +180,24 @@ class _DeclarativeMapState extends ConsumerState { ); } + Future _updateAllLayers() async { + final controller = widget.controller.controller!; + for (final layer in widget.layers) { + await controller.removeLayer(layer.id); + await controller.removeSource(layer.sourceId); + await _addLayer(layer); + } + } + @override void didUpdateWidget(DeclarativeMap oldWidget) { super.didUpdateWidget(oldWidget); - if (oldWidget.layers != widget.layers) { + if (oldWidget.styleString != widget.styleString) { + unawaited( + _updateAllLayers(), + ); + } + if (oldWidget.layers != widget.layers ) { unawaited( _updateLayers(), ); From 118a4077a59ffc5709747688e1e6abab4591aad2 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 16:35:13 +0900 Subject: [PATCH 02/70] chore: Update GitHub Actions workflow branch trigger pattern - Modify deploy.yaml to use '**' wildcard for more comprehensive branch triggering - Ensure broader branch coverage in GitHub Actions deployment workflow --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f57452e7..ba176f7b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,7 +6,7 @@ concurrency: on: push: branches: - - '*' + - '**' workflow_dispatch: inputs: ios: From 2ad510b59c4fbae9e6becc525f73e70e9ec1507f Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 19:03:25 +0900 Subject: [PATCH 03/70] chore: Update Google Play deployment workflow - Pin upload-google-play action to specific commit hash - Add userFraction parameter to control rollout percentage - Ensure consistent and precise deployment configuration --- .github/workflows/deploy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ba176f7b..fd768818 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -281,10 +281,11 @@ jobs: path: build - name: Upload to Google Play - uses: r0adkll/upload-google-play@v1 + uses: r0adkll/upload-google-play@935ef9c68bb393a8e6116b1575626a7f5be3a7fb #v1.1.3 with: serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }} packageName: net.yumnumm.eqmonitor releaseFiles: build/app-release.aab track: internal status: inProgress + userFraction: 1.0 From f4628c28b319cf61b5d47d19da68c97fcbd54ab5 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 19:18:11 +0900 Subject: [PATCH 04/70] chore: Increase GitHub Actions deployment timeout - Extend timeout for iOS and Android deployment jobs from 15 to 30 minutes - Ensure sufficient time for complete deployment processes --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index fd768818..d09b32fa 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -77,7 +77,7 @@ jobs: needs: define-matrix if: ${{ needs.define-matrix.outputs.deploy-ios }} runs-on: macos-latest - timeout-minutes: 15 + timeout-minutes: 30 steps: # https://github.com/actions/checkout - name: Checkout @@ -217,7 +217,7 @@ jobs: needs: define-matrix if: ${{ needs.define-matrix.outputs.deploy-android }} runs-on: ubuntu-24.04 - timeout-minutes: 15 + timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 From f1e5ad1f7ad311188e9b6bb76d1732d6b2aa2ac9 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 20:04:07 +0900 Subject: [PATCH 05/70] chore: Finalize Google Play deployment configuration - Change deployment status from 'inProgress' to 'completed' - Remove userFraction parameter for full release - Streamline Google Play deployment workflow --- .github/workflows/deploy.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d09b32fa..00417a2f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -287,5 +287,4 @@ jobs: packageName: net.yumnumm.eqmonitor releaseFiles: build/app-release.aab track: internal - status: inProgress - userFraction: 1.0 + status: completed From 00d1ccc2016d540f433c88257637699311e92627 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 20:22:40 +0900 Subject: [PATCH 06/70] chore: Configure Google Play deployment to allow updates for existing users - Add `changesNotSentForReview: false` to enable updates for current app users - Ensure smooth update process without requiring full review --- .github/workflows/deploy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 00417a2f..6e6e3007 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -288,3 +288,5 @@ jobs: releaseFiles: build/app-release.aab track: internal status: completed + # 既存ユーザーへのアップデートを許可 + changesNotSentForReview: false From a627ac4f6e0bb2ea43e5742768c4a6e4e1102048 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 7 Feb 2025 20:56:25 +0900 Subject: [PATCH 07/70] chore: Implement dynamic build number tracking for Android deployment - Add Codemagic CLI Tools to fetch latest build number from Google Play Store - Dynamically increment build number for AAB and APK artifacts - Ensure unique versioning for each app deployment --- .github/workflows/deploy.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6e6e3007..58560252 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -243,18 +243,40 @@ jobs: rm environment.tar.gz ls -l environment/ + - name: Install Codemagic CLI Tools + run: | + pip3 install codemagic-cli-tools + + - name: Fetch latest build number from Google Play Store + id: fetch-latest-build-number + run: | + echo "${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}" > service-account.json + LATEST_BUILD_NUMBER=$(google-play get-latest-build-number \ + --credentials="@file:service-account.json" \ + --package-name="net.yumnumm.eqmonitor" || echo "0") + BUILD_NUMBER=$((LATEST_BUILD_NUMBER + 1)) + echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_OUTPUT + echo "Build Number set to ${BUILD_NUMBER}." + rm service-account.json + - name: Build Android (AAB) working-directory: app + env: + BUILD_NUMBER: ${{ steps.fetch-latest-build-number.outputs.BUILD_NUMBER }} run: | flutter build appbundle \ --release \ + --build-number=${BUILD_NUMBER} \ --dart-define-from-file=../environment/.env.prod - name: Build Android (APK) working-directory: app + env: + BUILD_NUMBER: ${{ steps.fetch-latest-build-number.outputs.BUILD_NUMBER }} run: | flutter build apk \ --release \ + --build-number=${BUILD_NUMBER} \ --dart-define-from-file=../environment/.env.prod - name: Upload aab as artifact From 7754daf457f7ba61aa3e91505b2bd9639d546c8e Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sat, 8 Feb 2025 03:21:30 +0900 Subject: [PATCH 08/70] refactor: Improve Kyoshin Monitor settings and map layer components - Update AppSheetRoute to use Material widget with elevation and shape - Modify HomeMapLayerModal and KyoshinMonitorSettingsModal to use ClipRRect - Rename KmoniMarkerType to KyoshinMonitorMarkerType - Refactor KyoshinMonitorSettingsModel with renamed properties - Update KyoshinMonitorStatusCard with optional onTap callback - Enhance map layer rendering with more flexible layer properties tracking --- .../core/component/sheet/app_sheet_route.dart | 10 +- .../core/component/widget/app_list_tile.dart | 103 +++++++++ .../home/component/map/home_map_content.dart | 49 +++++ .../component/map/home_map_layer_modal.dart | 108 +++------- .../home/component/map/home_map_view.dart | 183 ++++++---------- .../map/kyoshin_monitor_scale_card.dart | 73 +++++++ .../eew_settings/eew_settings_notifier.dart | 36 ---- .../eew_settings/eew_settings_notifier.g.dart | 29 --- .../model/eew_setitngs_model.dart | 15 -- .../model/eew_setitngs_model.freezed.dart | 195 ------------------ .../model/eew_setitngs_model.g.dart | 35 ---- app/lib/feature/home/model/kmoni_config.dart | 13 -- .../home/model/kmoni_config.freezed.dart | 165 --------------- .../feature/home/model/kmoni_config.g.dart | 26 --- .../model/kyoshin_monitor_settings_model.dart | 9 +- ...yoshin_monitor_settings_model.freezed.dart | 60 +++--- .../kyoshin_monitor_settings_model.g.dart | 24 +-- .../kyoshin_monitor_status_card.dart | 16 +- .../page/kyoshin_monitor_settings_modal.dart | 47 ++--- .../kyoshin_monitor_layer_controller.dart | 10 +- .../kyoshin_monitor_layer_controller.g.dart | 2 +- app/lib/feature/map/ui/declarative_map.dart | 9 +- 22 files changed, 411 insertions(+), 806 deletions(-) create mode 100644 app/lib/core/component/widget/app_list_tile.dart create mode 100644 app/lib/feature/home/component/map/home_map_content.dart create mode 100644 app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart delete mode 100644 app/lib/feature/home/features/eew_settings/eew_settings_notifier.dart delete mode 100644 app/lib/feature/home/features/eew_settings/eew_settings_notifier.g.dart delete mode 100644 app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.dart delete mode 100644 app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.freezed.dart delete mode 100644 app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.g.dart delete mode 100644 app/lib/feature/home/model/kmoni_config.dart delete mode 100644 app/lib/feature/home/model/kmoni_config.freezed.dart delete mode 100644 app/lib/feature/home/model/kmoni_config.g.dart diff --git a/app/lib/core/component/sheet/app_sheet_route.dart b/app/lib/core/component/sheet/app_sheet_route.dart index a8139aaa..f7d0bf70 100644 --- a/app/lib/core/component/sheet/app_sheet_route.dart +++ b/app/lib/core/component/sheet/app_sheet_route.dart @@ -11,9 +11,13 @@ class AppSheetRoute extends SheetRoute { stops: [initialExtent, 1], decorationBuilder: (context, child) => SafeArea( bottom: false, - child: ClipRRect( - borderRadius: const BorderRadius.vertical( - top: Radius.circular(16), + child: Material( + elevation: 2, + clipBehavior: Clip.hardEdge, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), ), child: child, ), diff --git a/app/lib/core/component/widget/app_list_tile.dart b/app/lib/core/component/widget/app_list_tile.dart new file mode 100644 index 00000000..3b2bda81 --- /dev/null +++ b/app/lib/core/component/widget/app_list_tile.dart @@ -0,0 +1,103 @@ +import 'package:flutter/material.dart'; + +class AppListTile extends StatelessWidget { + factory AppListTile.switchListTile({ + required String title, + required String subtitle, + required bool value, + // ignore: avoid_positional_boolean_parameters + required void Function(bool) onChanged, + Widget? trailing, + }) => + AppListTile._( + title: title, + subtitle: subtitle, + value: value, + onChanged: onChanged, + trailing: trailing, + type: _AppListTileType.switchListTile, + ); + + factory AppListTile.listTile({ + required String title, + required String subtitle, + Widget? trailing, + void Function()? onTap, + }) => + AppListTile._( + title: title, + subtitle: subtitle, + trailing: trailing, + onTap: onTap, + type: _AppListTileType.listTile, + ); + + const AppListTile._({ + required this.title, + required this.subtitle, + required this.type, + this.value, + this.onChanged, + this.onTap, + this.trailing, + }); + + final String title; + final String subtitle; + final bool? value; + // ignore: avoid_positional_boolean_parameters + final void Function(bool)? onChanged; + final void Function()? onTap; + final Widget? trailing; + // ignore: library_private_types_in_public_api + final _AppListTileType type; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colorScheme = theme.colorScheme; + final backgroundColor = colorScheme.secondaryContainer; + final textColor = colorScheme.onSecondaryContainer; + + final shape = RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ); + + return switch (type) { + _AppListTileType.switchListTile => SwitchListTile.adaptive( + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + ), + shape: shape, + tileColor: backgroundColor, + title: Text( + title, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text(subtitle), + value: value!, + onChanged: onChanged, + ), + _AppListTileType.listTile => ListTile( + onTap: onTap, + contentPadding: const EdgeInsets.symmetric( + horizontal: 16, + ), + shape: shape, + tileColor: backgroundColor, + textColor: textColor, + title: Text( + title, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + subtitle: Text(subtitle), + trailing: trailing, + ), + }; + } +} + +enum _AppListTileType { + switchListTile, + listTile, +} diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart new file mode 100644 index 00000000..32fd2c1b --- /dev/null +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -0,0 +1,49 @@ +import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; +import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; +import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; +import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; +import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; +import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; +import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; + +class HomeMapContent extends HookConsumerWidget { + const HomeMapContent({ + required this.mapController, + required this.cameraPosition, + super.key, + }); + + final DeclarativeMapController mapController; + final MapCameraPosition cameraPosition; + + @override + Widget build(BuildContext context, WidgetRef ref) { + // 強震モニタレイヤーの監視 + final kyoshinLayer = ref.watch(kyoshinMonitorLayerControllerProvider); + final isKyoshinLayerEnabled = + ref.watch(kyoshinMonitorSettingsProvider.select((v) => v.useKmoni)); + // スタイルの監視 + final configurationState = ref.watch(mapConfigurationNotifierProvider); + final configuration = configurationState.valueOrNull; + + if (configuration == null) { + return const Center( + child: CircularProgressIndicator.adaptive(), + ); + } + + final styleString = configuration.styleString; + if (styleString == null) { + throw ArgumentError('styleString is null'); + } + return DeclarativeMap( + styleString: styleString, + controller: mapController, + initialCameraPosition: cameraPosition, + layers: [ + if (kyoshinLayer != null && isKyoshinLayerEnabled) kyoshinLayer, + ], + ); + } +} diff --git a/app/lib/feature/home/component/map/home_map_layer_modal.dart b/app/lib/feature/home/component/map/home_map_layer_modal.dart index 868be361..5780e208 100644 --- a/app/lib/feature/home/component/map/home_map_layer_modal.dart +++ b/app/lib/feature/home/component/map/home_map_layer_modal.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:ui'; import 'package:eqmonitor/core/component/sheet/app_sheet_route.dart'; -import 'package:eqmonitor/core/util/haptic.dart'; +import 'package:eqmonitor/core/component/widget/app_list_tile.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart'; import 'package:flutter/material.dart'; @@ -14,7 +14,12 @@ class HomeMapLayerModal extends HookConsumerWidget { static Future show(BuildContext context) => Navigator.of(context).push( AppSheetRoute( - builder: (context) => const HomeMapLayerModal(), + builder: (context) => const ClipRRect( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + child: HomeMapLayerModal(), + ), ), ); @@ -38,7 +43,7 @@ class HomeMapLayerModal extends HookConsumerWidget { tileMode: TileMode.mirror, ), inner: ColorFilter.mode( - colorScheme.surfaceContainerLow.withValues(alpha: 0.8), + colorScheme.surfaceContainerLow.withValues(alpha: 0.7), BlendMode.srcATop, ), ), @@ -61,24 +66,8 @@ class HomeMapLayerModal extends HookConsumerWidget { ), ], ), - SliverToBoxAdapter( - child: _Card( - title: '強震モニタ', - description: '強震モニタのリアルタイムデータを表示します', - isEnabled: ref.watch(kyoshinMonitorSettingsProvider).useKmoni, - onEnabledChanged: (value) async => lightHapticFunction( - () => ref.read(kyoshinMonitorSettingsProvider.notifier).save( - ref.read(kyoshinMonitorSettingsProvider).copyWith( - useKmoni: value, - ), - ), - ), - onTap: ref.watch(kyoshinMonitorSettingsProvider).useKmoni - ? () async => selectionHapticFunction( - () async => KyoshinMonitorSettingsModal.show(context), - ) - : null, - ), + const SliverToBoxAdapter( + child: _KyoshinMonitorIsEnabledTile(), ), ], ), @@ -86,70 +75,25 @@ class HomeMapLayerModal extends HookConsumerWidget { } } -class _Card extends StatelessWidget { - const _Card({ - required this.title, - required this.description, - required this.isEnabled, - this.onEnabledChanged, - this.onTap, - }); - - final String title; - final String description; - final bool isEnabled; - // ignore: avoid_positional_boolean_parameters - final void Function(bool)? onEnabledChanged; - final VoidCallback? onTap; +class _KyoshinMonitorIsEnabledTile extends ConsumerWidget { + const _KyoshinMonitorIsEnabledTile(); @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - final colorScheme = theme.colorScheme; + Widget build(BuildContext context, WidgetRef ref) { + final setting = ref.watch(kyoshinMonitorSettingsProvider); - return Card( - margin: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - color: colorScheme.surfaceContainerHighest, - elevation: 0, - clipBehavior: Clip.hardEdge, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - child: InkWell( - onTap: onTap ?? () => onEnabledChanged?.call(!isEnabled), - child: Padding( - padding: const EdgeInsets.all(8), - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: theme.textTheme.titleMedium!.copyWith( - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 4), - Text( - description, - style: theme.textTheme.bodyMedium!.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), - ], - ), - ), - if (onEnabledChanged != null) - Switch.adaptive( - value: isEnabled, - onChanged: onEnabledChanged, - ), - if (onTap != null && isEnabled) const Icon(Icons.chevron_right), - ], - ), - ), + final subtitle = setting.useKmoni + ? '強震モニタのリアルタイムデータを表示します \n' + '(${setting.realtimeDataType.displayName}: ${setting.realtimeLayer.displayName})' + : '強震モニタを利用していません'; + + return Padding( + padding: const EdgeInsets.all(8), + child: AppListTile.listTile( + title: '強震モニタ', + subtitle: subtitle, + trailing: const Icon(Icons.chevron_right), + onTap: () async => KyoshinMonitorSettingsModal.show(context), ), ); } diff --git a/app/lib/feature/home/component/map/home_map_view.dart b/app/lib/feature/home/component/map/home_map_view.dart index d311eeb2..487c2e68 100644 --- a/app/lib/feature/home/component/map/home_map_view.dart +++ b/app/lib/feature/home/component/map/home_map_view.dart @@ -1,19 +1,16 @@ import 'package:eqmonitor/core/utils/map_camera_position_helper.dart'; +import 'package:eqmonitor/feature/home/component/map/home_map_content.dart'; import 'package:eqmonitor/feature/home/component/map/home_map_layer_modal.dart'; +import 'package:eqmonitor/feature/home/component/map/kyoshin_monitor_scale_card.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; -import 'package:eqmonitor/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart'; +import 'package:eqmonitor/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; -import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; -import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; import 'package:eqmonitor/feature/map/ui/components/controller/map_layer_controller_card.dart'; -import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; -import 'package:eqmonitor/gen/fonts.gen.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; class HomeMapView extends HookConsumerWidget { @@ -21,11 +18,9 @@ class HomeMapView extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - // 強震モニタレイヤーの監視 - final kyoshinLayer = ref.watch(kyoshinMonitorLayerControllerProvider); - final size = MediaQuery.sizeOf(context); final mapController = useMemoized(DeclarativeMapController.new); + final size = MediaQuery.sizeOf(context); final cameraPosition = useMemoized( () => MapCameraPosition( target: MapCameraPositionHelper.calculateJapanCenterPosition( @@ -40,73 +35,16 @@ class HomeMapView extends HookConsumerWidget { [size.width, size.height], ); - // スタイルの監視 - final configurationState = ref.watch(mapConfigurationNotifierProvider); - final configuration = configurationState.valueOrNull; - - if (configuration == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); - } - - final styleString = configuration.styleString; - if (styleString == null) { - throw ArgumentError('styleString is null'); - } - return Stack( children: [ - DeclarativeMap( - styleString: styleString, - controller: mapController, - initialCameraPosition: cameraPosition, - layers: [ - if (kyoshinLayer != null) kyoshinLayer, - ], + HomeMapContent( + mapController: mapController, + cameraPosition: cameraPosition, ), SafeArea( child: Padding( padding: const EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - KyoshinMonitorStatusCard(), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: _KyoshinMonitorScale(), - ), - ], - ), - const Column(), - MapLayerControllerCard( - onLayerButtonTap: () async => HomeMapLayerModal.show(context), - onLocationButtonTap: () async { - await mapController.moveCameraToPosition( - CameraPosition( - target: MapCameraPositionHelper - .calculateJapanCenterPosition( - size.width, - size.height, - ), - zoom: MapCameraPositionHelper.calculateJapanZoomLevel( - size.width, - size.height, - ), - ), - ); - }, - ), - ], - ), + child: _MapHeader(mapController: mapController, size: size), ), ), ], @@ -114,58 +52,73 @@ class HomeMapView extends HookConsumerWidget { } } -class _KyoshinMonitorScale extends ConsumerWidget { - const _KyoshinMonitorScale(); +class _MapHeader extends ConsumerWidget { + const _MapHeader({ + required this.mapController, + required this.size, + }); + + final DeclarativeMapController mapController; + final Size size; @override Widget build(BuildContext context, WidgetRef ref) { - final realtimeDataType = ref.watch( - kyoshinMonitorSettingsProvider.select((v) => v.realtimeDataType), + final useKmoni = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.useKmoni), ); - final type = switch (realtimeDataType) { - RealtimeDataType.shindo => KyoshinMonitorScaleType.intensity, - RealtimeDataType.pga => KyoshinMonitorScaleType.pga, - RealtimeDataType.pgv || - RealtimeDataType.response0125Hz || - RealtimeDataType.response025Hz || - RealtimeDataType.response05Hz || - RealtimeDataType.response1Hz || - RealtimeDataType.response2Hz || - RealtimeDataType.response4Hz => - KyoshinMonitorScaleType.pgv, - RealtimeDataType.pgd => KyoshinMonitorScaleType.pgd, - _ => throw ArgumentError( - 'Invalid realtimeDataType: $realtimeDataType)', - ), - }; - final theme = Theme.of(context); - return Column( + final showScaleCard = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.showScale), + ); + + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, - spacing: 8, children: [ - Text( - type.unit == '' - ? type.title - : '${type.title.toUpperCase()} [${type.unit}]', - style: theme.textTheme.bodySmall!.copyWith( - fontFamily: FontFamily.jetBrainsMono, - textBaseline: TextBaseline.alphabetic, - fontWeight: FontWeight.bold, - ), + AnimatedSwitcher( + duration: const Duration(milliseconds: 200), + child: useKmoni + ? Column( + key: const ValueKey('kyoshin_monitor_status_card'), + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, + children: [ + KyoshinMonitorStatusCard( + onTap: () async => + KyoshinMonitorSettingsModal.show(context), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8, + ), + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 200), + child: showScaleCard + ? const KyoshinMonitorScaleCard() + : const SizedBox.shrink(), + ), + ), + ], + ) + : const SizedBox.shrink(), ), - KyoshinMonitorScale( - type: type, - width: 15, - height: 150, - gradientDirection: KyoshinMonitorScaleGradientDirection.reverse, - orientation: KyoshinMonitorScaleOrientation.vertical, - textColor: theme.colorScheme.onSurface, - tickInterval: 3, - textStyle: theme.textTheme.bodySmall!.copyWith( - fontFamily: FontFamily.jetBrainsMono, - textBaseline: TextBaseline.alphabetic, - fontSize: 10, - ), + const Column(), + MapLayerControllerCard( + onLayerButtonTap: () async => HomeMapLayerModal.show(context), + onLocationButtonTap: () async { + await mapController.moveCameraToPosition( + CameraPosition( + target: MapCameraPositionHelper.calculateJapanCenterPosition( + size.width, + size.height, + ), + zoom: MapCameraPositionHelper.calculateJapanZoomLevel( + size.width, + size.height, + ), + ), + ); + }, ), ], ); diff --git a/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart b/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart new file mode 100644 index 00000000..a2e8fd63 --- /dev/null +++ b/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart @@ -0,0 +1,73 @@ +import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; +import 'package:eqmonitor/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart'; +import 'package:eqmonitor/gen/fonts.gen.dart'; +import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; + +/// 強震モニタの設定状況を考慮したスケールカード +class KyoshinMonitorScaleCard extends ConsumerWidget { + const KyoshinMonitorScaleCard({ + this.onTap, + super.key, + }); + + final void Function()? onTap; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final realtimeDataType = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.realtimeDataType), + ); + final type = switch (realtimeDataType) { + RealtimeDataType.shindo => KyoshinMonitorScaleType.intensity, + RealtimeDataType.pga => KyoshinMonitorScaleType.pga, + RealtimeDataType.pgv || + RealtimeDataType.response0125Hz || + RealtimeDataType.response025Hz || + RealtimeDataType.response05Hz || + RealtimeDataType.response1Hz || + RealtimeDataType.response2Hz || + RealtimeDataType.response4Hz => + KyoshinMonitorScaleType.pgv, + RealtimeDataType.pgd => KyoshinMonitorScaleType.pgd, + _ => throw ArgumentError( + 'Invalid realtimeDataType: $realtimeDataType)', + ), + }; + final theme = Theme.of(context); + return GestureDetector( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + type.unit == '' + ? type.title + : '${type.title.toUpperCase()} [${type.unit}]', + style: theme.textTheme.bodySmall!.copyWith( + fontFamily: FontFamily.jetBrainsMono, + textBaseline: TextBaseline.alphabetic, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + KyoshinMonitorScale( + type: type, + width: 15, + height: 150, + gradientDirection: KyoshinMonitorScaleGradientDirection.reverse, + orientation: KyoshinMonitorScaleOrientation.vertical, + textColor: theme.colorScheme.onSurface, + tickInterval: 3, + textStyle: theme.textTheme.bodySmall!.copyWith( + fontFamily: FontFamily.jetBrainsMono, + textBaseline: TextBaseline.alphabetic, + fontSize: 10, + ), + ), + ], + ), + ); + } +} diff --git a/app/lib/feature/home/features/eew_settings/eew_settings_notifier.dart b/app/lib/feature/home/features/eew_settings/eew_settings_notifier.dart deleted file mode 100644 index 1e95d37e..00000000 --- a/app/lib/feature/home/features/eew_settings/eew_settings_notifier.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'dart:convert'; - -import 'package:eqmonitor/core/provider/shared_preferences.dart'; -import 'package:eqmonitor/feature/home/features/eew_settings/model/eew_setitngs_model.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'eew_settings_notifier.g.dart'; - -@Riverpod(keepAlive: true) -class EewSettingsNotifier extends _$EewSettingsNotifier { - @override - EewSetitngs build() { - final prefs = ref.read(sharedPreferencesProvider); - final json = prefs.getString(_prefsKey); - if (json == null) { - return const EewSetitngs(); - } - return EewSetitngs.fromJson(jsonDecode(json) as Map); - } - - Future setShowCalculatedRegionIntensity({required bool value}) async { - state = state.copyWith(showCalculatedRegionIntensity: value); - await _save(); - } - - Future setShowCalculatedCityIntensity({required bool value}) async { - state = state.copyWith(showCalculatedCityIntensity: value); - await _save(); - } - - Future _save() async => ref - .read(sharedPreferencesProvider) - .setString(_prefsKey, jsonEncode(state.toJson())); - - static const _prefsKey = 'eew_settings'; -} diff --git a/app/lib/feature/home/features/eew_settings/eew_settings_notifier.g.dart b/app/lib/feature/home/features/eew_settings/eew_settings_notifier.g.dart deleted file mode 100644 index c4d41b41..00000000 --- a/app/lib/feature/home/features/eew_settings/eew_settings_notifier.g.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use - -part of 'eew_settings_notifier.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$eewSettingsNotifierHash() => - r'c79f12c749eea318f721bd8c511aac02a10921ca'; - -/// See also [EewSettingsNotifier]. -@ProviderFor(EewSettingsNotifier) -final eewSettingsNotifierProvider = - NotifierProvider.internal( - EewSettingsNotifier.new, - name: r'eewSettingsNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewSettingsNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$EewSettingsNotifier = Notifier; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.dart b/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.dart deleted file mode 100644 index 1fb8da81..00000000 --- a/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'eew_setitngs_model.freezed.dart'; -part 'eew_setitngs_model.g.dart'; - -@freezed -class EewSetitngs with _$EewSetitngs { - const factory EewSetitngs({ - @Default(false) bool showCalculatedRegionIntensity, - @Default(false) bool showCalculatedCityIntensity, - }) = _EewSetitngs; - - factory EewSetitngs.fromJson(Map json) => - _$EewSetitngsFromJson(json); -} diff --git a/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.freezed.dart b/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.freezed.dart deleted file mode 100644 index 81c97f74..00000000 --- a/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.freezed.dart +++ /dev/null @@ -1,195 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'eew_setitngs_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -EewSetitngs _$EewSetitngsFromJson(Map json) { - return _EewSetitngs.fromJson(json); -} - -/// @nodoc -mixin _$EewSetitngs { - bool get showCalculatedRegionIntensity => throw _privateConstructorUsedError; - bool get showCalculatedCityIntensity => throw _privateConstructorUsedError; - - /// Serializes this EewSetitngs to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of EewSetitngs - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $EewSetitngsCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $EewSetitngsCopyWith<$Res> { - factory $EewSetitngsCopyWith( - EewSetitngs value, $Res Function(EewSetitngs) then) = - _$EewSetitngsCopyWithImpl<$Res, EewSetitngs>; - @useResult - $Res call( - {bool showCalculatedRegionIntensity, bool showCalculatedCityIntensity}); -} - -/// @nodoc -class _$EewSetitngsCopyWithImpl<$Res, $Val extends EewSetitngs> - implements $EewSetitngsCopyWith<$Res> { - _$EewSetitngsCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of EewSetitngs - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? showCalculatedRegionIntensity = null, - Object? showCalculatedCityIntensity = null, - }) { - return _then(_value.copyWith( - showCalculatedRegionIntensity: null == showCalculatedRegionIntensity - ? _value.showCalculatedRegionIntensity - : showCalculatedRegionIntensity // ignore: cast_nullable_to_non_nullable - as bool, - showCalculatedCityIntensity: null == showCalculatedCityIntensity - ? _value.showCalculatedCityIntensity - : showCalculatedCityIntensity // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$EewSetitngsImplCopyWith<$Res> - implements $EewSetitngsCopyWith<$Res> { - factory _$$EewSetitngsImplCopyWith( - _$EewSetitngsImpl value, $Res Function(_$EewSetitngsImpl) then) = - __$$EewSetitngsImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {bool showCalculatedRegionIntensity, bool showCalculatedCityIntensity}); -} - -/// @nodoc -class __$$EewSetitngsImplCopyWithImpl<$Res> - extends _$EewSetitngsCopyWithImpl<$Res, _$EewSetitngsImpl> - implements _$$EewSetitngsImplCopyWith<$Res> { - __$$EewSetitngsImplCopyWithImpl( - _$EewSetitngsImpl _value, $Res Function(_$EewSetitngsImpl) _then) - : super(_value, _then); - - /// Create a copy of EewSetitngs - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? showCalculatedRegionIntensity = null, - Object? showCalculatedCityIntensity = null, - }) { - return _then(_$EewSetitngsImpl( - showCalculatedRegionIntensity: null == showCalculatedRegionIntensity - ? _value.showCalculatedRegionIntensity - : showCalculatedRegionIntensity // ignore: cast_nullable_to_non_nullable - as bool, - showCalculatedCityIntensity: null == showCalculatedCityIntensity - ? _value.showCalculatedCityIntensity - : showCalculatedCityIntensity // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$EewSetitngsImpl implements _EewSetitngs { - const _$EewSetitngsImpl( - {this.showCalculatedRegionIntensity = false, - this.showCalculatedCityIntensity = false}); - - factory _$EewSetitngsImpl.fromJson(Map json) => - _$$EewSetitngsImplFromJson(json); - - @override - @JsonKey() - final bool showCalculatedRegionIntensity; - @override - @JsonKey() - final bool showCalculatedCityIntensity; - - @override - String toString() { - return 'EewSetitngs(showCalculatedRegionIntensity: $showCalculatedRegionIntensity, showCalculatedCityIntensity: $showCalculatedCityIntensity)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$EewSetitngsImpl && - (identical(other.showCalculatedRegionIntensity, - showCalculatedRegionIntensity) || - other.showCalculatedRegionIntensity == - showCalculatedRegionIntensity) && - (identical(other.showCalculatedCityIntensity, - showCalculatedCityIntensity) || - other.showCalculatedCityIntensity == - showCalculatedCityIntensity)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash( - runtimeType, showCalculatedRegionIntensity, showCalculatedCityIntensity); - - /// Create a copy of EewSetitngs - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$EewSetitngsImplCopyWith<_$EewSetitngsImpl> get copyWith => - __$$EewSetitngsImplCopyWithImpl<_$EewSetitngsImpl>(this, _$identity); - - @override - Map toJson() { - return _$$EewSetitngsImplToJson( - this, - ); - } -} - -abstract class _EewSetitngs implements EewSetitngs { - const factory _EewSetitngs( - {final bool showCalculatedRegionIntensity, - final bool showCalculatedCityIntensity}) = _$EewSetitngsImpl; - - factory _EewSetitngs.fromJson(Map json) = - _$EewSetitngsImpl.fromJson; - - @override - bool get showCalculatedRegionIntensity; - @override - bool get showCalculatedCityIntensity; - - /// Create a copy of EewSetitngs - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$EewSetitngsImplCopyWith<_$EewSetitngsImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.g.dart b/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.g.dart deleted file mode 100644 index b617e0bc..00000000 --- a/app/lib/feature/home/features/eew_settings/model/eew_setitngs_model.g.dart +++ /dev/null @@ -1,35 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use - -part of 'eew_setitngs_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$EewSetitngsImpl _$$EewSetitngsImplFromJson(Map json) => - $checkedCreate( - r'_$EewSetitngsImpl', - json, - ($checkedConvert) { - final val = _$EewSetitngsImpl( - showCalculatedRegionIntensity: $checkedConvert( - 'show_calculated_region_intensity', (v) => v as bool? ?? false), - showCalculatedCityIntensity: $checkedConvert( - 'show_calculated_city_intensity', (v) => v as bool? ?? false), - ); - return val; - }, - fieldKeyMap: const { - 'showCalculatedRegionIntensity': 'show_calculated_region_intensity', - 'showCalculatedCityIntensity': 'show_calculated_city_intensity' - }, - ); - -Map _$$EewSetitngsImplToJson(_$EewSetitngsImpl instance) => - { - 'show_calculated_region_intensity': - instance.showCalculatedRegionIntensity, - 'show_calculated_city_intensity': instance.showCalculatedCityIntensity, - }; diff --git a/app/lib/feature/home/model/kmoni_config.dart b/app/lib/feature/home/model/kmoni_config.dart deleted file mode 100644 index b45a9891..00000000 --- a/app/lib/feature/home/model/kmoni_config.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; -part 'kmoni_config.freezed.dart'; -part 'kmoni_config.g.dart'; - -@freezed -class KmoniConfig with _$KmoniConfig { - const factory KmoniConfig({ - @Default(0) int counter, // Add your fields here - }) = _KmoniConfig; - - factory KmoniConfig.fromJson(Map json) => - _$KmoniConfigFromJson(json); -} diff --git a/app/lib/feature/home/model/kmoni_config.freezed.dart b/app/lib/feature/home/model/kmoni_config.freezed.dart deleted file mode 100644 index 69156c3c..00000000 --- a/app/lib/feature/home/model/kmoni_config.freezed.dart +++ /dev/null @@ -1,165 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'kmoni_config.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -KmoniConfig _$KmoniConfigFromJson(Map json) { - return _KmoniConfig.fromJson(json); -} - -/// @nodoc -mixin _$KmoniConfig { - int get counter => throw _privateConstructorUsedError; - - /// Serializes this KmoniConfig to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of KmoniConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $KmoniConfigCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $KmoniConfigCopyWith<$Res> { - factory $KmoniConfigCopyWith( - KmoniConfig value, $Res Function(KmoniConfig) then) = - _$KmoniConfigCopyWithImpl<$Res, KmoniConfig>; - @useResult - $Res call({int counter}); -} - -/// @nodoc -class _$KmoniConfigCopyWithImpl<$Res, $Val extends KmoniConfig> - implements $KmoniConfigCopyWith<$Res> { - _$KmoniConfigCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of KmoniConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? counter = null, - }) { - return _then(_value.copyWith( - counter: null == counter - ? _value.counter - : counter // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$KmoniConfigImplCopyWith<$Res> - implements $KmoniConfigCopyWith<$Res> { - factory _$$KmoniConfigImplCopyWith( - _$KmoniConfigImpl value, $Res Function(_$KmoniConfigImpl) then) = - __$$KmoniConfigImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int counter}); -} - -/// @nodoc -class __$$KmoniConfigImplCopyWithImpl<$Res> - extends _$KmoniConfigCopyWithImpl<$Res, _$KmoniConfigImpl> - implements _$$KmoniConfigImplCopyWith<$Res> { - __$$KmoniConfigImplCopyWithImpl( - _$KmoniConfigImpl _value, $Res Function(_$KmoniConfigImpl) _then) - : super(_value, _then); - - /// Create a copy of KmoniConfig - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? counter = null, - }) { - return _then(_$KmoniConfigImpl( - counter: null == counter - ? _value.counter - : counter // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$KmoniConfigImpl implements _KmoniConfig { - const _$KmoniConfigImpl({this.counter = 0}); - - factory _$KmoniConfigImpl.fromJson(Map json) => - _$$KmoniConfigImplFromJson(json); - - @override - @JsonKey() - final int counter; - - @override - String toString() { - return 'KmoniConfig(counter: $counter)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$KmoniConfigImpl && - (identical(other.counter, counter) || other.counter == counter)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, counter); - - /// Create a copy of KmoniConfig - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$KmoniConfigImplCopyWith<_$KmoniConfigImpl> get copyWith => - __$$KmoniConfigImplCopyWithImpl<_$KmoniConfigImpl>(this, _$identity); - - @override - Map toJson() { - return _$$KmoniConfigImplToJson( - this, - ); - } -} - -abstract class _KmoniConfig implements KmoniConfig { - const factory _KmoniConfig({final int counter}) = _$KmoniConfigImpl; - - factory _KmoniConfig.fromJson(Map json) = - _$KmoniConfigImpl.fromJson; - - @override - int get counter; - - /// Create a copy of KmoniConfig - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$KmoniConfigImplCopyWith<_$KmoniConfigImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/app/lib/feature/home/model/kmoni_config.g.dart b/app/lib/feature/home/model/kmoni_config.g.dart deleted file mode 100644 index fcc5c8da..00000000 --- a/app/lib/feature/home/model/kmoni_config.g.dart +++ /dev/null @@ -1,26 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use - -part of 'kmoni_config.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$KmoniConfigImpl _$$KmoniConfigImplFromJson(Map json) => - $checkedCreate( - r'_$KmoniConfigImpl', - json, - ($checkedConvert) { - final val = _$KmoniConfigImpl( - counter: $checkedConvert('counter', (v) => (v as num?)?.toInt() ?? 0), - ); - return val; - }, - ); - -Map _$$KmoniConfigImplToJson(_$KmoniConfigImpl instance) => - { - 'counter': instance.counter, - }; diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart index e46952b5..f135816d 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart @@ -11,16 +11,17 @@ class KyoshinMonitorSettingsModel with _$KyoshinMonitorSettingsModel { @Default(null) double? minRealtimeShindo, /// スケールを表示するかどうか - @Default(true) bool showRealtimeShindoScale, + @Default(true) bool showScale, /// 強震モニタを使用するかどうか - @Default(false) bool useKmoni, + @Default(true) bool useKmoni, /// 現在地のマーカーを表示するかどうか @Default(false) bool showCurrentLocationMarker, /// 強震モニタ観測点のマーカーの種類 - @Default(KmoniMarkerType.onlyEew) KmoniMarkerType kmoniMarkerType, + @Default(KyoshinMonitorMarkerType.onlyEew) + KyoshinMonitorMarkerType kmoniMarkerType, /// 強震モニタのリアルタイムデータの種類 @Default(RealtimeDataType.shindo) RealtimeDataType realtimeDataType, @@ -74,7 +75,7 @@ enum KyoshinMonitorEndpoint { final String url; } -enum KmoniMarkerType { +enum KyoshinMonitorMarkerType { /// 常に枠を表示する always, diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart index 01b3961e..82b698ac 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart @@ -25,7 +25,7 @@ mixin _$KyoshinMonitorSettingsModel { double? get minRealtimeShindo => throw _privateConstructorUsedError; /// スケールを表示するかどうか - bool get showRealtimeShindoScale => throw _privateConstructorUsedError; + bool get showScale => throw _privateConstructorUsedError; /// 強震モニタを使用するかどうか bool get useKmoni => throw _privateConstructorUsedError; @@ -34,7 +34,8 @@ mixin _$KyoshinMonitorSettingsModel { bool get showCurrentLocationMarker => throw _privateConstructorUsedError; /// 強震モニタ観測点のマーカーの種類 - KmoniMarkerType get kmoniMarkerType => throw _privateConstructorUsedError; + KyoshinMonitorMarkerType get kmoniMarkerType => + throw _privateConstructorUsedError; /// 強震モニタのリアルタイムデータの種類 RealtimeDataType get realtimeDataType => throw _privateConstructorUsedError; @@ -65,10 +66,10 @@ abstract class $KyoshinMonitorSettingsModelCopyWith<$Res> { @useResult $Res call( {double? minRealtimeShindo, - bool showRealtimeShindoScale, + bool showScale, bool useKmoni, bool showCurrentLocationMarker, - KmoniMarkerType kmoniMarkerType, + KyoshinMonitorMarkerType kmoniMarkerType, RealtimeDataType realtimeDataType, RealtimeLayer realtimeLayer, KyoshinMonitorSettingsApiModel api}); @@ -93,7 +94,7 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, @override $Res call({ Object? minRealtimeShindo = freezed, - Object? showRealtimeShindoScale = null, + Object? showScale = null, Object? useKmoni = null, Object? showCurrentLocationMarker = null, Object? kmoniMarkerType = null, @@ -106,9 +107,9 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, ? _value.minRealtimeShindo : minRealtimeShindo // ignore: cast_nullable_to_non_nullable as double?, - showRealtimeShindoScale: null == showRealtimeShindoScale - ? _value.showRealtimeShindoScale - : showRealtimeShindoScale // ignore: cast_nullable_to_non_nullable + showScale: null == showScale + ? _value.showScale + : showScale // ignore: cast_nullable_to_non_nullable as bool, useKmoni: null == useKmoni ? _value.useKmoni @@ -121,7 +122,7 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, kmoniMarkerType: null == kmoniMarkerType ? _value.kmoniMarkerType : kmoniMarkerType // ignore: cast_nullable_to_non_nullable - as KmoniMarkerType, + as KyoshinMonitorMarkerType, realtimeDataType: null == realtimeDataType ? _value.realtimeDataType : realtimeDataType // ignore: cast_nullable_to_non_nullable @@ -159,10 +160,10 @@ abstract class _$$KyoshinMonitorSettingsModelImplCopyWith<$Res> @useResult $Res call( {double? minRealtimeShindo, - bool showRealtimeShindoScale, + bool showScale, bool useKmoni, bool showCurrentLocationMarker, - KmoniMarkerType kmoniMarkerType, + KyoshinMonitorMarkerType kmoniMarkerType, RealtimeDataType realtimeDataType, RealtimeLayer realtimeLayer, KyoshinMonitorSettingsApiModel api}); @@ -187,7 +188,7 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> @override $Res call({ Object? minRealtimeShindo = freezed, - Object? showRealtimeShindoScale = null, + Object? showScale = null, Object? useKmoni = null, Object? showCurrentLocationMarker = null, Object? kmoniMarkerType = null, @@ -200,9 +201,9 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> ? _value.minRealtimeShindo : minRealtimeShindo // ignore: cast_nullable_to_non_nullable as double?, - showRealtimeShindoScale: null == showRealtimeShindoScale - ? _value.showRealtimeShindoScale - : showRealtimeShindoScale // ignore: cast_nullable_to_non_nullable + showScale: null == showScale + ? _value.showScale + : showScale // ignore: cast_nullable_to_non_nullable as bool, useKmoni: null == useKmoni ? _value.useKmoni @@ -215,7 +216,7 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> kmoniMarkerType: null == kmoniMarkerType ? _value.kmoniMarkerType : kmoniMarkerType // ignore: cast_nullable_to_non_nullable - as KmoniMarkerType, + as KyoshinMonitorMarkerType, realtimeDataType: null == realtimeDataType ? _value.realtimeDataType : realtimeDataType // ignore: cast_nullable_to_non_nullable @@ -238,10 +239,10 @@ class _$KyoshinMonitorSettingsModelImpl implements _KyoshinMonitorSettingsModel { const _$KyoshinMonitorSettingsModelImpl( {this.minRealtimeShindo = null, - this.showRealtimeShindoScale = true, - this.useKmoni = false, + this.showScale = true, + this.useKmoni = true, this.showCurrentLocationMarker = false, - this.kmoniMarkerType = KmoniMarkerType.onlyEew, + this.kmoniMarkerType = KyoshinMonitorMarkerType.onlyEew, this.realtimeDataType = RealtimeDataType.shindo, this.realtimeLayer = RealtimeLayer.surface, this.api = const KyoshinMonitorSettingsApiModel()}); @@ -258,7 +259,7 @@ class _$KyoshinMonitorSettingsModelImpl /// スケールを表示するかどうか @override @JsonKey() - final bool showRealtimeShindoScale; + final bool showScale; /// 強震モニタを使用するかどうか @override @@ -273,7 +274,7 @@ class _$KyoshinMonitorSettingsModelImpl /// 強震モニタ観測点のマーカーの種類 @override @JsonKey() - final KmoniMarkerType kmoniMarkerType; + final KyoshinMonitorMarkerType kmoniMarkerType; /// 強震モニタのリアルタイムデータの種類 @override @@ -292,7 +293,7 @@ class _$KyoshinMonitorSettingsModelImpl @override String toString() { - return 'KyoshinMonitorSettingsModel(minRealtimeShindo: $minRealtimeShindo, showRealtimeShindoScale: $showRealtimeShindoScale, useKmoni: $useKmoni, showCurrentLocationMarker: $showCurrentLocationMarker, kmoniMarkerType: $kmoniMarkerType, realtimeDataType: $realtimeDataType, realtimeLayer: $realtimeLayer, api: $api)'; + return 'KyoshinMonitorSettingsModel(minRealtimeShindo: $minRealtimeShindo, showScale: $showScale, useKmoni: $useKmoni, showCurrentLocationMarker: $showCurrentLocationMarker, kmoniMarkerType: $kmoniMarkerType, realtimeDataType: $realtimeDataType, realtimeLayer: $realtimeLayer, api: $api)'; } @override @@ -302,9 +303,8 @@ class _$KyoshinMonitorSettingsModelImpl other is _$KyoshinMonitorSettingsModelImpl && (identical(other.minRealtimeShindo, minRealtimeShindo) || other.minRealtimeShindo == minRealtimeShindo) && - (identical( - other.showRealtimeShindoScale, showRealtimeShindoScale) || - other.showRealtimeShindoScale == showRealtimeShindoScale) && + (identical(other.showScale, showScale) || + other.showScale == showScale) && (identical(other.useKmoni, useKmoni) || other.useKmoni == useKmoni) && (identical(other.showCurrentLocationMarker, @@ -324,7 +324,7 @@ class _$KyoshinMonitorSettingsModelImpl int get hashCode => Object.hash( runtimeType, minRealtimeShindo, - showRealtimeShindoScale, + showScale, useKmoni, showCurrentLocationMarker, kmoniMarkerType, @@ -353,10 +353,10 @@ abstract class _KyoshinMonitorSettingsModel implements KyoshinMonitorSettingsModel { const factory _KyoshinMonitorSettingsModel( {final double? minRealtimeShindo, - final bool showRealtimeShindoScale, + final bool showScale, final bool useKmoni, final bool showCurrentLocationMarker, - final KmoniMarkerType kmoniMarkerType, + final KyoshinMonitorMarkerType kmoniMarkerType, final RealtimeDataType realtimeDataType, final RealtimeLayer realtimeLayer, final KyoshinMonitorSettingsApiModel api}) = @@ -371,7 +371,7 @@ abstract class _KyoshinMonitorSettingsModel /// スケールを表示するかどうか @override - bool get showRealtimeShindoScale; + bool get showScale; /// 強震モニタを使用するかどうか @override @@ -383,7 +383,7 @@ abstract class _KyoshinMonitorSettingsModel /// 強震モニタ観測点のマーカーの種類 @override - KmoniMarkerType get kmoniMarkerType; + KyoshinMonitorMarkerType get kmoniMarkerType; /// 強震モニタのリアルタイムデータの種類 @override diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart index 34d6051c..4a4cd0b1 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart @@ -17,16 +17,15 @@ _$KyoshinMonitorSettingsModelImpl _$$KyoshinMonitorSettingsModelImplFromJson( final val = _$KyoshinMonitorSettingsModelImpl( minRealtimeShindo: $checkedConvert( 'min_realtime_shindo', (v) => (v as num?)?.toDouble() ?? null), - showRealtimeShindoScale: $checkedConvert( - 'show_realtime_shindo_scale', (v) => v as bool? ?? true), - useKmoni: $checkedConvert('use_kmoni', (v) => v as bool? ?? false), + showScale: $checkedConvert('show_scale', (v) => v as bool? ?? true), + useKmoni: $checkedConvert('use_kmoni', (v) => v as bool? ?? true), showCurrentLocationMarker: $checkedConvert( 'show_current_location_marker', (v) => v as bool? ?? false), kmoniMarkerType: $checkedConvert( 'kmoni_marker_type', (v) => - $enumDecodeNullable(_$KmoniMarkerTypeEnumMap, v) ?? - KmoniMarkerType.onlyEew), + $enumDecodeNullable(_$KyoshinMonitorMarkerTypeEnumMap, v) ?? + KyoshinMonitorMarkerType.onlyEew), realtimeDataType: $checkedConvert( 'realtime_data_type', (v) => @@ -48,7 +47,7 @@ _$KyoshinMonitorSettingsModelImpl _$$KyoshinMonitorSettingsModelImplFromJson( }, fieldKeyMap: const { 'minRealtimeShindo': 'min_realtime_shindo', - 'showRealtimeShindoScale': 'show_realtime_shindo_scale', + 'showScale': 'show_scale', 'useKmoni': 'use_kmoni', 'showCurrentLocationMarker': 'show_current_location_marker', 'kmoniMarkerType': 'kmoni_marker_type', @@ -61,20 +60,21 @@ Map _$$KyoshinMonitorSettingsModelImplToJson( _$KyoshinMonitorSettingsModelImpl instance) => { 'min_realtime_shindo': instance.minRealtimeShindo, - 'show_realtime_shindo_scale': instance.showRealtimeShindoScale, + 'show_scale': instance.showScale, 'use_kmoni': instance.useKmoni, 'show_current_location_marker': instance.showCurrentLocationMarker, - 'kmoni_marker_type': _$KmoniMarkerTypeEnumMap[instance.kmoniMarkerType]!, + 'kmoni_marker_type': + _$KyoshinMonitorMarkerTypeEnumMap[instance.kmoniMarkerType]!, 'realtime_data_type': _$RealtimeDataTypeEnumMap[instance.realtimeDataType]!, 'realtime_layer': _$RealtimeLayerEnumMap[instance.realtimeLayer]!, 'api': instance.api, }; -const _$KmoniMarkerTypeEnumMap = { - KmoniMarkerType.always: 'always', - KmoniMarkerType.onlyEew: 'onlyEew', - KmoniMarkerType.never: 'never', +const _$KyoshinMonitorMarkerTypeEnumMap = { + KyoshinMonitorMarkerType.always: 'always', + KyoshinMonitorMarkerType.onlyEew: 'onlyEew', + KyoshinMonitorMarkerType.never: 'never', }; const _$RealtimeDataTypeEnumMap = { diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart index 01d78957..7dc33f92 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart @@ -1,13 +1,17 @@ import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart'; -import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/gen/fonts.gen.dart'; import 'package:flutter/material.dart' hide ConnectionState; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class KyoshinMonitorStatusCard extends ConsumerWidget { - const KyoshinMonitorStatusCard({super.key}); + const KyoshinMonitorStatusCard({ + this.onTap, + super.key, + }); + + final void Function()? onTap; @override Widget build(BuildContext context, WidgetRef ref) { @@ -15,13 +19,6 @@ class KyoshinMonitorStatusCard extends ConsumerWidget { final isInitialized = state.hasValue; final latestTime = state.valueOrNull?.lastUpdatedAt?.toLocal(); final status = state.valueOrNull?.status ?? KyoshinMonitorStatus.stopped; - final useKmoni = ref.watch( - kyoshinMonitorSettingsProvider.select((value) => value.useKmoni), - ); - - if (!useKmoni) { - return const SizedBox.shrink(); - } final theme = Theme.of(context); final dateFormat = DateFormat('yyyy/MM/dd HH:mm:ss'); @@ -37,6 +34,7 @@ class KyoshinMonitorStatusCard extends ConsumerWidget { child: Tooltip( message: '強震モニタ', child: InkWell( + onTap: onTap, borderRadius: BorderRadius.circular(8), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), diff --git a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart index 365055f3..595a0c42 100644 --- a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart +++ b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:ui'; import 'package:eqmonitor/core/component/sheet/app_sheet_route.dart'; +import 'package:eqmonitor/core/component/widget/app_list_tile.dart'; import 'package:eqmonitor/core/router/router.dart'; import 'package:eqmonitor/core/util/haptic.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart'; @@ -18,7 +19,12 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { static Future show(BuildContext context) => Navigator.of(context).push( AppSheetRoute( - builder: (context) => const KyoshinMonitorSettingsModal(), + builder: (context) => const ClipRRect( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + child: KyoshinMonitorSettingsModal(), + ), ), ); @@ -46,7 +52,7 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { tileMode: TileMode.mirror, ), inner: ColorFilter.mode( - colorScheme.surfaceContainerLow.withValues(alpha: 0.8), + colorScheme.surfaceContainerLow.withValues(alpha: 0.7), BlendMode.srcATop, ), ), @@ -151,13 +157,13 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { ), value: ref .watch(kyoshinMonitorSettingsProvider) - .showRealtimeShindoScale, + .showScale, onChanged: (value) async => ref .read(kyoshinMonitorSettingsProvider.notifier) .save( ref .read(kyoshinMonitorSettingsProvider) - .copyWith(showRealtimeShindoScale: value), + .copyWith(showScale: value), ), ), SwitchListTile.adaptive( @@ -197,27 +203,14 @@ class _KyoshinMonitorSwitchListTile extends ConsumerWidget { final isEnabled = ref.watch(kyoshinMonitorSettingsProvider.select((v) => v.useKmoni)); - final theme = Theme.of(context); - final colorScheme = theme.colorScheme; - final backgroundColor = colorScheme.secondaryContainer; return Padding( padding: const EdgeInsets.symmetric( horizontal: 8, vertical: 4, ), - child: SwitchListTile.adaptive( - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - tileColor: backgroundColor, - title: const Text( - '強震モニタを利用する', - style: TextStyle(fontWeight: FontWeight.bold), - ), - subtitle: const Text('強震モニタを利用するかどうかを選択します'), + child: AppListTile.switchListTile( + title: '強震モニタを利用する', + subtitle: '強震モニタを利用するかどうかを選択します', value: isEnabled, onChanged: (value) async => selectionHapticFunction( () async => ref.read(kyoshinMonitorSettingsProvider.notifier).save( @@ -354,26 +347,26 @@ class _MarkerTypeSelector extends StatelessWidget { required this.onChanged, }); - final KmoniMarkerType value; - final void Function(KmoniMarkerType) onChanged; + final KyoshinMonitorMarkerType value; + final void Function(KyoshinMonitorMarkerType) onChanged; @override Widget build(BuildContext context) { - return DropdownMenu( + return DropdownMenu( initialSelection: value, onSelected: (value) { if (value != null) { onChanged(value); } }, - dropdownMenuEntries: KmoniMarkerType.values + dropdownMenuEntries: KyoshinMonitorMarkerType.values .map( (value) => DropdownMenuEntry( value: value, label: switch (value) { - KmoniMarkerType.always => '常に表示', - KmoniMarkerType.onlyEew => 'EEW時のみ', - KmoniMarkerType.never => '表示しない', + KyoshinMonitorMarkerType.always => '常に表示', + KyoshinMonitorMarkerType.onlyEew => 'EEW時のみ', + KyoshinMonitorMarkerType.never => '表示しない', }, ), ) diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index 9ac7e9d3..7084df5f 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -43,7 +43,7 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { visible: true, points: points, isInEew: false, - markerType: KmoniMarkerType.always, + markerType: KyoshinMonitorMarkerType.always, realtimeDataType: RealtimeDataType.shindo, ); } @@ -73,7 +73,7 @@ class KyoshinMonitorObservationLayer extends IMapLayer { final List points; final bool isInEew; - final KmoniMarkerType markerType; + final KyoshinMonitorMarkerType markerType; final RealtimeDataType realtimeDataType; @override @@ -96,8 +96,8 @@ class KyoshinMonitorObservationLayer extends IMapLayer { 'intensity': e.observation.scaleToIntensity, 'name': e.point.code, 'strokeOpacity': switch (markerType) { - KmoniMarkerType.always => 1.0, - KmoniMarkerType.onlyEew when isInEew => 1.0, + KyoshinMonitorMarkerType.always => 1.0, + KyoshinMonitorMarkerType.onlyEew when isInEew => 1.0, _ => 0.0, }, }, @@ -149,5 +149,5 @@ class KyoshinMonitorObservationLayer extends IMapLayer { } @override - String get layerPropertiesHash => ''; + String get layerPropertiesHash => '${markerType.index}'; } diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart index 4c4321b9..dbedd93d 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart @@ -9,7 +9,7 @@ part of 'kyoshin_monitor_layer_controller.dart'; // ************************************************************************** String _$kyoshinMonitorLayerControllerHash() => - r'95c22c35d60af17cd8de9f58691e1f63d696dd59'; + r'95019261f39872cc53733f50357cd0be4b3c1856'; /// 強震モニタの観測点レイヤーを管理するコントローラー /// diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index bc434dc4..aafab1f1 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -133,14 +133,15 @@ class _DeclarativeMapState extends ConsumerState { if (cachedLayer.layer != layer) { // キャッシュ済みレイヤーと同じかどうか // style check - final cachedLayerProperties = cachedLayer.layerPropertiesHash; - final layerProperties = layer.layerPropertiesHash; - if (cachedLayerProperties != layerProperties) { + final cachedLayerPropertiesHash = cachedLayer.layerPropertiesHash; + final layerPropertiesHash = layer.layerPropertiesHash; + if (cachedLayerPropertiesHash != layerPropertiesHash) { log('layer properties changed'); await controller.removeLayer(layer.id); await controller.removeSource(layer.sourceId); await _addLayer(layer); _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); + log('layer properties changed: ${layer.toLayerProperties().toJson()}'); continue; } @@ -197,7 +198,7 @@ class _DeclarativeMapState extends ConsumerState { _updateAllLayers(), ); } - if (oldWidget.layers != widget.layers ) { + if (oldWidget.layers != widget.layers) { unawaited( _updateLayers(), ); From 2b479e2157e595b20bab536f992690f7175859e2 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sat, 8 Feb 2025 03:25:33 +0900 Subject: [PATCH 09/70] =?UTF-8?q?refactor:=20HomeView=E3=81=8B=E3=82=89Hom?= =?UTF-8?q?ePage=E3=81=AB=E3=83=AA=E3=83=8D=E3=83=BC=E3=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/core/router/router.dart | 4 ++-- .../home_view.dart => page/home_page.dart} | 4 ++-- .../children/config/debug/debugger_page.dart | 17 ----------------- 3 files changed, 4 insertions(+), 21 deletions(-) rename app/lib/feature/home/{view/home_view.dart => page/home_page.dart} (83%) diff --git a/app/lib/core/router/router.dart b/app/lib/core/router/router.dart index 1ff4fc0d..91abae3f 100644 --- a/app/lib/core/router/router.dart +++ b/app/lib/core/router/router.dart @@ -12,7 +12,7 @@ import 'package:eqmonitor/feature/earthquake_history_details/ui/screen/earthquak import 'package:eqmonitor/feature/earthquake_history_early/ui/earthquake_history_early_details_screen.dart'; import 'package:eqmonitor/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart'; import 'package:eqmonitor/feature/eew/ui/screen/eew_details_by_event_id_page.dart'; -import 'package:eqmonitor/feature/home/view/home_view.dart'; +import 'package:eqmonitor/feature/home/page/home_page.dart'; import 'package:eqmonitor/feature/information_history/page/information_history_page.dart'; import 'package:eqmonitor/feature/information_history_details/information_history_details_page.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/page/kyoshin_monitor_about_observation_network_page.dart'; @@ -170,7 +170,7 @@ class HomeRoute extends GoRouteData { @override Page buildPage(BuildContext context, GoRouterState state) => const MaterialExtendedPage( - child: HomeView(), + child: HomePage(), ); } diff --git a/app/lib/feature/home/view/home_view.dart b/app/lib/feature/home/page/home_page.dart similarity index 83% rename from app/lib/feature/home/view/home_view.dart rename to app/lib/feature/home/page/home_page.dart index 28abe02c..f2d9b88c 100644 --- a/app/lib/feature/home/view/home_view.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -2,8 +2,8 @@ import 'package:eqmonitor/feature/home/component/map/home_map_view.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -class HomeView extends HookConsumerWidget { - const HomeView({super.key}); +class HomePage extends HookConsumerWidget { + const HomePage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { diff --git a/app/lib/feature/settings/children/config/debug/debugger_page.dart b/app/lib/feature/settings/children/config/debug/debugger_page.dart index 35e98f29..a93a7197 100644 --- a/app/lib/feature/settings/children/config/debug/debugger_page.dart +++ b/app/lib/feature/settings/children/config/debug/debugger_page.dart @@ -4,7 +4,6 @@ import 'package:eqmonitor/core/provider/telegram_url/provider/telegram_url_provi import 'package:eqmonitor/core/router/router.dart'; import 'package:eqmonitor/core/util/env.dart'; import 'package:eqmonitor/feature/home/component/sheet/sheet_header.dart'; -import 'package:eqmonitor/feature/home/features/eew_settings/eew_settings_notifier.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/playground/playground_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; @@ -38,8 +37,6 @@ class _DebugWidget extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final theme = Theme.of(context); - final eewSettings = ref.watch(eewSettingsNotifierProvider); - return Card( margin: const EdgeInsets.all(4), elevation: 1, @@ -61,20 +58,6 @@ class _DebugWidget extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ const SheetHeader(title: 'デバッグメニュー'), - SwitchListTile.adaptive( - value: eewSettings.showCalculatedRegionIntensity, - onChanged: (value) async => ref - .read(eewSettingsNotifierProvider.notifier) - .setShowCalculatedRegionIntensity(value: value), - title: const Text('距離減衰式による予想震度(Region)'), - ), - SwitchListTile.adaptive( - value: eewSettings.showCalculatedCityIntensity, - onChanged: (value) async => ref - .read(eewSettingsNotifierProvider.notifier) - .setShowCalculatedCityIntensity(value: value), - title: const Text('距離減衰式による予想震度(City)'), - ), ListTile( title: const Text('Flavor'), leading: const Icon(Icons.flag), From 65d8c8d7156c9c034deec668d32a40f0a9c481c3 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sat, 8 Feb 2025 05:13:12 +0900 Subject: [PATCH 10/70] feat: Add location marker configuration and permission handling - Implement location marker toggle in home map layer modal - Add permission handling for location services - Remove deprecated `showCurrentLocationMarker` from KyoshinMonitorSettingsModel - Update DeclarativeMap to support dynamic location marker rendering - Enhance home map content with location marker configuration --- .../home/component/map/home_map_content.dart | 16 +- .../component/map/home_map_layer_modal.dart | 154 ++++++++ .../data/model/home_configuration_model.dart | 15 + .../home_configuration_model.freezed.dart | 176 +++++++++ .../model/home_configuration_model.g.dart | 30 ++ .../notifier/home_configuration_notifier.dart | 34 ++ .../home_configuration_notifier.g.dart | 30 ++ .../model/kyoshin_monitor_settings_model.dart | 3 - ...yoshin_monitor_settings_model.freezed.dart | 43 +-- .../kyoshin_monitor_settings_model.g.dart | 4 - .../page/kyoshin_monitor_settings_modal.dart | 17 - .../kyoshin_monitor_layer_controller.dart | 93 +++-- ...shin_monitor_layer_controller.freezed.dart | 341 ++++++++++++++++++ .../kyoshin_monitor_layer_controller.g.dart | 6 +- .../map/data/layer/base/i_map_layer.dart | 18 +- app/lib/feature/map/ui/declarative_map.dart | 11 + app/lib/main.dart | 8 +- 17 files changed, 887 insertions(+), 112 deletions(-) create mode 100644 app/lib/feature/home/data/model/home_configuration_model.dart create mode 100644 app/lib/feature/home/data/model/home_configuration_model.freezed.dart create mode 100644 app/lib/feature/home/data/model/home_configuration_model.g.dart create mode 100644 app/lib/feature/home/data/notifier/home_configuration_notifier.dart create mode 100644 app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart create mode 100644 app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart index 32fd2c1b..9654372f 100644 --- a/app/lib/feature/home/component/map/home_map_content.dart +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -1,3 +1,4 @@ +import 'package:eqmonitor/feature/home/data/notifier/home_configuration_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; @@ -6,6 +7,7 @@ import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.d import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:maplibre_gl/maplibre_gl.dart'; class HomeMapContent extends HookConsumerWidget { const HomeMapContent({ @@ -21,8 +23,9 @@ class HomeMapContent extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { // 強震モニタレイヤーの監視 final kyoshinLayer = ref.watch(kyoshinMonitorLayerControllerProvider); - final isKyoshinLayerEnabled = - ref.watch(kyoshinMonitorSettingsProvider.select((v) => v.useKmoni)); + final isKyoshinLayerEnabled = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.useKmoni), + ); // スタイルの監視 final configurationState = ref.watch(mapConfigurationNotifierProvider); final configuration = configurationState.valueOrNull; @@ -37,12 +40,19 @@ class HomeMapContent extends HookConsumerWidget { if (styleString == null) { throw ArgumentError('styleString is null'); } + + final homeConfiguration = ref.watch(homeConfigurationNotifierProvider); + return DeclarativeMap( + myLocationEnabled: homeConfiguration.showLocation, + myLocationRenderMode: homeConfiguration.showLocation + ? MyLocationRenderMode.compass + : MyLocationRenderMode.normal, styleString: styleString, controller: mapController, initialCameraPosition: cameraPosition, layers: [ - if (kyoshinLayer != null && isKyoshinLayerEnabled) kyoshinLayer, + if (isKyoshinLayerEnabled) kyoshinLayer, ], ); } diff --git a/app/lib/feature/home/component/map/home_map_layer_modal.dart b/app/lib/feature/home/component/map/home_map_layer_modal.dart index 5780e208..c7edee1f 100644 --- a/app/lib/feature/home/component/map/home_map_layer_modal.dart +++ b/app/lib/feature/home/component/map/home_map_layer_modal.dart @@ -3,6 +3,9 @@ import 'dart:ui'; import 'package:eqmonitor/core/component/sheet/app_sheet_route.dart'; import 'package:eqmonitor/core/component/widget/app_list_tile.dart'; +import 'package:eqmonitor/core/provider/config/permission/permission_notifier.dart'; +import 'package:eqmonitor/core/util/haptic.dart'; +import 'package:eqmonitor/feature/home/data/notifier/home_configuration_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart'; import 'package:flutter/material.dart'; @@ -69,12 +72,163 @@ class HomeMapLayerModal extends HookConsumerWidget { const SliverToBoxAdapter( child: _KyoshinMonitorIsEnabledTile(), ), + const SliverToBoxAdapter( + child: _LocationSettingCards(), + ), ], ), ); } } +class _LocationSettingCards extends ConsumerWidget { + const _LocationSettingCards(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = Theme.of(context); + final config = ref.watch(homeConfigurationNotifierProvider); + final permissionState = ref.watch(permissionNotifierProvider); + + return Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '現在位置マーカー', + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Row( + children: [ + Expanded( + child: _LocationCard( + title: '非表示', + icon: Icons.location_off_outlined, + isSelected: !config.showLocation, + onTap: () async => lightHapticFunction( + () async => ref + .read(homeConfigurationNotifierProvider.notifier) + .save( + config.copyWith(showLocation: false), + ), + ), + ), + ), + Expanded( + child: _LocationCard( + title: '表示', + icon: Icons.location_on_outlined, + isSelected: config.showLocation, + subtitle: !permissionState.location ? '位置情報が許可されていません' : null, + onTap: () async => lightHapticFunction( + () async { + // 位置情報の権限がない場合は要求する + if (!permissionState.location) { + await ref + .read(permissionNotifierProvider.notifier) + .requestLocationWhenInUsePermission(); + // 権限が付与されなかった場合は早期リターン + if (!ref.read(permissionNotifierProvider).location) { + return; + } + } + // 権限がある場合は位置情報表示を有効化 + await ref + .read(homeConfigurationNotifierProvider.notifier) + .save( + config.copyWith(showLocation: true), + ); + }, + ), + ), + ), + ], + ), + ], + ), + ); + } +} + +class _LocationCard extends StatelessWidget { + const _LocationCard({ + required this.title, + required this.icon, + required this.isSelected, + required this.onTap, + this.subtitle, + }); + + final String title; + final IconData icon; + final bool isSelected; + final VoidCallback onTap; + final String? subtitle; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colorScheme = theme.colorScheme; + + return Card.outlined( + elevation: 0, + color: isSelected + ? colorScheme.primaryContainer + : colorScheme.surfaceContainer, + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(12), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 12, + horizontal: 16, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + icon, + color: isSelected + ? colorScheme.onPrimaryContainer + : colorScheme.onSurfaceVariant, + ), + const SizedBox(width: 8), + Text( + title, + style: theme.textTheme.bodyMedium?.copyWith( + color: isSelected + ? colorScheme.onPrimaryContainer + : colorScheme.onSurfaceVariant, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + if (subtitle != null) ...[ + const SizedBox(height: 4), + Text( + subtitle!, + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.error, + ), + textAlign: TextAlign.center, + ), + ], + ], + ), + ), + ), + ); + } +} + class _KyoshinMonitorIsEnabledTile extends ConsumerWidget { const _KyoshinMonitorIsEnabledTile(); diff --git a/app/lib/feature/home/data/model/home_configuration_model.dart b/app/lib/feature/home/data/model/home_configuration_model.dart new file mode 100644 index 00000000..9269598a --- /dev/null +++ b/app/lib/feature/home/data/model/home_configuration_model.dart @@ -0,0 +1,15 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'home_configuration_model.freezed.dart'; +part 'home_configuration_model.g.dart'; + +@freezed +class HomeConfigurationModel with _$HomeConfigurationModel { + const factory HomeConfigurationModel({ + /// 位置情報を表示するかどうか + @Default(false) bool showLocation, + }) = _HomeConfigurationModel; + + factory HomeConfigurationModel.fromJson(Map json) => + _$HomeConfigurationModelFromJson(json); +} diff --git a/app/lib/feature/home/data/model/home_configuration_model.freezed.dart b/app/lib/feature/home/data/model/home_configuration_model.freezed.dart new file mode 100644 index 00000000..85b132ed --- /dev/null +++ b/app/lib/feature/home/data/model/home_configuration_model.freezed.dart @@ -0,0 +1,176 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'home_configuration_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +HomeConfigurationModel _$HomeConfigurationModelFromJson( + Map json) { + return _HomeConfigurationModel.fromJson(json); +} + +/// @nodoc +mixin _$HomeConfigurationModel { + /// 位置情報を表示するかどうか + bool get showLocation => throw _privateConstructorUsedError; + + /// Serializes this HomeConfigurationModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of HomeConfigurationModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $HomeConfigurationModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $HomeConfigurationModelCopyWith<$Res> { + factory $HomeConfigurationModelCopyWith(HomeConfigurationModel value, + $Res Function(HomeConfigurationModel) then) = + _$HomeConfigurationModelCopyWithImpl<$Res, HomeConfigurationModel>; + @useResult + $Res call({bool showLocation}); +} + +/// @nodoc +class _$HomeConfigurationModelCopyWithImpl<$Res, + $Val extends HomeConfigurationModel> + implements $HomeConfigurationModelCopyWith<$Res> { + _$HomeConfigurationModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of HomeConfigurationModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? showLocation = null, + }) { + return _then(_value.copyWith( + showLocation: null == showLocation + ? _value.showLocation + : showLocation // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$HomeConfigurationModelImplCopyWith<$Res> + implements $HomeConfigurationModelCopyWith<$Res> { + factory _$$HomeConfigurationModelImplCopyWith( + _$HomeConfigurationModelImpl value, + $Res Function(_$HomeConfigurationModelImpl) then) = + __$$HomeConfigurationModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool showLocation}); +} + +/// @nodoc +class __$$HomeConfigurationModelImplCopyWithImpl<$Res> + extends _$HomeConfigurationModelCopyWithImpl<$Res, + _$HomeConfigurationModelImpl> + implements _$$HomeConfigurationModelImplCopyWith<$Res> { + __$$HomeConfigurationModelImplCopyWithImpl( + _$HomeConfigurationModelImpl _value, + $Res Function(_$HomeConfigurationModelImpl) _then) + : super(_value, _then); + + /// Create a copy of HomeConfigurationModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? showLocation = null, + }) { + return _then(_$HomeConfigurationModelImpl( + showLocation: null == showLocation + ? _value.showLocation + : showLocation // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$HomeConfigurationModelImpl implements _HomeConfigurationModel { + const _$HomeConfigurationModelImpl({this.showLocation = false}); + + factory _$HomeConfigurationModelImpl.fromJson(Map json) => + _$$HomeConfigurationModelImplFromJson(json); + + /// 位置情報を表示するかどうか + @override + @JsonKey() + final bool showLocation; + + @override + String toString() { + return 'HomeConfigurationModel(showLocation: $showLocation)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$HomeConfigurationModelImpl && + (identical(other.showLocation, showLocation) || + other.showLocation == showLocation)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, showLocation); + + /// Create a copy of HomeConfigurationModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$HomeConfigurationModelImplCopyWith<_$HomeConfigurationModelImpl> + get copyWith => __$$HomeConfigurationModelImplCopyWithImpl< + _$HomeConfigurationModelImpl>(this, _$identity); + + @override + Map toJson() { + return _$$HomeConfigurationModelImplToJson( + this, + ); + } +} + +abstract class _HomeConfigurationModel implements HomeConfigurationModel { + const factory _HomeConfigurationModel({final bool showLocation}) = + _$HomeConfigurationModelImpl; + + factory _HomeConfigurationModel.fromJson(Map json) = + _$HomeConfigurationModelImpl.fromJson; + + /// 位置情報を表示するかどうか + @override + bool get showLocation; + + /// Create a copy of HomeConfigurationModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$HomeConfigurationModelImplCopyWith<_$HomeConfigurationModelImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/app/lib/feature/home/data/model/home_configuration_model.g.dart b/app/lib/feature/home/data/model/home_configuration_model.g.dart new file mode 100644 index 00000000..f8134fc2 --- /dev/null +++ b/app/lib/feature/home/data/model/home_configuration_model.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use + +part of 'home_configuration_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$HomeConfigurationModelImpl _$$HomeConfigurationModelImplFromJson( + Map json) => + $checkedCreate( + r'_$HomeConfigurationModelImpl', + json, + ($checkedConvert) { + final val = _$HomeConfigurationModelImpl( + showLocation: + $checkedConvert('show_location', (v) => v as bool? ?? false), + ); + return val; + }, + fieldKeyMap: const {'showLocation': 'show_location'}, + ); + +Map _$$HomeConfigurationModelImplToJson( + _$HomeConfigurationModelImpl instance) => + { + 'show_location': instance.showLocation, + }; diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart new file mode 100644 index 00000000..f85f5551 --- /dev/null +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart @@ -0,0 +1,34 @@ +import 'dart:convert'; + +import 'package:eqmonitor/core/provider/shared_preferences.dart'; +import 'package:eqmonitor/feature/home/data/model/home_configuration_model.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +part 'home_configuration_notifier.g.dart'; + +@riverpod +class HomeConfigurationNotifier extends _$HomeConfigurationNotifier { + @override + HomeConfigurationModel build() { + return const HomeConfigurationModel(); + } + + static const _key = 'home_configuration'; + + HomeConfigurationModel? load() { + final jsonString = ref.read(sharedPreferencesProvider).getString(_key); + if (jsonString == null) { + return null; + } + final json = jsonDecode(jsonString) as Map; + return HomeConfigurationModel.fromJson(json); + } + + Future save(HomeConfigurationModel configuration) async { + state = configuration; + await ref.read(sharedPreferencesProvider).setString( + _key, + configuration.toJson().toString(), + ); + } +} diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart new file mode 100644 index 00000000..881fcbdb --- /dev/null +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart @@ -0,0 +1,30 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use + +part of 'home_configuration_notifier.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$homeConfigurationNotifierHash() => + r'070781e9982ded06f18104eb8fb052c0a8f6b79a'; + +/// See also [HomeConfigurationNotifier]. +@ProviderFor(HomeConfigurationNotifier) +final homeConfigurationNotifierProvider = AutoDisposeNotifierProvider< + HomeConfigurationNotifier, HomeConfigurationModel>.internal( + HomeConfigurationNotifier.new, + name: r'homeConfigurationNotifierProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$homeConfigurationNotifierHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$HomeConfigurationNotifier + = AutoDisposeNotifier; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart index f135816d..20c9106d 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart @@ -16,9 +16,6 @@ class KyoshinMonitorSettingsModel with _$KyoshinMonitorSettingsModel { /// 強震モニタを使用するかどうか @Default(true) bool useKmoni, - /// 現在地のマーカーを表示するかどうか - @Default(false) bool showCurrentLocationMarker, - /// 強震モニタ観測点のマーカーの種類 @Default(KyoshinMonitorMarkerType.onlyEew) KyoshinMonitorMarkerType kmoniMarkerType, diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart index 82b698ac..cca06c22 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart @@ -30,9 +30,6 @@ mixin _$KyoshinMonitorSettingsModel { /// 強震モニタを使用するかどうか bool get useKmoni => throw _privateConstructorUsedError; - /// 現在地のマーカーを表示するかどうか - bool get showCurrentLocationMarker => throw _privateConstructorUsedError; - /// 強震モニタ観測点のマーカーの種類 KyoshinMonitorMarkerType get kmoniMarkerType => throw _privateConstructorUsedError; @@ -68,7 +65,6 @@ abstract class $KyoshinMonitorSettingsModelCopyWith<$Res> { {double? minRealtimeShindo, bool showScale, bool useKmoni, - bool showCurrentLocationMarker, KyoshinMonitorMarkerType kmoniMarkerType, RealtimeDataType realtimeDataType, RealtimeLayer realtimeLayer, @@ -96,7 +92,6 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, Object? minRealtimeShindo = freezed, Object? showScale = null, Object? useKmoni = null, - Object? showCurrentLocationMarker = null, Object? kmoniMarkerType = null, Object? realtimeDataType = null, Object? realtimeLayer = null, @@ -115,10 +110,6 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, ? _value.useKmoni : useKmoni // ignore: cast_nullable_to_non_nullable as bool, - showCurrentLocationMarker: null == showCurrentLocationMarker - ? _value.showCurrentLocationMarker - : showCurrentLocationMarker // ignore: cast_nullable_to_non_nullable - as bool, kmoniMarkerType: null == kmoniMarkerType ? _value.kmoniMarkerType : kmoniMarkerType // ignore: cast_nullable_to_non_nullable @@ -162,7 +153,6 @@ abstract class _$$KyoshinMonitorSettingsModelImplCopyWith<$Res> {double? minRealtimeShindo, bool showScale, bool useKmoni, - bool showCurrentLocationMarker, KyoshinMonitorMarkerType kmoniMarkerType, RealtimeDataType realtimeDataType, RealtimeLayer realtimeLayer, @@ -190,7 +180,6 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> Object? minRealtimeShindo = freezed, Object? showScale = null, Object? useKmoni = null, - Object? showCurrentLocationMarker = null, Object? kmoniMarkerType = null, Object? realtimeDataType = null, Object? realtimeLayer = null, @@ -209,10 +198,6 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> ? _value.useKmoni : useKmoni // ignore: cast_nullable_to_non_nullable as bool, - showCurrentLocationMarker: null == showCurrentLocationMarker - ? _value.showCurrentLocationMarker - : showCurrentLocationMarker // ignore: cast_nullable_to_non_nullable - as bool, kmoniMarkerType: null == kmoniMarkerType ? _value.kmoniMarkerType : kmoniMarkerType // ignore: cast_nullable_to_non_nullable @@ -241,7 +226,6 @@ class _$KyoshinMonitorSettingsModelImpl {this.minRealtimeShindo = null, this.showScale = true, this.useKmoni = true, - this.showCurrentLocationMarker = false, this.kmoniMarkerType = KyoshinMonitorMarkerType.onlyEew, this.realtimeDataType = RealtimeDataType.shindo, this.realtimeLayer = RealtimeLayer.surface, @@ -266,11 +250,6 @@ class _$KyoshinMonitorSettingsModelImpl @JsonKey() final bool useKmoni; - /// 現在地のマーカーを表示するかどうか - @override - @JsonKey() - final bool showCurrentLocationMarker; - /// 強震モニタ観測点のマーカーの種類 @override @JsonKey() @@ -293,7 +272,7 @@ class _$KyoshinMonitorSettingsModelImpl @override String toString() { - return 'KyoshinMonitorSettingsModel(minRealtimeShindo: $minRealtimeShindo, showScale: $showScale, useKmoni: $useKmoni, showCurrentLocationMarker: $showCurrentLocationMarker, kmoniMarkerType: $kmoniMarkerType, realtimeDataType: $realtimeDataType, realtimeLayer: $realtimeLayer, api: $api)'; + return 'KyoshinMonitorSettingsModel(minRealtimeShindo: $minRealtimeShindo, showScale: $showScale, useKmoni: $useKmoni, kmoniMarkerType: $kmoniMarkerType, realtimeDataType: $realtimeDataType, realtimeLayer: $realtimeLayer, api: $api)'; } @override @@ -307,9 +286,6 @@ class _$KyoshinMonitorSettingsModelImpl other.showScale == showScale) && (identical(other.useKmoni, useKmoni) || other.useKmoni == useKmoni) && - (identical(other.showCurrentLocationMarker, - showCurrentLocationMarker) || - other.showCurrentLocationMarker == showCurrentLocationMarker) && (identical(other.kmoniMarkerType, kmoniMarkerType) || other.kmoniMarkerType == kmoniMarkerType) && (identical(other.realtimeDataType, realtimeDataType) || @@ -321,16 +297,8 @@ class _$KyoshinMonitorSettingsModelImpl @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, - minRealtimeShindo, - showScale, - useKmoni, - showCurrentLocationMarker, - kmoniMarkerType, - realtimeDataType, - realtimeLayer, - api); + int get hashCode => Object.hash(runtimeType, minRealtimeShindo, showScale, + useKmoni, kmoniMarkerType, realtimeDataType, realtimeLayer, api); /// Create a copy of KyoshinMonitorSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -355,7 +323,6 @@ abstract class _KyoshinMonitorSettingsModel {final double? minRealtimeShindo, final bool showScale, final bool useKmoni, - final bool showCurrentLocationMarker, final KyoshinMonitorMarkerType kmoniMarkerType, final RealtimeDataType realtimeDataType, final RealtimeLayer realtimeLayer, @@ -377,10 +344,6 @@ abstract class _KyoshinMonitorSettingsModel @override bool get useKmoni; - /// 現在地のマーカーを表示するかどうか - @override - bool get showCurrentLocationMarker; - /// 強震モニタ観測点のマーカーの種類 @override KyoshinMonitorMarkerType get kmoniMarkerType; diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart index 4a4cd0b1..b048b423 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart @@ -19,8 +19,6 @@ _$KyoshinMonitorSettingsModelImpl _$$KyoshinMonitorSettingsModelImplFromJson( 'min_realtime_shindo', (v) => (v as num?)?.toDouble() ?? null), showScale: $checkedConvert('show_scale', (v) => v as bool? ?? true), useKmoni: $checkedConvert('use_kmoni', (v) => v as bool? ?? true), - showCurrentLocationMarker: $checkedConvert( - 'show_current_location_marker', (v) => v as bool? ?? false), kmoniMarkerType: $checkedConvert( 'kmoni_marker_type', (v) => @@ -49,7 +47,6 @@ _$KyoshinMonitorSettingsModelImpl _$$KyoshinMonitorSettingsModelImplFromJson( 'minRealtimeShindo': 'min_realtime_shindo', 'showScale': 'show_scale', 'useKmoni': 'use_kmoni', - 'showCurrentLocationMarker': 'show_current_location_marker', 'kmoniMarkerType': 'kmoni_marker_type', 'realtimeDataType': 'realtime_data_type', 'realtimeLayer': 'realtime_layer' @@ -62,7 +59,6 @@ Map _$$KyoshinMonitorSettingsModelImplToJson( 'min_realtime_shindo': instance.minRealtimeShindo, 'show_scale': instance.showScale, 'use_kmoni': instance.useKmoni, - 'show_current_location_marker': instance.showCurrentLocationMarker, 'kmoni_marker_type': _$KyoshinMonitorMarkerTypeEnumMap[instance.kmoniMarkerType]!, 'realtime_data_type': diff --git a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart index 595a0c42..bac4f95d 100644 --- a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart +++ b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart @@ -166,23 +166,6 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { .copyWith(showScale: value), ), ), - SwitchListTile.adaptive( - contentPadding: EdgeInsets.zero, - title: const Text('現在地マーカーを表示'), - subtitle: const Text( - '地図上に現在地を示すマーカーを表示します', - ), - value: ref - .watch(kyoshinMonitorSettingsProvider) - .showCurrentLocationMarker, - onChanged: (value) async => ref - .read(kyoshinMonitorSettingsProvider.notifier) - .save( - ref - .read(kyoshinMonitorSettingsProvider) - .copyWith(showCurrentLocationMarker: value), - ), - ), ], ), ), diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index 7084df5f..b4414baa 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -1,39 +1,77 @@ +import 'package:eqmonitor/feature/eew/data/eew_alive_telegram.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart'; +import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/map/data/layer/base/i_map_layer.dart'; import 'package:eqmonitor/feature/map/data/provider/map_style_util.dart'; import 'package:flutter/material.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; import 'package:kyoshin_monitor_image_parser/kyoshin_monitor_image_parser.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; +part 'kyoshin_monitor_layer_controller.freezed.dart'; part 'kyoshin_monitor_layer_controller.g.dart'; /// 強震モニタの観測点レイヤーを管理するコントローラー @riverpod class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { @override - KyoshinMonitorObservationLayer? build() { + KyoshinMonitorObservationLayer build() { // 強震モニタの状態を監視 - ref.listen( - kyoshinMonitorNotifierProvider, - (prev, next) { - final previousPoints = prev?.valueOrNull?.analyzedPoints; - final nextPoints = next.valueOrNull?.analyzedPoints; - if (previousPoints != nextPoints) { - _updateLayer(nextPoints ?? []); - } - }, + ref + ..listen( + kyoshinMonitorNotifierProvider, + (prev, next) { + final previousPoints = prev?.valueOrNull?.analyzedPoints; + final nextPoints = next.valueOrNull?.analyzedPoints; + if (previousPoints != nextPoints) { + _updateLayer(nextPoints ?? []); + } + }, + ) + ..listen( + kyoshinMonitorSettingsProvider, + (prev, next) { + if (prev?.realtimeDataType != next.realtimeDataType || + prev?.realtimeLayer != next.realtimeLayer) { + state = state.copyWith( + points: [], + realtimeDataType: next.realtimeDataType, + markerType: next.kmoniMarkerType, + ); + } + }, + ) + ..listen( + eewAliveTelegramProvider, + (_, next) { + final isInEew = next?.isNotEmpty ?? false; + state = state.copyWith( + isInEew: isInEew, + ); + }, + ); + return KyoshinMonitorObservationLayer( + id: 'kyoshin-monitor-points', + sourceId: 'kyoshin-monitor-points', + visible: true, + points: [], + isInEew: false, + markerType: ref.read(kyoshinMonitorSettingsProvider).kmoniMarkerType, + realtimeDataType: + ref.read(kyoshinMonitorSettingsProvider).realtimeDataType, ); - return null; } /// レイヤーを更新 void _updateLayer(List points) { if (points.isEmpty) { - state = null; + state = state.copyWith( + points: [], + ); return; } @@ -58,23 +96,22 @@ extension KyoshinMonitorObservationAnalyzedPointEx } } -class KyoshinMonitorObservationLayer extends IMapLayer { - const KyoshinMonitorObservationLayer({ - required super.id, - required super.sourceId, - required super.visible, - required this.points, - required this.isInEew, - required this.markerType, - required this.realtimeDataType, - super.minZoom, - super.maxZoom, - }); +@freezed +class KyoshinMonitorObservationLayer extends IMapLayer + with _$KyoshinMonitorObservationLayer { + factory KyoshinMonitorObservationLayer({ + required String id, + required String sourceId, + required bool visible, + required List points, + required bool isInEew, + required KyoshinMonitorMarkerType markerType, + required RealtimeDataType realtimeDataType, + double? minZoom, + double? maxZoom, + }) = _KyoshinMonitorObservationLayer; - final List points; - final bool isInEew; - final KyoshinMonitorMarkerType markerType; - final RealtimeDataType realtimeDataType; + const KyoshinMonitorObservationLayer._(); @override Map toGeoJsonSource() { diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart new file mode 100644 index 00000000..45f5ccd3 --- /dev/null +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart @@ -0,0 +1,341 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'kyoshin_monitor_layer_controller.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$KyoshinMonitorObservationLayer { + String get id => throw _privateConstructorUsedError; + String get sourceId => throw _privateConstructorUsedError; + bool get visible => throw _privateConstructorUsedError; + List get points => + throw _privateConstructorUsedError; + bool get isInEew => throw _privateConstructorUsedError; + KyoshinMonitorMarkerType get markerType => throw _privateConstructorUsedError; + RealtimeDataType get realtimeDataType => throw _privateConstructorUsedError; + double? get minZoom => throw _privateConstructorUsedError; + double? get maxZoom => throw _privateConstructorUsedError; + + /// Create a copy of KyoshinMonitorObservationLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $KyoshinMonitorObservationLayerCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $KyoshinMonitorObservationLayerCopyWith<$Res> { + factory $KyoshinMonitorObservationLayerCopyWith( + KyoshinMonitorObservationLayer value, + $Res Function(KyoshinMonitorObservationLayer) then) = + _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, + KyoshinMonitorObservationLayer>; + @useResult + $Res call( + {String id, + String sourceId, + bool visible, + List points, + bool isInEew, + KyoshinMonitorMarkerType markerType, + RealtimeDataType realtimeDataType, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, + $Val extends KyoshinMonitorObservationLayer> + implements $KyoshinMonitorObservationLayerCopyWith<$Res> { + _$KyoshinMonitorObservationLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of KyoshinMonitorObservationLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? sourceId = null, + Object? visible = null, + Object? points = null, + Object? isInEew = null, + Object? markerType = null, + Object? realtimeDataType = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + points: null == points + ? _value.points + : points // ignore: cast_nullable_to_non_nullable + as List, + isInEew: null == isInEew + ? _value.isInEew + : isInEew // ignore: cast_nullable_to_non_nullable + as bool, + markerType: null == markerType + ? _value.markerType + : markerType // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorMarkerType, + realtimeDataType: null == realtimeDataType + ? _value.realtimeDataType + : realtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$KyoshinMonitorObservationLayerImplCopyWith<$Res> + implements $KyoshinMonitorObservationLayerCopyWith<$Res> { + factory _$$KyoshinMonitorObservationLayerImplCopyWith( + _$KyoshinMonitorObservationLayerImpl value, + $Res Function(_$KyoshinMonitorObservationLayerImpl) then) = + __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String id, + String sourceId, + bool visible, + List points, + bool isInEew, + KyoshinMonitorMarkerType markerType, + RealtimeDataType realtimeDataType, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res> + extends _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, + _$KyoshinMonitorObservationLayerImpl> + implements _$$KyoshinMonitorObservationLayerImplCopyWith<$Res> { + __$$KyoshinMonitorObservationLayerImplCopyWithImpl( + _$KyoshinMonitorObservationLayerImpl _value, + $Res Function(_$KyoshinMonitorObservationLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of KyoshinMonitorObservationLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? sourceId = null, + Object? visible = null, + Object? points = null, + Object? isInEew = null, + Object? markerType = null, + Object? realtimeDataType = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_$KyoshinMonitorObservationLayerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + points: null == points + ? _value._points + : points // ignore: cast_nullable_to_non_nullable + as List, + isInEew: null == isInEew + ? _value.isInEew + : isInEew // ignore: cast_nullable_to_non_nullable + as bool, + markerType: null == markerType + ? _value.markerType + : markerType // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorMarkerType, + realtimeDataType: null == realtimeDataType + ? _value.realtimeDataType + : realtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc + +class _$KyoshinMonitorObservationLayerImpl + extends _KyoshinMonitorObservationLayer { + _$KyoshinMonitorObservationLayerImpl( + {required this.id, + required this.sourceId, + required this.visible, + required final List points, + required this.isInEew, + required this.markerType, + required this.realtimeDataType, + this.minZoom, + this.maxZoom}) + : _points = points, + super._(); + + @override + final String id; + @override + final String sourceId; + @override + final bool visible; + final List _points; + @override + List get points { + if (_points is EqualUnmodifiableListView) return _points; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_points); + } + + @override + final bool isInEew; + @override + final KyoshinMonitorMarkerType markerType; + @override + final RealtimeDataType realtimeDataType; + @override + final double? minZoom; + @override + final double? maxZoom; + + @override + String toString() { + return 'KyoshinMonitorObservationLayer(id: $id, sourceId: $sourceId, visible: $visible, points: $points, isInEew: $isInEew, markerType: $markerType, realtimeDataType: $realtimeDataType, minZoom: $minZoom, maxZoom: $maxZoom)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$KyoshinMonitorObservationLayerImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.sourceId, sourceId) || + other.sourceId == sourceId) && + (identical(other.visible, visible) || other.visible == visible) && + const DeepCollectionEquality().equals(other._points, _points) && + (identical(other.isInEew, isInEew) || other.isInEew == isInEew) && + (identical(other.markerType, markerType) || + other.markerType == markerType) && + (identical(other.realtimeDataType, realtimeDataType) || + other.realtimeDataType == realtimeDataType) && + (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + sourceId, + visible, + const DeepCollectionEquality().hash(_points), + isInEew, + markerType, + realtimeDataType, + minZoom, + maxZoom); + + /// Create a copy of KyoshinMonitorObservationLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$KyoshinMonitorObservationLayerImplCopyWith< + _$KyoshinMonitorObservationLayerImpl> + get copyWith => __$$KyoshinMonitorObservationLayerImplCopyWithImpl< + _$KyoshinMonitorObservationLayerImpl>(this, _$identity); +} + +abstract class _KyoshinMonitorObservationLayer + extends KyoshinMonitorObservationLayer { + factory _KyoshinMonitorObservationLayer( + {required final String id, + required final String sourceId, + required final bool visible, + required final List points, + required final bool isInEew, + required final KyoshinMonitorMarkerType markerType, + required final RealtimeDataType realtimeDataType, + final double? minZoom, + final double? maxZoom}) = _$KyoshinMonitorObservationLayerImpl; + _KyoshinMonitorObservationLayer._() : super._(); + + @override + String get id; + @override + String get sourceId; + @override + bool get visible; + @override + List get points; + @override + bool get isInEew; + @override + KyoshinMonitorMarkerType get markerType; + @override + RealtimeDataType get realtimeDataType; + @override + double? get minZoom; + @override + double? get maxZoom; + + /// Create a copy of KyoshinMonitorObservationLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$KyoshinMonitorObservationLayerImplCopyWith< + _$KyoshinMonitorObservationLayerImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart index dbedd93d..e211ce73 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart @@ -9,14 +9,14 @@ part of 'kyoshin_monitor_layer_controller.dart'; // ************************************************************************** String _$kyoshinMonitorLayerControllerHash() => - r'95019261f39872cc53733f50357cd0be4b3c1856'; + r'af2b9ed4606857f59aaaaa6543565eb9e9eb87ce'; /// 強震モニタの観測点レイヤーを管理するコントローラー /// /// Copied from [KyoshinMonitorLayerController]. @ProviderFor(KyoshinMonitorLayerController) final kyoshinMonitorLayerControllerProvider = AutoDisposeNotifierProvider< - KyoshinMonitorLayerController, KyoshinMonitorObservationLayer?>.internal( + KyoshinMonitorLayerController, KyoshinMonitorObservationLayer>.internal( KyoshinMonitorLayerController.new, name: r'kyoshinMonitorLayerControllerProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -27,6 +27,6 @@ final kyoshinMonitorLayerControllerProvider = AutoDisposeNotifierProvider< ); typedef _$KyoshinMonitorLayerController - = AutoDisposeNotifier; + = AutoDisposeNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/layer/base/i_map_layer.dart b/app/lib/feature/map/data/layer/base/i_map_layer.dart index 86ec79b3..def24ae1 100644 --- a/app/lib/feature/map/data/layer/base/i_map_layer.dart +++ b/app/lib/feature/map/data/layer/base/i_map_layer.dart @@ -1,24 +1,18 @@ import 'package:maplibre_gl/maplibre_gl.dart'; abstract class IMapLayer { - const IMapLayer({ - required this.id, - required this.sourceId, - required this.visible, - this.minZoom, - this.maxZoom, - }); + const IMapLayer(); Map toGeoJsonSource(); String get geoJsonSourceHash; LayerProperties toLayerProperties(); String get layerPropertiesHash; - final String id; - final String sourceId; - final bool visible; - final double? minZoom; - final double? maxZoom; + String get id; + String get sourceId; + bool get visible; + double? get minZoom; + double? get maxZoom; } class CachedIMapLayer { diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index aafab1f1..0dbf68b0 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -19,6 +19,8 @@ class DeclarativeMap extends StatefulHookConsumerWidget { this.onCameraIdle, this.layers = const [], this.myLocationEnabled = false, + this.myLocationRenderMode = MyLocationRenderMode.normal, + this.myLocationTrackingMode = MyLocationTrackingMode.none, this.compassEnabled = true, this.rotateGesturesEnabled = true, this.scrollGesturesEnabled = true, @@ -44,6 +46,12 @@ class DeclarativeMap extends StatefulHookConsumerWidget { /// 現在位置の表示 final bool myLocationEnabled; + /// 現在位置の表示モード + final MyLocationRenderMode myLocationRenderMode; + + /// 現在位置の追跡モード + final MyLocationTrackingMode myLocationTrackingMode; + /// コンパスの表示 final bool compassEnabled; @@ -99,6 +107,8 @@ class _DeclarativeMapState extends ConsumerState { scrollGesturesEnabled: widget.scrollGesturesEnabled, zoomGesturesEnabled: widget.zoomGesturesEnabled, doubleClickZoomEnabled: widget.doubleClickZoomEnabled, + myLocationRenderMode: widget.myLocationRenderMode, + myLocationTrackingMode: widget.myLocationTrackingMode, ); } @@ -135,6 +145,7 @@ class _DeclarativeMapState extends ConsumerState { // style check final cachedLayerPropertiesHash = cachedLayer.layerPropertiesHash; final layerPropertiesHash = layer.layerPropertiesHash; + log('cached $cachedLayerPropertiesHash layer $layerPropertiesHash'); if (cachedLayerPropertiesHash != layerPropertiesHash) { log('layer properties changed'); await controller.removeLayer(layer.id); diff --git a/app/lib/main.dart b/app/lib/main.dart index 89a7a091..5a625ee8 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -8,6 +8,7 @@ import 'package:device_info_plus/device_info_plus.dart'; import 'package:eqmonitor/app.dart'; import 'package:eqmonitor/core/fcm/channels.dart'; import 'package:eqmonitor/core/provider/application_documents_directory.dart'; +import 'package:eqmonitor/core/provider/config/permission/permission_notifier.dart'; import 'package:eqmonitor/core/provider/custom_provider_observer.dart'; import 'package:eqmonitor/core/provider/device_info.dart'; import 'package:eqmonitor/core/provider/jma_code_table_provider.dart'; @@ -162,8 +163,11 @@ Future main() async { ], ); - await container - .read(kyoshinMonitorInternalObservationPointsConvertedProvider.future); + await ( + container + .read(kyoshinMonitorInternalObservationPointsConvertedProvider.future), + container.read(permissionNotifierProvider.notifier).initialize(), + ).wait; runApp( UncontrolledProviderScope( From f2c77e3a9b6d2a98766c74b2dbf8ffa6473c04d7 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sat, 8 Feb 2025 23:55:02 +0900 Subject: [PATCH 11/70] recommended change from Xcode --- app/ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index 71a12bad..84849071 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ @@ -263,7 +263,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1540; - LastUpgradeCheck = 1510; + LastUpgradeCheck = 1620; ORGANIZATIONNAME = ""; TargetAttributes = { 85E6094D2BFF792C00C21983 = { @@ -285,7 +285,7 @@ ); mainGroup = 97C146E51CF9000F007C117D; packageReferences = ( - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, 85B405182C08E73300EB3835 /* XCRemoteSwiftPackageReference "GzipSwift" */, ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; @@ -946,7 +946,7 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { isa = XCLocalSwiftPackageReference; relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; diff --git a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8bd37ea7..8c24242c 100644 --- a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Date: Sun, 9 Feb 2025 00:01:09 +0900 Subject: [PATCH 12/70] recommended change from Xcode --- app/ios/Runner.xcodeproj/project.pbxproj | 4 ++-- .../Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index 84849071..bdd8252e 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 60; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -263,7 +263,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1540; - LastUpgradeCheck = 1620; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 85E6094D2BFF792C00C21983 = { diff --git a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8c24242c..8bd37ea7 100644 --- a/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Date: Sun, 9 Feb 2025 00:02:51 +0900 Subject: [PATCH 13/70] rename: IMapLayer -> MapLayer --- .../controller/kyoshin_monitor_layer_controller.dart | 11 +++++++---- .../kyoshin_monitor_layer_controller.g.dart | 2 +- .../feature/map/data/controller/layer_controller.dart | 8 ++++---- .../map/data/controller/layer_controller.g.dart | 6 +++--- .../layer/base/{i_map_layer.dart => map_layer.dart} | 8 ++++---- app/lib/feature/map/ui/declarative_map.dart | 6 +++--- app/lib/feature/map/widget/declarative_map.dart | 6 +++--- 7 files changed, 25 insertions(+), 22 deletions(-) rename app/lib/feature/map/data/layer/base/{i_map_layer.dart => map_layer.dart} (82%) diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index b4414baa..df30d375 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -3,7 +3,7 @@ import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_set import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; -import 'package:eqmonitor/feature/map/data/layer/base/i_map_layer.dart'; +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; import 'package:eqmonitor/feature/map/data/provider/map_style_util.dart'; import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -36,7 +36,10 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { kyoshinMonitorSettingsProvider, (prev, next) { if (prev?.realtimeDataType != next.realtimeDataType || - prev?.realtimeLayer != next.realtimeLayer) { + prev?.realtimeLayer != next.realtimeLayer || + prev?.kmoniMarkerType != next.kmoniMarkerType) { + print('prev: ${prev?.kmoniMarkerType}'); + print('next: ${next.kmoniMarkerType}'); state = state.copyWith( points: [], realtimeDataType: next.realtimeDataType, @@ -97,7 +100,7 @@ extension KyoshinMonitorObservationAnalyzedPointEx } @freezed -class KyoshinMonitorObservationLayer extends IMapLayer +class KyoshinMonitorObservationLayer extends MapLayer with _$KyoshinMonitorObservationLayer { factory KyoshinMonitorObservationLayer({ required String id, @@ -186,5 +189,5 @@ class KyoshinMonitorObservationLayer extends IMapLayer } @override - String get layerPropertiesHash => '${markerType.index}'; + String get layerPropertiesHash => markerType.name; } diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart index e211ce73..bbaf70c0 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart @@ -9,7 +9,7 @@ part of 'kyoshin_monitor_layer_controller.dart'; // ************************************************************************** String _$kyoshinMonitorLayerControllerHash() => - r'af2b9ed4606857f59aaaaa6543565eb9e9eb87ce'; + r'e33391f5bec03d2e34386f4a4a50accca6248f72'; /// 強震モニタの観測点レイヤーを管理するコントローラー /// diff --git a/app/lib/feature/map/data/controller/layer_controller.dart b/app/lib/feature/map/data/controller/layer_controller.dart index 552c4eea..7d92e824 100644 --- a/app/lib/feature/map/data/controller/layer_controller.dart +++ b/app/lib/feature/map/data/controller/layer_controller.dart @@ -1,4 +1,4 @@ -import 'package:eqmonitor/feature/map/data/layer/base/i_map_layer.dart'; +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'layer_controller.g.dart'; @@ -7,12 +7,12 @@ part 'layer_controller.g.dart'; @riverpod class MapLayerController extends _$MapLayerController { @override - List build() { + List build() { return []; } /// レイヤーを追加 - void addLayer(IMapLayer layer) { + void addLayer(MapLayer layer) { state = [...state, layer]; } @@ -22,7 +22,7 @@ class MapLayerController extends _$MapLayerController { } /// レイヤーを更新 - void updateLayer(IMapLayer layer) { + void updateLayer(MapLayer layer) { state = state.map((l) => l.id == layer.id ? layer : l).toList(); } diff --git a/app/lib/feature/map/data/controller/layer_controller.g.dart b/app/lib/feature/map/data/controller/layer_controller.g.dart index e96c6ef1..97577b90 100644 --- a/app/lib/feature/map/data/controller/layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/layer_controller.g.dart @@ -9,14 +9,14 @@ part of 'layer_controller.dart'; // ************************************************************************** String _$mapLayerControllerHash() => - r'dc309422e0f56a73e849ed7068d835b7fe3b68e9'; + r'4f47c79441eab48355b2cc791319a7d2dd1260e2'; /// マップのレイヤーを管理するコントローラー /// /// Copied from [MapLayerController]. @ProviderFor(MapLayerController) final mapLayerControllerProvider = - AutoDisposeNotifierProvider>.internal( + AutoDisposeNotifierProvider>.internal( MapLayerController.new, name: r'mapLayerControllerProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -26,6 +26,6 @@ final mapLayerControllerProvider = allTransitiveDependencies: null, ); -typedef _$MapLayerController = AutoDisposeNotifier>; +typedef _$MapLayerController = AutoDisposeNotifier>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/layer/base/i_map_layer.dart b/app/lib/feature/map/data/layer/base/map_layer.dart similarity index 82% rename from app/lib/feature/map/data/layer/base/i_map_layer.dart rename to app/lib/feature/map/data/layer/base/map_layer.dart index def24ae1..e7217d80 100644 --- a/app/lib/feature/map/data/layer/base/i_map_layer.dart +++ b/app/lib/feature/map/data/layer/base/map_layer.dart @@ -1,7 +1,7 @@ import 'package:maplibre_gl/maplibre_gl.dart'; -abstract class IMapLayer { - const IMapLayer(); +abstract class MapLayer { + const MapLayer(); Map toGeoJsonSource(); String get geoJsonSourceHash; @@ -22,13 +22,13 @@ class CachedIMapLayer { required this.layerPropertiesHash, }); - factory CachedIMapLayer.fromLayer(IMapLayer layer) => CachedIMapLayer( + factory CachedIMapLayer.fromLayer(MapLayer layer) => CachedIMapLayer( layer: layer, geoJsonSourceHash: layer.geoJsonSourceHash, layerPropertiesHash: layer.layerPropertiesHash, ); - final IMapLayer layer; + final MapLayer layer; final String geoJsonSourceHash; final String layerPropertiesHash; } diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 0dbf68b0..99289140 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:developer'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; -import 'package:eqmonitor/feature/map/data/layer/base/i_map_layer.dart'; +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -41,7 +41,7 @@ class DeclarativeMap extends StatefulHookConsumerWidget { final void Function(MapCameraPosition)? onCameraIdle; /// レイヤーのリスト - final List layers; + final List layers; /// 現在位置の表示 final bool myLocationEnabled; @@ -179,7 +179,7 @@ class _DeclarativeMapState extends ConsumerState { } } - Future _addLayer(IMapLayer layer) async { + Future _addLayer(MapLayer layer) async { final controller = widget.controller.controller!; await controller.addGeoJsonSource( layer.sourceId, diff --git a/app/lib/feature/map/widget/declarative_map.dart b/app/lib/feature/map/widget/declarative_map.dart index 18a6a8c5..3df44e06 100644 --- a/app/lib/feature/map/widget/declarative_map.dart +++ b/app/lib/feature/map/widget/declarative_map.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'dart:developer'; -import 'package:eqmonitor/feature/map/data/layer/base/i_map_layer.dart'; +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; import 'package:flutter/material.dart'; @@ -38,7 +38,7 @@ class DeclarativeMap extends ConsumerStatefulWidget { final void Function(MapCameraPosition)? onCameraIdle; /// レイヤーのリスト - final List layers; + final List layers; /// 現在位置の表示 final bool myLocationEnabled; @@ -179,7 +179,7 @@ class _DeclarativeMapState extends ConsumerState { } } - Future _addLayer(IMapLayer layer) async { + Future _addLayer(MapLayer layer) async { final controller = _controller!; await controller.addGeoJsonSource( layer.sourceId, From 54b78775f5b629e32305274b6dfef09a7143c990 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 00:03:03 +0900 Subject: [PATCH 14/70] =?UTF-8?q?chore:=20=E4=B8=8D=E8=A6=81=E3=81=AAlint?= =?UTF-8?q?=E8=AD=A6=E5=91=8A=E3=82=92=E7=84=A1=E5=8A=B9=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/kyoshin_monitor_image_parser/bin/export.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/kyoshin_monitor_image_parser/bin/export.dart b/packages/kyoshin_monitor_image_parser/bin/export.dart index 710e4302..b150471b 100644 --- a/packages/kyoshin_monitor_image_parser/bin/export.dart +++ b/packages/kyoshin_monitor_image_parser/bin/export.dart @@ -1,3 +1,5 @@ +// ignore_for_file: unused_element, unused_local_variable, unreachable_from_main + import 'dart:convert'; import 'dart:math' as math; @@ -9,6 +11,7 @@ class Color { final int green; final int blue; + // ignore: prefer_constructors_over_static_methods static Color fromRGB(int r, int g, int b) { return Color( r.clamp(0, 255), From d276f141df53f7b254845090e89f6d920e7e2f92 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 00:15:29 +0900 Subject: [PATCH 15/70] format --- app/lib/core/theme/theme_provider.dart | 3 ++- .../home/data/notifier/home_configuration_notifier.dart | 6 +++--- .../kyoshin_monitor/data/api/kyoshin_monitor_dio.dart | 1 - .../data_source/kyoshin_monitor_web_api_data_source.dart | 3 ++- .../data/service/kyoshin_monitor_delay_adjust_service.dart | 4 +--- app/lib/feature/map/ui/declarative_map.dart | 2 +- .../config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart | 3 +-- packages/earthquake_replay/lib/test.dart | 2 +- .../lib/src/model/kyoshin_monitor_color_map.dart | 1 + 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/lib/core/theme/theme_provider.dart b/app/lib/core/theme/theme_provider.dart index 1f74c5fb..7467521e 100644 --- a/app/lib/core/theme/theme_provider.dart +++ b/app/lib/core/theme/theme_provider.dart @@ -36,7 +36,8 @@ class ThemeModeNotifier extends _$ThemeModeNotifier { } @Riverpod(keepAlive: true) -class BrightnessNotifier extends _$BrightnessNotifier with WidgetsBindingObserver { +class BrightnessNotifier extends _$BrightnessNotifier + with WidgetsBindingObserver { @override ui.Brightness build() { // プロバイダ構築時に監視を開始。 diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart index f85f5551..4962a47a 100644 --- a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart @@ -27,8 +27,8 @@ class HomeConfigurationNotifier extends _$HomeConfigurationNotifier { Future save(HomeConfigurationModel configuration) async { state = configuration; await ref.read(sharedPreferencesProvider).setString( - _key, - configuration.toJson().toString(), - ); + _key, + configuration.toJson().toString(), + ); } } diff --git a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart index 2b287578..496e2362 100644 --- a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart +++ b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart @@ -23,4 +23,3 @@ Dio kyoshinMonitorDio(Ref ref) => Dio( }, ), ); - diff --git a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart index 7b6ab59f..260c41f3 100644 --- a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart +++ b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart @@ -12,7 +12,8 @@ KyoshinMonitorWebApiDataSource kyoshinMonitorWebApiDataSource(Ref ref) => ); @Riverpod(keepAlive: true) -LpgmKyoshinMonitorWebApiDataSource lpgmKyoshinMonitorWebApiDataSource(Ref ref) => +LpgmKyoshinMonitorWebApiDataSource lpgmKyoshinMonitorWebApiDataSource( + Ref ref) => LpgmKyoshinMonitorWebApiDataSource( client: ref.watch(lpgmKyoshinMonitorWebApiClientProvider), ); diff --git a/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart b/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart index 5a978ee2..8ff7df88 100644 --- a/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart +++ b/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart @@ -13,6 +13,4 @@ enum KyoshinMonitorDelayAdjustType { ; } -abstract class KyoshinMonitorDelayAdjustService { - -} +abstract class KyoshinMonitorDelayAdjustService {} diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 99289140..5da70ec9 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -145,7 +145,7 @@ class _DeclarativeMapState extends ConsumerState { // style check final cachedLayerPropertiesHash = cachedLayer.layerPropertiesHash; final layerPropertiesHash = layer.layerPropertiesHash; - log('cached $cachedLayerPropertiesHash layer $layerPropertiesHash'); + log('cached $cachedLayerPropertiesHash -> $layerPropertiesHash'); if (cachedLayerPropertiesHash != layerPropertiesHash) { log('layer properties changed'); await controller.removeLayer(layer.id); diff --git a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart index 5fa51566..cc04ba0b 100644 --- a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart +++ b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart @@ -35,8 +35,7 @@ class DebugKyoshinMonitorPage extends StatelessWidget { fontFamily: FontFamily.jetBrainsMono, ), ), - actions: const [ - ], + actions: const [], ), body: const SingleChildScrollView( primary: true, diff --git a/packages/earthquake_replay/lib/test.dart b/packages/earthquake_replay/lib/test.dart index 641cff64..3a462396 100644 --- a/packages/earthquake_replay/lib/test.dart +++ b/packages/earthquake_replay/lib/test.dart @@ -4,7 +4,7 @@ import 'package:earthquake_replay/src/parser/replay_data_parser.dart'; Future main() async { final parser = ReplayDataParser(); - final data = parser.parse( + final data = parser.parse( File('test/20240101-能登7.eprp').readAsBytesSync(), ); print(data); diff --git a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_color_map.dart b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_color_map.dart index e69de29b..8b137891 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_color_map.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_color_map.dart @@ -0,0 +1 @@ + From 25843cc05d32c3d01c1ab1acd1c1bac3ea6a6cb4 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 00:18:22 +0900 Subject: [PATCH 16/70] add: earthquake_replay as a dependency --- app/pubspec.yaml | 3 +++ pubspec.lock | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 569d3327..a227352c 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -21,6 +21,8 @@ dependencies: device_info_plus: ^11.2.0 dio: ^5.7.0 dynamic_color: ^1.7.0 + earthquake_replay: + path: ../packages/earthquake_replay eqapi_client: path: ../packages/eqapi_client eqapi_types: @@ -28,6 +30,7 @@ dependencies: extensions: path: ../packages/extensions feedback: ^3.1.0 + file_picker: ^8.3.2 firebase_analytics: ^11.3.6 firebase_app_installations: ^0.3.1 firebase_core: ^3.8.1 diff --git a/pubspec.lock b/pubspec.lock index eb6ff87e..b569285d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -486,6 +486,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + file_picker: + dependency: transitive + description: + name: file_picker + sha256: cacfdc5abe93e64d418caa9256eef663499ad791bb688d9fd12c85a311968fba + url: "https://pub.dev" + source: hosted + version: "8.3.2" firebase_analytics: dependency: transitive description: @@ -704,6 +712,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.5" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" + url: "https://pub.dev" + source: hosted + version: "2.0.24" flutter_riverpod: dependency: transitive description: From 5153a50ddc8521e14934bf2b0f85998ce3324bda Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 00:18:26 +0900 Subject: [PATCH 17/70] fix: ci --- .github/workflows/check-pull-request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-pull-request.yaml b/.github/workflows/check-pull-request.yaml index 3307072a..d9ac7669 100644 --- a/.github/workflows/check-pull-request.yaml +++ b/.github/workflows/check-pull-request.yaml @@ -65,7 +65,7 @@ jobs: run: melos run rebuild --no-select - name: format - run: melos run format --no-select + run: melos format --no-select - name: check difference run: | From 17d6419ea8178888b864d1653cc9af557fb3687f Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 01:03:20 +0900 Subject: [PATCH 18/70] =?UTF-8?q?chore(ci):=20upload-artifact=E6=99=82?= =?UTF-8?q?=E3=81=AB=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=82=89?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yaml | 3 +++ .github/workflows/tag-release.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 58560252..e9b0a95d 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -172,6 +172,7 @@ jobs: with: name: EQMonitor-ios.ipa path: app/eqmonitor.ipa + if-no-files-found: error deploy-ios: needs: build-ios @@ -284,12 +285,14 @@ jobs: with: name: EQMonitor-android.aab path: app/build/app/outputs/bundle/release/app-release.aab + if-no-files-found: error - name: Upload apk as artifact uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: EQMonitor-android.apk path: app/build/app/outputs/flutter-apk/app-release.apk + if-no-files-found: error deploy-android: needs: build-android diff --git a/.github/workflows/tag-release.yaml b/.github/workflows/tag-release.yaml index 4bc93a06..02d17fb7 100644 --- a/.github/workflows/tag-release.yaml +++ b/.github/workflows/tag-release.yaml @@ -71,6 +71,7 @@ jobs: with: path: app/build/app/outputs/bundle/release/app-release.aab name: release-aab + if-no-files-found: error deploy-android: runs-on: ubuntu-latest @@ -213,6 +214,7 @@ jobs: with: path: app/ios/Runner.ipa name: release-ios + if-no-files-found: error deploy-ios: runs-on: macos-latest From 9735b37fb8d3029756a3888c86bacfbc01dce16b Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 01:03:47 +0900 Subject: [PATCH 19/70] =?UTF-8?q?add:=20deeplink.eqmonitor.app=20=E3=82=92?= =?UTF-8?q?URLTypes=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ios/Runner/Info.plist | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/app/ios/Runner/Info.plist b/app/ios/Runner/Info.plist index f8b2b9da..dbe05355 100644 --- a/app/ios/Runner/Info.plist +++ b/app/ios/Runner/Info.plist @@ -22,8 +22,23 @@ $(FLUTTER_BUILD_NAME) CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + deeplink.eqmonitor.app + + + CFBundleVersion 1287 + FlutterDeepLinkingEnabled + + ITSAppUsesNonExemptEncryption + LSApplicationCategoryType LSApplicationQueriesSchemes @@ -37,6 +52,12 @@ NSAllowsArbitraryLoads + NSLocationAlwaysAndWhenInUseUsageDescription + 現在地の地震情報を通知・表示するために、位置情報を利用します + NSLocationAlwaysUsageDescription + 現在地の地震情報を通知・表示するために、位置情報を利用します + NSLocationWhenInUseUsageDescription + 現在地に即した地震情報を表示するために、位置情報を利用します UIApplicationSupportsIndirectInputEvents UIBackgroundModes @@ -48,16 +69,6 @@ LaunchScreen UIMainStoryboardFile Main - ITSAppUsesNonExemptEncryption - - FlutterDeepLinkingEnabled - - NSLocationAlwaysAndWhenInUseUsageDescription - 現在地の地震情報を通知・表示するために、位置情報を利用します - NSLocationAlwaysUsageDescription - 現在地の地震情報を通知・表示するために、位置情報を利用します - NSLocationWhenInUseUsageDescription - 現在地に即した地震情報を表示するために、位置情報を利用します UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeLeft From c1dcddb4cfa72d356fcbb0cf53cfa9cd8838d1ca Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 01:03:59 +0900 Subject: [PATCH 20/70] resolve podfile.lock --- app/ios/Podfile.lock | 50 ++++++++++++++++++++++++ app/ios/Runner.xcodeproj/project.pbxproj | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/app/ios/Podfile.lock b/app/ios/Podfile.lock index c1b82fca..a0a865b7 100644 --- a/app/ios/Podfile.lock +++ b/app/ios/Podfile.lock @@ -5,6 +5,40 @@ PODS: - Flutter - device_info_plus (0.0.1): - Flutter + - DKImagePickerController/Core (4.3.9): + - DKImagePickerController/ImageDataManager + - DKImagePickerController/Resource + - DKImagePickerController/ImageDataManager (4.3.9) + - DKImagePickerController/PhotoGallery (4.3.9): + - DKImagePickerController/Core + - DKPhotoGallery + - DKImagePickerController/Resource (4.3.9) + - DKPhotoGallery (0.0.19): + - DKPhotoGallery/Core (= 0.0.19) + - DKPhotoGallery/Model (= 0.0.19) + - DKPhotoGallery/Preview (= 0.0.19) + - DKPhotoGallery/Resource (= 0.0.19) + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Core (0.0.19): + - DKPhotoGallery/Model + - DKPhotoGallery/Preview + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Model (0.0.19): + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Preview (0.0.19): + - DKPhotoGallery/Model + - DKPhotoGallery/Resource + - SDWebImage + - SwiftyGif + - DKPhotoGallery/Resource (0.0.19): + - SDWebImage + - SwiftyGif + - file_picker (0.0.1): + - DKImagePickerController/PhotoGallery + - Flutter - Firebase/Analytics (11.6.0): - Firebase/Core - Firebase/Core (11.6.0): @@ -188,6 +222,9 @@ PODS: - PurchasesHybridCommon (13.15.2): - RevenueCat (= 5.14.5) - RevenueCat (5.14.5) + - SDWebImage (5.20.0): + - SDWebImage/Core (= 5.20.0) + - SDWebImage/Core (5.20.0) - share_plus (0.0.1): - Flutter - shared_preference_app_group (1.0.0): @@ -196,6 +233,7 @@ PODS: - Flutter - FlutterMacOS - SwiftProtobuf (1.28.2) + - SwiftyGif (5.4.5) - url_launcher_ios (0.0.1): - Flutter @@ -203,6 +241,7 @@ DEPENDENCIES: - app_settings (from `.symlinks/plugins/app_settings/ios`) - background_task (from `.symlinks/plugins/background_task/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) + - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_app_installations (from `.symlinks/plugins/firebase_app_installations/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) @@ -228,6 +267,8 @@ DEPENDENCIES: SPEC REPOS: trunk: + - DKImagePickerController + - DKPhotoGallery - Firebase - FirebaseAnalytics - FirebaseCore @@ -247,7 +288,9 @@ SPEC REPOS: - PromisesSwift - PurchasesHybridCommon - RevenueCat + - SDWebImage - SwiftProtobuf + - SwiftyGif EXTERNAL SOURCES: app_settings: @@ -256,6 +299,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/background_task/ios" device_info_plus: :path: ".symlinks/plugins/device_info_plus/ios" + file_picker: + :path: ".symlinks/plugins/file_picker/ios" firebase_analytics: :path: ".symlinks/plugins/firebase_analytics/ios" firebase_app_installations: @@ -303,6 +348,9 @@ SPEC CHECKSUMS: app_settings: 3507c575c2b18a462c99948f61d5de21d4420999 background_task: cb74890aa75be08c253c56017a2f0f6038d0879a device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe + DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c + DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 + file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be Firebase: 374a441a91ead896215703a674d58cdb3e9d772b firebase_analytics: 8ad276088e4f9ba7dfc8dd6be4ee93a29673dde1 firebase_app_installations: 8a78b8906822972d1d8bf3a28c02f700d598e60f @@ -339,10 +387,12 @@ SPEC CHECKSUMS: purchases_flutter: a3f9f057c0f437b8e9b4ed1985b2036d8aa95ec1 PurchasesHybridCommon: 8af6bb6d85b794dc47ccef1b536ed0e677c789ea RevenueCat: 4c0e809f7c7428cbe8d79cbb9a0dc7551e71e74e + SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8 share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a shared_preference_app_group: 7422922a188e05cf680a656e18e2786dcb5c58b3 shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 SwiftProtobuf: 4dbaffec76a39a8dc5da23b40af1a5dc01a4c02d + SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 url_launcher_ios: 694010445543906933d732453a59da0a173ae33d PODFILE CHECKSUM: d10447a9148f63b89692c9605e3219ee49461f0a diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index bdd8252e..ca57aa5a 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ From 42e487317f9dbc407fc12f396c7c0435caa33c01 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 18:30:18 +0900 Subject: [PATCH 21/70] add: sheet --- .../home/component/map/home_map_content.dart | 4 - .../notifier/home_configuration_notifier.dart | 20 +++-- app/lib/feature/home/page/home_page.dart | 85 ++++++++++++++++++- app/lib/feature/location/data/location.dart | 1 + .../kyoshin_monitor_layer_controller.dart | 45 ++++++---- app/lib/feature/map/ui/declarative_map.dart | 9 +- 6 files changed, 131 insertions(+), 33 deletions(-) diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart index 9654372f..f586eb45 100644 --- a/app/lib/feature/home/component/map/home_map_content.dart +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -7,7 +7,6 @@ import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.d import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:maplibre_gl/maplibre_gl.dart'; class HomeMapContent extends HookConsumerWidget { const HomeMapContent({ @@ -45,9 +44,6 @@ class HomeMapContent extends HookConsumerWidget { return DeclarativeMap( myLocationEnabled: homeConfiguration.showLocation, - myLocationRenderMode: homeConfiguration.showLocation - ? MyLocationRenderMode.compass - : MyLocationRenderMode.normal, styleString: styleString, controller: mapController, initialCameraPosition: cameraPosition, diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart index 4962a47a..9fcb5279 100644 --- a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:developer'; import 'package:eqmonitor/core/provider/shared_preferences.dart'; import 'package:eqmonitor/feature/home/data/model/home_configuration_model.dart'; @@ -10,25 +11,34 @@ part 'home_configuration_notifier.g.dart'; class HomeConfigurationNotifier extends _$HomeConfigurationNotifier { @override HomeConfigurationModel build() { + final saved = load(); + if (saved != null) { + return saved; + } return const HomeConfigurationModel(); } static const _key = 'home_configuration'; HomeConfigurationModel? load() { - final jsonString = ref.read(sharedPreferencesProvider).getString(_key); - if (jsonString == null) { + try { + final jsonString = ref.read(sharedPreferencesProvider).getString(_key); + if (jsonString == null) { + return null; + } + final json = jsonDecode(jsonString) as Map; + return HomeConfigurationModel.fromJson(json); + } on Exception catch (e) { + log('load home configuration failed: $e'); return null; } - final json = jsonDecode(jsonString) as Map; - return HomeConfigurationModel.fromJson(json); } Future save(HomeConfigurationModel configuration) async { state = configuration; await ref.read(sharedPreferencesProvider).setString( _key, - configuration.toJson().toString(), + jsonEncode(configuration.toJson()), ); } } diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index f2d9b88c..2d46ee26 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -1,6 +1,8 @@ +import 'package:eqmonitor/feature/home/component/eew/eew_widget.dart'; import 'package:eqmonitor/feature/home/component/map/home_map_view.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:sheet/sheet.dart'; class HomePage extends HookConsumerWidget { const HomePage({super.key}); @@ -11,9 +13,90 @@ class HomePage extends HookConsumerWidget { body: Stack( children: [ HomeMapView(), - // _Sheet(), + _Sheet(), ], ), ); } } + +class _Sheet extends StatelessWidget { + const _Sheet(); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colorScheme = theme.colorScheme; + + return SafeArea( + bottom: false, + child: LayoutBuilder( + builder: (context, constraints) { + final size = ( + width: constraints.maxWidth, + height: constraints.maxHeight, + ); + final isLandscape = size.width > size.height; + final sheet = Sheet( + elevation: 4, + initialExtent: size.height * 0.2, + physics: const SnapSheetPhysics( + stops: [0.1, 0.2, 0.5, 1], + ), + child: Material( + color: colorScheme.surfaceContainer, + clipBehavior: Clip.hardEdge, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + ), + child: Column( + children: [ + Container( + margin: const EdgeInsets.symmetric(vertical: 8), + width: 36, + height: 4, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: theme.colorScheme.onSurface, + ), + ), + const Expanded( + child: _SheetBody(), + ), + ], + ), + ), + ); + + if (isLandscape) { + return Align( + alignment: Alignment.centerRight, + child: SizedBox( + width: size.width * 0.5, + height: size.height, + child: sheet, + ), + ); + } + return sheet; + }, + ), + ); + } +} + +class _SheetBody extends ConsumerWidget { + const _SheetBody(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return const Column( + children: [ + EewWidgets(), + ], + ); + } +} diff --git a/app/lib/feature/location/data/location.dart b/app/lib/feature/location/data/location.dart index 8b02273f..8d6e9491 100644 --- a/app/lib/feature/location/data/location.dart +++ b/app/lib/feature/location/data/location.dart @@ -32,6 +32,7 @@ Stream locationStream(Ref ref) async* { } } +/// 近隣の強震観測点 @riverpod Stream<(KyoshinObservationPoint, double km)> closestKmoniObservationPointStream( Ref ref, diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index df30d375..fb8ceee9 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -1,3 +1,6 @@ +import 'dart:convert'; +import 'dart:developer'; + import 'package:eqmonitor/feature/eew/data/eew_alive_telegram.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart'; @@ -35,11 +38,19 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { ..listen( kyoshinMonitorSettingsProvider, (prev, next) { + log('prev: ${jsonEncode(prev)}'); + log('next: ${jsonEncode(next)}'); if (prev?.realtimeDataType != next.realtimeDataType || prev?.realtimeLayer != next.realtimeLayer || prev?.kmoniMarkerType != next.kmoniMarkerType) { - print('prev: ${prev?.kmoniMarkerType}'); - print('next: ${next.kmoniMarkerType}'); + log( + 'prev: ${prev?.kmoniMarkerType}', + name: 'kyoshin_monitor_layer_controller', + ); + log( + 'next: ${next.kmoniMarkerType}', + name: 'kyoshin_monitor_layer_controller', + ); state = state.copyWith( points: [], realtimeDataType: next.realtimeDataType, @@ -133,13 +144,9 @@ class KyoshinMonitorObservationLayer extends MapLayer }, 'properties': { 'color': e.observation.colorHex, - 'intensity': e.observation.scaleToIntensity, 'name': e.point.code, - 'strokeOpacity': switch (markerType) { - KyoshinMonitorMarkerType.always => 1.0, - KyoshinMonitorMarkerType.onlyEew when isInEew => 1.0, - _ => 0.0, - }, + 'zIndex': e.observation.scale, + 'showStroke': markerType == KyoshinMonitorMarkerType.always, }, }, ) @@ -172,18 +179,20 @@ class KyoshinMonitorObservationLayer extends MapLayer 'get', 'strokeOpacity', ], - circleStrokeWidth: [ - 'interpolate', - ['linear'], - ['zoom'], - 3, - 0.2, - 10, - 1, - ], + circleStrokeWidth: switch (markerType) { + KyoshinMonitorMarkerType.always => [ + 'get', + 'strokeWidth', + ], + KyoshinMonitorMarkerType.onlyEew when isInEew => [ + 'get', + 'strokeWidth', + ], + _ => 0, + }, circleSortKey: [ 'get', - 'intensity', + 'zIndex', ], ); } diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 5da70ec9..b6b5efbc 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -145,12 +145,11 @@ class _DeclarativeMapState extends ConsumerState { // style check final cachedLayerPropertiesHash = cachedLayer.layerPropertiesHash; final layerPropertiesHash = layer.layerPropertiesHash; - log('cached $cachedLayerPropertiesHash -> $layerPropertiesHash'); if (cachedLayerPropertiesHash != layerPropertiesHash) { - log('layer properties changed'); - await controller.removeLayer(layer.id); - await controller.removeSource(layer.sourceId); - await _addLayer(layer); + await controller.setLayerProperties( + layer.id, + layer.toLayerProperties(), + ); _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); log('layer properties changed: ${layer.toLayerProperties().toJson()}'); From 6ecc6cc96d06678dd5870efd9a457e9face6b4d4 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 19:14:07 +0900 Subject: [PATCH 22/70] =?UTF-8?q?add:=20=E7=9B=B4=E8=BF=91=E3=81=AE?= =?UTF-8?q?=E5=9C=B0=E9=9C=87=E5=B1=A5=E6=AD=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ios/Runner.xcodeproj/project.pbxproj | 2 +- app/lib/core/theme/build_theme.dart | 1 + .../earthquake_history_list_tile.dart | 16 +++ .../sheet/home_earthquake_history_sheet.dart | 118 ++++++++++++++++++ app/lib/feature/home/page/home_page.dart | 21 +++- .../kyoshin_monitor_status_card.dart | 19 +-- .../kyoshin_monitor_layer_controller.dart | 22 ++-- app/lib/feature/map/ui/declarative_map.dart | 3 - 8 files changed, 176 insertions(+), 26 deletions(-) create mode 100644 app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index ca57aa5a..bdd8252e 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 60; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ diff --git a/app/lib/core/theme/build_theme.dart b/app/lib/core/theme/build_theme.dart index b0726afd..fa450829 100644 --- a/app/lib/core/theme/build_theme.dart +++ b/app/lib/core/theme/build_theme.dart @@ -31,6 +31,7 @@ ThemeData buildTheme({ surfaceTintColor: Colors.transparent, scrolledUnderElevation: 0, ), + splashFactory: NoSplash.splashFactory, ); } diff --git a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart index 3d5969e4..8075c572 100644 --- a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart +++ b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart @@ -19,12 +19,22 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { required this.item, this.onTap, this.showBackgroundColor = true, + this.intensityIconSize = 40.0, + this.titleTextColor, + this.descriptionTextColor, + this.magnitudeTextColor, + this.visualDensity, super.key, }); final EarthquakeV1Extended item; final void Function()? onTap; final bool showBackgroundColor; + final double intensityIconSize; + final Color? titleTextColor; + final Color? descriptionTextColor; + final Color? magnitudeTextColor; + final VisualDensity? visualDensity; @override Widget build(BuildContext context, WidgetRef ref) { @@ -126,6 +136,7 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { ), ]; return ListTile( + visualDensity: visualDensity, tileColor: showBackgroundColor ? intensityColor?.withValues(alpha: 0.4) : null, onTap: onTap, @@ -133,6 +144,7 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { title, style: theme.textTheme.titleMedium!.copyWith( fontWeight: FontWeight.bold, + color: titleTextColor, ), ), subtitle: Wrap( @@ -143,6 +155,7 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { subTitle, style: TextStyle( fontFamily: GoogleFonts.notoSansJp().fontFamily, + color: descriptionTextColor, ), ), ...chips, @@ -153,17 +166,20 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { intensity: JmaIntensity.fiveLower, type: IntensityIconType.filled, customText: isVolcano ? '噴火\n情報' : '遠地\n地震', + size: intensityIconSize, ) : maxIntensity != null ? JmaIntensityIcon( intensity: maxIntensity, type: IntensityIconType.filled, + size: intensityIconSize, ) : null, trailing: Text( trailingText, style: theme.textTheme.labelLarge!.copyWith( fontWeight: FontWeight.bold, + color: magnitudeTextColor, ), ), ); diff --git a/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart b/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart new file mode 100644 index 00000000..bc042534 --- /dev/null +++ b/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart @@ -0,0 +1,118 @@ +import 'package:eqmonitor/core/router/router.dart'; +import 'package:eqmonitor/feature/earthquake_history/data/earthquake_history_notifier.dart'; +import 'package:eqmonitor/feature/earthquake_history/data/model/earthquake_history_parameter.dart'; +import 'package:eqmonitor/feature/earthquake_history/data/model/earthquake_v1_extended.dart'; +import 'package:eqmonitor/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart'; +import 'package:eqmonitor/feature/earthquake_history/ui/components/earthquake_history_not_found.dart'; +import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; + +class HomeEarthquakeHistorySheet extends HookConsumerWidget { + const HomeEarthquakeHistorySheet({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final state = ref.watch( + earthquakeHistoryNotifierProvider(const EarthquakeHistoryParameter()), + ); + + return Card.outlined( + color: Theme.of(context).colorScheme.surfaceContainerHigh, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const _Header(), + switch (state) { + AsyncData(:final value) => value.$1.isEmpty + ? const EarthquakeHistoryNotFound() + : _EarthquakeList(earthquakes: value.$1), + AsyncError(:final error) => Center( + child: Text(error.toString()), + ), + _ => const Center( + child: CircularProgressIndicator.adaptive(), + ), + }, + ], + ), + ), + ); + } +} + +class _Header extends StatelessWidget { + const _Header(); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colorScheme = theme.colorScheme; + + return Row( + children: [ + Text( + '最近の地震', + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + color: colorScheme.onSurface, + ), + ), + const Spacer(), + FilledButton.tonalIcon( + style: FilledButton.styleFrom( + visualDensity: VisualDensity.compact, + padding: const EdgeInsets.symmetric(horizontal: 12), + backgroundColor: colorScheme.secondaryContainer, + foregroundColor: colorScheme.onSecondaryContainer, + ), + onPressed: () async => + const EarthquakeHistoryRoute().push(context), + icon: const Icon(Icons.arrow_forward), + label: const Text('さらに表示'), + ), + ], + ); + } +} + +class _EarthquakeList extends StatelessWidget { + const _EarthquakeList({ + required this.earthquakes, + }); + + final List earthquakes; + + @override + Widget build(BuildContext context) { + final colorScheme = Theme.of(context).colorScheme; + + return Column( + children: earthquakes + .take(3) + .map( + (item) => InkWell( + borderRadius: BorderRadius.circular(12), + onTap: () async => EarthquakeHistoryDetailsRoute( + eventId: item.eventId, + ).push(context), + child: EarthquakeHistoryListTile( + visualDensity: VisualDensity.compact, + item: item, + showBackgroundColor: false, + intensityIconSize: 32, + titleTextColor: colorScheme.onSurfaceVariant, + descriptionTextColor: colorScheme.onSurfaceVariant, + magnitudeTextColor: colorScheme.onPrimaryContainer, + ), + ), + ) + .toList(), + ); + } +} diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index 2d46ee26..1d2fbb7e 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -1,5 +1,6 @@ import 'package:eqmonitor/feature/home/component/eew/eew_widget.dart'; import 'package:eqmonitor/feature/home/component/map/home_map_view.dart'; +import 'package:eqmonitor/feature/home/component/sheet/home_earthquake_history_sheet.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:sheet/sheet.dart'; @@ -63,8 +64,13 @@ class _Sheet extends StatelessWidget { color: theme.colorScheme.onSurface, ), ), - const Expanded( - child: _SheetBody(), + const Padding( + padding: EdgeInsets.symmetric( + horizontal: 8, + ), + child: Expanded( + child: _SheetBody(), + ), ), ], ), @@ -93,10 +99,13 @@ class _SheetBody extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - return const Column( - children: [ - EewWidgets(), - ], + return const SingleChildScrollView( + child: Column( + children: [ + EewWidgets(), + HomeEarthquakeHistorySheet(), + ], + ), ); } } diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart index 7dc33f92..8355f4af 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart @@ -15,10 +15,16 @@ class KyoshinMonitorStatusCard extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final state = ref.watch(kyoshinMonitorNotifierProvider); - final isInitialized = state.hasValue; - final latestTime = state.valueOrNull?.lastUpdatedAt?.toLocal(); - final status = state.valueOrNull?.status ?? KyoshinMonitorStatus.stopped; + final latestTime = ref + .watch( + kyoshinMonitorNotifierProvider + .select((v) => v.valueOrNull?.lastUpdatedAt), + ) + ?.toLocal(); + final status = ref.watch( + kyoshinMonitorNotifierProvider.select((v) => v.valueOrNull?.status), + ) ?? + KyoshinMonitorStatus.stopped; final theme = Theme.of(context); final dateFormat = DateFormat('yyyy/MM/dd HH:mm:ss'); @@ -58,8 +64,7 @@ class KyoshinMonitorStatusCard extends ConsumerWidget { ), ], _ - when isInitialized && - latestTime != null && + when latestTime != null && status == KyoshinMonitorStatus.delayed => [ Flexible( @@ -72,7 +77,7 @@ class KyoshinMonitorStatusCard extends ConsumerWidget { ), ), ], - _ when isInitialized && latestTime != null => [ + _ when latestTime != null => [ Flexible( child: Text( dateFormat.format(latestTime), diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index fb8ceee9..b5101f8e 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -159,6 +159,15 @@ class KyoshinMonitorObservationLayer extends MapLayer @override LayerProperties toLayerProperties() { + final defaultStrokeWidthStatement = [ + 'interpolate', + ['linear'], + ['zoom'], + 3, + 0.2, + 10, + 1, + ]; return CircleLayerProperties( circleRadius: [ 'interpolate', @@ -180,14 +189,9 @@ class KyoshinMonitorObservationLayer extends MapLayer 'strokeOpacity', ], circleStrokeWidth: switch (markerType) { - KyoshinMonitorMarkerType.always => [ - 'get', - 'strokeWidth', - ], - KyoshinMonitorMarkerType.onlyEew when isInEew => [ - 'get', - 'strokeWidth', - ], + KyoshinMonitorMarkerType.always => defaultStrokeWidthStatement, + KyoshinMonitorMarkerType.onlyEew when isInEew => + defaultStrokeWidthStatement, _ => 0, }, circleSortKey: [ @@ -198,5 +202,5 @@ class KyoshinMonitorObservationLayer extends MapLayer } @override - String get layerPropertiesHash => markerType.name; + String get layerPropertiesHash => '${markerType.name}-${isInEew}'; } diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index b6b5efbc..4b355b3f 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -151,9 +151,6 @@ class _DeclarativeMapState extends ConsumerState { layer.toLayerProperties(), ); _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); - log('layer properties changed: ${layer.toLayerProperties().toJson()}'); - - continue; } // geoJsonSource check final cachedGeoJsonSource = cachedLayer.geoJsonSourceHash; From 642aea43f4518cf3a198d13431dc111141b41a96 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 19:24:22 +0900 Subject: [PATCH 23/70] =?UTF-8?q?add:=20=E6=8F=BA=E3=82=8C=E6=A4=9C?= =?UTF-8?q?=E7=9F=A5=E3=82=92=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shake-detect/shake_detection_card.dart | 76 ++++++++++--------- app/lib/feature/home/page/home_page.dart | 23 ++++++ app/lib/main.dart | 43 +++++++++++ 3 files changed, 108 insertions(+), 34 deletions(-) diff --git a/app/lib/feature/home/component/shake-detect/shake_detection_card.dart b/app/lib/feature/home/component/shake-detect/shake_detection_card.dart index 7a8dc1a8..dccf430c 100644 --- a/app/lib/feature/home/component/shake-detect/shake_detection_card.dart +++ b/app/lib/feature/home/component/shake-detect/shake_detection_card.dart @@ -1,5 +1,4 @@ import 'package:eqapi_types/eqapi_types.dart'; -import 'package:eqmonitor/core/component/container/bordered_container.dart'; import 'package:eqmonitor/core/provider/config/theme/intensity_color/intensity_color_provider.dart'; import 'package:eqmonitor/core/provider/config/theme/intensity_color/model/intensity_color_model.dart'; import 'package:flutter/material.dart'; @@ -38,47 +37,56 @@ class ShakeDetectionCard extends ConsumerWidget { JmaForecastIntensity.unknown => '揺れを検知' }; - return BorderedContainer( - accentColor: Color.lerp( + return Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + side: BorderSide( + color: maxIntensityColor.background.withValues(alpha: 0.2), + ), + ), + color: Color.lerp( maxIntensityColor.background, theme.colorScheme.surface, 0.8, ), elevation: 1, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Row(), - Text( - maxIntensityText, - style: theme.textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.bold, + child: Padding( + padding: const EdgeInsets.all(8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Row(), + Text( + maxIntensityText, + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + ), ), - ), - const SizedBox(height: 8), - Text.rich( - TextSpan( - children: [ - TextSpan( - text: '地域: ', - style: theme.textTheme.bodyMedium?.copyWith( - fontWeight: FontWeight.bold, + const SizedBox(height: 8), + Text.rich( + TextSpan( + children: [ + TextSpan( + text: '地域: ', + style: theme.textTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.bold, + ), + ), + TextSpan( + text: event.regions.map((region) => region.name).join(', '), ), - ), - TextSpan( - text: event.regions.map((region) => region.name).join(', '), - ), - ], + ], + ), + ), + Text( + '検知時刻: ' + // ignore: lines_longer_than_80_chars + "${DateFormat('yyyy/MM/dd HH:mm').format(event.createdAt.toLocal())}" + '頃', + style: theme.textTheme.bodyMedium, ), - ), - Text( - '検知時刻: ' - // ignore: lines_longer_than_80_chars - "${DateFormat('yyyy/MM/dd HH:mm').format(event.createdAt.toLocal())}" - '頃', - style: theme.textTheme.bodyMedium, - ), - ], + ], + ), ), ); } diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index 1d2fbb7e..8f75c503 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -1,6 +1,8 @@ import 'package:eqmonitor/feature/home/component/eew/eew_widget.dart'; import 'package:eqmonitor/feature/home/component/map/home_map_view.dart'; +import 'package:eqmonitor/feature/home/component/shake-detect/shake_detection_card.dart'; import 'package:eqmonitor/feature/home/component/sheet/home_earthquake_history_sheet.dart'; +import 'package:eqmonitor/feature/shake_detection/provider/shake_detection_provider.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:sheet/sheet.dart'; @@ -103,9 +105,30 @@ class _SheetBody extends ConsumerWidget { child: Column( children: [ EewWidgets(), + _ShakeDetectionList(), HomeEarthquakeHistorySheet(), ], ), ); } } + +class _ShakeDetectionList extends ConsumerWidget { + const _ShakeDetectionList(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final shakeDetectionEvents = ref.watch(shakeDetectionProvider); + + return switch (shakeDetectionEvents) { + AsyncData(:final value) when value.isNotEmpty => Column( + children: [ + ...value.map( + (event) => ShakeDetectionCard(event: event), + ), + ], + ), + _ => const SizedBox.shrink(), + }; + } +} diff --git a/app/lib/main.dart b/app/lib/main.dart index 5a625ee8..a085e521 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -5,6 +5,7 @@ import 'dart:developer'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; +import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/app.dart'; import 'package:eqmonitor/core/fcm/channels.dart'; import 'package:eqmonitor/core/provider/application_documents_directory.dart'; @@ -20,6 +21,7 @@ import 'package:eqmonitor/core/util/license/init_licenses.dart'; import 'package:eqmonitor/feature/donation/data/donation_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart'; +import 'package:eqmonitor/feature/shake_detection/provider/shake_detection_provider.dart'; import 'package:eqmonitor/firebase_options.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; @@ -154,6 +156,10 @@ Future main() async { jmaCodeTableProvider.overrideWithValue(results.$1.$7), if (results.$2.$3 != null) kyoshinColorMapProvider.overrideWithValue(results.$2.$3!), + if (kDebugMode) + shakeDetectionProvider.overrideWith( + _MockShakeDetection.new, + ), ], observers: [ if (kDebugMode) @@ -196,3 +202,40 @@ Future _registerNotificationChannelIfNeeded() async { Future onBackgroundMessage(RemoteMessage message) async { log('onBackgroundMessage: $message'); } + +class _MockShakeDetection extends ShakeDetection { + @override + Future> build() async { + return [ + ShakeDetectionEvent( + id: 1, + eventId: 'debug_event', + serialNo: 1, + maxIntensity: JmaForecastIntensity.four, + regions: [ + const ShakeDetectionRegion( + name: '東京都23区', + maxIntensity: JmaForecastIntensity.four, + points: [ + ShakeDetectionPoint( + code: '11001', + intensity: JmaForecastIntensity.four, + ), + ], + ), + ], + createdAt: DateTime.now(), + insertedAt: DateTime.now(), + topLeft: const ShakeDetectionLatLng( + latitude: 35.8, + longitude: 139.6, + ), + bottomRight: const ShakeDetectionLatLng( + latitude: 35.5, + longitude: 139.9, + ), + pointCount: 1, + ), + ]; + } +} From 2d676f063a2a0349286eb4c5b4958634e6da982a Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 22:48:53 +0900 Subject: [PATCH 24/70] remove unused images --- app/assets/intensity/0.PNG | Bin 6500 -> 0 bytes app/assets/intensity/1.PNG | Bin 3049 -> 0 bytes app/assets/intensity/2.PNG | Bin 5236 -> 0 bytes app/assets/intensity/3.PNG | Bin 6627 -> 0 bytes app/assets/intensity/4.PNG | Bin 4612 -> 0 bytes app/assets/intensity/5+.PNG | Bin 5175 -> 0 bytes app/assets/intensity/5-.PNG | Bin 4676 -> 0 bytes app/assets/intensity/6+.PNG | Bin 6280 -> 0 bytes app/assets/intensity/6-.PNG | Bin 5621 -> 0 bytes app/assets/intensity/7.PNG | Bin 4431 -> 0 bytes app/assets/intensity/unknown.PNG | Bin 4506 -> 0 bytes 11 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/assets/intensity/0.PNG delete mode 100644 app/assets/intensity/1.PNG delete mode 100644 app/assets/intensity/2.PNG delete mode 100644 app/assets/intensity/3.PNG delete mode 100644 app/assets/intensity/4.PNG delete mode 100644 app/assets/intensity/5+.PNG delete mode 100644 app/assets/intensity/5-.PNG delete mode 100644 app/assets/intensity/6+.PNG delete mode 100644 app/assets/intensity/6-.PNG delete mode 100644 app/assets/intensity/7.PNG delete mode 100644 app/assets/intensity/unknown.PNG diff --git a/app/assets/intensity/0.PNG b/app/assets/intensity/0.PNG deleted file mode 100644 index a89f93e39bbbd61ae387da7dde20696506416bab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6500 zcmch6cQjnlyS5t9YltXGL^lY+5WPhwIw6Rf1T&au!yrVEVYH~DMHhASE+Oiu(S;Gw z8A&kOXm|3v-}=`2{`&s8>z;M?e)jvm&s)w}d!4=4J~2-XwP>mCP!SOk(duYxm=F<> z;QqCnqy&u_i777uh#@9gYD86|oZAF}%uUrmm52xxPkr%%oFKbC)i=|epPz4PYAPrw z$jZv{@bEA(F_Dpx2@4BDqtU&+y$A%t+S*!3NQgkEqoXS;D@#d9vA4IUprBAxRD?hv zot>TEzki29p${KEbai#Dsj1P>(BR*_A^2wec8wzd&l?j%)9e4= zMMOK^<4s^wdTCoj2zh({HR677sWTDLZEGD3RkHxQy`?1(j}DW{N@@Zlkk<0%eP_(I z1l!5laBG_uI$5?&KSDe-2aGJkeL5g6SV9g)T(*|EEoj_%#jk9dN z#cMn7*~_eoCusLi`h9bVhQ}bR`VYG&XS8gq`a15lxo_RR#=y@yi2BnQz2w?+xPCX3 zE>TuZEBx}|3eCp7iAr}IS;VZ^!RHDG*OU(&;fS2Q%sgAja<5Khj-ZS1bz7yo1vF_X zkjy+JXtN#~zVwRBjJ6tajJKI(iWv#AfdpN~8Q`~fwZtrZa3yqQ@Q)|$R!y_Hb1AfE zz|DQp!v5*Zt}77ub#=8|s{Tf(E22PL(4zQa7;{j>?JH}BiJoJu zF&JOrO29@O6n5^%g{t9B6`KXYBto60suzTvFsP8}8TLbS<%vl@vkn{hUPrJUS8+C@oi zM8S=_Sj*?7B>mabG)5|&!9SfARhy|q>_6gD;ASEYZ?D+o5AnaVzFiG58T#+ao&NMT zbVUZS1E2ko&F~!2!A4~b%eeNB2w=Nkp?^n=dGy~hk+0H)4FPeF8t|SEPMV7f`F_Ow znYXC~4^UmgxL+lY0gNBy(_9y)(vIvwrcHN)q6!8h5zoiDpS1Q3X{vFiyG;=wjJB_Y;CB! zY=#O8O}urjPCHzgymKmg+7!biG4@0dpx1J6bTPp0*tW~3_p?pS-138O8TyF&{u_lN zLDWLHsYQ6@gCEsKRPmc+tCtg~&eAPaNGQH%T<+bN=AxmAnV0|i?y}jHpZM3F4t1Ep zC(_GfaC{dgTdfE4sk3k(_UedTp!1KKTe;?;OCWsL!q4;(Uo zO{7NtZTZ4o`iI=?#geGajZiWYDc%F)KVNUU{EQ(=x$*Z962$m9kFB_QitX<1o~9tl zUHY#_P=%d6%~E2!f%_XZ*IFeY3sJp1`haK6O4lOIcHrq+GFjojhl?wb!17e`FGoXR zS1f)xpy^s7neDhaWtem5jD_f-dI?H`UEC(8c2-i+?+(W!s@loa{ZG2oaZxo;ZoDi+ z7|A7vhRZWhW>*INHuZVg%F+BRrfT@v=dm~sVLBK#*?!7=ezDJ!hfMkCD_Oq@?6q^E zQu8gizL!F`tdv)b(uMEAPyYt9+}l=#@u6!G_A|4z{5QDCQysjyht~nqo4vQTO%?vO zRPWyST>m9m*<=_ya|}Bo7Hgx-?Y)XXqPyi?a1SdU@S(pUkm$^1-d@GM$=IO9R_v(? zUxW)V#zGL~Yki2!s=@Lb6FDfqIYfS}Ap@F=P)Sb(39ISOJu~<$peQqiTz1xQ0S-dx z%06K(`0oSSbY#|y)jKYMl*W~f+nMP9sPDe^m3;o^mNbFACIuS#exSHs);@Z{&-Gd> zAgKy@QtD!Dv^VrYnpk-Hzy3vo``-SG&2)tIpRbba&ruWk_@0HgA2d z@D@$!>sJ$!Y%e9#aEdeubxYn=b0K-> z(7^;h)x$aI;1T3~=V=Bs_?h9;5Gf^tmGs76YrBd1A*;xbbq>00g96_AAx=TwtlGM{ z9k%^zK>j10he9wsNQA$O{cf>?zHY7((&d078PA#Crl3M{)~HCr*MP@U zn-4+#wN$ZQ+KlL9Buo0o&M#L_H`L}#bBU9_r_DWjbT#9WG36Fkh~r~*N$8YM#?vI6 z*~I8_)haK>)lxpxGhOZRaT1FxS^lOjlfYsP)51$+4fd&Tpfp{<+7sV%>H-F~EY=bc zETY+ieGf*71?zaEt}vQ%$+S`Wm?0X_fD<@4wfo-ToFuj609pSN^vi+8O8pc%ot^B# zCl6+vs9jL2;&va~O7a;G=hR9%WN%auNydv#IYsgwRSov3Ef`Q$s`4B{-D*(@iJrk0 zl&eN|AEoB4H0W$z|9XPUYUSsEH}@Cakja0yD{=HGA<(0Yg;i&#-%W_j2di1;7-?Ck zm>*zT0WbjAo`T+MYuvE$Sa_npC%UY`(@F(jdXXRPe#Xya+%D9}qCV{Gsd4ii3%JkC zd`0>dLeTsp$8>Z?1+u3H8~w|mBTp zwtLI8mLoqQ-e@zqo^U`=zkO%vzHv8WFEX6o$FXO+nrq`rkD|m*0GXSRmu=2{wakhOH@s@*^m|3=QCu>OOlPSOwKL=^4 z6>H@%@lpwa7K`pG%wJ{yOHOSaD--nsx9sTKKksjGSZIl47x>lV{`#SpO(40zCU0}t43pAF3dE90|273Bb(Cb237C5Zl~$&FK@* zTORj9s{F=IZ|M2>exP{6#9B2(d}K@DsR*_H{e7?6P_N2hX%$k#m)B9~HA6KVuqfZl zkrtv88NWepQDU349;eq;*sUo?-O9z7vek_i|7JHtc=HVY4S&_-QM|hxA79bA_@CXw z4rDCAR^n|9D4FbfR7voQMkwQ3^&ip!pkFCHKpjPl#bR35>o-dz0;6HV0~yDm|pvyZhE|2v#)Xo>)Ru zSPkdE?;niuYVxC2H!g=yne-&LtVbtZ`Y*1L!?ca;t5BUU9vrh9e>b6dcFLj^oXH^kRIBfben1Y7k)XGMqP!V{?)BN35zc z1zAV`{RC`rCMooQb6e-eWtI(H=KjNXa`Eaf`|@(7wvgVWTUpx%QXryi(s0ZwgEn`N zl-oGaX?%=WoJ)G^pT}$|J9z6~e|HJeY1+Z=z#?)N_eJ_3S}I9Z*$p~LNV7>|CpD9| zNrQK#!OK}zB2m@OqlumDT6npLPWFh9(L8V;&Xq1eBtlM+@+SU(gEuS@(Lt=1d9uY=~$9yCugaVIsw?@XFu(S6Wz}c$X^4zen)Y^|l-*#2@yxJt9w` z$6ucEP)lyvvA+oC9WD(xOytc7?#)x9skoeYn7yG^cX>~EuB{6N9#F{C$|@v+U0`? zysXvF*dF0Jdv{d{5)#1S zlkbH&;d?^}_BGB5-?! zTdtsn*Q)tSUZ2E@*YHNLFDL5F5m(+H$rr1bkBqn*SPWg{-B1s|6TL zg|Wvl=M?uf*qh9^+_2#V*7<))gG#y{Dn<_BZu*=aD4s3&3Rmy<&GhcNUHKA{YGaZyln6RD?yP zUjJ@{;8a@h2j;-#iPaG`hBEiTMq!8de|8@g#O`(#CZ)9OH;E5|@Pde!cX@KcEC2-z zE$&|rXeGX$z)X#!GhM!Z=bV6e_DX(GUx*45b+G{SFi4}r*Et+NJ2`o?IQCgoBNMjT zQI70xi*Gekb~yx&*{x8q>IwsBmud~>@LOnEjgi_#{nXM|^G@thx2J|ioMZZP|EbT4 z7xY;(`k%GOL@fSvl(Kf@cHig!-b?`(o-r{h3@q;&Y+5^oNp9KwggL6Qv)B)!zm4!L!3pVXB znv1KtOXdRwW4{alj%iPeSXeXG=H4+-3oWw#O$t+vtFAhM$D@fCHvuf&bAvDc%sWTCmI_k_r?tuGgSS zUG8eR$3ZVNnIia%NAV^%D3w?;=m*oD1H}wnB!2gIC(VM> zv3<`?t?wzi&DUA;w@DO@h3o7<=za7Nn?k9t9>!U;YC}1R5b1ezswoQqC+o;Na+#Jc#N*Q$( z!u{hJu{^o}iTc?cH#v7_t6%xf(NDv_Utf7p;;e4cy$>GN64l&tpEI8aPFaohw;S}D z$DWfr_Tj_Qm*e9t{Jf?QM*Pn1^dq3T3qdm?s1wdz451^NW3DfM)~`Q#_txhR3cJP4 zynJ7DJyc4?T;l^?`DLc0m3vr+^@mLLcS0+bmgz96A6T;<>w}(oiJg;I^&Tfcp34X% zBgJgfVCmu%;2z(3iWc9(cm>72K>{X*%|0@7F0dAm$x-ZHD`sQPqOfXt)kih@F$L*o zo1f`r{rPT?*KY{iLF@SEqDw<9-)^eERi(#J>w3we=yXc9TP|v>LcA#^w3{E_r@yQ0 z9NF2BCGdf~PHh=!Alp^9UMw$A*X6_XBbQ?3qT9UeR?WLZ=CQvvpkw{PcKB>+I}le>0DcDeZ`m*VQhL_h3Q{Si!XrL{HdEmCNEwx#N)>)=;BPX z;M?s=_3k!pj~XUQpfh6jm1a8#1iH?`^U=g_QS_*T^t8KDo9~TsEgU;`Pky|h)%kdH zA67{5Mpo#>?r$(`uqqhg#D?muIDR)X!h?T+td*x6@xb+0@%4nbk30!2u=}%KUT%!n z>vgRU+N_3#tG(!I$~G~ol}{PiYeF1Ai{0@g8@=1*IeQ6Ew!L|tqSORGx9KZq@gi1; zf$U=Lhe)9lN2=Px1!J)#G>IoNi)Q3^;vQKNj8n9-0Q z;jnwPZKpX7zqyy|qHw;q9=v3gY-S$SwAB@P4fxY?$tJ#exb09=p0c#Z_IE;gT^PBjv!kOh;D#aDHR zGmIjkgd&x+)dK1`lp&bfh~e1)Q3FFDJWApkiH2-S2qfvj9VCTgs(*Kd!DeZC7s zxyxBTooo;GX))1pd&b8t4;~1=`szYNM5Kd*15gu*yI#JWsIIPKGTD87s;a7*I|qbTl;Fr?bu16YaN}6$Fc77HX^P= z6Q%l*%}1wh5ae}jlkPr-ATDnTN$v9L_}Py*F>0W*<$xgZmmUap&#!DNR>Tg5Zl@cT z(Tk^(9?7~8c~>7_SQd^nu7Wg!4fP2UU%DX(k28#M@@~SD4E$@cnPX2{4LxihZNn*s zI-u)JkuWb$-^W>Pp!yNZ>)<~3i3n*{L%Kq5&6<8BB+sng>=o)-p>p5CzCz+2E+NRX z^`ek&`95iuXms=XP+zhHi{~dzH~SF@Yq^Op>MJ@CC6Wi}WF6N$uCA<|i!>Z};_NvA?N7VP@Uq zsjhzBvz=^F>$1GnOeI#NX@uFV{4;&P4S?sJFcRDoS(;R$1b{dCn=Y%!cWV4%1Q_;reswXReYJI*H%b+sktd0H64S_ z_diFQKZkL3Rv|-)9%?;Dk{GK7mT?%oIyp$P!=hJb}_V0rgoh7ej2#S?rjt1B(Y{@qPIZpNrV) z>YQAoa&5R8YcuhD#fd|?Is2B9ploA*+PRVC>ndn_rPP(iPy9?vD`>LZ+2H0NG4brqV)0VUleD49*# ziIyUmE2zmccs|1$gasw!Sjk$^0#Z@3|6r&~n@wshK}(tI#f4Y%86F*oo?pU%wR9`m z@YS;U4BJZ=ln`v~zLmG@y#);4rpecC^JP?1kU^$zf^%Hn;wQ6EC#72K!woS#CeL*N PC{WZMN=57t6~ zP%MH=kc2=MW}jy-_F`{#FZVpp`QG=upPv8XT>P=dM%q-AOq66~WK_C38m44qw{bU{ z;?A{Ve%tKXHQWj^)m9^`onXOUAILpa4OPj=>XRN2o$p?s-Hi>*HOVST98IJ@;G~x$ zq(A3K@GVlz50Y^|X$42RUe<#o*)EdKH&P3lv`--YI3hi)BYBRKMB7OeHKfjz1g=0{Xe^rkf)M~m=#wz;z{=wkIA#fGOs@|u9|6;y!%!HHz&Alm%VNNuNoG1z5B!!%f zutY9hsA#dUJ_S;%xOXX~=v`H@B><01<2z`Tw6}Xe!Xkl0&Zq;+W^_cp))4#9>6^@% z`}jKx1*BkG&M1z> zc2tYw$9Y-j6s4$>EAx0f{L>EJ2a=+cTZdO~Ko9rZl;J(tmjpNRriqO$DVGZhFiDa@ zgG!hO;wzqS_$p7>2rs+k^hPu@pc$F(06JdiIOP5{=A%uPSH64B8DR8X8;reZT1qOs zgI>2E#f#J`P84KIyg;j5yaWu{$Zfy6dXUuUu_4rP?6e+u>a&#OB**44*&n;|C_Fpn zP<^#577w55lY?wG`deJ7v|Y_!hMJF}ygOM{n2l!CBCeh*ju$jEDUvM0*3rH9O(&yz zUlIS5l_N;6Jlg`KNmN8RbFDthU$}daNq53Gl&}!>W&LDhDZxp2Wn*n8w(SYrx_kW1 zCCEl0jX-^m&L~d3V!tFXT+N;dZ^Y&fcpo#rev2sMtk8whI5tn2g<#8gw)+@|YzDP01DEFBkkqaNmzN0PcwS5?|!L!7m;w3Mm za-H!(z%Mf4-NJfPBnw=_acE;<%5;e+I@zG@B@y|yGtd3T>ou&>dPY5L#|j}dZIkCz>0?LY5a4ixAc|kTvPDd zy%gG-nk2z8f~(7|Z&k@#Nkjd9#P8<*wW%sY|?aOqMxak0KJ1wBUy$RomN} zp&ecGKFXw^^Zmu$laPJoROeCd`aQF${o1{=Ps-gtTB>DocTa24Z}Qp*+*2Dbx11x6 z8y^4k@yqzJzT)c&^A2ZWV))%EOhvx7skPI4&R;4%fMKmJvmK5f#*Bx8@;1 zQfQob;U3j5TqbB5K#6~6*qqcR@#l;qv^{%qzT<=YMgC~RGSBqd9FBSr_$3T}%)e;= zl6=2zj_Rah^KLx5NxBdh4N}iat@t+Gc`8jFl zMvx`QboqL{yQ*)muV-Pm_iB-dL)iEllSey$@?77^1B6%-&Pc9Yw_eoVPQM&HT$K#A zV|rK&)%sO7LNs(Ozf7E01^x;=9Y6OZRCMw`QOpy8(_oF8>%W0z2tHQJeG77FzTPH} zk5~T|-K^1%X>jNgct9A$DQ9i9Ba3~kLYn*{mmPd*28(^{*sH`L@6hcbSb=o)h2~0^ zt9tcCu!+3)j&XCvcrE`{#LiL8@_s33!E8@cRBN~cxtk%z%rR}Y#3U>Vl`KGmoHw*`T!X&yEgZ%(aX5!&94Yf6TC&=0bqv5UZ z8C9Zjm0*vC%QX93FFCJPHYY#vy0l%`ng|{WKP|CayGQ%8LI-CUcH4ZpAP~@;oibHb zySN+21{6N?hPovJe`HtX)Hmjz8cHxm^|vUcR%eSM7tUwLnmK099A+FF3A&RF*>Ub6 zD+VpBD*=`HVG@#NCf}voSudizwwSp+#?5h+%ru2*IDg5l+=^D2x$|%K;}=1@-B@5` zrFYjx)yA8Vs@~l2yh5yk%HW)RaiIL1zG}z}q1(Qn${A+XWp2RK-2K$y75{c{WqKSO zX@_o$v#?SK>$R(BJJ-V)~)w?7IRIV>^U$5ZwYH)%Gdg%yEf2h=qvOq%_o*0vx1}UlQi?;)ibPtKfag%g?Cy;>duN9>!J;ZNEl!)(2S17VMf+th zJp#{Yd*ceqi}u~F%%*^t&ON?Gz4$qqKL%F> zYATI0jM6uRkY*>A(WARR{Ojz}ZpHw!1mT$KYlh7|_73*o09}Uv?2J zGj3UBy|gGMPHYs(%qgqDn2n@&oVdWIWl{^M_s61dUr|xeUaK_142d?5wd^VERCZ{d009!*=oE@#uAe}d* z-}CY6^g>Zi;%LhX&)V|k^$5j9 z;iZOv=Xb}MeZk;t6+ft}u0$BOsK<1DS$Z@o5p*rGA6q_}83jio>VkzpLTz*DLYStnakw&OyPh!IWIvAWK`{xTB0=btw?Ju*iz7JGy3C1oogY2Hx_ zx?@=lr}TPGtTVr1%S+k=B{lgNx8tlnLNObWeVgXjSXR<*GCiZK8&X;ZOI>*$jjR!n zulNwoqm*xNo`!poj2PbMegPAIt&Q8(#576lGDBHvibh>~@h2Icq`7%*$bB9WFqKkMQ445qaD6(nhvC}8oG8vf*O zr7P*WXvy2JT{*a~Cg~U{EVe{w3jUOx0%Q@3%zc6>@$8&-6@ttrSnXw(!D1^9N9KCZ z|IoRxPRA$>O!omTO2U}*A4}yDPwlfyVjDEz66OXpEm9qRr+b5ZYV!^jB{HGv^gy)f zfFEYf)dperQkMn@s3)WcA6hdWSLGhYCR=>Xi2#(qVj7B>V+&r4K%et~bNFqwqd2B! zzWFYjRWqC6jE{MH__W47S4&=?5_6{19Rj(hW_nFa&||YyIl4GWlTZh}5?HJX4|rm% z8T+`jIuz?gSJ4A$>YL*-=t2!AXiZlVXhw9ajlmbIUzD2p0KLyRv)Z609EL8fu zrc#?fM}DwaN)ENi$E+mKyieX5NL+jW^*`;%S)$@h8)sFg&GjQ({a-dnecpF>@7C`VqjV{R_n6sO^i1}|nU1MlDq0Mcztz?*rIpy@Xut3Nv9-(Y ztbMN8%Bs^gr0@^?OH%Hu%!@1nzr*j!o+Sc#VXXAI9pZ;!XDip!h#D@}iWT#6U z&OOvD8gh_FZH9XZE60UT=m#{7bD%01_ssVy&;lX3d*&m@4Dn%t{fhl-`Fdi2n#Bvq zSQT21J9laHk#Z`!Vz%fj?Xh|LxZ@}A(dXu31WJtUs4CsYg;Miz78MFz5xmTS5-x%n zzq=z4LBk)y?|amgs0hgJEf{%I&@z}Hj~83J6EXIg9?p5v_tA31C&m90VXZU^rWb=E z7Ce4ywi#eoral(YLTv$7?5VXJJ%qe$zNFvz&@RO7&VUt_i#qU3%i~~bGAhhceAzxqo%;bE zKsoA@_>r^Rmq-np=N&TZ558@;d)kh9Pe|y_Ob`oDie@;LM!DAq1H_KhDr1~-1#9&rzM*rAg zP86e}cMUHv<>BtzmN(Lm=hv3OlMy$q$jEfJOA?T%C3SiEDndHycLTl?ZyUDe`+G+D z50Z5+qpw&f2>hyr9GFt@1Ts%vm7Qlsn}YD{TA9(lPoPjOEQ11)v88S|^cjZU?K+s9 z6O%fNyDtt&Gq|DTkZ1#T9t<}*Bqc{#6`GWSy`e=nS>%wviU6iFd_y=B@f%9_Z&p## zL!7P`fjnDT4|+qRZ?focw9(4ChBs}8|D}kVtY~F51YZUArfv2Oz5j0(;$}jrf7|~5 zu>bwbnv8CSwkZ+SV`1#4uOuP~|BHWJ2VRl*&8Q~!Vw~(tx{{khx|&8BwQ4V;{{#5R BiuV8j diff --git a/app/assets/intensity/3.PNG b/app/assets/intensity/3.PNG deleted file mode 100644 index 1e35722b37c8a110e4d60138cc24b91f74720195..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6627 zcmchcXD}RY)b=Ghv4jNCJJDOLwnSYLtlmSS6S1rJ61}gU=%R}fYxNo}t3)T!OAx&U ztFC?g=l%YEdgeJZXU_Ru=gf8AAMcqvMq3L^MnXq|gM&k+uBNPugY)q0za+xFSM(q1 zaom>&?z&(_oSIRFoqNEuSI|_z!9l=DZ{OkHvz@kvz6y>4md6tN(iN*6hz%*g!mF@d zW7w!tY||k2KDG|9`At~kFf4^8R@fE`OT&Ju!=h%e-+Hk`U@VIX)+YZ}@)~A&Hd|n|5N=mUo$2cft+Wg1ozd%se|o#f_F^_tWn5&Ta(|X@7XXyd0eS}3TM3~PI?e-IQ7>iZ`vDR35aB% zy8RnBggQG0q*eODM81yqXsZww{4IByLw2BGQBbV!1`3(NSCaFPn5sItD>Ye3-C_p` zJ;2(DGR}cdysjJ9paL<5FZ6Vh9(On~iB(@s zrSNi%BG2C>bq!4Y>U?r+q{3KZdJ5Il%m@pvC|w$OFX!NNhwD9c3>~vv)H|_q76K%_zyQqQv8%LL;uCjZ<{{2yB z*FBdCRq9~t8<}wfYj=!?ZyWN|T>XlgRI(v-UhoU0iQ)O%6_~g_bG+IIxzF=Qp@+M^ zU;dH$-`I}p%#1FJ2Q7%?9@M2w|K%I`9>nZ1_QOK-u20&)=)B7Hj!iibsFRDO0leO3 zqa(jd&|J^$jh$|azD}&*SqOkyDLi#!jps8 z&=#~_kj?RVNLsbbgiXU1^KU_SQG@H|`mIhzuQzs{3EMH)hhY=dGihQF{Bg*&e)BIU zt(j-oPx?ff+;XlgT&70!8Wq^lV)f8i&5?vYO8wD*g8 zNRsgn`5CY|a2rzN52kxlXJ*qul%<6i{1@#~Pj{g6z~INAbZ*9-P3F$QW<>kD#%CYi z=i|6+G}E;YA|x!U4tCr)&X;Y}yp6`t&WI1C-FdG%fYd~@1GS_g&~g&;>eNWS}~($`zkLwdunmXS85^`$#?pxf^WRbzOX$?vss^KB*$jv@@vO6bZMgY<|B!V*7HvV}k#q7wa zl~(e|D5kp6V(fe^kErt3=&wH|?~(O6zJ>nh%h&Ju9Et7ULLzX{T9f`B-drIb$+1-V zx8n^@Wt_$J4d0{C8XMevOQ1Pi(DQI&fWlFfbFF&|Kxk1;Y5d03{)pp6S)5p_qim&~ zOSzV>)8dE~#N)O5KAE?YXQXXsweCt%i8o#cy|q7Qg%smd;3@*Rz!#2x*y^=Tjf{l;dkPNPbgi5iM%^dm&PJgvc8$xlwA8bAkc3l{>x8 zE}_Zd!fQGoqSBd}%!^zUUx>=d$73P_RgmQ6OP0(Y{OyW#j&n4>4OfM+%l^AWb*=DP zdseYQmDC4rChEG-F-5!B(?qr$w_>$jse?gcm1@BrMuu1|Ji5^w?R^R|1gq(|^Q&>0 zFUHv)dkS-Lvwx9ZhCUc>zz`*IO)Mg)l;52Hx{An6O@?jrg|E<6eR-Di*&M44T z!M0+w$amt5Qer>mCpV>5iwzu?oYZKZjS`2B7+1xHx1O;@t%2HAooz>aL99f6g0{yB zuI(oAf^OaWk)u}3PZXeVH^IR1DZlk_mhCY9&N89pI+nfgfkZ-y38q94h>Ccpm&8v79(Pm0$$d_QrT zskKw!1tulS`Ht(gpD0qCiCm9Nj=3;cd|K8EEg;veSF=FHPJ~Vqh6>avs5WmH9nZQa zExoy33RO_`yQv?94QJ7Zt-*`|!|Pp?m=$5w5|_7#%t!P#YnuPWKql}A;9wjuN0S_? zJGQO9b1%AFSAd9)*?i$8d&5N&uLrjfXol|z)2Jr5c+Ph9yvZpaTxd#@v2JZRu!1z> zY_d0d14N`SUpc`(2*Iue1^BqzBQi;b5yxCtbJf!>tD67p#6}fD#0+*5#H%#Avp4Lq zD6~OAA<){Z6i$uwGXHF-aRo$y+-Yy6_ zQp?FPD@Wc)u^sro;tJZ%;x5;?i079noo-61 zdm|H3Q2(**XSt?#BGfgHCLvZktsnWuD#qj`3p*(Dc&zf|{CwD&)zZlHV4PP3-Rwi@ zFb-c*Ok4tpY@lYmPZnw1e8NAtWiMlgI4;zk-XeEs{YVq*Im@0x?}MP|m*w>HVco8j zWo`LLH3-=VQgOp&=GC108-h!*8pfYn)cQ-pHXO#x1k6(H&XRpWA5D+7`iGV$tD=;uB*q@r?lFRx<+5F^h?(ex{h0NNIzn zp~36h|AYSk7snLW^UWPunIT)06`yk^7FPuRh~QMicVwbR4v!_(JxQMB?-z+lGyq%i zPLsrRMidh9PjguHIS*NecT_oYd)OLm$>~9`zW-Q08#EzLp586GH+}x}rkF)^C>Pab z^^BUN-_Q*_FGV-co4gF$XRDC%wIPY?Bet7oNuw|&B2ZkyRg?!)~th22BghN zUDShd`wsQp{fqmDZK}OrPMdp#;_^f2sNcG#N2q8^9;Bs^)##Z%!k^ME>6;;mE7WFE zcRr@lY%biS+M-yu&w-L$*>oVt0p{-=yPx#9+&VMUH!uJC^E~8*FPV##!{g1R8oMM^ zf-=ua{YYA==%RMW?#NX1XOuv{gP;rA>>+a#Wm&)!f9BvHu7~MR0NU)D{McG&2nhYv z2MXe`x)=%XV82XGk|9`-TEKG!eY1B7-f~d~5gN^#QAA9Q8a}#c9_r}VR`b3fN52R; zP2dkwbh1B4u>uGhnB4X?FwGi07=3d0ox6wWQ>S8tG1T z+#r|%wWxMPbsM#sbczVHp-!I0!4t1-S15hBFF#zZI2hG)uBMJRZRW2f@&fL}8&}E!W~XM9qo9n3 zombVlBgVP?*-U9rtyyri5r}7nRzkn~tT4d6XO!}@#l0Num*erL{ZMQoC4|P+Ww`5s z9a3^v^Xf0Y4m=Fjw26JB1Gh+rTGYOZxG#yOjp+qOo7qJ&H_O`y9gO$XAU$a&z^6_K z5b%v>*vrD?8}y$KHU0_>?J)QsGNV#4@CTe+0K!=Nyi2CPBEVn z;8Mo37Z~ClG`3TNPXBOUJhaohR8pptk~_Cdfc^XPEoA4{LL&*9Abz* z2@xMcbnR7VpyxvLzg9Fgm#tCm7&KI(BYwzHC+QosJv%a^WGL4U`sc586ZW%buuy;$ zN%1v9aQA{C0=J|`#S0ROTdi{^hkw6iFxQ*6cgAY8x#U07h?c_nB6<}2)ZJu5cu2ZL zU|$bMcOf4CXG0*t%c@Ztbecf2dh!R=*K?F}@or@3Gg|g+wyEmIN9O}PQ{i6La6-}Y zx-(0+Qog#@F_BrZY4%FqUJ?N%km&Gu#1C!w&r<4G>73B8MQZ9e=^X3$#mL~33kUGfxKiDLJaG2bKY_iR{{_a}r+b-vYStJe(hrkbp zU|dKf^(S?a)Cj)VMnAhcm`d^rtd!GSX9MWW@lh!DboBFJ&r_A4UWN1jM$QK&A>`Db zp9>u5gph}J)QPiwr%}+w+Q1(Ms0Bxg2%N)IMN&)bh>b`{f2K)JP<9g4SQOb2TjE_r zPq`6T9twz3Wi1rpFyo1tkenZv)D37vBcZEt1p!DT_<@$O4Oic8+PGE6D-48?go-+I zrSKZB0#H4=;P+#Xkw$WKRWqLF_58illkB|pBWzAFROxN; z?`N~nJl)%VRR#KoW@R3DH|)~dq11RF!kZo0h5sg9E%;@gVw0qE|AB%A44<66BMI~O zdH<0>qfiPZl?iM2%Ho=T+*2y%PzyC-FzHG_QTZO_nd1E`Y9)YOazCcP$ds7NapEHQ zuI?zAGRlO67!3}$%+D^ zKbMFkP1pxRhVq{3JFc)jPsDkwJ6#Y4q~YVu!0SjUT<5>kFw|*Z3m4<;7qIGXtH9%X zW-e4-;#2aa4f-|n4|iRZg5r1-McZSAlu7sJVQFut-1i-`R(bFa2Wj;92S?A#tnU`bKlr8f?SJOS3wzjx|*5u*wA0Xhgh_O3oTaiF%wt#=EIze0K?0V*w%Ml74B=*!{-ZdE zm2o;^+W%q!;&ac&)lwW#y1MY)yCrH|-~c0c}r~zWnXl zpRZeaZic{7YsT_nFPyW6_>_X&Ye$1AzayI${sNtVEjxQaq4}R-OJVKCHvm4p|CswG zr(sy7#`z9E5ZJOg2nA$0d$uVw{``wi*ko7s;VbrS9w$=hOdy@v^?`a&oB4})B|GeE zCiK{FfaOIvTL*3?H78^qA>P1jXPV##r^X}Hr%}68spOl78@7P2*h>*iHY2X&?`D_z zQgWg`)JV^O5s7<8Rq=XrG*Qj@+=m)I#tf%)Cx=g#2+qRPI3oiQmO*emA$j_~fy==1xyetD@ zT8P3vE~h7SP#5dZehgZ-fmE?o%#yQ08BNg-y&F6x5ne^fZw4}8A5$rfZMFRHA-oO z!M$msoL$X@!CEjIZ)>70<3RGaV3G0>gZo_eLh_;{unriJ&D!D$x56a2zO4+7fU`5p zSlf5;$qsvv8WBNMLO(GnL4=Dc0RNBet|281;U_j(Y6ZGGk5eD`#a5yWr3sO${pl;ARF9=BJ!F z??I()%ugIaQ*c;rWaaVtR~~bVBG#su`0_4-^#EsjzcIlXn5?S@{f}$X$EPQV5@UBXplzY+RRsa0{MKfNPHOV!svsbR-@XOSt z<$NTj_KkSMMVt_J`$!_Wuhi{*9cc>p2{j@wO zrFqw7FG9lX+{T1kt1rZOvDHs?;wS7YG3-XADtACDUA zqdUsxTzb(QVO3AA^J7sn#%FQ701a9N-Uw9IGbQt^ zZ<9l_rYn1Y@A2HD#jgNdtdCnMB~wHHvRT{|8J&!7=~< diff --git a/app/assets/intensity/4.PNG b/app/assets/intensity/4.PNG deleted file mode 100644 index f89929973827302b983ab5dfca643f36800ae313..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4612 zcmeHLX;_ojwx;#i)_Q2_P;A6QDj+I~w1i1*hy!6Llgb<L`9}Rf_V*2Hc=${B zUXQ(cdLr)1g`>;inQ_3~hoT$FC;V*JSseD-=U z`$gxEmfJS4W8FMmEXVsU)nAYD^RoV)<<(Sua@kE^ge4vzYkphf)lmm?^ImVxd{r|l~GCQ|ZaZJ$8$*cigt+)uY;=23uWvWk0#eACxp zqgvHLmI&~p|9(NxU`_8r#urnnEaU;N+131Tuce-R#`dQupiy>ogtUUxqt>5)dmyMt zbR1Zk+^loZ)=@(@0=R6AD5C{==ZFhDNL9WD#%h&pMKjk%SzqQQxrPs6=KTQ934$kp zYyKgJpFCs~Ss9Mw<&KLyWBQ!6ia&lx2A2d?TcyF22w7~lZZrtYR2s(bu3K#X(?_`7 zNl_o9HF-WAnfCy=ipXt_VyY2hQfTrdj~ez(PU-Usk~Y{v42s$vHYnRMKrb1%)t^2a z;M#El_!jvEg6c|2yW<(#-%kZ;H&#&$Ox3DQ{dDpZ^OaW0dN**;Hiwe1nnRdx$Pc{C z4=|nO8y_%#b73p=r<mNJ{8SsV->`5P-^t zJXLPFy=t(!yW|)+ixqgkx9HX&tDQ}BVNG3T6Pg|meh~uB{w?Y4a;!l3*`KS=jApa!P`vzN4RB)@|NK zRMz_fa!~fmoy|vi@^mevAsztvPe2R}8D=j=siDgu_ai!__NH&ok;?Flb&_->=k);d z!6W3(R+5I_)`Do3tF@5SC=gYW9Dy_jYegtD0|FCAWM;?NHxI>2e!xezK;TiJW-n%5 z+!b|W_X;G2XH)FxqtXIu*xzzWgBHDmt{lv$zVF^qQvq4;hpe9zPKJ3;AdfZT0<*e) zsF-Ktr!+^TcTmOL-Zg|W+fPZJ6i`Dg7_1XuA5<&>p9Y|JzbP~uYU#o87FIuS@33&_ z{>bUBkm3g&Fv!u;gVqFzCGjXv#>o+VmR4aH3#_71AxB_ zvH~y<)%v}Z3$NlV#AdD?agroFH!|C%P~AB4M=~h3cDGR8cDxe`x;HF2%0g^TB=rJZ zPC!QWW3|42G;`W&7X~(MAjaRBdA_jFJXz(FhSU-XJdx{s{Wiha`U@5;sG&&agca-C z&jI_fJ%H}8%~eSI`xO~zg%HS|MI|R>j#?Fcf3>hQB+QaG{wm=?LGi#VVQS>46|LKR zTQ0UR&ej}u;zD~F{rd_Otv`U8dTsB*;sEcY0b~`@?~{wHA{$Hvgz)R%X+_Vj!`xe6 zO^~#n8XD&r^XJxndPtAC5NujsLsJhZnjoiw_v;)jdAh?H)n1A>-k7+`77^(+Dv8EN zqgv*yM<&V0wi4)Eu;!y`6ddQWsTtN^so!o)j(AO}QJgI-C7^bB(|7$zRx3_rluQ$% z>7hUk)$tk%fZP>c-Z2jfTnKjuP8PndL@W2xur{YXMggOCAGH4cDq!d8M^#w0* z6Lr%d;y3pWyDp>oD!5bY4?f8XyIV&ox{RgRR3Tqx{q(^n<{ltnp-e(wHORCu{H|)Wn5jT9rL5722+V9-Q&NEwY9s|>k~X?V zaZzcgDDa4zfK^B-5=dl}{5?aMG1ea$aq?t z=~1Id&4KL$HKClm!x# zpW!7zt#RinwB{9IfQh>fl(ytOjWO;#y_tD2)j!2mfh*96>X>=7cB~Z%Lj}>e&m~0r zI(9%f0>eI_P1)@k_Hznh0+ywNJ)9ltd}$dFXasOcJp8lFK}flijnz}gC$wS%wbY&b zbgA1Z%vuAUE-|)KZ>)qvRSuA|lb^AdRY5hOV-0)L7D{%Q55p1Q%4Bfqp zsGa7bbkD=KhikCd^r8hwBnLpZfg82_h&Oa~!ge5t$~Pe{9_}*gpJP`md5_=|?P{UO z<`W{LfT)hVX6v_ZHHvH{Pb7r~O7@3p`W;#Fx1QdGdM{lL-vLf_BO2=o)EsoOP~<9k zRba*&?)YWqy6mYriHjFQS8gkz;A@~W@v5MznyY+SIT$e-Z3$`=KNWIrj9q`!{C@T$ z=yYUX%>k*5%HK*{bk9Yj<1=qMrKHObY5oQff|%JF?sOHCK|tdo#d;Ucr8?btF{H$I5u0$=;_YJ&)O zMMo^HDYxra$l}Ma$Ag^EJ!3}FX|{2HL9$t^5y@`7WayGA5rJ<)EqS}nL*_>xy?+5f zcKiu)W|W3YcCK<34d-x*$MWZvnqIgubP-U4zBP&>B`*S6H#rNbd^0QJ^{EBHbG6*M ztF1C?2)2f0f(EnUEzq?&>k(@EF1K9nHBeqe1+;Y`rHH7+L2+9~W{(sPw2P}s9@%FB zfHVYP17gV?b}KkJTc_&~jEzPv=_cL?>N1{951JIN_s{5u{MBHkmj(ZpZ+$Op}PwFE!ese);iP-+a--%7`Lm$4|{lO#alT%e#hI}9D31A z=jfQo10Qo5>#H?(iQ??6iZx&YI*it91 zrY&(zg-p9iyy{?aRPjEMC~GwtxKD0+^A2{J6*Up77<&e3-{7TcsAyO?|zs1t#$~i$rRs$PK-Ew)k*vA4{{AfAZp46~=Sbi^w&|ktQ z+ZUK6{P$RSNw1|_P|mwffKZzDt`qCiX4<8Vh^w@wi{*{hjU?RSIq*atmY-9L7F~7A z-ega``xg7SQl<^RyYp*O1KBk-fHk@5RVN`I1ao#~)p-xmHWiK0z=>9W2v)=jKr~s zEj(-_c6|;8XGpv=oJQdo3g=Hac*2Pjj+$^-{m;bz4<*IHrm*4pU;G2&h(69}fz18k V$!gogy&cGqE5*~XcHfcn{{kxkR>%MV diff --git a/app/assets/intensity/5+.PNG b/app/assets/intensity/5+.PNG deleted file mode 100644 index 5e5807637031b2c5b8125e311a4a77d07a159021..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5175 zcmd5=d0bLyxTdKbb2l2L%&{!@%*=5YozPq`cT3GJ$1S%^%^Vk`DYdaNm)ypc$PjnZ zG)z%u+MG0n#45Q07f`PCWX zc>E2+AOoEC@aVLc9d=H-#w4Ku)MbF4{tFdO@UjLo75Qgc!(WdkEu?ZCa$u zOgwneyyETdv-Q6n5P9m;BoMvlvU5NR1fuYC``j^<*c1VQK##dNobvrOWM!7^{l4#! z6m^%bh5C1OE&GV4`6BXC%#)xv=#D-9w60@Com(8&0PCyhxTxt0oYA(6{~yO+m5DkH zx1c%Wvr|p;yRcUdDDU^EJybS!L~|h@nsbNx&=Nsel7`nD;l+=gc8IV^y6(9*!_0{} zbr2h!vic3>eKg`{Fn=pYPS;%tSyH^?`5uJc-jjDNPU&(q5AVEXlJkV<{Li&{IqV@` zeBn3BAV-AMzG&&((*IF7{jIRJ&9fhI3RGH=|0H^^Zgw|m(amn z!VoNv{55?Ut}oc?`#tPSP49&xw@iYHhUHJ@NE+s^-_{+w49^+7{aYGcIb%+nr{272 zyc!OZAeh$o#)*e{>dJtb)Lf7!Gd&Q&q*$l^?gREx*(^Jz*>V3|SbnTNN^Os*?YXlr z6fj%1Uo(316N3K2E$9I&X!)lMFqKBPEGlVg94C5_AK#_oLAqrFad3fyDK@cTa2)f( z*_TEGYsxQe9q&~m>5k$G9|XpcInzYo`5Eth16l)+M!XmvFJZzDnE58i?_aBZ_Em9p z{<>S*{v%#)UmN`q@qMu0GZ1t~euYoRl^@|KwKwG< zOl}h|!PhT?#^OqY3AGYw)Q_MkD_$dw@tU?h_iYXZaq2e`+vD#d%&dlw@DiT!tH-VY zHlWgchMNE`b*~=u9YkQA!Bf6f-I?2rNdt`{m7QK59(0GrNZY-DjXny>#}@tOe2C{J zjq=DD%wMLmk3i2#4rKpPBs?$~ck+!^36k!>U$th>JRyW5=s8q@1GA<{VZd0l9)%;RjDjgQYWH3(d*og~JJta7`3+4jO8Vz6 ze!IWsKS2U@QE|jJND$C}JLw;AEhh5jD&(qoVDQL16m-z^HD!Kuo1r(T^!bVVN`Ur! zvYX1&Vg$IBK^-rDfq8?VXN%Rtk?vYNLk?KvD=icwn1M~CVesya(}$2G<4>bKC)G3d>NAdtPM*hP0`hD`NM+C@75A85k;I(uv=bit>GRVvZ828 z7*N3b)wGEabi~T4H33iCvYDD3d#%Wram|io@_8D`YL#&7`K%s(M5Vx_EZY5qd?r%*W zDf+CY4hLcVYc_oKO0J5qQsD-=u4$a;*-x1!8tJ%DVr^sX)_tt-!Q9{^(C(>^1PBzC^ii@6XMu9NXUc%e3t4fC zj}h2BId>2hA^hadVg>%*YFfc>48bKH?s$8_+eahZ+kY+8AnCh?mmGGuvkY4tr{#XZ zBA>zzcaUk7N3ASf7Y~a%j!NBsFirKFvq{e1X#`+!{5# zHoP5Hc%3THWhuKCIEM9L$puiD&)AV#Siv@WdN$3fGTB5e+{=?Cx>E9aM_9pW5TrpG z$G6>t+I#sYFyqoDI3b7|&?Df$BeZ|fSMcM!gTXWBedhvMlaCiCq9^SB&i_rf&5ZZd z4|w=+Idckj^E#4Fu&-T?Fjm+NM-9dLUAq;g+xBRjfD+Ud^%CB<9L)oF7`RBs{pvkf z?vq%1^6KbryOz}uGb!wY>H2JFxrFo6*wt!S&h?GP#Irct7k9ylDt0YS(0$7R*bT75 zZn(k+?c=i?E-ll#!ZP<}wIWe+r%vI}E0?p=Py^&Sdi`edV>I9~$zUjcCKJzkEr;&{ z*G??gzjko7&~l60VnTO!-$+Y%8v3<_*!uVZCZLeSB+@i-W<55exo8LI8SgQZyqtx$ zPN=IILDeJ>8Y=QknK=j`Ndja^K_)_6>*B)<5%1b&o<9{v=G9 zvZx1*hWdqRbZ{$N#OvIsIos&<#C=0P+Y8w#8hal8W<*TPs_A*}A$GJ;z(075M5C+y z7ee2Sewn|p+#Y|>JuDn+he@&qge~F;a^b>dnLrt_*mj^@ID4t%rU1I-b-O_iG+AV~ zH5A&F?%!{$>h|4{lTGqbXdVaV=$^hz;9J znZF+!#uafmjaG}c6UMykoTb~hF zhZBOb)}^wms!z*hC&J@!GdZT4x4thUL&l|OIq+DgT?x|TFiSXk{|CbvB{2DL%qlxd zk5`sFs8#hq6Jd~%fwUZ{b35PPD_>skJx1(OpR~s^%D*HTJinm6HzVX_fNaF{@f(Ir zR=QTS_2+CI)m9#99Y(%XmmT_222S|MIWxXy5CFE+PWp%k@4TUL&kxr=1dA;^Qbm`& zJ(&=ZTR-WottkzUyR**sC2Pnnv(gPCH{8g(y>N`4wa?shEaD-M3YVqRI{r|*y!ltN zc-$ndNH2TN%J>}GH)Br8F0l^QYKNex%`@7e;e01%y8UngfHC$@WnE|C`)HKn+-THd-`>zab^Z)K^80Y4dA<=3#Qn%ZYIE|hGWx%+ZhrWx~ z@Im4PygXBvba(oSlntmuDiQC*YLuFHZC6W?Ti@%8{{*#7mXEn&HGDQnslT*Iq~V0K zjhfFch+orm`fQH&7XDpP_Aow4?yW|-t=DjrTbl8^J00^BZyY^d8g;MiyQ!ypi}m_X z%JsKlsN^zlR;Dy+_J-0A5WoSYXO{FV)ERL-VO*-*jUP|FVlu z$UhsOV9N;z%*8S)gJWsRag56VDjoNT-8Q|JuZZOHkr+KKo;r#4a?0uL(#x7+nhNKa z?#25yB-Xz+b4Pep^DPqrgNVjgjcaKthy-wVCg-<$M}H2nU>LO(vaw)0&f&OZ;>cpE z{g6>auI(F`QL6Wb3g=618x@b-Bc6|W`M3yG@Y?D=o^s_tC2n|}tCV~mDAb^}@|wL7 zWL|htt)Gv&U85@CYdQPriDGYxdF<2?DfPqrQ`ZP6Wn)v0rfA&y;2M2&`f$<=ng3 zf9F}S%r-cg1(RBERLgz8FMq(BDe1VZiIr)dhcDn8y3psF@%xAB5q(}TeMkn?fk_IE zHT)^ipq-j#Qzda`rf9hZ1u$(-v{MEBOQTRYszW0wOy4jim?ndw_#7+p1%h0P5>@od z?Z5=1#}jOT4+eZ(91Gq=PqO=Qsz5|Q;!mo*<)hW9DHCa~1UyAWwedXHo9r5Q$!hKl zw+e|l7I`X1r#-rE(bRkvk6@OHp?;0$7gT-oN8N@DXm(H_g1#_35qEx>tYu~%Ou?b= z;XTf!p9<~0_~k)nCC_`Ma@7F5k%mULcE3E6>atZA;smRXOj_iqvt8`QN28eL8Y*9I zLSi#(j(yU#i|Tf}O<+ii-K{axQAzoV1 zgIgdG7YA=fpWHH^&lemb^XRkEsKHm0He5;@Wh`s5)dt+82Ybz2mfTSDA8$m*Ip-iT zMuHvxPO-9#ng=82&^GLhm7+sDVX~-ZVU`orOdhVyR01SX%T-j$A#2wy^O27LhSfgm zHEB>IcJ;8kvFVtem-diYMN5#-K7+sA8^$Sz`pK476civ%F?Xs8byeO6SU!96vg|x3 zjisn>&!F#-!eX8ttFpS^qhN0G{x3<_olAZmb~o>%YLI%Jboki#tF5j=1Yw+VBsCk5 z1wVbP$=YOxFQX`iM$VQiGrGi*{3T5wVsUS$(HX$a&jDLp1I!+=&C+r;=3qx7X-Bp7 zXM^QbK9Bp4`1nHkO)+CyG&0nUbD1OFDGb43T$k`i*DUDt?2jMB#2VC%zcku$4XVJ@ zEABd@oGa$9tjx@gEv^W}wrIzx{&POe-0b5f@SZHn2j-BZl7>gq8+*y!_qI2e@urEi z2Eh;YA)a7-w{^{h(VDX5$c!!p+T+(&Cr=bfLcu-ItsLkfRc2iEj>HCkdK=c!T%dkF zUeVL)A=aDlMS1-yoBjU4pcK9&kC0c+5*xVIzHhB2Z2yA7pHVL`uSjxZnl^18DKA8K9qJf~j+r?N zJK*TaY^`d`_L$E*RZJ$bc2zOLUkD44OTxRey6S}tZq|EP+QXiH>;uD{_a$@hciKkt zNBZUn7qRE8I@gK5-*feaq_b#Kw&}6bppL7#Ihn)>yOiBLpigguG*QU(5j%#hW4-+b9uJ-gV$}m zVyH%-&Di7q^{hMfoJ*@wq|O0y=EMZGVRke-?-m-JruFH{%12|uM~&4D;`sw_Kd?vn z>1TP03{fDzj{lfM>a&G!`3|MX^>>?GFD(t_(ZflzmBAq9jfBWs-_yd2Gp^3_}zlgv^sd z(x9)ceQpzxU7gJ=gWUKIgu_pZjxvzUR8H>zwO6vV&U*@E_*~ z06+j{ZSDX7duiOoyARA<-0P?a!XBi9l_~IQK#B|o`vXjDO#t9^#vzu^0WkKryKvEh zvj~iL0oYpLvNM22e;K@&;gM4V+X2wn)HW zJAlapS}Fh+1aMdoIHL+&^8%8h0p5dvt|m}d0^ITgG7^BLA+D^JMdf7>kRQUpcupZ3Z- zK^DjRZ9;YN0o%K+m)LfzUW*?F$`3_&jJz1lTG0Rn|DRmn>S}Oq-2$fMVa6{|bMTFu zGz<}OTESvW<>p}n4N9Oei6PFVfshyNBn0J;N9|E$Cq ztOn~Tkr@x@%|%%>7Prwu=$$1Ut~bH5Td7=EW+!V~7IM%_Vi%*^%JIX+^l(xpjnx&s zQwxiZH>toF{5}_4@ze2cX;Zl)zG-0TVZH`S&}Z^~*YZ}g?Fmorrh3<)6CutDzoGxT zJ?K238+Sm-uz<&t0~?}@!EaR2OY){&wM6KCq@{VD_%2?+bVvXyg#j~ zj+Rx@Gvdrd2=g7cFQo;55Slz9eN&dpRmX(?PD4SEBa`8A_z?LcTF*Oo($Sbd>2YHe z1u!xq*Kw2ak&S8AL&;2Z#<`&s<`YL@UN?K!9Zm)@|d{|OrQOTJ3is07aglESx+djC0n_xDZ z)}-tZq1#Umyb!kqj>OfKY$K2lKKg2Sw7SGK+c3Ph<%w$+VO!GbEN(PqW_tZa_O1>{ zdXepQp2y7*bR=^Ggt*@SHYWRDj&KL+xKSJTjM}5H5IxX3oLR>`PBBgRV1Yd`S#kE9 zX3$P8=n5Icl`U{I=y+XJvN+-t4Fgl|@LxObaI%>xGD!7ZZnqYu8BbLZ)GBYrU++7I zlu?LEYT)uWU8e{ZpyA+BZO}eExB}}y4#Xi9sdk%x4;6hPz88ruIQrJW<$glAIYm&^ z=b3b7yBSx!)AFYvU5{&{ox05JlD(_0EL{1D$_ETiG&y1emI2+Ix&Z=E3YqJ+v{ z*fL2JxwrAU1Q|s1PFN^`Dx;H*_qm{;#Af4mT^e(~Z{OJ%kOX?{r{b1KG1e5F_DOB# z%q+PlIVrXehQii)_B%#bGb|0zpp@+9--O_SAh9J*S5jgMqGS@y2@vWFqciSe>D#_D zMtT&`4|Rd&Ei_SHFix1hf#uw^t7zUCXbJ6Q2eWY7>ChF!Hy~%F&KB>1lQg6ljyqtQ z%NK3G2lDSDOg^_xTUoraVu{}J19}}_o6aj*RqPxKX)Lhe%wGGM)#74bftop>9#UTkCaw}h zS#H7o)fHc7vW*L_m~El&oLNGQIgxE=e^{-aXKr{Bj(6NdYxeomArt|xV^IyK8%juz zv|RH?YDrX9^mpfWN1jZj>)8w~NjZo|&mhJybYD&O_Dvmmhif|Ime75x*)0(|dmXMd z7X}4y6)!|zF!P2@!%_$NVC5lkTop+@1y_iV6s5_O*yL=NP}S5J4RIVD?* z$jmJb7wNQ9i@u3N-Q?u$!DgsbNtZgNZKH6qX(J5Fv_Zvt#fif|mJO{X-UznB@pycE zDJU9xvWj-dX(#1WmmOHrG99<1E~9!-SNNf6V{W`Gv_1$C+PKd`g#Q%#`DiYa*R*WH zhGd1O);KAcALhq7F)^(PxizQg!iikIIx%AR*^3dYKe#*atWNNjmwTJ5CB`Z*aFCS) zn{mQBT8ZDoli11~EZpNQvC=sbqUQOC)qXBfxQ!|m5+O8>B{kfk|FrrRJ~>}^k}jM8 ziW_N@jY$+Jrbq{gYAk)VF#5wmcF##Ick-|s+;dIm!=#uuwK6b9yJN%(;E!`=PMIz6 ztR=Dczmwz1W44xfCMq;!Dge zh30bEx=A6!26>R@Sb-u`2wjigq{p$~6Fj^2X*Ceg=G+FBxF8a@9MTg=i;|o{h&Vff z54?8?RWqo!k&SAS#{4U^gRN?PYATz%8(x$&?wsbZmSj8H+bt4ZMWY^FnkRi*>u@<6uCD&g%=fIB}m{#))9}|i)K9=WTNAAr!+r<#^K?rjL zD`c{4Xu6#DMGqU33Rwh2?gnOUMj%uPoIUgE!rp@&IcchpDw@Ki|0`?p`en6O=x6v0 zNTbyd^5a<(4;WZ;X)*l8uy<4U1CfhNd!hhwbUVfKV{Cit-}h{cU+rw`sp!5dyzOBP zGF@j=`jfZAL#07+U+=kt#oy-hnXTy{uermoM@0ksXce5Gt5ZFQw&}j>D|7nbST5t4 zCpt6khKP>agU-c_SAtYf&c7651Iw9?TYbAkXfi%;n{lS3=`C}Wm-lgASk~6J#1)?) z*VTamc^S27PyCU&VKMoCJQ`&D6r|KhVT!>o_qg-;D8uFolTu0;XI`RlijGpRh4iu( zL*OKK(*tf;F+W0W9A>4NBTCFjhROKOd1CB0QO1#vAod^7yxJ!SLBu}3aL z_j8WXpNI};^?#Z=6`nbim1Cnp4upM%oX9G9f>vb5?N1a%*Q!sOpSfmYQ;|n&GXMRR z0;{GuPs6_+*1#--?@EK|Px#^`Pys9gW!I(7o2?Z+H-NMXk;_ zsVg}@xkaf)hD6rnpuM}^VjwC-dSi8mATaEGkEoPEhwkcbPiq)cNounYf9ErU=4l=H zPuqQ)(uV09vhQ8qa?t0Nrep*EifGK7rMBWMJ(DP z9N-COjZvw$hHX@7aMNWQr|H<#NXN;_W6Y@CFMnm%wrnHMepXgTqkODMxkVc#UKe&x z#^fQNk|O-cJ4d`@-t?W1oBr1Gs(N}}O6kXym7siRYv_Puh=cxk?1tW6xMJw7IaOF3X;1e$j=J+%dxEe1oMKH#d=d`EFw=G_mY= zUj`?5ei&OqiG7kIh$lu-{X(7jJ1(Y`d2ePYg>#BEcqDw4k@U7uFfLug_=AYMZ8max zxzZ|7lTJ#-TAf{&m^Uadl=16alt3kg;S>Bh0Yux3hH%7#P!-^)m@EtTV%BH@4wRIp zZDp;T3a%J3E@FSh5Y}=1C!=a>IpSCo<(NwSVxy&HOs<{8&bP z%&qLVghg3RXwGGwiMc{CvA#x^q!-8Q(4DpwIZdQ^3BNO(VpCEhi$TRotCAw7Ju8fTIp@l#Zi~#>QbS6T zG5)6PY5C8(BFxS-?V#PoNX_}+(M{#Bm=RSG=D-4_e>-n*XZYdPR?=%84`aJ!gS@x7 z^J3FfXov*a!*EU6dRvS?ZmTD71@{bE`cB zJJ89d@?{(9ZYL5PwU1xUJK>nRlJ}8J=n(f)?{Y9iL`q5ak6xM4G(XC4 z@qeva|(sK_T>>Qv?Ijx}QwDKdbTGD2<WrRyep8&RD%;#N;18b7ES6t(+pFgXIczoRbb5wjtT+Bi3yjjGU&I8T( zME8OSC>y4A_4f9jka}sV%Qm?$YTDOgr)vIeNR#x|oo({d(j^>aY+cKJLf}Cs;pMY2 zWA~VU0t-lvKO_CvXH|k&#I>(&Ht=!UE7v+72{chVZ&1=q@?juddo&r`)UQ~ZUybJcb*@GPzs|;3^fDIo)juuZpzjgocJ2f z7}gzxem?v5iBZo)%v~jt&-<%InvlVhlqUt7RDneaT==8myp~Fc#OUk`w#w=aapGou z(dNa$gIA*}*XvU&`0|t?`9o~h#%93yy6a_mZy_X{AbTvzf1Prp6WB!2J4JN z+liFfc55m%9mOff5GnosjjtpB_`m!65WO|-%{kx{%Q$oiFC5 zmFwg(a|xNGvALu%w=w&!&+q@=zu)h9JkI01&+|N=&)4f*{y68Ic*)ULLQGanL_|cw z?xHnJL}Ul|Z{537h`8)v#;P2kSvV(xBihAzE)Tc|x;ncj*tfJogiJal@KT0Zvp`gw@ zdtq}j1m@^0^!)!95sAJpK|=PvyBFcXA|eOA{H_1AqhI@oh{#~g?Qs2aF&xD6RSx)#J?$Jhge7P}K@w>%W z8L1&9d>it5QBO$}l2EjYd%CWg+~a+ZAV@yz)fyD7c)d#51mubZX)2HwnNKVMJcjfwc z8OJ%&GrK0~Wx{)-Tp($o>0e6&HG3&Zsq4@rQ{B((svsdqn_L2MaR$It`g>|nnlzM$h<%{ ziU!UxO>&gmO{g0aKcCy8K+SPRru$9~uGn$sjwP>E|IP;sv~!fdfVs0K@~zIPsRd}; zs;-0yV@CNT6@P2MJR(YA%A(wzgl_S%u6R#L35U4$)!hgW(YN~fm!Upi+Z479{eP5C zdzZIf*2VAViRPvPdKY_V-0|!epnbTugUf4Ap45eh51%2BeQn32Mb$&vB# z4M%e}=^(cTllsn|y1n)Ldc%j3AZ_%iGfDaWExlhF*Rchy`#xN z?iFax{U=RW6Gn9<|2!3+qaIqpj|suvufv2Vb#RRqY(Ybu<>|;Xsal7*(pNm(>M7wC z+nm)BrF48@i{J=@2V2hdtu8ZvG6zMvCRc790=e;Vg_h8GsW!`%b=6X{1vbVVbZCSUI3WUF?&P7 zqn;n3;%_dsX%}aD05SRzwzX!%T3H1E^#!9LDQ;&5sF*uH;`Uwhg#!uTd(?9Pugvq0 zZO(W*t`d_?a%LP!t9||LBrgPrQHIBH1HC#lSo=*A6=yqtQg>v4e0?PP@lSQnk^m}f z>&V3BU0}ooSSYa&0FH3Bb`A9o_1y==NZHAKR`~7mr~q*CHlbkmUK>p`CC8AV3 zyZI5Gm7mWG6eTzUZdHBx!vC_-HG!BDX(JSJ43B346YAoqi7Kuj~8l^fG+rXQLY z0bJ_8iKg#Y023CC%}NLWg@^C)h9;vNKQwVqXa;BlM)G!2r;YB>Tk4V6YUhKapG&CH zOS-h!R^@?V$VB8xim(3WXKXl8l|^S}a0%l5PD?%FTmQzpno{v0rhrV^w=s2J$Og#V z|K_(YE*n;gOVxXsGvBHt+cG(w!raUAH{BD0JslRDYpf}-d4hKx(?(Y^-+~j`wvC`o zv0HwQ#{R0dq~0)TPkL9>V7Dsrz;)kExhqpbrB-YEnJz^@{5yXy|NiyjC3QH&4tpqt z9{^%|JYUK6@8Nl8Tf(WDe7puWx-4rNJN8oM8knHt+mAY$(q#OtZ)-Cq;G%B@*)9|K z@t$Hz(>L9ZUvKTk2T471An2Hp2&lQ%>ag3({wh5~N4WJcy?p|t?fsp_-BnP{`4^yi z7{j}f9rCQz7g2Kzdjmk9fn?|K8t>(+&c}3z0C}Ii`eq;zseC`*slXm(vuuW}$EnX6M__1p&bI91G#+~5%VrJo_!45r_@edU7GzDUwuZb zs(6Nn%EC!yfV3J(Uh%d#F?8I*ZaxBnWfb*eENWkoOfUJ)jr(mh2Odr|+{GN*{h zFK{v?op2=IMm2Ru0nzm->TDE+YzKezC+d&-OvmfbhXAcfNB@(OBP?~j{Ud)&+b|$g zsAssu z@?9q{Iu%XHLM7v-<1BqC?SVb;iJg$+<*BuQ118SQBgLIRC}@x0-^8Jka6<+dY626} zuUj1lIrb?rlZCQiIp5)YfjkLXTbdrhm;HsB$fgN1^TjDso34Y{CSOBq+qvwR=+^r= zHX)yQh012vBzg0jv+YG|*D=-SZReQKvBpiYxieRly8CF6B&D(S$WkY?iNM-WI0#ls ztuKxw@lcO(ZC&`>{XVv3$kJ3-7RsCsirg`Aomb35J;Jrc#rVv%^sm^j(Do{%WPym^ zsGhJ2s0&S0AqB~Un@a@GI1uF#p3S|U&V>0ex?3#dTvxwtV`QI;yoLY-knc{w)ZY&L~{ zoOB!ep(>_$;+Pq7^~qeT!H1f1Y}M+K>D+ZyVKuC%_xMQ#E|Md_LTBrUD0D7H@ra{(4d*h3g@y} ztuE`yDHhiL`&45O`t`b|g1alD=({B)wq=LLHILSw5VLOxi|{Z#97$jZpRZ7ke>*H= zk){#R+fkw(p<)ssDB|T0^@p|Uzh*r*gpUdL!ld~g_KVdfWEUor^<0Nvq2e{3x<1-8 zZXK6$h-+6VX;SuFhwiA)j-uSUVS#lGptv8kJ__u+2N!DI%=AK_0v!gE|2)*E+n z?SOI3(>gKzmoRki%vejiTYZxCxMuC!TO_s`QkW0CWvIaUQIs zCI;Gbpp-NW7vrf4he7t!^J;H4m40hPZoka{^)AK6lpi)+`t_Fb21Ng}8;D6G7a-=| z7MYv6#kp>)TdK3tf9=LF@2vwBi3F1UgM2G(W_K02z$*2qpPgxG`4Er>c+URIS%}EX zWrAo|)BjsnMyX)wYeaf^jU!h(0|YO$jf_fIE$xH{y9T>%7y$n+JtN*?cwSSW^B=_Gzd0+M#Wz{sNAvZhdle8t6kHNkEHJ7$(TMld%@cX9<{8` z?0%Y?K2H3Q0|Pb{x4J7MInbR%kk&-P(k<;@4xPpaxmuLU43N9>%(EiVSW92YmnoC( zlV-dk!XoXO4M&x4vL+;Yc+k(rCu^`v9!^|cgfWUbO{W@S`ewe%GL}|iftY+&dd%!% zE*0)1m11PqH)A&<>xJc6GRJ+=drRCHCCO6s2k-H@&l`u*_M|>AXYS2BU6_W6Vh|8R%J|egx^uXIS@?az%bmuy>)4gNs<$6k)~+(4mAT%+OKr_7HP8K{ z+{=4YeRv+GZUzH61W0M1Vqv}OKAw*$eVz90-+Qa6h62Sha%X06SWuqZNRjmfFY2uW zK^Ixn2)Po?M+hTKPk8UfG~|ZBRR(9~v+rzu#j7!)wYeL4Vs9+{$d#PXR-wPYmbTO# z>z>|qYSWV3mjlQVs`MFqxlOsisL-Ju zk8D%WC*X&Km;3qp%|(h$wcGd0{Rwo~oZmr3EwtFhC@uNYDEfuK3zx?`xN6+_0V_vQ z+3hZEmK-HkbuaG_%yCBq&{|yWD7Rc`nTuZ{J)*PncQI|74lAu*HXJp~Zcb=9SsyZh zXc_L*kDtBJm-QS(fk%p;Mt63nOC^tMqQ&YRcSYkAm!R?16ftcfUG_V%+asTbW zuc_C^yVD8)DgmymovG*M;J~u?8dMZDtlvZtX-d>dZJmNwCjOU0+9>G@*X z`TjM7p2K!~mdM_!hn?+#7&}QCwDl`mviV*DgSn!!(AT_{>~r&uU0+s4JQy7!$M6Q}`l2H2iDL!n58sp$6%J{vb~L1+3s50g)$x*!^MWF9f|l z9;e;-z4D#Zck^@7_%ngGN%3p`^BjjyzOaZ{Ud*nnviUlT_x$+nJGEh3e!0Ew!rX&;C-S%rI9wNJ0rPQ zOsv}OS?do5K;FqLM~~lf=+3`-ty2tVd}0=x5a9~ker>gJbV4ke_KoP3j|^=j<`-A4 zKd4E*Km7J368c3Enag5aRhyG#*PjU1@8yxaqw{LolD(Q2ZB->9@&B?H zBOTOwoS5dv_1X7hpeMK31cJh%Z*T5gVM7R*eYrSdW(UbD86{Zff(`)R{-t zG7AT$zRTs7B-@o4^?cn%Cz;;iw2ka}Az_nO=Q=teS5owGnIILY`;mexi7jld0orK) zI^I)vG)Z2$_kHt(tKz>$mc-HbJUHtV_lk;vAkPx&Mv(sti4~9h1Npy|28;$)F&#i; z%&AWLBO)HmxKm+mu4`(h=RQF&ziQ?XN2)saxM%Rg;V#q=vsEXeAv!j_$Nmpv&0RkL diff --git a/app/assets/intensity/6-.PNG b/app/assets/intensity/6-.PNG deleted file mode 100644 index a34389f3bc810d34181e6c8a6e9bb2c17b346fbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5621 zcmd6LcQ_kt)V^+2s*0+uW{py6*LYR!5>4zHwKqj;gh)$YqtaTjnh0Jawicx|t5$;~ zYHzLCMDT_L4Uv!c`u+X;_xsLuo$Flp{oK#}ob&v7k}WNa*jV^jn3$N@OpG4_nV8N} zPLuiE31f8@Bz{uPgaM5nFxBD&2q)mYx1PBk6Vu1kD@U#uPOz8dBP#>OZ6<~SGs9M$ zp>>nt{1?O1m;ryuc%R6?bTWqf87Hx`&3Ng<_}0uYz0F8?#yHq#=!-C-o-%3+7#r&h z%e#zFJH{lQp>mDUR>xRbWcXV$ic%Tq9LC#7#{4AX6Z*7|wBDwZBKjO?0Xp^k{{|D= zaCgXw`tmbl`!FV^tKFx0ra!pcgNccYX!20cD$;p#p3QdFxSnbF0;}rs!TB&|#d9~0 z8Fh|2GMv>+ia?Y3`mOx1h1q$vAX&W1ry3%0i*e?}^8ZLAuBacY2~=YVWWx0Hbj(M) zqoZ~EqxENYC{g(Mn= z_ZM#{3XE+&KmOD_4mg6{Dsn)~Mj`gc+3&bJmXEB_bX0!2^h{Y6Q1{y9yUnkdC4v}>J2@zo@w_EnD$rUG){FkbVUe7vT*%AIIZYGV03Qnmlc+!9F z>j#UAC`_lTzq-Vb4aZ9fyA03BNqw8!jK;V9FN*>a>n2GfiC+ufb#Q~DA>A2r`ZL+= zQBS&gE!pgk^CavOfCkx6FMsv!a`C~=B%?ST>_vZpg~ZVo!aT$}F&~NuWw$~CDuT;nCHmD#2jI7arq%1Zhr&}l!<(;7pYF}!_>Se-tQ(1Ubvs7~0 zH{^tFT(6dON}XA44B810tCaCJ$yRpHozZF#H_O1@E>pz^uu1i|Y+a}jB!3^q1on*H zw#$&{YGy`<9B=^GHpdqthYQ(X)xPta<2v9qtAE}o9Zd5mNeaTl0ZWwY2Qix*xV++9z}dIX3r&YeAStlny#on2mbPXRs;7jU&M?p=}|Nwr?V zSbL&$T>?4<@4rRFR*MbEki$N;E59nTr3Ns$)UHjgDN=$#21B}9v7B41E9D28q|U0E zNN?kH4zTA@TdPX6_tOi9GWhkgsI#V2yzbnhP_Nk6!T|wlNQYDZe)q727|W%`wg@Sa z3v3rL1D6F@zmiII5o7`!BfO1Z8LcQ*K$1$)6cjIp(5E{*uRL4TdqBqrLP?!5jDPPnw#P z(j2l!?gDDSGwM5aUZ#Fju{h;vb5?dLVVzkQ#7`VIOFr)6m*d_jeh94{O?X2MNmzuy z*i>d7BE9NG490f`vt|a%pTvII`BvmPc87ixzba>#potZ=+D(d*$(esHh6lA$Hh6lp zKABlicC^L^Ehug%;;JM#3PqEU0xJUOp~2sHcE=Rde&F4$%I%1-Snl`-y+BTS{Be|_ zNLc32ksHqpMW`1q9=h_z58cBCz};9?c{n~?#<@Q#cUZzrmFCzP-Xb%fSNI5f;MP7O z|E%v;owM%)y!y(xY>tJJyTF#1M{8>eM^TUw$H#f?o+QgJgUr)g$c-LjIZ==MVdu5Q z(j#I@J*5prHxCAa6-CD6{r8ia?fOJFhivGVU0?&aUow7tZ?VNX$Q6Hl zQ@CmTkGEEams+Z#fR%!OcyVjS5966@wP#+Djc258|G3B3&(SD&$4$L_(dl8Jky9NO ziLJ%sY^rwAoi{p<*O&K5(o9a(ldTYTZ8Oy+@^h>5ucCNlv2Mq6=Z$~`i0O-unwdMkQoi`H zV?pNTeP5%BJKH_lcUDNuixIBGJw-Bn%6srj@>Q3tQB$a3F~l$5N+9s_ds*VY61E(g z`HnqL3%=mm)=Pf~5A8JGz3Rje^bS128w6zr89P3B(E_s* z{5kxdS$kZJE|2`~3P_DZIzL9aRb$}(?y(uJ#+IB6$Mj!f%bwK72gHIpSM;SpG*8y1 z4RL~Fdbqsu>c6kxGW1r6TJ!42QB{@)z7<$W*>)<_@X6nS*m~`?NtFt&;YSWI_yb+; z7r#VB7C3(WFo#iRt0`k^Jl_60iT3A>q@X0`ZS(xJB$LJk32%_E9Y!tdr%4R zgSmVSVd|91VnVWZEAajKa7}&yaId69GsS3-5_+B+db7(J1%L7_0(V@##=TdwZ(1qX z`&}9K6V(pipK3;wRl@%0ghE&!bz2`X&~DOqvV*~Vqg%I!vQZoEj(mn`1ki#zG{-jvL;^CdvoMWT>FoZ2edrwh@P3${`T#|njAwxHLMHh8RLu|NP z@)6l-aOs1((u!j6x@sM;Sf{U~=$K$WK=?Pf*-EndeHO7bU5u758_ed>^11t^NLQ31ig1uYjt)0WDb;HdmQMG-ctH!X75 z!dWI8G2`L}HHpr9OP+f17*Yn1UTCwDO9?u|$f!14zWFYJcn@MqUQ_fhbaj*nlu7>O zQ?4_L=5kyUdq1aT*78fk(0$T?nx|758J4Gvdm5@K?|zrB5>GLax&`wI-6gpRLXRxm z{-dPnt{cdPj!ST0P3p%fYbaGxs1czk*Q@HG?AT|iJcc5GWU|>!nuo6vM2q4$^?z7K zmjUup>iTkiy9`zf_8OBaJHVME@}TJ`;b`JQFz>ljg|PcOixE0H`IS$(_Gl_PLd0d= z4Fc<~C03~|BlA{1|DK8GTpm6ZK7nYDx9%Iq=&|bSujc8jK5rlsKg;tMf2i6cn&U3i z7gP5fn{K#q@yXyR(nhqmcFpz>)(0ojSPzIBp{2&MSAI66tbLMP#=?dCYY-lD{K|Fu)zOt?FuW9IP^W%8;Ns+ajcDqr#F z!%UDj)VcX+rJocY-Ng5-C{oB}?g8v;?M#*0g{zs+&wuuU8n-ny7j&+U@-)JN18x}> z7VSI|257)nmvd^H<{TH<({^U}$NQO-$MOk)CFx7#yTP2!x@!>};2$pbC67v3~ihhQP4cb9dxf>Uib z^pBTz|1)^Ffz_YLifve^hs**YF~|grH?5Wv(Hs=ba@d6MTwXqX9khj@4Y`jLO?6Us zzXsj|#UP!sY=eP8-x)nQl{?WITN2aFa^wAI-`vnL7jfs6{U^fsxq9wfI_CQGdB-}a zdLF^|4mv7>bu$cDQRi(PZ0$gmns)dNg=N2Kq3Yd9pV@YBPoi)6{n35fLuaprq4`FW zf~n@{KS}JPmJwy!cYfzct3hJq4!dTli#>_c)=|{5xbpu0y|uv-!L1K<;#CR7-fP5UeG&c+NX`T!^c{({^JfEN)uYl{RiuB90Na{c}e=-C&#$}iLk)U zXxJZa^5fIH~d`u-^j)QN2S&55Y)ylUiT3Lp0a&L`~e^ zb}%L7rf_t+MX%NAGBocG&d5%t9<=X@2W8F-O4h~Q>sdO>owRr#`!6GDJun_K)sAEC z+0HNRz8qCkdgt+c?@NIu(m9;z(CWxuQ$*YIx9P@LY1fl=>UOKQGS1m&#CHstMbA|0 z{P}s22Sh?Y?WUkS$32lzX<<6)-qJf_CSj${2sI*WbOg7 z{5U<0qx6K&-N+n?1s(LhcI~N~wib^TL*;9w3vPw^)o~xG-Js9*;OEW% z6yohY!`go;m%!x)6^JVoP|s6=&v2fv+lqD?yxWpIICMc0;-L4wG?eebz~lKXOhFPn zdu~S!UMlxp-tF#HM^kKlOk+v4`4^u+QJ`P;$=^$_H`_e3Igo*!Rm}YRbxw(<4*n?>c3fyy*Wg?5$bN~@B?dO8CaPg!O zj4MKNoVxHD-+L<5IInj`Nf}IfWL}kOw14&hIN@O?Pg;3INZAM8Ere&~x8AINjl6$d z_A_fv7qYKz0b|W-^Vfi>{xmdz*I}THm=Y>=c}2j^x(j7=5w4_tJ7S1xt)*u)gO!vh z{ZT)4B)R@uC|`{;Gi=Dd;!)nHE8+I*ie%vq1mb3ZkM#Wuo7_kw5;vzbi|$}#HVAEK zhr5O1CT4+Tle_@W7!t~L}~lld%sBR9Z$W@$}C z5gsN=ue#E&Wp3?ule+lsncyN^?4l=lBwOt;l{S~F)|yv~tP!uH)tp)TG}mT%0?m8= zdZV-G<(=F+ASLgfTYs1o$Hm_M!qIuXug!*LGFauH(@Lx;kXZkos+QnjUTo@%m8+u} z7a5tD4|h)ARu44cFF)Q*Ly-WneZx^)1Sxs#l8nQ#PAR~8fqHfDVwscrc1}+HQ%(>&Q*9GhBo`^NBa=FGm@O|KfCo+gm!1RRF6Ln^CNn`{;b zKN#Uqk9MfOkL&sOx0!IJ}?*4=(;3 zc51X}g;tvD9lQ}gbuYT;@TG$K>v9)AsWr2!BE()T7mB;amQ#aS7=K5=J))ue_J>BL zC8q{ARCaZCWIYZ!xZ4<^)hCKG*V1aN7h2q?z9&oY^WcmwHNB2}=ldpX zi#wYYK_1=9+_%O5;6@CbXfGaefU?BpF0~jvN$vr za6C2ojK%Sz5m-WqgK%(jiUI|F$7Xi(V?I>i_44xQW_Smfye1sCJIU~9oks}?%Nn2k iUt1P_eNEqnGA^+^V%-qkw9Y#1!^FViVeNybasLCir7-jW diff --git a/app/assets/intensity/7.PNG b/app/assets/intensity/7.PNG deleted file mode 100644 index 57ea18ec61b5826b9b04ff897c5fca2c176a87b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4431 zcmb_fX;>6j)+WhJG*LuD5*Z<4#0`xs!S2FQ(?MmY09iyub_K<@5N#o%fJQ?if=Cb$ zN<_w{*<=@xW*bDng%;Ay-jt|Bq(Jm>=#JW2^qgC5oNxYoKfdSVdHPn>t$WXX&-=dT z)Wd04XIt%07ksLvrKN3ex7kfg>q7iD!FGs!^2-ftZ*wW zt@5N9UrUdlQ>)bv@+xj_Bi_Dzl|OSuvunuf=P#)2qDDLa`tP^D zd@??mF6>Lns#K zE-kIOo9#DSdHmozN$vCA>Q(Vq*AoZat$xxCoE@)LdtKU7sB8KlFH*A7CrA)mivQuf zLH6q5W@==>nKYs&tXcPwAz@W$kr46im9HWN3ML;3+Hjq@D*I8uKv7vsed90d zTtudAsTCmiLb)_xy(+fWHF4G@~ov98FRHy8E?4;u2-V04Ki_Fnq0Dy%Xkpj z-F}6;Jv%lOVKT{nifF0nZO(e6uJ$i?9=yB$qp{_Kgac96I9tRIIlChLI2Bg`bjeJ zWhLF7OlL`seVv?VX}* zYw;&#bVxGsAz!t9ys8X%ix;H$%aRsTOZpX8y1fI8$(UbLqE>ygTjsKu+T5==d9l|q zU^N*tmtNK)GTbb_T}IC+h`bTVWen1l&f7Xf*&|09bP=%Y`Cd0dxs09^kH>j!XQGx~ z4VJk)3=;+NRmLUbiDegY-cJJEAeqj?h?Mu^i*nzY6F`|AX2oS@hmA+i1(_d2=mKYp zs3ijmqn&*di<(7-&6CS+i?Y8LpRS;nAE-m)^@19!n<`xWM`?Dyp>osJ!``MR6O`n% z53VxK>eDGt6Qoqd$kg42j32yRO6?j@@H}`eI|wX*%Onl;b(Zx$=OoT0r)|HDJ)270 z;HwOO@Z;Tp_j|dF4)|ybZqzDLpKubt&X^kRye*2&6il6|ptGxEzCQLSLN`RlTb)8Y z3teE&Wm2Av&)DWDzFkRYUyCt3wwU^TK;a@THuNvf#u%oauga@0dgA9O-s>;pJ;pbv zcf|It`4MJ!c2AWqrPh?u*$3Q{ntBa6iA%`oPcj4}5wd1c?8aqOed%5xA?eLFm!>p< z?1m_I$a4d;Lx+>Nf}9Q~uqHEddW-4!!#-7!D0#PxH(s$Yrua>!O&YGwmqop*8X}_l z6-l>+`ZeS-E)ygq{W5X&g(yX<5Iq}xTUAV8K75s}9oEDpr;mmxe?ODeV=3jUp6`yA z2uUuNdHHRw;t40wlAK-_lF^j$D>2xw7)~Z)4s)5vZ(D<HbD<^REYI-z1 zL>B8Pe*JhrF?{QD(jLp=tHRcI2bCV)E*tZg#cmS6Rt_lq?g~j+rp+vJdS6DM1uaU& z)m2W$4FcI6kvd*3nZs9=+F|R;=%#;(7e=k7Md`RY*U6Z%#;=@)yNRgLs*=zJIA3MD zJJj2+drfA)!td63X&oh~q?^te=Qfq>6_nFWi>Rl~BDIUCx@S_9g{!lj${~T!5Se

DBiPYIT%KClw*hl?} zr5^mz2#e#mUrbTE&)v!356Q+|4)k#Mn!m%&nYkpnz;-z~ZJ06GE6=o9h3+7`;J=X5 zFfQjZA@Cxdljw`?1cy9iW4mRspRMGk5W!_Mj}_@_zRCqekxJ%rnch3pQFQP+E>js|I$_^;uKSCi(?;5Y9^H=zouaVl4ZjDz;tu?9h9UNOeVqi$9S$-NQxAM?o@z0LZaR@^+6?p|=KdmqMQ0=FD<0@=Bx9JSXW2b#J|2ja zg-9j4@t|}2vFQA2Wqq6Zt!nbS6v8BQK?=VPL0Zm9w2z>Glr|W>l!7xoYitG%!?r}Z z#Ev9Xt`NAzAj3_S&e8t(dVc4@)pXoi(7`(KWK723)>w?lhj9=N=0ed#Gq_CL=UF@;dKy_11zzTRZ z>|}0}-|r+2IO_@>36dD>P2$WMY*=^p?W06CDGMM)s2`yVSc}<&&ccDSdO+cXaNSz! zq8P+D9G!N?9_#p;DkH&DNHJDmP^@mjj7bg4z}!L&RG@BNA-F~(%ivb_fND4Zri{)L z_j@e&05j3v??h!avcvexJ&^Emf|iJP0i}}Y#FG&@ZmN;W%o&rw4I4tw$OEbqk>UAH zG8PLc?wsHMw7$)%4)xxaMUbfuvLfSuPq4gD*f(Gk5Io2a+Dz|(YK{z-pbr`0szQW6>U~LuuFYu(!nY(j?N%^3^Fpv zb0|hKM;<~`IDHP#cp^G%^5MJir;r;Oi;l3-m0L>w za2>hq^UeWmJIIlP?s}*QQFH6qV)!^zsvRVhO6q`Q@aBHtyZ{<~oVi8@JM5_q0L?*D zYuPEZ7!g+>IJ9-@GBu%EF(0bi$n(GC3lgHDZev@;?8RUl5Aj--6F$^iyLI&WGtp2# zCY}z@ft(z{p)Dg&KmA~6b2n6A3CUt0_efVsDZ4$I?*! z>7h7sm4$k-oaPDE;0OiCI z=6*4kz@G10BmlenfiKh91FnEzL#!L3+@>yPK@)bXD$ZjGLWRf@DzeKZ)6o=bk?Y#b zoEt@%GpKjMJ7B1wK)g$RfSOf2p-8pD>rh=l0(-o>MimG$0gSuV=+kk==p)0PuPF!X zLe$U`QeYdh=C!e;u+W7F=r9X(+7cXLl1hBnyMFA;mAO2qdK4O12~pxE%PBM15B=C2 zweskcyVQI7M%2)CCqb~9$eeKcms6l23;I50&|+TiVFnBd+eWh@n*qH%8eea7`4J^Fn_2w zl!1{aKLYe3q5HzCYhbZHXdX~cpO>T7WDMGvf}0#E1ooFN$cDlbU8^<4TQJy*)CI{)$f-}LS|?sv~|JlAnt$9a6u^ZcFHb$vgte(~4A=6pP7csMvX z_^w%)*l=(hUO(8}N7xy=!?v>Qa45jW{3=KF*RwRX;Pf;C8F6sbrkvPy;bLo#>(+Lr zBdk#(m56D@JkELI6NM;fDrlj!S~*y0U(r$0P-1r-<346{*CwkbJ0LFL7W@{!Aph&m z@?=~J%M&M5#rgs+!K}()-=@ormvPg#3c}4 z#SZ5JZNRpy|7~&b^|$-8yN~->+zQ~};BP>XuK{I~0)iKGV% zISyM;pIZ?~WU^dFMe9d)U0X+0b8_r`-$v9D2*Z>fj}_dNhxH@gQT{sv??|5&-Z`uJ z!dTkFpQZWZRXlWdAl(QpI`{YPiGA=|#>e|_mb2-KpQaf3tW!ULBzHls*Fxa+AvWpA8)U&ZAWly2jw@`aUQ}EZU zr&#$dR6fx@eEhLpfpr7c+-w@-!x=-BB8EZhZ_UzoDN;c5v6O9;FS1#$FNQU_Dj(@o z9`3~q05g{>K>6{=#i+D5mrU(^U1QEs}icF^(F?6jO9Fd_iz? z8_k~;dDuK=I+3{JlWp7Xda-ITeJ1REV#>4ni#2aVS%#2-{Q?>jb~|sZNJ)~V9wa?& zJ00OO|H02-VDkQGecebmQ^(;})8*5Ngrq1;IHZAk*S~m%GGj9a8Fww6p)A%vD^OBy z?V7Sc!4*`z{|TQ^*C&B*WTtN7pQoh0jz9b`#_Gb3SHiY`=8cF1YfHP785IGK4YDwC z#vx_JNK+DeDY>yB1b7h&Ol}G?|N7bFhc5B!=SUm0Pl5X)-5V!c-Vt9=T$oxWjvMVf zW*G_91aFL-|7vGK)SbwP-!n036Z`nKU5+fsa21rEv6XvUCffdHB7_I+!246%&|WCf z5g_90xt3@H$hES{88IytORnxy;~_pq1tK3n6=F;10g0LbMW-T1yLcDcb`RQu*Lp}n z^r9;~=R2L8AOvW>7xAe?_>^l%kgWSDE>})|Te(vV7hbjKFG^q96~~`v*x1EE@8E}Y zF=hNS%}sZTu8YK_EldZ*IT0%lNO94CS?ULy10LZ$_ZU`@d*;A zo|JR(x#_q1JYC~bP1(Tn1Pw#jwJcMSm=(l~46aF$o6n&Va&F$}2%XtOQ<*n9QNiq| zDSt6Kfi{d&JO*-TwEnx?NMiE(Jwf6tK4_7V$Wt>DsY<3y=zRR$whfHHXd|`uf>6Vl_}W>(`Hm zcnYOwa{X>oZtv2@&aCZj4tZ`KH;EQhb!v&(-bM88XAmP8UZK)a{U*p{$}?xQ;0vG4 z;HTq1@S&5S<~65d1GffUBDx_d?UT2V%_HhFeJHVt>_SsXv$r3RyE2jE{h}3!-PGgn zlG@1E23=H!@c7z3V`-^i+uIa>lMgkD?TTufRpojVhn7;}=(A7gge z3c6ua%09grHQjCEuju-`=fwL`4b9W;CAC7yTXq%cdRNm@QTFLdwQu-kjOqp;bFdn@ z=?H;7Gg`12?+MTS^mB3>1cAno5k=&Zp}$$Oo&O_+CtyFr-tM<9EPF4OFDoVZB`^@5 zmOrE9C~01iWa!{j2)emy?|YSI6`w7?B^S74trB9b$LtchP zZw~iPw-&}$s>9tv8cv@I!6zlIvL2k0fpnC#fb>p-9Aa=U5diU~y2s8}6L3RU>5s^2-LCKa<$U(xb0UF!H?hqL;-N*yDT) z8K@yUsI(ipmdRu_>S40BU?It{3(wZ}%hnQ7Sn3e+C7zHNYiQJlbdb%;3X2x@>GmAu zJh^f*zRj=^)`H$oTm&uxnV#|JeLyVdjHOn^=Ce92A<3M_^*^-Ismc-se7LmGhC5Nt zT?3YR=C|y3NS1ju_nT7=wGC^N0w%n|^12?H-64~$vzzLYW63?zq`(Pc$lVBbjp%nb z;?|Ps^B*6Xbt;Y>2g>=&L5PFDpLEsjzmlG{Eykyn>TV;Ad2%$pKsKIq!kszFG#V$mACK7k?v1%UTaw^Ixi^4)vMq4VkW+y~_YGxXVf8 zP!<+fDgs)rQ*g8-tyeQJuYcjIwG2R}lt-mBuk+j0%9~`e-MW)~OJp2&39}M*iR??4 ztKbDKk8yd;v(PJH3B^|=j;Bw4bse?rU*E_l-PCf1Gyz25GG}TOma%Z<|AzDJvGw_4 zC$!RvX{_h9SA@kMgs(nGz(Z5!xp9?YJOVM%e~*w1Ry`HA0q+9>oP`Rz(9*3e{z z;Vy6(Bo}hw5kt`Ji98Cua_OOb0d}7~h6e0743gEAyx*4Ih+YnRpHj?zzm%I~9{M$> zuUnyX@oQcq-^Ez0CMTiSqapL}Ux-p1JH-l5;&QY&xz5isU=#Za*6Hx-nTU~Z8Y-LJ zr^?-s=`!@f3I+EPMhxXFOBWZ$aqj$r4M$(mQ$o2S@n`sEbH};E&RF^(XHT5YCxN4D zq(biz(mjMCjF`?}FKh65d;N&a`BZ%H{wVGX5shKCWk~RzP{O>FCIhm0e^1r;~ zh=%p2qfs}P(A4(s7U=K z`bFZeX3hl+E?#yl9`s{B+rcB$2W-DvB!+NH~BXpo0FD+bbMz0Rz=1A6FNz5X+QBUQCO;Y=Xpxw)4Q98 zFuA2;P8(U>0%FGBj}6;@J*F9ZXGk)l@34W)@Xx}LJ5GC2Ph)&xiMj%%~{ z4Em;SUZa?CnY)UQf|jy})_4)9tu00t%F`hq(Qwo8`+4y}`4O(H)>l;Vfpb(~+H#0M z_hW4TYKz3nLm>3*BEU_T4BxsR9xwhy%W>a(v4{J}h&5)mMvbB0o?B{gg88)c!W8ec z+FnIjs{_hYFa@|=w{^-Yi+3tDLSeQ^WlZDoxVcH>@1G~LGkS5W>)S+XoS636`&VtZ z?1RSq&_u(<2~ca0@R7I~>six5d+b`l9B}7lSt`(1b&+M9@D z5vP7k7+U`_7^DPgkNH(9#qOT4l}Og=O>OdSCrK$V<`@zib`O){h>Kdr`}5w2C~8KY?;jpsO$dIUKbO91?}`e}gM>P+ zS@x_sOJjoN*)cMOWI&dk1AfZPk5rlicEsdQj_P;5^dVE;FFlq4HPDI{8h*gZK4Cf$ ze$h(Wgh!TOO#&8%AB-hiSJQfZbiaMhn;g)`<=c_1_7p{ z9?BZbT7-Q`ThElCDVhJjDj4?Y)Ng3#Ggto2KWBfZYtd&XUhWRh_rVByAyJphwS z{sUCyfWfEM@%>dtw-1MdHKFQ>AxlbE>A py1hsR{Pk}D{n7i_c5h>hbwsXvkegRkC*q)T%@k}>ef4hie*jv3)06-J From 180a90ad7289cfa50710a94f069aacdde2291ce8 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 22:49:12 +0900 Subject: [PATCH 25/70] add: hypocenter image as assets --- app/assets/images/map/low_precise_hypocenter.png | Bin 0 -> 7942 bytes app/assets/images/map/normal_hypocenter.png | Bin 0 -> 3959 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/assets/images/map/low_precise_hypocenter.png create mode 100644 app/assets/images/map/normal_hypocenter.png diff --git a/app/assets/images/map/low_precise_hypocenter.png b/app/assets/images/map/low_precise_hypocenter.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed72ea6816a144ee855ae323eece701a4aaa355 GIT binary patch literal 7942 zcmdUUhgVZe*EhrjDI$UtMVbZCgd!?Mq=;NlzzYf_gb*NrkzPcR5+D#CK*4s=P(+$i zB!vVFy#z!==>iGT5e-NO1BA|ZxX<^k_5BI&d-lp?t(iG{X3os~_Wtet_@>o0QDIqO zK0ZEC^Xq@v@bU4h?)?r405xalY_x$t@V%?%cEZ3TREulm<5Q?L|I64e^v&Gx-~Pw? z$^>ry8E_(fbz*h2808g{G7VnGIym575s8aOJ|m4Ieux_?(xob zTB#mE{@STrHQpV(zT1 zbj~sH!hre%R+G)DM5|@E1%NSoKI(-@aG%c6}4^b4DVVb0_#k z^ceEl6I4BZQUKQ?l~2Gxf}ZU<;XbT~tP3JvM7Kz8Ct9TBgkJ~R4-48ovGx(~IF4!H z2a{;kTl0UaTNmoKHWSNb0yIX75cYk05|3vl8maG8to>ZX?=Es1JH?EQb{FRT7XS&_ z+NCKt8`Pkv^SgDsn>!1QE+J_Q=^uwc(zE9vr1Yi^D^pCkx{~~{|Ab!<^XEpNPNgD1 zGP9>K4Kh-s>QN{&!*_z1-=4T91xC*mQZ4$os@Frf3q4t*5t|c(I-`gP6H_5HU4o7z z-ExfD1ic#TO%CHbRxNQlu=oZ@I`JGTJ3%QAq?Ip-affIaCt}6vM+PJ*^HrjD1j(#p zuuviNlfUcT&eR?(5V3jV{$xx!P*a*ev1nyrBYi*AI6>}2=!({D4Npx0{zUZ^L}AtX zZo$y zH*NmJ)1|0FiTB7P!?;O^+Q2EyxBnnua1g6_0tf2g?WC*s#$R40)ZsKfsq`cpxx5bG z|Ha$XieyOAqB4qnc%`F)A}W|$aB|~xTz8}XIX^>R!`Y1xHH5a!qcLqUPw}>7`7Z+p z(NM=;Wy~#8p9Uxt979ZTP^ zv-ntXSO`5ntKg?U*Hv$RAaz)RamKR#1eq-jk}qG;5wlT4cj*q@M;jiUS@R{A1n-7d z%{y%)H#5!w3sXfMMJdv3@=lbhir0KjT~BCXbE;cIQWm_K>6kN_`e4;0Z)_Q9*Me2| zBgi;`<r3H6T9Gyg zs0D6-)d{4$W%k>A!@b#ef>oaZy@r`J_^{oQc_69_)Zr-SL zl+TYOMR6-54P&H;q^VEpNX>lRqQ04x@Y3+Ae>^SUsEpU#Vo%WKxTkz=8{91CFszZT zDz>7&S9J+I1Yv2K=m(M}!<&eGgQ5r&ez8V-pZ#z)78`mRsAd&Jube?fdT$rnHT(cm zHH1)>9s)i;@-e|YrVXvnnVukxX?rb*2&~ceC>z(e^)Q>s{~kuv7D9@Y8u$dS}b@?7Y7{TqVUTlI0lcc#X(?mW~WTnf&ELI9!8;$e|V=axAhS*i$gd3rvYc`U6_C zEu7)&Ck6%%TJKjsi}d2ZT0MTxp?vR+BQqXOhP&2NuZ7uT76$U) zo#`btpyhW@rQN0y*!Q=cc3%uc^B)xA7sUQObM(I z^5IznANcN?I0d6`c>u+3mwkGaa-1WE;AyyDFO_Z({>=J(UMyW^Px73pLkDGF9mj~i z?ahCu=@Yzkjaq>BEjiFCp2b}oN|BnZw9$D5s7Q=vRobXEY?#d6Rq@$|A~V;9`U*Ww zyP#Z#tLn|yyK!kXZJ1zno-JVx43mN>^=5p7ZZdNEDb7O33@E&k6cQnbsJ}NYKs|4= zn0bDdwabdyCs%OalCIz2t=e;5!CHO9xyFf#Ad_dvGbTH`CLY^vO*@syF08# zGBNoc&oDz}#{n*g(gfqzd7ROd{%7wBl5?cSHs2ChX?Gn71h~sYgVzoNKCE`rN+)aS zuKsGCl_}Y-wd-SUq&Qtq)8DeoImRzhNy{QyFNKdCuZNTOKKkbpKlyMa%zo)e&^kwk zJ+o5vYo>Tm|GJvil?;nTZ`=Nv!N$%W(Vv`Z37sc#qmCYFai2L+=<<;&M6k>ubdjLV z-FQWr?C;ap>3V-Na>sqP&_38y}ri5uS*&iu*r89@4Kpj5XzMx#5#uaY+W}} zgM3cRhPwa#y>`dhZ2=ncTg2?By&e|U0(EegpbHPqKOI#L5GA2YNgeJ#3Q(vQdI)BN zWtW~+n(zk;b}E?iF{oUib=weLbg<_dUE+Pmg#fKG#fpe1G22xxIY~>}S{(6Dzy#Dt zWuo!Z!n<~iR1DPW_uWZVWX9B~j zTqb%n?eS4S8MSxbt6^XOsdSN-c?Ubp9O3ft3ah&=I~O;(3zN(Oy_SVf^yd)E5SVRc zM{UGI0}-wS{rp$0Ugw=pJ{e@c;P~&Yl$4h!aDkwO81t3$bB}7}prxgIM`I}4N)L8} zgqK&!*6zM5bxb=(t25P!%O@$JHV%_=jvcfl={FC=W_f0O7C*X8PP_cqgD*zu(t%_^&$zM zO7__B+_2x{J})Og*)V3McZ0lg(5$!?V!qyjsQvjRGwx*#QI-0!P7rDCbSkU1TUIr% z1EI6D7VL1V5QWpf{BoH3DRL$v&wi)k&ns8+Fvr*_n!BYkMp?_{_hQ6)mc;p9!?RMi zRWvWyK8WcmNF&+MzTDoN%w(2GHN)5YDS0$Lmj`(~{ce}$WQ%$W=rAFcgL-Ib{~)!t z;}8x^_H?>sIVJ5T=b>5sGV2G=yp#HIRc2%^Haa*TZQw&~&=f*YpkV5s4-QZVg8(P2 zG)$Bq_E-VOwhRzu7ov&Bkt=WScR_X1^OCf_I$mnKoY+(efEvp&C+$^B85lx#CJLi8 z)8R$fieq(y$*}4ODgR}xE3mX-R2|dT_kidbn%sIr3KsO;gu0?VCKxD z0wHTe07ZDtbXo=w*8pi07P$_H^-~8Pl;wdLMt9< zVF=v21@szfT;Rlwq~uS!hCEZoWaKt;jvgrIUE?H};xgE*PN^uML zl&2qYIOfm%_V8u|Eorhw^0FE7``S$?Qf2CHn1D^opsZcxxTHauaEf*!$LpiAINhqd z=g$Glj66C9X4&IT4lGO#cXpQMCzousUU*?r1ThsYy_YbT!^>0+cA_Xa6#YPg*o({XuxA&WGRbr1Nv%6bx&JTW$06u@iFN5M=8RnI{7y3f(n0G5)OZNMn zh{X>mVdT&BUG*^(jI69~51U-i*18TdP`GAEu2`=0eFnMq{3J${)+zRw33yR=qD!Me%x=+aPJVu6TiZMN?QMS6I)PK>rQOGiya!#Z1e_{sNzP*pk0dXj4Ae%F*d>Xo{6`udB7YLCpO zZs;#?Ix`913=lovI`eI(sh;hu(oy38VBlP%F5k4C0`vtaDpu}OlkUZ6r2nTA>UL^ zbP9qOUEN`i*?7?Yl+0Q?f+;6CD9`r&CsS%ZAdfHnoP|2fCe;C*v?}Z()jKgU-+Ba* z9_Bnd)17ATl#Pq7Y4L)8%7ot~5ovD5ik~kXOxDIp{mG11>+Aw9fq3TWHnjy+1VfmM zC}|s@qd2+;$17N}ZFvA<{5i0P7(dUxK)3wc{+4jJ09$bm@JFR3+o_XTG|o{g;FfdR zpO=m{EG6sBI_Fa9*}MG;V#&~9{L@o%YImYQQckA>p;1g ze>Jr_Nvm>GjR)%@L^P0wZfX7qz}XN9Aq|&m)$^xb4Zi@HRU##c zNU0bjrnPS@lkj2F^k;KfxE&1KAG>B zo{U*v#G?WL9c}wtPD&G=W^tFxIhn$$cy!a`ohfT$-mvV}+HkwG@(GM`64`?aN1`&= zX8rw?OKP9&%3yGg41pRV=OtuSR75M{GA)WY5pB+S${6f7cQHqD;2?`3wG}8BJNRIns(-f zM8!mzBc5}Iv|3nRM08#CJIN3*_cI`ZeV9*|d`G|KA6AQw2qB4|Q6F`xYhBvL!6)xY zgitEWKI(Q(#7}K4-T9vObnfrc07C)N28`0@a_&BWDn2#-AQ4(k|~Lrq`dx8Dn@wNxXFP!6-sNe1S5f)+xhB;9 zFtuT5ua|*O67QhL4AHLSL4wH5jN@ySN1~pM8JJ;x^uK|gjK0J)O$KH4LCELr=)zxX zzmhEwumO^1?7EO+ESX}B+gF$BZ#N)h*KlaFkGPE{qn{c>$nPU?`kYYo zz3qKrvVtj}|0Jy{WhE`Ao>0d~IJ7?xkfGExZlSUA^UM*m<1@qc#AW*YY{-YtU6A zYsC+!f`s^U|1Uzxdmf`IcdTu~_$<06Bkm;)xFNJ6qs`6veZ7Wp>`vR&d#N}T0a$6D zG6tTX)KpgdP`Yw$D5GF@(u(7K6!0;B4Scw%Ob!9bRIk0sgRknP^1O_RWW;< zoVUwp|E7?}1+OM~f5#c`Tb6btF!^FjWf4niH{5_L z1REMb?OTC>LN3`?@x>96YQgj1tc}AmLu-+wz^ATtz)2xq>jzM>^ajA6TUPG7o-x|; zzmxkUtkooz?6*|;Xl2GOoC|fVOepZs808o&6rxMb>%Hyf3q)GQnETb9mw=1P1nq)* zy@V#5<6OtR8W2Lrr>#z36QnBLo92Vs?y#_N=C38at>$|<~YV3U+7Ya zx0%v=uEfeO>C;g&HdMg`p9oPVJGXZEA_l=UbGZWJ7v7E;YVU)Llyz@aPRB;G(uP`f zdwq_+ZlCTs!|&@7EljXeH1iiCp;yf6r`sgy{yUeqy}0&8eT9AJB^jS3a9}GOD9Q`> zyj~?7-!rC%CzOVimDmceZKn63CDFW zT0lo7W>o6B4g~E_B_E?$WXM3sbwC8@wP7evaradKWb{m=2(SJ{Fd`Lu#4R!fxsX?*+d%ScSR23Rtb%L` zE4o4NmXLcIt(6;*ZW`YnzwSPp=OzEKV&J=%5|5BG$N*mhe84+6?U|k6qQ1w+*S`CZ z6^unbe=`G|8|NMgIbyWddmFXJ4eMh9#v&UmGkO9SInth%C5Ui8OqV{6Z>8__04pR! zF{CIK?Wn*1WTg~Z*2|&`IdWHV#<0~>`v%0bT9pOJoVqv9M zyeif`^nUo)6%NXVx^%3cE6A8^Yfe*@n0kA8iV!La6kidM%x-^^IlT z!~Ml!7-9DVDFxk#nE)<Xi6p!O)g8QVEpzuFLzTpBlLlqPTCsFkYZM(%3U=&p;UM za#<^^6*k`GJ|^5MoyxpqGQ%*ge``)fl({{a8K1kKBVBRCK{2MqSISRb#v;i z2}mmU6vo&LmB{enHZHIHkckoQJ`AMqsHQEpX#`oYs%P|A(>nO9=VKtfcerLPNeNk&lG~B@F%Y{go0I(*|h!V zi1eR-VO}53#(V{Df)|IUPQ}bF%-JGVamVf4S@b?4o#gzk<2iW{J*)M?hkm&)n4NucE6M!v6syVm43! literal 0 HcmV?d00001 diff --git a/app/assets/images/map/normal_hypocenter.png b/app/assets/images/map/normal_hypocenter.png new file mode 100644 index 0000000000000000000000000000000000000000..fff7227cc963c7a300496ba7a2d07a1e4098eb28 GIT binary patch literal 3959 zcmd5COn_>krY;<{=*r6tI|RANm|LCcSi<0os>vIRy4mUiqg*+h?Y_S5qIjOACezZU!& zbbG&(#YsnmmMfAF3p+b)1}lcN{)s0dn3<*fJygPJWXTTpC3HR#3qF)^%2{QA2@bG0 zS#h-Q7udCO_Urbql5pIT-UC~utTTUD=?Z;tC#}}2ei0aAR!`9Fic2uH$30Bgt91<0c;bvG0B6tgf%Y z8ZJE0U@ewgzr{K4vC4ZNIKHOJ|JcXDN2u9rdy70D%f}J<=qF+yEsy07A4sl2;!&ZuUF5xVfoOeQNEDw{TZ>KN z-YEY1YfRlh!mW80>k3Q!e02I|*;JTJRbhOQYh=)InqGI)FYakU_T8I5g8c($n1^gH zU-$K04#S7gwIe}BMm1*Wfr)I=&DyLZ$|{*^rfnq5$RJ>bPMJJ_XX|yw^VV+E z3a7c|Zn}vN$uef{H7naO+yHz|hD=pp%*-$=i!j`5S*S|=ou|cPz;>)mA9t16n$p;I z(wZ?~yIHS~>tUuQHMZ4T2YPHbEA?>(W@>8V!3OKVH5+jwKP08LFsX5>*Y>8zMvUQy z2x|*d8&gf|!ME3B>Do==wv+m$UChbA$dh%}(Im6dh8c>G z)fMA&{msf^BV*VVS{c;unbf!=Tj%*$Jas~Uub25rjk@xQcuAk_B}2aq#6m1ph@<`*0Ppi{ zF86C@Q8eX#nmZOe+wyKqfm7;Z9K4h6S+cV)%=Q}wV?x-|n>?2jqyQawD~IW4`Tk-CjyH6H;X z_5{h0#x)#yiQzKU9GW`USr9@MaMqxk2nhR{WM_-fO@Rp8f^9mCqdvlFe5IrxOnAC| zakWHIF-RHmRQqXC{4}B%zMo%nc}R)~*R&l+z2^$`;^@LJ35oV?R)cEjM4XjeY6o%x^5;aG2V$RZ)jr`mVA_6sL&eHS`tV2FKbojXKa|!P{?_@{Jn)55$ zw|93uw7p0VPyLF(eHFuZjsrR-XP6bftqn_^9`!LqOpP6d0=*Uv`Dn6%$VR?1Fx%7$ z!UzOth9iGqHN9B6FxiPNP{?87PVhE?gJ&b-p;3y)y+N-!F-YNl z20Yp+b(;haTRuqH`Fzfj$p=2b0fzs*N`%^DMT7~_oG_Ng0!Q1j(!P!3G7M=OA+c+k zHpl+>*E06LNBIkh=^h;&j8H7~K$ZTHi`pTW$o-w{MaV9%dQaeQa6IP+FJ_A_U6H!| z2B0n7cj`}g66oA4~7jyUowkRUS;27r$Nr{O^55pyiAQ5BfqF5** z11h>88{p@=-R{2Y#MqG(Qih?aX}={^3MQ!CMOHK4%UHZX^y zPlLI9Fb61#hW`Otz649pcI7e`NV>O3N#GRR6?$PDTmGZetzyF*w$|Rfcy8h%tEg~h z{MDNAgLB!xX7scCi>vP6Df;d_uS2}OCV9#_qMJQCwc2QUS=?6CFs}XU#4fQ}c(Oy+ z5nL?39u!;`o6M0?t0R6To(N75ohYP~NcnG5DKIwo^d>?0y6m(g5WLyO+Si zPXXlvkEvkcGC+C5W5-}2(7oUaea3+<#RG~6eHH;-ijk7`_`qw|LzfnTITz^fzM2PE zwZmB)Z8L$JaBQ%IiyrEYut zn@<6;tp>*ea1D}fd~`CEr)EA!{H3CQto?fr(b#kdFl% z&2NGhzvgU0Vnrl)wGeoc@I7K;8bA$?ACw5Y1kmJCda1dBOq3QPs&l^&M(RcPvx$ondRDbL&*Vu>$AQ$r&c z4lqBdw0;SSvPgceAz?VB_RMA55MX2YxjhNWl-k3O#ql}1Cw_2Pa${9cfAeE;RkrR) z034RuXbI|n@=$Ea*1ZDP*N||ihxwJ#YOAn*8;+D+1%1r_ExV4ZSMeC_M(!a~o_PsR-cf}UHUstq_|A%^0**#|PJj;$RtfOIQc~eEu zZCM?;ZG>oKSh2LcXSt2e!P=2uw7h*FtHd%QGio1hGg}sbyMQ5;?OB-CiEqf!fqMV= z!+gT#EfXV(JVC7>+%h3v62srbX;Sa&WCoKgPM4?3k1kCte&y1~4E6^s(gNfF({DR~ z@<18zVy-t}zYe`EBLkhEur$?J5)f+dwi%uROdItC+YRs6{mznb97BOdC*8;Z7r8p_ zYw%48CDzggkcGSPErPdgOH(kgL;-z|KRm{+12Ti4q>lz5W?TUlK+)YF1v;b&U@0=% ztR!o$hwIPs=6n7VpwYSaN0#wCQpU Date: Sun, 9 Feb 2025 22:50:38 +0900 Subject: [PATCH 26/70] =?UTF-8?q?refactor:=20=E4=B8=8D=E8=A6=81=E3=81=AAin?= =?UTF-8?q?tensity=5Ficon=5Frender=E9=96=A2=E9=80=A3=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../capture/intensity_icon_render.dart | 89 ------------ .../capture/intensity_icon_render.g.dart | 132 ------------------ 2 files changed, 221 deletions(-) delete mode 100644 app/lib/core/provider/capture/intensity_icon_render.dart delete mode 100644 app/lib/core/provider/capture/intensity_icon_render.g.dart diff --git a/app/lib/core/provider/capture/intensity_icon_render.dart b/app/lib/core/provider/capture/intensity_icon_render.dart deleted file mode 100644 index c74e8b08..00000000 --- a/app/lib/core/provider/capture/intensity_icon_render.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'package:eqapi_types/eqapi_types.dart'; -import 'package:extensions/extensions.dart'; -import 'package:flutter/services.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'intensity_icon_render.g.dart'; - -@Riverpod(keepAlive: true) -class IntensityIconRender extends _$IntensityIconRender { - void onRendered(Uint8List data, JmaIntensity intensity) { - state = {...state, intensity: data}; - } - - Uint8List? get(JmaIntensity intensity) => state.getOrNull(intensity); - - @override - Map build() => {}; -} - -@Riverpod(keepAlive: true) -class IntensityIconFillRender extends _$IntensityIconFillRender { - void onRendered(Uint8List data, JmaIntensity intensity) { - state = {...state, intensity: data}; - } - - Uint8List? get(JmaIntensity intensity) => state.getOrNull(intensity); - - @override - 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 - Uint8List? build() => null; - - // ignore: use_setters_to_change_properties - void onRendered(Uint8List data) => state = data; -} - -@Riverpod(keepAlive: true) -class HypocenterLowPreciseIconRender extends _$HypocenterLowPreciseIconRender { - @override - Uint8List? build() => null; - - // ignore: use_setters_to_change_properties - void onRendered(Uint8List data) => state = data; -} - -@Riverpod(keepAlive: true) -class CurrentLocationIconRender extends _$CurrentLocationIconRender { - @override - Uint8List? build() => null; - - // ignore: use_setters_to_change_properties - void onRendered(Uint8List data) => state = data; -} - -extension IntensityIconRenderEx on Map { - bool isAllRendered() => length == JmaIntensity.values.length; -} - -extension LpgmIntensityIconRenderEx on Map { - bool isAllRendered() => length == JmaLgIntensity.values.length; -} diff --git a/app/lib/core/provider/capture/intensity_icon_render.g.dart b/app/lib/core/provider/capture/intensity_icon_render.g.dart deleted file mode 100644 index c55c06c5..00000000 --- a/app/lib/core/provider/capture/intensity_icon_render.g.dart +++ /dev/null @@ -1,132 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use - -part of 'intensity_icon_render.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$intensityIconRenderHash() => - r'166c11d54456f44a4543d1319dac89b3a9857ac7'; - -/// See also [IntensityIconRender]. -@ProviderFor(IntensityIconRender) -final intensityIconRenderProvider = NotifierProvider>.internal( - IntensityIconRender.new, - name: r'intensityIconRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$intensityIconRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$IntensityIconRender = Notifier>; -String _$intensityIconFillRenderHash() => - r'ffc902ad3f54b8cfcdd588157c47876d0f041dcb'; - -/// See also [IntensityIconFillRender]. -@ProviderFor(IntensityIconFillRender) -final intensityIconFillRenderProvider = NotifierProvider< - IntensityIconFillRender, Map>.internal( - IntensityIconFillRender.new, - name: r'intensityIconFillRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$intensityIconFillRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$IntensityIconFillRender = Notifier>; -String _$lpgmIntensityIconRenderHash() => - r'44e23825e54c81cde3fff5109e75be2910db02c9'; - -/// See also [LpgmIntensityIconRender]. -@ProviderFor(LpgmIntensityIconRender) -final lpgmIntensityIconRenderProvider = NotifierProvider< - LpgmIntensityIconRender, Map>.internal( - LpgmIntensityIconRender.new, - name: r'lpgmIntensityIconRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$lpgmIntensityIconRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$LpgmIntensityIconRender = Notifier>; -String _$lpgmIntensityIconFillRenderHash() => - r'34bd69625f805e15eebfa7192e71532f19e3c94d'; - -/// See also [LpgmIntensityIconFillRender]. -@ProviderFor(LpgmIntensityIconFillRender) -final lpgmIntensityIconFillRenderProvider = NotifierProvider< - LpgmIntensityIconFillRender, Map>.internal( - LpgmIntensityIconFillRender.new, - name: r'lpgmIntensityIconFillRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$lpgmIntensityIconFillRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$LpgmIntensityIconFillRender - = Notifier>; -String _$hypocenterIconRenderHash() => - r'76f8f7104e9c1218646b56290778b15bed6973c0'; - -/// See also [HypocenterIconRender]. -@ProviderFor(HypocenterIconRender) -final hypocenterIconRenderProvider = - NotifierProvider.internal( - HypocenterIconRender.new, - name: r'hypocenterIconRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$hypocenterIconRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$HypocenterIconRender = Notifier; -String _$hypocenterLowPreciseIconRenderHash() => - r'bcac14276f8cab043ecf7a29f78652b6be4140e8'; - -/// See also [HypocenterLowPreciseIconRender]. -@ProviderFor(HypocenterLowPreciseIconRender) -final hypocenterLowPreciseIconRenderProvider = - NotifierProvider.internal( - HypocenterLowPreciseIconRender.new, - name: r'hypocenterLowPreciseIconRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$hypocenterLowPreciseIconRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$HypocenterLowPreciseIconRender = Notifier; -String _$currentLocationIconRenderHash() => - r'1b5e895d96a9acf6de52b57b63f087b2636dc6c8'; - -/// See also [CurrentLocationIconRender]. -@ProviderFor(CurrentLocationIconRender) -final currentLocationIconRenderProvider = - NotifierProvider.internal( - CurrentLocationIconRender.new, - name: r'currentLocationIconRenderProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$currentLocationIconRenderHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$CurrentLocationIconRender = Notifier; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package From 6c4a49c6c0c7dfe9b12ec17814399d801580d342 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 22:50:43 +0900 Subject: [PATCH 27/70] =?UTF-8?q?feat:=20EEW=E9=9C=87=E6=BA=90=E5=9C=B0?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eew_hypocenter_layer_controller.dart | 64 +++ .../eew_hypocenter/eew_hypocenter_layer.dart | 89 ++++ .../eew_hypocenter_layer.freezed.dart | 438 ++++++++++++++++++ .../hypocenter_icon/hypocenter_icon_page.dart | 245 ++++++++++ 4 files changed, 836 insertions(+) create mode 100644 app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart create mode 100644 app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart create mode 100644 app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart create mode 100644 app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart diff --git a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart new file mode 100644 index 00000000..d08e4c51 --- /dev/null +++ b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart @@ -0,0 +1,64 @@ +import 'package:eqapi_types/eqapi_types.dart'; +import 'package:eqmonitor/core/provider/time_ticker.dart'; +import 'package:eqmonitor/feature/eew/data/eew_alive_telegram.dart'; +import 'package:eqmonitor/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +part 'eew_hypocenter_layer_controller.g.dart'; + +@riverpod +class EewHypocenterLayerController extends _$EewHypocenterLayerController { + @override + EewHypocenterLayer build(EewHypocenterIcon icon) { + ref + ..listen( + eewAliveTelegramProvider, + (_, next) { + final hypocenters = (next ?? []) + .where( + (eew) { + final isLowPrecise = eew.isLevelEew || + (eew.isPlum ?? false) || + (eew.isIpfOnePoint); + + final base = eew.latitude != null && + eew.longitude != null && + !eew.isCanceled; + + return switch (icon) { + EewHypocenterIcon.normal => base && !isLowPrecise, + EewHypocenterIcon.lowPrecise => base && isLowPrecise, + }; + }, + ) + .map( + (eew) => EewHypocenter( + latitude: eew.latitude!, + longitude: eew.longitude!, + ), + ) + .toList(); + + state = state.copyWith( + hypocenters: hypocenters, + ); + }, + ) + ..listen( + timeTickerProvider(const Duration(milliseconds: 500)), + (_, __) { + state = state.copyWith( + visible: !state.visible, + ); + }, + ); + + return EewHypocenterLayer( + id: 'eew-hypocenter-${icon.name}', + sourceId: 'eew-hypocenter-source-${icon.name}', + visible: true, + iconImage: icon.asset.name, + hypocenters: [], + ); + } +} diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart new file mode 100644 index 00000000..3e303f0d --- /dev/null +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart @@ -0,0 +1,89 @@ +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; +import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:maplibre_gl/maplibre_gl.dart'; + +part 'eew_hypocenter_layer.freezed.dart'; + +@freezed +class EewHypocenter with _$EewHypocenter { + const factory EewHypocenter({ + required double latitude, + required double longitude, + }) = _EewHypocenter; +} + +@freezed +class EewHypocenterLayer extends MapLayer with _$EewHypocenterLayer { + factory EewHypocenterLayer({ + required String id, + required String sourceId, + required bool visible, + required List hypocenters, + required String iconImage, + @Default(null) double? minZoom, + @Default(null) double? maxZoom, + }) = _EewHypocenterLayer; + + const EewHypocenterLayer._(); + + @override + Map toGeoJsonSource() { + return { + 'type': 'FeatureCollection', + 'features': hypocenters + .map( + (e) => { + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [e.longitude, e.latitude], + }, + 'properties': { + 'iconImage': iconImage, + 'latitude': e.latitude, + 'longitude': e.longitude, + }, + }, + ) + .toList(), + }; + } + + @override + String get geoJsonSourceHash => hypocenters.hashCode.toString(); + + @override + LayerProperties toLayerProperties() { + return SymbolLayerProperties( + iconOpacity: visible ? 1.0 : 0.5, + iconImage: iconImage, + iconAllowOverlap: true, + iconSize: [ + 'interpolate', + ['linear'], + ['zoom'], + 3, + 0.3, + 20, + 2, + ], + textField: ['get', 'properties'], + ); + } + + @override + String get layerPropertiesHash => + 'eew-hypocenter-${visible ? 'visible' : 'invisible'}'; +} + +enum EewHypocenterIcon { + normal, + lowPrecise, + ; + + DeclarativeAssets get asset => switch (this) { + normal => DeclarativeAssets.normalHypocenter, + lowPrecise => DeclarativeAssets.lowPreciseHypocenter, + }; +} diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart new file mode 100644 index 00000000..dfc0ced8 --- /dev/null +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart @@ -0,0 +1,438 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'eew_hypocenter_layer.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$EewHypocenter { + double get latitude => throw _privateConstructorUsedError; + double get longitude => throw _privateConstructorUsedError; + + /// Create a copy of EewHypocenter + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewHypocenterCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewHypocenterCopyWith<$Res> { + factory $EewHypocenterCopyWith( + EewHypocenter value, $Res Function(EewHypocenter) then) = + _$EewHypocenterCopyWithImpl<$Res, EewHypocenter>; + @useResult + $Res call({double latitude, double longitude}); +} + +/// @nodoc +class _$EewHypocenterCopyWithImpl<$Res, $Val extends EewHypocenter> + implements $EewHypocenterCopyWith<$Res> { + _$EewHypocenterCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewHypocenter + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? latitude = null, + Object? longitude = null, + }) { + return _then(_value.copyWith( + latitude: null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewHypocenterImplCopyWith<$Res> + implements $EewHypocenterCopyWith<$Res> { + factory _$$EewHypocenterImplCopyWith( + _$EewHypocenterImpl value, $Res Function(_$EewHypocenterImpl) then) = + __$$EewHypocenterImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({double latitude, double longitude}); +} + +/// @nodoc +class __$$EewHypocenterImplCopyWithImpl<$Res> + extends _$EewHypocenterCopyWithImpl<$Res, _$EewHypocenterImpl> + implements _$$EewHypocenterImplCopyWith<$Res> { + __$$EewHypocenterImplCopyWithImpl( + _$EewHypocenterImpl _value, $Res Function(_$EewHypocenterImpl) _then) + : super(_value, _then); + + /// Create a copy of EewHypocenter + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? latitude = null, + Object? longitude = null, + }) { + return _then(_$EewHypocenterImpl( + latitude: null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + )); + } +} + +/// @nodoc + +class _$EewHypocenterImpl implements _EewHypocenter { + const _$EewHypocenterImpl({required this.latitude, required this.longitude}); + + @override + final double latitude; + @override + final double longitude; + + @override + String toString() { + return 'EewHypocenter(latitude: $latitude, longitude: $longitude)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewHypocenterImpl && + (identical(other.latitude, latitude) || + other.latitude == latitude) && + (identical(other.longitude, longitude) || + other.longitude == longitude)); + } + + @override + int get hashCode => Object.hash(runtimeType, latitude, longitude); + + /// Create a copy of EewHypocenter + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewHypocenterImplCopyWith<_$EewHypocenterImpl> get copyWith => + __$$EewHypocenterImplCopyWithImpl<_$EewHypocenterImpl>(this, _$identity); +} + +abstract class _EewHypocenter implements EewHypocenter { + const factory _EewHypocenter( + {required final double latitude, + required final double longitude}) = _$EewHypocenterImpl; + + @override + double get latitude; + @override + double get longitude; + + /// Create a copy of EewHypocenter + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewHypocenterImplCopyWith<_$EewHypocenterImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$EewHypocenterLayer { + String get id => throw _privateConstructorUsedError; + String get sourceId => throw _privateConstructorUsedError; + bool get visible => throw _privateConstructorUsedError; + List get hypocenters => throw _privateConstructorUsedError; + String get iconImage => throw _privateConstructorUsedError; + double? get minZoom => throw _privateConstructorUsedError; + double? get maxZoom => throw _privateConstructorUsedError; + + /// Create a copy of EewHypocenterLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewHypocenterLayerCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewHypocenterLayerCopyWith<$Res> { + factory $EewHypocenterLayerCopyWith( + EewHypocenterLayer value, $Res Function(EewHypocenterLayer) then) = + _$EewHypocenterLayerCopyWithImpl<$Res, EewHypocenterLayer>; + @useResult + $Res call( + {String id, + String sourceId, + bool visible, + List hypocenters, + String iconImage, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class _$EewHypocenterLayerCopyWithImpl<$Res, $Val extends EewHypocenterLayer> + implements $EewHypocenterLayerCopyWith<$Res> { + _$EewHypocenterLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewHypocenterLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? sourceId = null, + Object? visible = null, + Object? hypocenters = null, + Object? iconImage = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + hypocenters: null == hypocenters + ? _value.hypocenters + : hypocenters // ignore: cast_nullable_to_non_nullable + as List, + iconImage: null == iconImage + ? _value.iconImage + : iconImage // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewHypocenterLayerImplCopyWith<$Res> + implements $EewHypocenterLayerCopyWith<$Res> { + factory _$$EewHypocenterLayerImplCopyWith(_$EewHypocenterLayerImpl value, + $Res Function(_$EewHypocenterLayerImpl) then) = + __$$EewHypocenterLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String id, + String sourceId, + bool visible, + List hypocenters, + String iconImage, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class __$$EewHypocenterLayerImplCopyWithImpl<$Res> + extends _$EewHypocenterLayerCopyWithImpl<$Res, _$EewHypocenterLayerImpl> + implements _$$EewHypocenterLayerImplCopyWith<$Res> { + __$$EewHypocenterLayerImplCopyWithImpl(_$EewHypocenterLayerImpl _value, + $Res Function(_$EewHypocenterLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of EewHypocenterLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? sourceId = null, + Object? visible = null, + Object? hypocenters = null, + Object? iconImage = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_$EewHypocenterLayerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + hypocenters: null == hypocenters + ? _value._hypocenters + : hypocenters // ignore: cast_nullable_to_non_nullable + as List, + iconImage: null == iconImage + ? _value.iconImage + : iconImage // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc + +class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { + _$EewHypocenterLayerImpl( + {required this.id, + required this.sourceId, + required this.visible, + required final List hypocenters, + required this.iconImage, + this.minZoom = null, + this.maxZoom = null}) + : _hypocenters = hypocenters, + super._(); + + @override + final String id; + @override + final String sourceId; + @override + final bool visible; + final List _hypocenters; + @override + List get hypocenters { + if (_hypocenters is EqualUnmodifiableListView) return _hypocenters; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_hypocenters); + } + + @override + final String iconImage; + @override + @JsonKey() + final double? minZoom; + @override + @JsonKey() + final double? maxZoom; + + @override + String toString() { + return 'EewHypocenterLayer(id: $id, sourceId: $sourceId, visible: $visible, hypocenters: $hypocenters, iconImage: $iconImage, minZoom: $minZoom, maxZoom: $maxZoom)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewHypocenterLayerImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.sourceId, sourceId) || + other.sourceId == sourceId) && + (identical(other.visible, visible) || other.visible == visible) && + const DeepCollectionEquality() + .equals(other._hypocenters, _hypocenters) && + (identical(other.iconImage, iconImage) || + other.iconImage == iconImage) && + (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + sourceId, + visible, + const DeepCollectionEquality().hash(_hypocenters), + iconImage, + minZoom, + maxZoom); + + /// Create a copy of EewHypocenterLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewHypocenterLayerImplCopyWith<_$EewHypocenterLayerImpl> get copyWith => + __$$EewHypocenterLayerImplCopyWithImpl<_$EewHypocenterLayerImpl>( + this, _$identity); +} + +abstract class _EewHypocenterLayer extends EewHypocenterLayer { + factory _EewHypocenterLayer( + {required final String id, + required final String sourceId, + required final bool visible, + required final List hypocenters, + required final String iconImage, + final double? minZoom, + final double? maxZoom}) = _$EewHypocenterLayerImpl; + _EewHypocenterLayer._() : super._(); + + @override + String get id; + @override + String get sourceId; + @override + bool get visible; + @override + List get hypocenters; + @override + String get iconImage; + @override + double? get minZoom; + @override + double? get maxZoom; + + /// Create a copy of EewHypocenterLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewHypocenterLayerImplCopyWith<_$EewHypocenterLayerImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart b/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart new file mode 100644 index 00000000..951b2edd --- /dev/null +++ b/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart @@ -0,0 +1,245 @@ +import 'dart:io'; + +import 'package:eqmonitor/gen/assets.gen.dart'; +import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:screenshot/screenshot.dart'; +import 'package:share_plus/share_plus.dart'; + +class HypocenterIconPage extends ConsumerWidget { + const HypocenterIconPage({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final normalController = ScreenshotController(); + final lowPreciseController = ScreenshotController(); + + return Scaffold( + appBar: AppBar( + title: const Text('震源アイコン生成'), + ), + body: ListView( + padding: const EdgeInsets.all(16), + children: [ + const Text( + '通常の震源アイコン', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('Rendered, Assets'), + Screenshot( + controller: normalController, + child: Container( + color: Colors.transparent, + height: 100, + width: 100, + child: const CustomPaint( + painter: _HypocenterPainter( + type: HypocenterType.normal, + ), + ), + ), + ), + Assets.images.map.normalHypocenter.image( + width: 100, + height: 100, + ), + FilledButton.icon( + onPressed: () async => _captureAndShare( + controller: normalController, + fileName: 'normal_hypocenter.png', + ), + icon: const Icon(Icons.share), + label: const Text('共有'), + ), + ], + ), + const SizedBox(height: 16), + const Text( + '精度の低い震源アイコン', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('Rendered, Assets'), + Column( + children: [ + Screenshot( + controller: lowPreciseController, + child: Container( + color: Colors.transparent, + height: 100, + width: 100, + child: const CustomPaint( + painter: _HypocenterPainter( + type: HypocenterType.lowPrecise, + ), + ), + ), + ), + Assets.images.map.lowPreciseHypocenter.image( + width: 100, + height: 100, + ), + FilledButton.icon( + onPressed: () async => _captureAndShare( + controller: lowPreciseController, + fileName: 'low_precise_hypocenter.png', + ), + icon: const Icon(Icons.share), + label: const Text('共有'), + ), + ], + ), + ], + ), + ], + ), + ); + } + + Future _captureAndShare({ + required ScreenshotController controller, + required String fileName, + }) async { + final image = await controller.capture(); + if (image == null) { + return; + } + + final tempDir = await getTemporaryDirectory(); + final file = await File('${tempDir.path}/$fileName').create(); + await file.writeAsBytes(image); + + await Share.shareXFiles( + [XFile(file.path)], + ); + } +} + +class _HypocenterPainter extends CustomPainter { + const _HypocenterPainter({ + required this.type, + }); + final HypocenterType type; + + @override + void paint(Canvas canvas, Size size) { + final offset = Offset(size.width / 2, size.height / 2); + if (type == HypocenterType.lowPrecise) { + // 円を描く + canvas + ..drawCircle( + offset, + 25, + Paint() + ..color = Colors.black + ..isAntiAlias = true + ..style = PaintingStyle.stroke + ..strokeWidth = 25, + ) + ..drawCircle( + offset, + 25, + Paint() + ..color = Colors.white + ..isAntiAlias = true + ..style = PaintingStyle.stroke + ..strokeWidth = 18, + ) + ..drawCircle( + offset, + 25, + Paint() + ..color = const Color.fromARGB(255, 255, 0, 0) + ..isAntiAlias = true + ..style = PaintingStyle.stroke + ..strokeWidth = 10, + ); + } else if (type == HypocenterType.normal) { + // ×印を描く + canvas + ..drawLine( + Offset(offset.dx - 20, offset.dy - 20), + Offset(offset.dx + 20, offset.dy + 20), + Paint() + ..color = const Color.fromARGB(255, 0, 0, 0) + ..isAntiAlias = true + ..strokeCap = StrokeCap.square + ..style = PaintingStyle.stroke + ..strokeWidth = 25, + ) + ..drawLine( + Offset(offset.dx + 20, offset.dy - 20), + Offset(offset.dx - 20, offset.dy + 20), + Paint() + ..color = const Color.fromARGB(255, 0, 0, 0) + ..isAntiAlias = true + ..strokeCap = StrokeCap.square + ..style = PaintingStyle.stroke + ..strokeWidth = 25, + ) + ..drawLine( + Offset(offset.dx - 20, offset.dy - 20), + Offset(offset.dx + 20, offset.dy + 20), + Paint() + ..color = const Color.fromARGB(255, 255, 255, 255) + ..isAntiAlias = true + ..strokeCap = StrokeCap.square + ..style = PaintingStyle.stroke + ..strokeWidth = 18, + ) + ..drawLine( + Offset(offset.dx + 20, offset.dy - 20), + Offset(offset.dx - 20, offset.dy + 20), + Paint() + ..color = const Color.fromARGB(255, 255, 255, 255) + ..isAntiAlias = true + ..strokeCap = StrokeCap.square + ..style = PaintingStyle.stroke + ..strokeWidth = 18, + ) + ..drawLine( + Offset(offset.dx - 20, offset.dy - 20), + Offset(offset.dx + 20, offset.dy + 20), + Paint() + ..color = const Color.fromARGB(255, 255, 0, 0) + ..isAntiAlias = true + ..strokeCap = StrokeCap.square + ..style = PaintingStyle.stroke + ..strokeWidth = 12, + ) + ..drawLine( + Offset(offset.dx + 20, offset.dy - 20), + Offset(offset.dx - 20, offset.dy + 20), + Paint() + ..color = const Color.fromARGB(255, 255, 0, 0) + ..isAntiAlias = true + ..strokeCap = StrokeCap.square + ..style = PaintingStyle.stroke + ..strokeWidth = 12, + ); + } + } + + @override + bool shouldRepaint(covariant _) => false; +} + +enum HypocenterType { + normal, + lowPrecise, + ; +} From 0350467322a0777541c7ad6ecbec551d8aa3ae8d Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 22:50:48 +0900 Subject: [PATCH 28/70] =?UTF-8?q?refactor:=20=E5=9C=B0=E5=9B=B3=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E6=A9=9F=E8=83=BD=E3=81=AE=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../declarative_map_controller.dart | 28 +++++++++++++++ .../kyoshin_monitor_layer_controller.dart | 33 +++++++++-------- .../map/data/layer/base/map_layer.dart | 11 ++++++ app/lib/feature/map/ui/declarative_map.dart | 35 +++++++++++++++---- 4 files changed, 84 insertions(+), 23 deletions(-) diff --git a/app/lib/feature/map/data/controller/declarative_map_controller.dart b/app/lib/feature/map/data/controller/declarative_map_controller.dart index 3a9a555f..4d00cd29 100644 --- a/app/lib/feature/map/data/controller/declarative_map_controller.dart +++ b/app/lib/feature/map/data/controller/declarative_map_controller.dart @@ -1,3 +1,7 @@ +import 'package:eqmonitor/core/provider/log/talker.dart'; +import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; +import 'package:eqmonitor/gen/assets.gen.dart'; +import 'package:flutter/services.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; /// 宣言的な地図コントローラー @@ -27,4 +31,28 @@ class DeclarativeMapController { CameraUpdate.newCameraPosition(position), ); } + + Future addHypocenterImages() async { + final controller = _controller; + if (controller == null) { + return; + } + + await Future.wait([ + for (final asset in DeclarativeAssets.values) + () async { + final bytes = await _loadImageBytes(asset.path); + if (bytes != null) { + await controller.addImage(asset.name, bytes); + } else { + talker.error('Failed to load image: $asset'); + } + }(), + ]); + } + + Future _loadImageBytes(String path) async { + final data = await rootBundle.load(path); + return data.buffer.asUint8List(); + } } diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index b5101f8e..ab7320f6 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -28,6 +28,19 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { ..listen( kyoshinMonitorNotifierProvider, (prev, next) { + // 現在の設定と違うLayerが来たらIgnore + final nextLayer = ( + next.valueOrNull?.currentRealtimeDataType, + next.valueOrNull?.currentRealtimeLayer + ); + final settingsLayer = ( + ref.read(kyoshinMonitorSettingsProvider).realtimeDataType, + ref.read(kyoshinMonitorSettingsProvider).realtimeLayer, + ); + if (nextLayer != settingsLayer) { + _updateLayer([]); + return; + } final previousPoints = prev?.valueOrNull?.analyzedPoints; final nextPoints = next.valueOrNull?.analyzedPoints; if (previousPoints != nextPoints) { @@ -43,14 +56,6 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { if (prev?.realtimeDataType != next.realtimeDataType || prev?.realtimeLayer != next.realtimeLayer || prev?.kmoniMarkerType != next.kmoniMarkerType) { - log( - 'prev: ${prev?.kmoniMarkerType}', - name: 'kyoshin_monitor_layer_controller', - ); - log( - 'next: ${next.kmoniMarkerType}', - name: 'kyoshin_monitor_layer_controller', - ); state = state.copyWith( points: [], realtimeDataType: next.realtimeDataType, @@ -73,7 +78,7 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { sourceId: 'kyoshin-monitor-points', visible: true, points: [], - isInEew: false, + isInEew: ref.read(eewAliveTelegramProvider)?.isNotEmpty ?? false, markerType: ref.read(kyoshinMonitorSettingsProvider).kmoniMarkerType, realtimeDataType: ref.read(kyoshinMonitorSettingsProvider).realtimeDataType, @@ -89,14 +94,8 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { return; } - state = KyoshinMonitorObservationLayer( - id: 'kyoshin-monitor-points', - sourceId: 'kyoshin-monitor-points', - visible: true, + state = state.copyWith( points: points, - isInEew: false, - markerType: KyoshinMonitorMarkerType.always, - realtimeDataType: RealtimeDataType.shindo, ); } } @@ -202,5 +201,5 @@ class KyoshinMonitorObservationLayer extends MapLayer } @override - String get layerPropertiesHash => '${markerType.name}-${isInEew}'; + String get layerPropertiesHash => '${markerType.name}-$isInEew'; } diff --git a/app/lib/feature/map/data/layer/base/map_layer.dart b/app/lib/feature/map/data/layer/base/map_layer.dart index e7217d80..44167b74 100644 --- a/app/lib/feature/map/data/layer/base/map_layer.dart +++ b/app/lib/feature/map/data/layer/base/map_layer.dart @@ -31,4 +31,15 @@ class CachedIMapLayer { final MapLayer layer; final String geoJsonSourceHash; final String layerPropertiesHash; + + CachedIMapLayer copyWith({ + MapLayer? layer, + String? geoJsonSourceHash, + String? layerPropertiesHash, + }) => + CachedIMapLayer( + layer: layer ?? this.layer, + geoJsonSourceHash: geoJsonSourceHash ?? this.geoJsonSourceHash, + layerPropertiesHash: layerPropertiesHash ?? this.layerPropertiesHash, + ); } diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 4b355b3f..a73079e8 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -1,9 +1,11 @@ import 'dart:async'; import 'dart:developer'; +import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; +import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; @@ -87,11 +89,10 @@ class _DeclarativeMapState extends ConsumerState { onMapCreated: (controller) { widget.controller.setController(controller); }, - onStyleLoadedCallback: () { + onStyleLoadedCallback: () async { widget.onStyleLoadedCallback?.call(); - unawaited( - _updateLayers(), - ); + await widget.controller.addHypocenterImages(); + await _updateLayers(); }, onCameraIdle: () { final position = widget.controller.controller?.cameraPosition; @@ -120,6 +121,7 @@ class _DeclarativeMapState extends ConsumerState { } // ロックチェック if (_isUpdatingLayers) { + talker.error('map layer update is locked'); return; } try { @@ -150,7 +152,9 @@ class _DeclarativeMapState extends ConsumerState { layer.id, layer.toLayerProperties(), ); - _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); + _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( + layerPropertiesHash: layerPropertiesHash, + ); } // geoJsonSource check final cachedGeoJsonSource = cachedLayer.geoJsonSourceHash; @@ -161,9 +165,13 @@ class _DeclarativeMapState extends ConsumerState { layer.sourceId, layer.toGeoJsonSource(), ); + _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( + geoJsonSourceHash: geoJsonSource, + ); } } } else { + log('adding new layer: ${layer.id}'); // 新規レイヤーの追加 await _addLayer(layer); } @@ -182,8 +190,8 @@ class _DeclarativeMapState extends ConsumerState { layer.toGeoJsonSource(), ); await controller.addLayer( - layer.id, layer.sourceId, + layer.id, layer.toLayerProperties(), ); } @@ -200,6 +208,10 @@ class _DeclarativeMapState extends ConsumerState { @override void didUpdateWidget(DeclarativeMap oldWidget) { super.didUpdateWidget(oldWidget); + if (widget.controller.controller == null) { + talker.error('controller is null'); + return; + } if (oldWidget.styleString != widget.styleString) { unawaited( _updateAllLayers(), @@ -212,3 +224,14 @@ class _DeclarativeMapState extends ConsumerState { } } } + +enum DeclarativeAssets { + normalHypocenter, + lowPreciseHypocenter, + ; + + String get path => switch (this) { + normalHypocenter => Assets.images.map.normalHypocenter.path, + lowPreciseHypocenter => Assets.images.map.lowPreciseHypocenter.path, + }; +} From dbf5cae7dd973fa9d2a0d6cc55a40b882f3485e0 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 22:50:55 +0900 Subject: [PATCH 29/70] =?UTF-8?q?refactor:=20EEW=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/eew/data/eew_alive_telegram.dart | 2 +- app/lib/feature/eew/data/eew_telegram.dart | 12 ++++++++++ app/lib/feature/eew/data/eew_telegram.g.dart | 2 +- .../home/component/eew/eew_widget.dart | 22 +++++++++++-------- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/app/lib/feature/eew/data/eew_alive_telegram.dart b/app/lib/feature/eew/data/eew_alive_telegram.dart index 344c6fab..d6e68d9a 100644 --- a/app/lib/feature/eew/data/eew_alive_telegram.dart +++ b/app/lib/feature/eew/data/eew_alive_telegram.dart @@ -28,7 +28,7 @@ class EewAliveTelegram extends _$EewAliveTelegram { List? build() { final state = ref.watch(eewProvider); final value = state.valueOrNull; - final tickerTime = ref.watch(timeTickerProvider); + final tickerTime = ref.watch(timeTickerProvider()); final checker = ref.watch(eewAliveCheckerProvider); if (value == null) { return null; diff --git a/app/lib/feature/eew/data/eew_telegram.dart b/app/lib/feature/eew/data/eew_telegram.dart index 94b487da..271239f4 100644 --- a/app/lib/feature/eew/data/eew_telegram.dart +++ b/app/lib/feature/eew/data/eew_telegram.dart @@ -5,9 +5,11 @@ import 'dart:ui'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; import 'package:eqmonitor/core/provider/app_lifecycle.dart'; +import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/core/provider/websocket/websocket_provider.dart'; import 'package:extensions/extensions.dart'; +import 'package:flutter/foundation.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:web_socket_client/web_socket_client.dart'; @@ -77,6 +79,16 @@ class Eew extends _$Eew { } state = AsyncData(data); } + + void upsert(EewV1 eew) { + if (kDebugMode || ref.read(debuggerProvider).isDebugger) { + _upsert(eew); + } else { + throw UnimplementedError( + 'This operation is not permitted in release mode', + ); + } + } } @Riverpod(keepAlive: true) diff --git a/app/lib/feature/eew/data/eew_telegram.g.dart b/app/lib/feature/eew/data/eew_telegram.g.dart index 788a53af..5a750820 100644 --- a/app/lib/feature/eew/data/eew_telegram.g.dart +++ b/app/lib/feature/eew/data/eew_telegram.g.dart @@ -24,7 +24,7 @@ final _eewRestProvider = FutureProvider>.internal( @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element typedef _EewRestRef = FutureProviderRef>; -String _$eewHash() => r'7ff669593c381970ca2d08a1fa6c6fa688e800c6'; +String _$eewHash() => r'fcf2455d2039c8233f88a5accd9fbf0faeba841d'; /// See also [Eew]. @ProviderFor(Eew) diff --git a/app/lib/feature/home/component/eew/eew_widget.dart b/app/lib/feature/home/component/eew/eew_widget.dart index 77594460..3bbd4562 100644 --- a/app/lib/feature/home/component/eew/eew_widget.dart +++ b/app/lib/feature/home/component/eew/eew_widget.dart @@ -20,6 +20,7 @@ class EewWidgets extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final state = ref.watch(eewAliveTelegramProvider) ?? []; + return Column( children: state.reversed .mapIndexed( @@ -323,16 +324,19 @@ class EewWidget extends ConsumerWidget { ), ] : null; - final card = BorderedContainer( + final card = Card( elevation: 1, - margin: const EdgeInsets.symmetric( - horizontal: 12, - ) + - const EdgeInsets.only( - bottom: 8, - ), - padding: EdgeInsets.zero, - accentColor: backgroundColor.withValues(alpha: 0.3), + color: backgroundColor.withValues(alpha: 0.3), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + side: BorderSide( + color: Color.lerp( + backgroundColor, + colorTheme.outline.withValues(alpha: 0.6), + 0.7, + )!, + ), + ), child: Padding( padding: const EdgeInsets.symmetric( horizontal: 8, From 57016c01d55ffc7e6649518181df922a667e74d3 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Sun, 9 Feb 2025 22:50:59 +0900 Subject: [PATCH 30/70] =?UTF-8?q?refactor:=20=E3=81=9D=E3=81=AE=E4=BB=96?= =?UTF-8?q?=E3=81=AE=E6=A9=9F=E8=83=BD=E6=94=B9=E5=96=84=E3=81=A8=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/core/provider/time_ticker.dart | 7 +- app/lib/core/provider/time_ticker.g.dart | 156 ++++++++++++++- .../ui/component/earthquake_map.dart | 57 +----- .../home/component/map/home_map_content.dart | 28 ++- .../shake-detect/shake_detection_card.dart | 173 ++++++++++++----- .../home_configuration_notifier.g.dart | 2 +- app/lib/feature/home/page/home_page.dart | 143 +++++++++++--- .../kyoshin_monitor_web_api_data_source.dart | 3 +- app/lib/feature/location/data/location.g.dart | 4 +- .../eew_hypocenter_layer_controller.g.dart | 183 ++++++++++++++++++ .../kyoshin_monitor_layer_controller.g.dart | 2 +- .../children/config/debug/debugger_page.dart | 10 + .../provider/shake_detection_provider.dart | 2 +- app/lib/gen/assets.gen.dart | 18 ++ app/lib/main.dart | 43 ---- app/pubspec.yaml | 1 + 16 files changed, 625 insertions(+), 207 deletions(-) create mode 100644 app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart diff --git a/app/lib/core/provider/time_ticker.dart b/app/lib/core/provider/time_ticker.dart index 014bb3d9..24940fcd 100644 --- a/app/lib/core/provider/time_ticker.dart +++ b/app/lib/core/provider/time_ticker.dart @@ -4,5 +4,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'time_ticker.g.dart'; @Riverpod(keepAlive: true, dependencies: []) -Stream timeTicker(Ref ref) => - Stream.periodic(const Duration(seconds: 1), (_) => DateTime.now()); +Stream timeTicker( + Ref ref, [ + Duration duration = const Duration(seconds: 1), +]) => + Stream.periodic(duration, (_) => DateTime.now()); diff --git a/app/lib/core/provider/time_ticker.g.dart b/app/lib/core/provider/time_ticker.g.dart index a9c3cb47..54f5cd9d 100644 --- a/app/lib/core/provider/time_ticker.g.dart +++ b/app/lib/core/provider/time_ticker.g.dart @@ -8,21 +8,157 @@ part of 'time_ticker.dart'; // RiverpodGenerator // ************************************************************************** -String _$timeTickerHash() => r'1da2250f8420935b7a6f942fe951df8a3dbb6817'; +String _$timeTickerHash() => r'e07001e8fe705386ea328936b8d5064182b4f9cb'; + +/// Copied from Dart SDK +class _SystemHash { + _SystemHash._(); + + static int combine(int hash, int value) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + value); + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); + return hash ^ (hash >> 6); + } + + static int finish(int hash) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); + // ignore: parameter_assignments + hash = hash ^ (hash >> 11); + return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); + } +} /// See also [timeTicker]. @ProviderFor(timeTicker) -final timeTickerProvider = StreamProvider.internal( - timeTicker, - name: r'timeTickerProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$timeTickerHash, - dependencies: const [], - allTransitiveDependencies: const {}, -); +const timeTickerProvider = TimeTickerFamily(); + +/// See also [timeTicker]. +class TimeTickerFamily extends Family> { + /// See also [timeTicker]. + const TimeTickerFamily(); + + /// See also [timeTicker]. + TimeTickerProvider call([ + Duration duration = const Duration(seconds: 1), + ]) { + return TimeTickerProvider( + duration, + ); + } + + @override + TimeTickerProvider getProviderOverride( + covariant TimeTickerProvider provider, + ) { + return call( + provider.duration, + ); + } + + static final Iterable _dependencies = + const []; + + @override + Iterable? get dependencies => _dependencies; + + static final Iterable _allTransitiveDependencies = + const {}; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'timeTickerProvider'; +} + +/// See also [timeTicker]. +class TimeTickerProvider extends StreamProvider { + /// See also [timeTicker]. + TimeTickerProvider([ + Duration duration = const Duration(seconds: 1), + ]) : this._internal( + (ref) => timeTicker( + ref as TimeTickerRef, + duration, + ), + from: timeTickerProvider, + name: r'timeTickerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$timeTickerHash, + dependencies: TimeTickerFamily._dependencies, + allTransitiveDependencies: + TimeTickerFamily._allTransitiveDependencies, + duration: duration, + ); + + TimeTickerProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.duration, + }) : super.internal(); + + final Duration duration; + + @override + Override overrideWith( + Stream Function(TimeTickerRef provider) create, + ) { + return ProviderOverride( + origin: this, + override: TimeTickerProvider._internal( + (ref) => create(ref as TimeTickerRef), + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + duration: duration, + ), + ); + } + + @override + StreamProviderElement createElement() { + return _TimeTickerProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is TimeTickerProvider && other.duration == duration; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, duration.hashCode); + + return _SystemHash.finish(hash); + } +} @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef TimeTickerRef = StreamProviderRef; +mixin TimeTickerRef on StreamProviderRef { + /// The parameter `duration` of this provider. + Duration get duration; +} + +class _TimeTickerProviderElement extends StreamProviderElement + with TimeTickerRef { + _TimeTickerProviderElement(super.provider); + + @override + Duration get duration => (origin as TimeTickerProvider).duration; +} // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart index 800799fc..49137f2c 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart @@ -5,7 +5,6 @@ import 'dart:async'; import 'package:collection/collection.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/extension/lat_lng_bounds_list.dart'; -import 'package:eqmonitor/core/provider/capture/intensity_icon_render.dart'; import 'package:eqmonitor/core/provider/config/earthquake_history/earthquake_history_config_provider.dart'; import 'package:eqmonitor/core/provider/config/earthquake_history/model/earthquake_history_config_model.dart'; import 'package:eqmonitor/core/provider/config/theme/intensity_color/intensity_color_provider.dart'; @@ -14,7 +13,6 @@ import 'package:eqmonitor/core/provider/jma_parameter/jma_parameter.dart'; import 'package:eqmonitor/core/provider/map/jma_map_provider.dart'; import 'package:eqmonitor/feature/earthquake_history/data/model/earthquake_v1_extended.dart'; import 'package:eqmonitor/feature/map/data/provider/map_style_util.dart'; -import 'package:extensions/extensions.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -71,25 +69,10 @@ class EarthquakeMapWidget extends HookConsumerWidget { final colorModel = ref.watch(intensityColorProvider); final earthquakeParams = ref.watch(jmaParameterProvider).valueOrNull?.earthquake; - final intensityIconData = ref.watch(intensityIconRenderProvider); - final intensityIconFillData = ref.watch(intensityIconFillRenderProvider); - final lpgmIntensityIconData = ref.watch(lpgmIntensityIconRenderProvider); - final lpgmIntensityIconFillData = - ref.watch(lpgmIntensityIconFillRenderProvider); - - final hypocenterIconRender = ref.watch(hypocenterIconRenderProvider); - final currentLocationIconRender = - ref.watch(currentLocationIconRenderProvider); + final jmaMap = ref.watch(jmaMapProvider).valueOrNull; - if (earthquakeParams == null || - !intensityIconData.isAllRendered() || - !intensityIconFillData.isAllRendered() || - !lpgmIntensityIconData.isAllRendered() || - !lpgmIntensityIconFillData.isAllRendered() || - currentLocationIconRender == null || - jmaMap == null || - hypocenterIconRender == null) { + if (earthquakeParams == null || jmaMap == null) { // どれが条件を満たしていないのか表示 return const Scaffold( body: Center( @@ -335,42 +318,6 @@ class EarthquakeMapWidget extends HookConsumerWidget { onMapCreated: (controller) => mapController.value = controller, onStyleLoadedCallback: () async { final controller = mapController.value!; - await [ - addImageFromBuffer( - controller, - 'hypocenter', - hypocenterIconRender, - ), - for (final intensity in JmaIntensity.values) ...[ - addImageFromBuffer( - controller, - 'intensity-${intensity.type}', - intensityIconData.getOrNull(intensity)!, - ), - addImageFromBuffer( - controller, - 'intensity-${intensity.type}-fill', - intensityIconFillData.getOrNull(intensity)!, - ), - ], - for (final intensity in JmaLgIntensity.values) ...[ - addImageFromBuffer( - controller, - 'lpgm-intensity-${intensity.type}', - lpgmIntensityIconData.getOrNull(intensity)!, - ), - addImageFromBuffer( - controller, - 'lpgm-intensity-${intensity.type}-fill', - lpgmIntensityIconFillData.getOrNull(intensity)!, - ), - ], - addImageFromBuffer( - controller, - 'current-location', - currentLocationIconRender, - ), - ].wait; await initActions(currentActions.value); await controller.moveCamera(cameraUpdate); maxZoomLevel.value = 12; diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart index f586eb45..8f20d3c6 100644 --- a/app/lib/feature/home/component/map/home_map_content.dart +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -1,7 +1,9 @@ import 'package:eqmonitor/feature/home/data/notifier/home_configuration_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; +import 'package:eqmonitor/feature/map/data/controller/eew_hypocenter_layer_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; +import 'package:eqmonitor/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; @@ -42,14 +44,24 @@ class HomeMapContent extends HookConsumerWidget { final homeConfiguration = ref.watch(homeConfigurationNotifierProvider); - return DeclarativeMap( - myLocationEnabled: homeConfiguration.showLocation, - styleString: styleString, - controller: mapController, - initialCameraPosition: cameraPosition, - layers: [ - if (isKyoshinLayerEnabled) kyoshinLayer, - ], + return RepaintBoundary( + child: DeclarativeMap( + myLocationEnabled: homeConfiguration.showLocation, + styleString: styleString, + controller: mapController, + initialCameraPosition: cameraPosition, + layers: [ + if (isKyoshinLayerEnabled) kyoshinLayer, + ref.watch( + eewHypocenterLayerControllerProvider(EewHypocenterIcon.normal), + ), + ref.watch( + eewHypocenterLayerControllerProvider( + EewHypocenterIcon.lowPrecise, + ), + ), + ], + ), ); } } diff --git a/app/lib/feature/home/component/shake-detect/shake_detection_card.dart b/app/lib/feature/home/component/shake-detect/shake_detection_card.dart index dccf430c..d36db571 100644 --- a/app/lib/feature/home/component/shake-detect/shake_detection_card.dart +++ b/app/lib/feature/home/component/shake-detect/shake_detection_card.dart @@ -1,9 +1,9 @@ import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/provider/config/theme/intensity_color/intensity_color_provider.dart'; import 'package:eqmonitor/core/provider/config/theme/intensity_color/model/intensity_color_model.dart'; +import 'package:eqmonitor/core/provider/time_ticker.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:intl/intl.dart'; class ShakeDetectionCard extends ConsumerWidget { const ShakeDetectionCard({ @@ -13,79 +13,148 @@ class ShakeDetectionCard extends ConsumerWidget { final ShakeDetectionEvent event; + String _formatRelativeTime(DateTime now, DateTime target) { + final difference = now.difference(target); + if (difference.inMinutes > 0) { + return '${difference.inMinutes}分${difference.inSeconds % 60}秒前から検知'; + } + return '${difference.inSeconds}秒前から検知'; + } + @override Widget build(BuildContext context, WidgetRef ref) { final theme = Theme.of(context); final maxIntensity = event.maxIntensity; + final now = ref.watch(timeTickerProvider()).value ?? DateTime.now(); final intensityColorSchema = ref.watch(intensityColorProvider); final maxIntensityColor = intensityColorSchema.fromJmaForecastIntensity(maxIntensity); final maxIntensityText = switch (maxIntensity) { - JmaForecastIntensity.zero => '微弱な反応を検知', - JmaForecastIntensity.one => '弱い揺れを検知', - JmaForecastIntensity.two => '揺れを検知', - JmaForecastIntensity.three || JmaForecastIntensity.four => 'やや強い揺れを検知', + JmaForecastIntensity.zero => '微弱な反応を検知しました', + JmaForecastIntensity.one => '弱い揺れを検知しました', + JmaForecastIntensity.two => '揺れを検知しました', + JmaForecastIntensity.three || + JmaForecastIntensity.four => + 'やや強い揺れを検知しました', JmaForecastIntensity.fiveLower || JmaForecastIntensity.fiveUpper => - '強い揺れを検知', + '強い揺れを検知しました', JmaForecastIntensity.sixLower || JmaForecastIntensity.sixUpper => - '非常に強い揺れを検知', - JmaForecastIntensity.seven => '非常に強い揺れを検知', - JmaForecastIntensity.unknown => '揺れを検知' + '非常に強い揺れを検知しました', + JmaForecastIntensity.seven => '非常に強い揺れを検知しました', + JmaForecastIntensity.unknown => '揺れを検知しました', }; - return Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - side: BorderSide( - color: maxIntensityColor.background.withValues(alpha: 0.2), + final regions = event.regions.map((region) => region.name).join('、'); + final relativeTime = _formatRelativeTime(now, event.createdAt.toLocal()); + + return Semantics( + label: '$maxIntensityText。$regions で、$relativeTime', + child: Card( + clipBehavior: Clip.antiAlias, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + side: BorderSide( + color: maxIntensityColor.background.withValues(alpha: 0.2), + ), ), - ), - color: Color.lerp( - maxIntensityColor.background, - theme.colorScheme.surface, - 0.8, - ), - elevation: 1, - child: Padding( - padding: const EdgeInsets.all(8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Row(), - Text( - maxIntensityText, - style: theme.textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.bold, - ), - ), - const SizedBox(height: 8), - Text.rich( - TextSpan( + color: Color.lerp( + maxIntensityColor.background, + theme.colorScheme.surface, + 0.9, + ), + elevation: 0, + shadowColor: maxIntensityColor.background.withValues(alpha: 0.3), + child: Padding( + padding: const EdgeInsets.all(4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( children: [ - TextSpan( - text: '地域: ', - style: theme.textTheme.bodyMedium?.copyWith( - fontWeight: FontWeight.bold, + Container( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 6, + ), + child: MergeSemantics( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.waves, + size: 18, + color: maxIntensityColor.background, + semanticLabel: '揺れ', + ), + const SizedBox(width: 8), + Text( + maxIntensityText, + style: theme.textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + color: maxIntensityColor.background, + ), + ), + ], + ), ), - ), - TextSpan( - text: event.regions.map((region) => region.name).join(', '), ), ], ), - ), - Text( - '検知時刻: ' - // ignore: lines_longer_than_80_chars - "${DateFormat('yyyy/MM/dd HH:mm').format(event.createdAt.toLocal())}" - '頃', - style: theme.textTheme.bodyMedium, - ), - ], + Container( + padding: const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + MergeSemantics( + child: Row( + children: [ + Icon( + Icons.location_on_outlined, + size: 16, + color: theme.colorScheme.onSurfaceVariant, + semanticLabel: '場所', + ), + const SizedBox(width: 8), + Expanded( + child: Text( + regions, + style: theme.textTheme.bodyMedium?.copyWith( + color: theme.colorScheme.onSurface, + ), + ), + ), + ], + ), + ), + const SizedBox(height: 8), + MergeSemantics( + child: Row( + children: [ + Icon( + Icons.access_time, + size: 16, + color: theme.colorScheme.onSurface, + semanticLabel: '時間', + ), + const SizedBox(width: 8), + Text( + relativeTime, + style: theme.textTheme.bodyMedium?.copyWith( + color: theme.colorScheme.onSurface, + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), ), ), ); diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart index 881fcbdb..199925b1 100644 --- a/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart @@ -9,7 +9,7 @@ part of 'home_configuration_notifier.dart'; // ************************************************************************** String _$homeConfigurationNotifierHash() => - r'070781e9982ded06f18104eb8fb052c0a8f6b79a'; + r'd304e781e1d01913d5f9b3c16c3e8fb27541f88b'; /// See also [HomeConfigurationNotifier]. @ProviderFor(HomeConfigurationNotifier) diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index 8f75c503..62013b02 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -1,8 +1,14 @@ +import 'dart:math'; + +import 'package:eqapi_types/eqapi_types.dart'; +import 'package:eqmonitor/core/router/router.dart'; +import 'package:eqmonitor/feature/eew/data/eew_telegram.dart'; import 'package:eqmonitor/feature/home/component/eew/eew_widget.dart'; import 'package:eqmonitor/feature/home/component/map/home_map_view.dart'; import 'package:eqmonitor/feature/home/component/shake-detect/shake_detection_card.dart'; import 'package:eqmonitor/feature/home/component/sheet/home_earthquake_history_sheet.dart'; import 'package:eqmonitor/feature/shake_detection/provider/shake_detection_provider.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:sheet/sheet.dart'; @@ -12,11 +18,29 @@ class HomePage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - return const Scaffold( + return Scaffold( body: Stack( children: [ - HomeMapView(), - _Sheet(), + const HomeMapView(), + const _Sheet(), + if (kDebugMode) + Align( + alignment: Alignment.centerRight, + child: FloatingActionButton.small( + onPressed: () async => Navigator.of(context).push( + ModalBottomSheetRoute( + isScrollControlled: false, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + ), + builder: (context) => const _DebugModal(), + ), + ), + child: const Icon(Icons.bug_report), + ), + ), ], ), ); @@ -44,7 +68,7 @@ class _Sheet extends StatelessWidget { elevation: 4, initialExtent: size.height * 0.2, physics: const SnapSheetPhysics( - stops: [0.1, 0.2, 0.5, 1], + stops: [0.1, 0.2, 0.5, 0.8, 1], ), child: Material( color: colorScheme.surfaceContainer, @@ -54,27 +78,29 @@ class _Sheet extends StatelessWidget { top: Radius.circular(16), ), ), - child: Column( - children: [ - Container( - margin: const EdgeInsets.symmetric(vertical: 8), - width: 36, - height: 4, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: theme.colorScheme.onSurface, - ), - ), - const Padding( - padding: EdgeInsets.symmetric( - horizontal: 8, + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: const EdgeInsets.symmetric(vertical: 8), + width: 36, + height: 4, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: theme.colorScheme.onSurface, + ), ), - child: Expanded( - child: _SheetBody(), + const Padding( + padding: EdgeInsets.symmetric( + horizontal: 8, + ), + child: Expanded( + child: _SheetBody(), + ), ), - ), - ], + ], + ), ), ), ); @@ -101,12 +127,18 @@ class _SheetBody extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - return const SingleChildScrollView( + return SingleChildScrollView( child: Column( children: [ - EewWidgets(), - _ShakeDetectionList(), - HomeEarthquakeHistorySheet(), + const EewWidgets(), + const _ShakeDetectionList(), + const HomeEarthquakeHistorySheet(), + if (kDebugMode) + ListTile( + title: const Text('デバッグページ'), + leading: const Icon(Icons.bug_report), + onTap: () async => const DebuggerRoute().push(context), + ), ], ), ); @@ -122,13 +154,60 @@ class _ShakeDetectionList extends ConsumerWidget { return switch (shakeDetectionEvents) { AsyncData(:final value) when value.isNotEmpty => Column( - children: [ - ...value.map( - (event) => ShakeDetectionCard(event: event), - ), - ], + children: value + .map( + (event) => ShakeDetectionCard(event: event), + ) + .toList(), ), _ => const SizedBox.shrink(), }; } } + +class _DebugModal extends ConsumerWidget { + const _DebugModal(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return Scaffold( + appBar: AppBar( + title: const Text('DEBUG'), + ), + body: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + title: const Text('ADD EEW SAMPLE'), + onTap: () async { + final eew = EewV1( + id: Random().nextInt(1000000000), + eventId: Random().nextInt(1000000000), + type: 'type', + schemaType: 'schemaType', + status: '訓練', + infoType: 'infoType', + reportTime: DateTime.now(), + isCanceled: false, + isLastInfo: Random().nextBool(), + isPlum: Random().nextBool(), + accuracy: null, + serialNo: Random().nextInt(100), + latitude: 30 + Random().nextDouble() * 10, + longitude: 130 + Random().nextDouble() * 10, + arrivalTime: DateTime.now(), + hypoName: 'テスト震源地', + magnitude: (Random().nextDouble() * 100).toInt() / 10, + depth: Random().nextInt(100), + originTime: DateTime.now(), + forecastMaxIntensity: JmaForecastIntensity.values[ + Random().nextInt(JmaForecastIntensity.values.length)], + ); + ref.read(eewProvider.notifier).upsert(eew); + }, + ), + ], + ), + ); + } +} diff --git a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart index 260c41f3..00eb07b3 100644 --- a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart +++ b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart @@ -13,7 +13,8 @@ KyoshinMonitorWebApiDataSource kyoshinMonitorWebApiDataSource(Ref ref) => @Riverpod(keepAlive: true) LpgmKyoshinMonitorWebApiDataSource lpgmKyoshinMonitorWebApiDataSource( - Ref ref) => + Ref ref, +) => LpgmKyoshinMonitorWebApiDataSource( client: ref.watch(lpgmKyoshinMonitorWebApiClientProvider), ); diff --git a/app/lib/feature/location/data/location.g.dart b/app/lib/feature/location/data/location.g.dart index 7036be94..54098f45 100644 --- a/app/lib/feature/location/data/location.g.dart +++ b/app/lib/feature/location/data/location.g.dart @@ -28,7 +28,9 @@ typedef LocationStreamRef = AutoDisposeStreamProviderRef; String _$closestKmoniObservationPointStreamHash() => r'0094c2c47c008397a4f460398410ce01c5f4847a'; -/// See also [closestKmoniObservationPointStream]. +/// 近隣の強震観測点 +/// +/// Copied from [closestKmoniObservationPointStream]. @ProviderFor(closestKmoniObservationPointStream) final closestKmoniObservationPointStreamProvider = AutoDisposeStreamProvider<(KyoshinObservationPoint, double km)>.internal( diff --git a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart new file mode 100644 index 00000000..ee60d4b9 --- /dev/null +++ b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart @@ -0,0 +1,183 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use + +part of 'eew_hypocenter_layer_controller.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$eewHypocenterLayerControllerHash() => + r'fab6bcc3fe7379f77aa02fd13f197361d109358e'; + +/// Copied from Dart SDK +class _SystemHash { + _SystemHash._(); + + static int combine(int hash, int value) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + value); + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); + return hash ^ (hash >> 6); + } + + static int finish(int hash) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); + // ignore: parameter_assignments + hash = hash ^ (hash >> 11); + return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); + } +} + +abstract class _$EewHypocenterLayerController + extends BuildlessAutoDisposeNotifier { + late final EewHypocenterIcon icon; + + EewHypocenterLayer build( + EewHypocenterIcon icon, + ); +} + +/// See also [EewHypocenterLayerController]. +@ProviderFor(EewHypocenterLayerController) +const eewHypocenterLayerControllerProvider = + EewHypocenterLayerControllerFamily(); + +/// See also [EewHypocenterLayerController]. +class EewHypocenterLayerControllerFamily extends Family { + /// See also [EewHypocenterLayerController]. + const EewHypocenterLayerControllerFamily(); + + /// See also [EewHypocenterLayerController]. + EewHypocenterLayerControllerProvider call( + EewHypocenterIcon icon, + ) { + return EewHypocenterLayerControllerProvider( + icon, + ); + } + + @override + EewHypocenterLayerControllerProvider getProviderOverride( + covariant EewHypocenterLayerControllerProvider provider, + ) { + return call( + provider.icon, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'eewHypocenterLayerControllerProvider'; +} + +/// See also [EewHypocenterLayerController]. +class EewHypocenterLayerControllerProvider + extends AutoDisposeNotifierProviderImpl { + /// See also [EewHypocenterLayerController]. + EewHypocenterLayerControllerProvider( + EewHypocenterIcon icon, + ) : this._internal( + () => EewHypocenterLayerController()..icon = icon, + from: eewHypocenterLayerControllerProvider, + name: r'eewHypocenterLayerControllerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewHypocenterLayerControllerHash, + dependencies: EewHypocenterLayerControllerFamily._dependencies, + allTransitiveDependencies: + EewHypocenterLayerControllerFamily._allTransitiveDependencies, + icon: icon, + ); + + EewHypocenterLayerControllerProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.icon, + }) : super.internal(); + + final EewHypocenterIcon icon; + + @override + EewHypocenterLayer runNotifierBuild( + covariant EewHypocenterLayerController notifier, + ) { + return notifier.build( + icon, + ); + } + + @override + Override overrideWith(EewHypocenterLayerController Function() create) { + return ProviderOverride( + origin: this, + override: EewHypocenterLayerControllerProvider._internal( + () => create()..icon = icon, + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + icon: icon, + ), + ); + } + + @override + AutoDisposeNotifierProviderElement createElement() { + return _EewHypocenterLayerControllerProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is EewHypocenterLayerControllerProvider && other.icon == icon; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, icon.hashCode); + + return _SystemHash.finish(hash); + } +} + +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element +mixin EewHypocenterLayerControllerRef + on AutoDisposeNotifierProviderRef { + /// The parameter `icon` of this provider. + EewHypocenterIcon get icon; +} + +class _EewHypocenterLayerControllerProviderElement + extends AutoDisposeNotifierProviderElement with EewHypocenterLayerControllerRef { + _EewHypocenterLayerControllerProviderElement(super.provider); + + @override + EewHypocenterIcon get icon => + (origin as EewHypocenterLayerControllerProvider).icon; +} +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart index bbaf70c0..ba8fda85 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart @@ -9,7 +9,7 @@ part of 'kyoshin_monitor_layer_controller.dart'; // ************************************************************************** String _$kyoshinMonitorLayerControllerHash() => - r'e33391f5bec03d2e34386f4a4a50accca6248f72'; + r'b925fc360bd92715f2f5cd5b24ab4acc303fcbda'; /// 強震モニタの観測点レイヤーを管理するコントローラー /// diff --git a/app/lib/feature/settings/children/config/debug/debugger_page.dart b/app/lib/feature/settings/children/config/debug/debugger_page.dart index a93a7197..8a609a86 100644 --- a/app/lib/feature/settings/children/config/debug/debugger_page.dart +++ b/app/lib/feature/settings/children/config/debug/debugger_page.dart @@ -4,6 +4,7 @@ import 'package:eqmonitor/core/provider/telegram_url/provider/telegram_url_provi import 'package:eqmonitor/core/router/router.dart'; import 'package:eqmonitor/core/util/env.dart'; import 'package:eqmonitor/feature/home/component/sheet/sheet_header.dart'; +import 'package:eqmonitor/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/playground/playground_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; @@ -92,6 +93,15 @@ class _DebugWidget extends ConsumerWidget { leading: const Icon(Icons.list), onTap: () async => const PlaygroundRoute().push(context), ), + ListTile( + title: const Text('震源アイコン生成'), + leading: const Icon(Icons.place), + onTap: () async => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const HypocenterIconPage(), + ), + ), + ), ListTile( title: const Text('FCM Token'), subtitle: Text( diff --git a/app/lib/feature/shake_detection/provider/shake_detection_provider.dart b/app/lib/feature/shake_detection/provider/shake_detection_provider.dart index 43b69187..cad5301e 100644 --- a/app/lib/feature/shake_detection/provider/shake_detection_provider.dart +++ b/app/lib/feature/shake_detection/provider/shake_detection_provider.dart @@ -42,7 +42,7 @@ class ShakeDetection extends _$ShakeDetection { }, ) ..listen( - timeTickerProvider, + timeTickerProvider(), (_, __) { if (state case AsyncData(:final value)) { state = AsyncData(_pruneOldEvents(value)); diff --git a/app/lib/gen/assets.gen.dart b/app/lib/gen/assets.gen.dart index 6c27b130..52f56c61 100644 --- a/app/lib/gen/assets.gen.dart +++ b/app/lib/gen/assets.gen.dart @@ -72,6 +72,9 @@ class $AssetsImagesGen { AssetGenImage get iconForeground => const AssetGenImage('assets/images/icon_foreground.png'); + /// Directory path: assets/images/map + $AssetsImagesMapGen get map => const $AssetsImagesMapGen(); + /// Directory path: assets/images/theme $AssetsImagesThemeGen get theme => const $AssetsImagesThemeGen(); @@ -79,6 +82,21 @@ class $AssetsImagesGen { List get values => [icon, iconForeground]; } +class $AssetsImagesMapGen { + const $AssetsImagesMapGen(); + + /// File path: assets/images/map/low_precise_hypocenter.png + AssetGenImage get lowPreciseHypocenter => + const AssetGenImage('assets/images/map/low_precise_hypocenter.png'); + + /// File path: assets/images/map/normal_hypocenter.png + AssetGenImage get normalHypocenter => + const AssetGenImage('assets/images/map/normal_hypocenter.png'); + + /// List of all assets + List get values => [lowPreciseHypocenter, normalHypocenter]; +} + class $AssetsImagesThemeGen { const $AssetsImagesThemeGen(); diff --git a/app/lib/main.dart b/app/lib/main.dart index a085e521..5a625ee8 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -5,7 +5,6 @@ import 'dart:developer'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; -import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/app.dart'; import 'package:eqmonitor/core/fcm/channels.dart'; import 'package:eqmonitor/core/provider/application_documents_directory.dart'; @@ -21,7 +20,6 @@ import 'package:eqmonitor/core/util/license/init_licenses.dart'; import 'package:eqmonitor/feature/donation/data/donation_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart'; -import 'package:eqmonitor/feature/shake_detection/provider/shake_detection_provider.dart'; import 'package:eqmonitor/firebase_options.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; @@ -156,10 +154,6 @@ Future main() async { jmaCodeTableProvider.overrideWithValue(results.$1.$7), if (results.$2.$3 != null) kyoshinColorMapProvider.overrideWithValue(results.$2.$3!), - if (kDebugMode) - shakeDetectionProvider.overrideWith( - _MockShakeDetection.new, - ), ], observers: [ if (kDebugMode) @@ -202,40 +196,3 @@ Future _registerNotificationChannelIfNeeded() async { Future onBackgroundMessage(RemoteMessage message) async { log('onBackgroundMessage: $message'); } - -class _MockShakeDetection extends ShakeDetection { - @override - Future> build() async { - return [ - ShakeDetectionEvent( - id: 1, - eventId: 'debug_event', - serialNo: 1, - maxIntensity: JmaForecastIntensity.four, - regions: [ - const ShakeDetectionRegion( - name: '東京都23区', - maxIntensity: JmaForecastIntensity.four, - points: [ - ShakeDetectionPoint( - code: '11001', - intensity: JmaForecastIntensity.four, - ), - ], - ), - ], - createdAt: DateTime.now(), - insertedAt: DateTime.now(), - topLeft: const ShakeDetectionLatLng( - latitude: 35.8, - longitude: 139.6, - ), - bottomRight: const ShakeDetectionLatLng( - latitude: 35.5, - longitude: 139.9, - ), - pointCount: 1, - ), - ]; - } -} diff --git a/app/pubspec.yaml b/app/pubspec.yaml index a227352c..92908574 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -136,6 +136,7 @@ flutter: - assets/ - assets/images/ - assets/images/theme/ + - assets/images/map/ - assets/fonts/ - assets/docs/ - shorebird.yaml From 3622ae8b91af32e95e3a19f04b959b45c0e2aeb9 Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Sun, 9 Feb 2025 13:54:33 +0000 Subject: [PATCH 31/70] Auto format --- app/lib/feature/eew/data/eew_alive_telegram.g.dart | 2 +- .../map/data/controller/eew_hypocenter_layer_controller.g.dart | 2 +- .../shake_detection/provider/shake_detection_provider.g.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/feature/eew/data/eew_alive_telegram.g.dart b/app/lib/feature/eew/data/eew_alive_telegram.g.dart index 6f868fe3..651b3f1e 100644 --- a/app/lib/feature/eew/data/eew_alive_telegram.g.dart +++ b/app/lib/feature/eew/data/eew_alive_telegram.g.dart @@ -48,7 +48,7 @@ final eewAliveCheckerProvider = Provider.internal( @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element typedef EewAliveCheckerRef = ProviderRef; -String _$eewAliveTelegramHash() => r'0f34793e7fbbc2dcc781d51e6bd49413e495555a'; +String _$eewAliveTelegramHash() => r'0e6433459f8e9d3a6a4b414224e0a0d9abb1e5a2'; /// イベント終了していないEEW /// diff --git a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart index ee60d4b9..cfbcd5d7 100644 --- a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart @@ -9,7 +9,7 @@ part of 'eew_hypocenter_layer_controller.dart'; // ************************************************************************** String _$eewHypocenterLayerControllerHash() => - r'fab6bcc3fe7379f77aa02fd13f197361d109358e'; + r'911e081cb89be6fef12a9c0841e147725aaa38a9'; /// Copied from Dart SDK class _SystemHash { diff --git a/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart b/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart index 96429c84..d15a9f39 100644 --- a/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart +++ b/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart @@ -28,7 +28,7 @@ final _fetchShakeDetectionEventsProvider = // ignore: unused_element typedef _FetchShakeDetectionEventsRef = FutureProviderRef>; -String _$shakeDetectionHash() => r'451b7778a93fe735e240aa9a96e6aa940cf6cd17'; +String _$shakeDetectionHash() => r'3cbc2b6a6d3312d20de99ca4512ff627577f3dcd'; /// See also [ShakeDetection]. @ProviderFor(ShakeDetection) From 403261f7821dc1d697a81fc766e0b541ff861074 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 02:43:32 +0900 Subject: [PATCH 32/70] =?UTF-8?q?refactor:=20Map=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=8D=E3=83=B3=E3=83=88=E3=81=AE=E3=83=87?= =?UTF-8?q?=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E6=A7=8B=E6=88=90?= =?UTF-8?q?=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/feature/home/page/home_page.dart | 61 ++++----- .../declarative_map_controller.dart | 1 - app/lib/feature/map/ui/declarative_map.dart | 125 +++++++++++------- 3 files changed, 109 insertions(+), 78 deletions(-) diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index 62013b02..561df91a 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -78,29 +78,27 @@ class _Sheet extends StatelessWidget { top: Radius.circular(16), ), ), - child: SingleChildScrollView( - child: Column( - children: [ - Container( - margin: const EdgeInsets.symmetric(vertical: 8), - width: 36, - height: 4, - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - color: theme.colorScheme.onSurface, - ), + child: Column( + children: [ + Container( + margin: const EdgeInsets.symmetric(vertical: 8), + width: 36, + height: 4, + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: theme.colorScheme.onSurface, ), - const Padding( + ), + const Expanded( + child: Padding( padding: EdgeInsets.symmetric( horizontal: 8, ), - child: Expanded( - child: _SheetBody(), - ), + child: _SheetBody(), ), - ], - ), + ), + ], ), ), ); @@ -128,18 +126,21 @@ class _SheetBody extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return SingleChildScrollView( - child: Column( - children: [ - const EewWidgets(), - const _ShakeDetectionList(), - const HomeEarthquakeHistorySheet(), - if (kDebugMode) - ListTile( - title: const Text('デバッグページ'), - leading: const Icon(Icons.bug_report), - onTap: () async => const DebuggerRoute().push(context), - ), - ], + child: SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const EewWidgets(), + const _ShakeDetectionList(), + const HomeEarthquakeHistorySheet(), + if (kDebugMode) + ListTile( + title: const Text('デバッグページ'), + leading: const Icon(Icons.bug_report), + onTap: () async => const DebuggerRoute().push(context), + ), + ], + ), ), ); } diff --git a/app/lib/feature/map/data/controller/declarative_map_controller.dart b/app/lib/feature/map/data/controller/declarative_map_controller.dart index 4d00cd29..38a11651 100644 --- a/app/lib/feature/map/data/controller/declarative_map_controller.dart +++ b/app/lib/feature/map/data/controller/declarative_map_controller.dart @@ -1,6 +1,5 @@ import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/feature/map/ui/declarative_map.dart'; -import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:flutter/services.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index a73079e8..51e4dbdf 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:developer'; +import 'package:collection/collection.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; @@ -77,7 +78,7 @@ class DeclarativeMap extends StatefulHookConsumerWidget { } class _DeclarativeMapState extends ConsumerState { - final Map _addedLayers = {}; + final Map _addedLayers = {}; // レイヤー操作のロック bool _isUpdatingLayers = false; @@ -128,63 +129,87 @@ class _DeclarativeMapState extends ConsumerState { // ロック取得 _isUpdatingLayers = true; - // 削除されたレイヤーを削除 - final newLayerIds = widget.layers.map((l) => l.id).toSet(); - for (final id in _addedLayers.keys.toSet()) { - if (!newLayerIds.contains(id)) { - await controller.removeLayer(id); - await controller.removeSource(_addedLayers[id]!.layer.sourceId); - _addedLayers.remove(id); + // 削除探索 + for (final layer in _addedLayers.values) { + if (!widget.layers.any((e) => e.id == layer.layer.id)) { + await controller.removeLayer(layer.layer.id); + await controller.removeSource(layer.layer.sourceId); + _addedLayers.remove(layer.layer.id); } } - for (final layer in widget.layers) { - if (_addedLayers.containsKey(layer.id)) { - final cachedLayer = _addedLayers[layer.id]!; - // レイヤーの更新 - if (cachedLayer.layer != layer) { - // キャッシュ済みレイヤーと同じかどうか - // style check - final cachedLayerPropertiesHash = cachedLayer.layerPropertiesHash; - final layerPropertiesHash = layer.layerPropertiesHash; - if (cachedLayerPropertiesHash != layerPropertiesHash) { - await controller.setLayerProperties( - layer.id, - layer.toLayerProperties(), - ); - _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( - layerPropertiesHash: layerPropertiesHash, - ); - } - // geoJsonSource check - final cachedGeoJsonSource = cachedLayer.geoJsonSourceHash; - final geoJsonSource = layer.geoJsonSourceHash; - if (cachedGeoJsonSource != geoJsonSource) { - // update geojson - await controller.setGeoJsonSource( - layer.sourceId, - layer.toGeoJsonSource(), - ); - _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( - geoJsonSourceHash: geoJsonSource, - ); + widget.layers.forEachIndexed( + (index, layer) async { + final belowLayerId = index > 0 ? widget.layers[index - 1].id : null; + + if (_addedLayers.containsKey(layer.id)) { + final cachedLayer = _addedLayers[layer.id]!; + // レイヤーの更新 + if (cachedLayer.layer != layer) { + final isLayerPropertiesChanged = + cachedLayer.layerPropertiesHash != layer.layerPropertiesHash; + final isGeoJsonSourceChanged = + cachedLayer.geoJsonSourceHash != layer.geoJsonSourceHash; + final isFilterChanged = cachedLayer.layer.filter != layer.filter; + + // style check + if (isLayerPropertiesChanged) { + await controller.setLayerProperties( + layer.id, + layer.toLayerProperties(), + ); + _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( + layerPropertiesHash: layer.layerPropertiesHash, + ); + } + // geoJsonSource check + if (isGeoJsonSourceChanged) { + await controller.setGeoJsonSource( + layer.sourceId, + layer.toGeoJsonSource(), + ); + _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( + geoJsonSourceHash: layer.geoJsonSourceHash, + ); + } + // filter check + if (isFilterChanged) { + await controller.setFilter( + layer.id, + layer.filter, + ); + _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( + layer: layer, + ); + } } + } else { + print('adding new layer: ${layer.id}'); + // 新規レイヤーの追加 + await _addLayer( + layer: layer, + belowLayerId: belowLayerId, + ); } - } else { - log('adding new layer: ${layer.id}'); - // 新規レイヤーの追加 - await _addLayer(layer); - } - _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); - } + _addedLayers[layer.id] = CachedMapLayer.fromLayer( + layer: layer, + belowLayerId: belowLayerId, + ); + }, + ); } finally { // ロック解放 _isUpdatingLayers = false; } } - Future _addLayer(MapLayer layer) async { + Future _addLayer({ + required MapLayer layer, + String? belowLayerId, + }) async { final controller = widget.controller.controller!; + await controller.removeSource(layer.sourceId); + await controller.removeLayer(layer.id); await controller.addGeoJsonSource( layer.sourceId, layer.toGeoJsonSource(), @@ -193,6 +218,7 @@ class _DeclarativeMapState extends ConsumerState { layer.sourceId, layer.id, layer.toLayerProperties(), + belowLayerId: belowLayerId, ); } @@ -201,13 +227,18 @@ class _DeclarativeMapState extends ConsumerState { for (final layer in widget.layers) { await controller.removeLayer(layer.id); await controller.removeSource(layer.sourceId); - await _addLayer(layer); + _addedLayers.remove(layer.id); } + await _updateLayers(); } @override void didUpdateWidget(DeclarativeMap oldWidget) { super.didUpdateWidget(oldWidget); + if (_isUpdatingLayers) { + talker.error('map layer update is locked'); + return; + } if (widget.controller.controller == null) { talker.error('controller is null'); return; From 364e8bcf7c0d0a91215d696951454b0472f963eb Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 02:43:38 +0900 Subject: [PATCH 33/70] =?UTF-8?q?refactor:=20Map=E3=83=AC=E3=82=A4?= =?UTF-8?q?=E3=83=A4=E3=83=BC=E9=96=A2=E9=80=A3=E3=81=AE=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/data/layer/base/map_layer.dart | 44 ++-- .../data/layer/base/map_layer.freezed.dart | 214 ++++++++++++++++++ .../eew_hypocenter/eew_hypocenter_layer.dart | 1 + .../eew_hypocenter_layer.freezed.dart | 35 ++- 4 files changed, 264 insertions(+), 30 deletions(-) create mode 100644 app/lib/feature/map/data/layer/base/map_layer.freezed.dart diff --git a/app/lib/feature/map/data/layer/base/map_layer.dart b/app/lib/feature/map/data/layer/base/map_layer.dart index 44167b74..d3fd0539 100644 --- a/app/lib/feature/map/data/layer/base/map_layer.dart +++ b/app/lib/feature/map/data/layer/base/map_layer.dart @@ -1,5 +1,8 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; +part 'map_layer.freezed.dart'; + abstract class MapLayer { const MapLayer(); @@ -10,36 +13,31 @@ abstract class MapLayer { String get id; String get sourceId; - bool get visible; + bool? get visible; double? get minZoom; double? get maxZoom; + dynamic get filter; } -class CachedIMapLayer { - const CachedIMapLayer({ - required this.layer, - required this.geoJsonSourceHash, - required this.layerPropertiesHash, - }); +@freezed +class CachedMapLayer with _$CachedMapLayer { + const factory CachedMapLayer({ + required MapLayer layer, + required String geoJsonSourceHash, + required String layerPropertiesHash, + required String? belowLayerId, + }) = _CachedMapLayer; + + const CachedMapLayer._(); - factory CachedIMapLayer.fromLayer(MapLayer layer) => CachedIMapLayer( + factory CachedMapLayer.fromLayer({ + required MapLayer layer, + String? belowLayerId, + }) => + CachedMapLayer( layer: layer, geoJsonSourceHash: layer.geoJsonSourceHash, layerPropertiesHash: layer.layerPropertiesHash, - ); - - final MapLayer layer; - final String geoJsonSourceHash; - final String layerPropertiesHash; - - CachedIMapLayer copyWith({ - MapLayer? layer, - String? geoJsonSourceHash, - String? layerPropertiesHash, - }) => - CachedIMapLayer( - layer: layer ?? this.layer, - geoJsonSourceHash: geoJsonSourceHash ?? this.geoJsonSourceHash, - layerPropertiesHash: layerPropertiesHash ?? this.layerPropertiesHash, + belowLayerId: belowLayerId, ); } diff --git a/app/lib/feature/map/data/layer/base/map_layer.freezed.dart b/app/lib/feature/map/data/layer/base/map_layer.freezed.dart new file mode 100644 index 00000000..d8a15a27 --- /dev/null +++ b/app/lib/feature/map/data/layer/base/map_layer.freezed.dart @@ -0,0 +1,214 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'map_layer.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$CachedMapLayer { + MapLayer get layer => throw _privateConstructorUsedError; + String get geoJsonSourceHash => throw _privateConstructorUsedError; + String get layerPropertiesHash => throw _privateConstructorUsedError; + String? get belowLayerId => throw _privateConstructorUsedError; + + /// Create a copy of CachedMapLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $CachedMapLayerCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CachedMapLayerCopyWith<$Res> { + factory $CachedMapLayerCopyWith( + CachedMapLayer value, $Res Function(CachedMapLayer) then) = + _$CachedMapLayerCopyWithImpl<$Res, CachedMapLayer>; + @useResult + $Res call( + {MapLayer layer, + String geoJsonSourceHash, + String layerPropertiesHash, + String? belowLayerId}); +} + +/// @nodoc +class _$CachedMapLayerCopyWithImpl<$Res, $Val extends CachedMapLayer> + implements $CachedMapLayerCopyWith<$Res> { + _$CachedMapLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of CachedMapLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? layer = null, + Object? geoJsonSourceHash = null, + Object? layerPropertiesHash = null, + Object? belowLayerId = freezed, + }) { + return _then(_value.copyWith( + layer: null == layer + ? _value.layer + : layer // ignore: cast_nullable_to_non_nullable + as MapLayer, + geoJsonSourceHash: null == geoJsonSourceHash + ? _value.geoJsonSourceHash + : geoJsonSourceHash // ignore: cast_nullable_to_non_nullable + as String, + layerPropertiesHash: null == layerPropertiesHash + ? _value.layerPropertiesHash + : layerPropertiesHash // ignore: cast_nullable_to_non_nullable + as String, + belowLayerId: freezed == belowLayerId + ? _value.belowLayerId + : belowLayerId // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$CachedMapLayerImplCopyWith<$Res> + implements $CachedMapLayerCopyWith<$Res> { + factory _$$CachedMapLayerImplCopyWith(_$CachedMapLayerImpl value, + $Res Function(_$CachedMapLayerImpl) then) = + __$$CachedMapLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {MapLayer layer, + String geoJsonSourceHash, + String layerPropertiesHash, + String? belowLayerId}); +} + +/// @nodoc +class __$$CachedMapLayerImplCopyWithImpl<$Res> + extends _$CachedMapLayerCopyWithImpl<$Res, _$CachedMapLayerImpl> + implements _$$CachedMapLayerImplCopyWith<$Res> { + __$$CachedMapLayerImplCopyWithImpl( + _$CachedMapLayerImpl _value, $Res Function(_$CachedMapLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of CachedMapLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? layer = null, + Object? geoJsonSourceHash = null, + Object? layerPropertiesHash = null, + Object? belowLayerId = freezed, + }) { + return _then(_$CachedMapLayerImpl( + layer: null == layer + ? _value.layer + : layer // ignore: cast_nullable_to_non_nullable + as MapLayer, + geoJsonSourceHash: null == geoJsonSourceHash + ? _value.geoJsonSourceHash + : geoJsonSourceHash // ignore: cast_nullable_to_non_nullable + as String, + layerPropertiesHash: null == layerPropertiesHash + ? _value.layerPropertiesHash + : layerPropertiesHash // ignore: cast_nullable_to_non_nullable + as String, + belowLayerId: freezed == belowLayerId + ? _value.belowLayerId + : belowLayerId // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc + +class _$CachedMapLayerImpl extends _CachedMapLayer { + const _$CachedMapLayerImpl( + {required this.layer, + required this.geoJsonSourceHash, + required this.layerPropertiesHash, + required this.belowLayerId}) + : super._(); + + @override + final MapLayer layer; + @override + final String geoJsonSourceHash; + @override + final String layerPropertiesHash; + @override + final String? belowLayerId; + + @override + String toString() { + return 'CachedMapLayer(layer: $layer, geoJsonSourceHash: $geoJsonSourceHash, layerPropertiesHash: $layerPropertiesHash, belowLayerId: $belowLayerId)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CachedMapLayerImpl && + (identical(other.layer, layer) || other.layer == layer) && + (identical(other.geoJsonSourceHash, geoJsonSourceHash) || + other.geoJsonSourceHash == geoJsonSourceHash) && + (identical(other.layerPropertiesHash, layerPropertiesHash) || + other.layerPropertiesHash == layerPropertiesHash) && + (identical(other.belowLayerId, belowLayerId) || + other.belowLayerId == belowLayerId)); + } + + @override + int get hashCode => Object.hash( + runtimeType, layer, geoJsonSourceHash, layerPropertiesHash, belowLayerId); + + /// Create a copy of CachedMapLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$CachedMapLayerImplCopyWith<_$CachedMapLayerImpl> get copyWith => + __$$CachedMapLayerImplCopyWithImpl<_$CachedMapLayerImpl>( + this, _$identity); +} + +abstract class _CachedMapLayer extends CachedMapLayer { + const factory _CachedMapLayer( + {required final MapLayer layer, + required final String geoJsonSourceHash, + required final String layerPropertiesHash, + required final String? belowLayerId}) = _$CachedMapLayerImpl; + const _CachedMapLayer._() : super._(); + + @override + MapLayer get layer; + @override + String get geoJsonSourceHash; + @override + String get layerPropertiesHash; + @override + String? get belowLayerId; + + /// Create a copy of CachedMapLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$CachedMapLayerImplCopyWith<_$CachedMapLayerImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart index 3e303f0d..8e34ffc2 100644 --- a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart @@ -23,6 +23,7 @@ class EewHypocenterLayer extends MapLayer with _$EewHypocenterLayer { required String iconImage, @Default(null) double? minZoom, @Default(null) double? maxZoom, + dynamic filter, }) = _EewHypocenterLayer; const EewHypocenterLayer._(); diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart index dfc0ced8..55ab0839 100644 --- a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart @@ -171,6 +171,7 @@ mixin _$EewHypocenterLayer { String get iconImage => throw _privateConstructorUsedError; double? get minZoom => throw _privateConstructorUsedError; double? get maxZoom => throw _privateConstructorUsedError; + dynamic get filter => throw _privateConstructorUsedError; /// Create a copy of EewHypocenterLayer /// with the given fields replaced by the non-null parameter values. @@ -192,7 +193,8 @@ abstract class $EewHypocenterLayerCopyWith<$Res> { List hypocenters, String iconImage, double? minZoom, - double? maxZoom}); + double? maxZoom, + dynamic filter}); } /// @nodoc @@ -217,6 +219,7 @@ class _$EewHypocenterLayerCopyWithImpl<$Res, $Val extends EewHypocenterLayer> Object? iconImage = null, Object? minZoom = freezed, Object? maxZoom = freezed, + Object? filter = freezed, }) { return _then(_value.copyWith( id: null == id @@ -247,6 +250,10 @@ class _$EewHypocenterLayerCopyWithImpl<$Res, $Val extends EewHypocenterLayer> ? _value.maxZoom : maxZoom // ignore: cast_nullable_to_non_nullable as double?, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, ) as $Val); } } @@ -266,7 +273,8 @@ abstract class _$$EewHypocenterLayerImplCopyWith<$Res> List hypocenters, String iconImage, double? minZoom, - double? maxZoom}); + double? maxZoom, + dynamic filter}); } /// @nodoc @@ -289,6 +297,7 @@ class __$$EewHypocenterLayerImplCopyWithImpl<$Res> Object? iconImage = null, Object? minZoom = freezed, Object? maxZoom = freezed, + Object? filter = freezed, }) { return _then(_$EewHypocenterLayerImpl( id: null == id @@ -319,6 +328,10 @@ class __$$EewHypocenterLayerImplCopyWithImpl<$Res> ? _value.maxZoom : maxZoom // ignore: cast_nullable_to_non_nullable as double?, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, )); } } @@ -333,7 +346,8 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { required final List hypocenters, required this.iconImage, this.minZoom = null, - this.maxZoom = null}) + this.maxZoom = null, + this.filter}) : _hypocenters = hypocenters, super._(); @@ -359,10 +373,12 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { @override @JsonKey() final double? maxZoom; + @override + final dynamic filter; @override String toString() { - return 'EewHypocenterLayer(id: $id, sourceId: $sourceId, visible: $visible, hypocenters: $hypocenters, iconImage: $iconImage, minZoom: $minZoom, maxZoom: $maxZoom)'; + return 'EewHypocenterLayer(id: $id, sourceId: $sourceId, visible: $visible, hypocenters: $hypocenters, iconImage: $iconImage, minZoom: $minZoom, maxZoom: $maxZoom, filter: $filter)'; } @override @@ -379,7 +395,8 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { (identical(other.iconImage, iconImage) || other.iconImage == iconImage) && (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && - (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom) && + const DeepCollectionEquality().equals(other.filter, filter)); } @override @@ -391,7 +408,8 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { const DeepCollectionEquality().hash(_hypocenters), iconImage, minZoom, - maxZoom); + maxZoom, + const DeepCollectionEquality().hash(filter)); /// Create a copy of EewHypocenterLayer /// with the given fields replaced by the non-null parameter values. @@ -411,7 +429,8 @@ abstract class _EewHypocenterLayer extends EewHypocenterLayer { required final List hypocenters, required final String iconImage, final double? minZoom, - final double? maxZoom}) = _$EewHypocenterLayerImpl; + final double? maxZoom, + final dynamic filter}) = _$EewHypocenterLayerImpl; _EewHypocenterLayer._() : super._(); @override @@ -428,6 +447,8 @@ abstract class _EewHypocenterLayer extends EewHypocenterLayer { double? get minZoom; @override double? get maxZoom; + @override + dynamic get filter; /// Create a copy of EewHypocenterLayer /// with the given fields replaced by the non-null parameter values. From aaa57433ef8fc546699a70c555096b7a27e4910b Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 02:43:43 +0900 Subject: [PATCH 34/70] =?UTF-8?q?chore:=20=E8=87=AA=E5=8B=95=E7=94=9F?= =?UTF-8?q?=E6=88=90=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kyoshin_monitor_layer_controller.dart | 1 + ...shin_monitor_layer_controller.freezed.dart | 35 ++- .../map/data/provider/map_style_util.dart | 1 + .../feature/map/widget/declarative_map.dart | 204 ------------------ 4 files changed, 30 insertions(+), 211 deletions(-) delete mode 100644 app/lib/feature/map/widget/declarative_map.dart diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index ab7320f6..301f42d4 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -122,6 +122,7 @@ class KyoshinMonitorObservationLayer extends MapLayer required RealtimeDataType realtimeDataType, double? minZoom, double? maxZoom, + dynamic filter, }) = _KyoshinMonitorObservationLayer; const KyoshinMonitorObservationLayer._(); diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart index 45f5ccd3..a02aed66 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart @@ -26,6 +26,7 @@ mixin _$KyoshinMonitorObservationLayer { RealtimeDataType get realtimeDataType => throw _privateConstructorUsedError; double? get minZoom => throw _privateConstructorUsedError; double? get maxZoom => throw _privateConstructorUsedError; + dynamic get filter => throw _privateConstructorUsedError; /// Create a copy of KyoshinMonitorObservationLayer /// with the given fields replaced by the non-null parameter values. @@ -51,7 +52,8 @@ abstract class $KyoshinMonitorObservationLayerCopyWith<$Res> { KyoshinMonitorMarkerType markerType, RealtimeDataType realtimeDataType, double? minZoom, - double? maxZoom}); + double? maxZoom, + dynamic filter}); } /// @nodoc @@ -79,6 +81,7 @@ class _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, Object? realtimeDataType = null, Object? minZoom = freezed, Object? maxZoom = freezed, + Object? filter = freezed, }) { return _then(_value.copyWith( id: null == id @@ -117,6 +120,10 @@ class _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, ? _value.maxZoom : maxZoom // ignore: cast_nullable_to_non_nullable as double?, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, ) as $Val); } } @@ -139,7 +146,8 @@ abstract class _$$KyoshinMonitorObservationLayerImplCopyWith<$Res> KyoshinMonitorMarkerType markerType, RealtimeDataType realtimeDataType, double? minZoom, - double? maxZoom}); + double? maxZoom, + dynamic filter}); } /// @nodoc @@ -166,6 +174,7 @@ class __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res> Object? realtimeDataType = null, Object? minZoom = freezed, Object? maxZoom = freezed, + Object? filter = freezed, }) { return _then(_$KyoshinMonitorObservationLayerImpl( id: null == id @@ -204,6 +213,10 @@ class __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res> ? _value.maxZoom : maxZoom // ignore: cast_nullable_to_non_nullable as double?, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, )); } } @@ -221,7 +234,8 @@ class _$KyoshinMonitorObservationLayerImpl required this.markerType, required this.realtimeDataType, this.minZoom, - this.maxZoom}) + this.maxZoom, + this.filter}) : _points = points, super._(); @@ -249,10 +263,12 @@ class _$KyoshinMonitorObservationLayerImpl final double? minZoom; @override final double? maxZoom; + @override + final dynamic filter; @override String toString() { - return 'KyoshinMonitorObservationLayer(id: $id, sourceId: $sourceId, visible: $visible, points: $points, isInEew: $isInEew, markerType: $markerType, realtimeDataType: $realtimeDataType, minZoom: $minZoom, maxZoom: $maxZoom)'; + return 'KyoshinMonitorObservationLayer(id: $id, sourceId: $sourceId, visible: $visible, points: $points, isInEew: $isInEew, markerType: $markerType, realtimeDataType: $realtimeDataType, minZoom: $minZoom, maxZoom: $maxZoom, filter: $filter)'; } @override @@ -271,7 +287,8 @@ class _$KyoshinMonitorObservationLayerImpl (identical(other.realtimeDataType, realtimeDataType) || other.realtimeDataType == realtimeDataType) && (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && - (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom) && + const DeepCollectionEquality().equals(other.filter, filter)); } @override @@ -285,7 +302,8 @@ class _$KyoshinMonitorObservationLayerImpl markerType, realtimeDataType, minZoom, - maxZoom); + maxZoom, + const DeepCollectionEquality().hash(filter)); /// Create a copy of KyoshinMonitorObservationLayer /// with the given fields replaced by the non-null parameter values. @@ -309,7 +327,8 @@ abstract class _KyoshinMonitorObservationLayer required final KyoshinMonitorMarkerType markerType, required final RealtimeDataType realtimeDataType, final double? minZoom, - final double? maxZoom}) = _$KyoshinMonitorObservationLayerImpl; + final double? maxZoom, + final dynamic filter}) = _$KyoshinMonitorObservationLayerImpl; _KyoshinMonitorObservationLayer._() : super._(); @override @@ -330,6 +349,8 @@ abstract class _KyoshinMonitorObservationLayer double? get minZoom; @override double? get maxZoom; + @override + dynamic get filter; /// Create a copy of KyoshinMonitorObservationLayer /// with the given fields replaced by the non-null parameter values. diff --git a/app/lib/feature/map/data/provider/map_style_util.dart b/app/lib/feature/map/data/provider/map_style_util.dart index 0fad9c07..0ed8f803 100644 --- a/app/lib/feature/map/data/provider/map_style_util.dart +++ b/app/lib/feature/map/data/provider/map_style_util.dart @@ -1,3 +1,4 @@ + import 'dart:convert'; import 'dart:io'; import 'dart:ui'; diff --git a/app/lib/feature/map/widget/declarative_map.dart b/app/lib/feature/map/widget/declarative_map.dart deleted file mode 100644 index 3df44e06..00000000 --- a/app/lib/feature/map/widget/declarative_map.dart +++ /dev/null @@ -1,204 +0,0 @@ -import 'dart:async'; -import 'dart:developer'; - -import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; -import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; -import 'package:eqmonitor/feature/map/data/notifier/map_configuration_notifier.dart'; -import 'package:flutter/material.dart'; -import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:maplibre_gl/maplibre_gl.dart'; - -/// 宣言的なMapLibreMapのラッパー -class DeclarativeMap extends ConsumerStatefulWidget { - const DeclarativeMap({ - required this.initialCameraPosition, - super.key, - this.onMapCreated, - this.onStyleLoadedCallback, - this.onCameraIdle, - this.layers = const [], - this.myLocationEnabled = false, - this.compassEnabled = true, - this.rotateGesturesEnabled = true, - this.scrollGesturesEnabled = true, - this.zoomGesturesEnabled = true, - this.doubleClickZoomEnabled = true, - }); - - /// 初期カメラ位置 - final MapCameraPosition initialCameraPosition; - - /// マップ作成時のコールバック - final void Function(MapLibreMapController)? onMapCreated; - - /// スタイル読み込み完了時のコールバック - final void Function()? onStyleLoadedCallback; - - /// カメラ移動完了時のコールバック - final void Function(MapCameraPosition)? onCameraIdle; - - /// レイヤーのリスト - final List layers; - - /// 現在位置の表示 - final bool myLocationEnabled; - - /// コンパスの表示 - final bool compassEnabled; - - /// 回転ジェスチャーの有効化 - final bool rotateGesturesEnabled; - - /// スクロールジェスチャーの有効化 - final bool scrollGesturesEnabled; - - /// ズームジェスチャーの有効化 - final bool zoomGesturesEnabled; - - /// ダブルタップズームの有効化 - final bool doubleClickZoomEnabled; - - @override - ConsumerState createState() => _DeclarativeMapState(); -} - -class _DeclarativeMapState extends ConsumerState { - MapLibreMapController? _controller; - final Map _addedLayers = {}; - // レイヤー操作のロック - bool _isUpdatingLayers = false; - - @override - Widget build(BuildContext context) { - // スタイルの監視 - final configurationState = ref.watch(mapConfigurationNotifierProvider); - final configuration = configurationState.valueOrNull; - - if (configuration == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); - } - - final styleString = configuration.styleString; - if (styleString == null) { - throw ArgumentError('styleString is null'); - } - - return MapLibreMap( - styleString: styleString, - initialCameraPosition: widget.initialCameraPosition.toMapLibre(), - onMapCreated: (controller) { - _controller = controller; - widget.onMapCreated?.call(controller); - }, - onStyleLoadedCallback: () { - widget.onStyleLoadedCallback?.call(); - unawaited( - _updateLayers(), - ); - }, - onCameraIdle: () { - final position = _controller?.cameraPosition; - if (position != null) { - widget.onCameraIdle?.call( - MapCameraPosition.fromMapLibre(position), - ); - } - }, - myLocationEnabled: widget.myLocationEnabled, - compassEnabled: widget.compassEnabled, - rotateGesturesEnabled: widget.rotateGesturesEnabled, - scrollGesturesEnabled: widget.scrollGesturesEnabled, - zoomGesturesEnabled: widget.zoomGesturesEnabled, - doubleClickZoomEnabled: widget.doubleClickZoomEnabled, - ); - } - - Future _updateLayers() async { - if (_controller == null) { - log('controller is null'); - return; - } - // ロックチェック - if (_isUpdatingLayers) { - return; - } - try { - // ロック取得 - _isUpdatingLayers = true; - - // 削除されたレイヤーを削除 - final newLayerIds = widget.layers.map((l) => l.id).toSet(); - for (final id in _addedLayers.keys.toSet()) { - if (!newLayerIds.contains(id)) { - await _controller!.removeLayer(id); - await _controller!.removeSource(_addedLayers[id]!.layer.sourceId); - _addedLayers.remove(id); - } - } - - for (final layer in widget.layers) { - if (_addedLayers.containsKey(layer.id)) { - final cachedLayer = _addedLayers[layer.id]!; - // レイヤーの更新 - if (cachedLayer.layer != layer) { - // キャッシュ済みレイヤーと同じかどうか - // style check - final cachedLayerProperties = cachedLayer.layerPropertiesHash; - final layerProperties = layer.layerPropertiesHash; - if (cachedLayerProperties != layerProperties) { - log('layer properties changed'); - await _controller!.removeLayer(layer.id); - await _controller!.removeSource(layer.sourceId); - await _addLayer(layer); - _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); - - continue; - } - // geoJsonSource check - final cachedGeoJsonSource = cachedLayer.geoJsonSourceHash; - final geoJsonSource = layer.geoJsonSourceHash; - if (cachedGeoJsonSource != geoJsonSource) { - // update geojson - await _controller!.setGeoJsonSource( - layer.sourceId, - layer.toGeoJsonSource(), - ); - } - } - } else { - // 新規レイヤーの追加 - await _addLayer(layer); - } - _addedLayers[layer.id] = CachedIMapLayer.fromLayer(layer); - } - } finally { - // ロック解放 - _isUpdatingLayers = false; - } - } - - Future _addLayer(MapLayer layer) async { - final controller = _controller!; - await controller.addGeoJsonSource( - layer.sourceId, - layer.toGeoJsonSource(), - ); - await controller.addLayer( - layer.id, - layer.sourceId, - layer.toLayerProperties(), - ); - } - - @override - void didUpdateWidget(DeclarativeMap oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.layers != widget.layers) { - unawaited( - _updateLayers(), - ); - } - } -} From ec5851a4913fc00d64b901a2856a1a95079bbe62 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 05:20:37 +0900 Subject: [PATCH 35/70] =?UTF-8?q?feat:=20EEW=E3=81=AEP=E6=B3=A2=E3=83=BBS?= =?UTF-8?q?=E6=B3=A2=E8=A1=A8=E7=A4=BA=E6=A9=9F=E8=83=BD=E3=81=AE=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/eew_ps_wave_controller.dart | 93 ++ .../controller/eew_ps_wave_controller.g.dart | 63 + .../layer/eew_ps_wave/eew_ps_wave_layer.dart | 251 ++++ .../eew_ps_wave_layer.freezed.dart | 1028 +++++++++++++++++ 4 files changed, 1435 insertions(+) create mode 100644 app/lib/feature/map/data/controller/eew_ps_wave_controller.dart create mode 100644 app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart create mode 100644 app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart create mode 100644 app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart diff --git a/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart b/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart new file mode 100644 index 00000000..d9ae5891 --- /dev/null +++ b/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart @@ -0,0 +1,93 @@ +import 'package:collection/collection.dart'; +import 'package:eqmonitor/core/provider/time_ticker.dart'; +import 'package:eqmonitor/core/provider/travel_time/provider/travel_time_provider.dart'; +import 'package:eqmonitor/feature/eew/data/eew_alive_telegram.dart'; +import 'package:eqmonitor/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart'; +import 'package:flutter/material.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +part 'eew_ps_wave_controller.g.dart'; + +@Riverpod(keepAlive: true) +class EewPsWaveFillLayerController extends _$EewPsWaveFillLayerController { + @override + List build() => [ + EewWaveFillLayer.sWaveWarning( + color: Colors.redAccent, + ), + EewWaveFillLayer.sWaveNotWarning( + color: Colors.orangeAccent, + ), + EewWaveFillLayer.pWave( + color: Colors.blue, + ), + ]; +} + +@Riverpod(keepAlive: true) +class EewPsWaveLineLayerController extends _$EewPsWaveLineLayerController { + @override + List build() => [ + EewWaveLineLayer.sWaveWarning( + color: Colors.redAccent, + ), + EewWaveLineLayer.sWaveNotWarning( + color: Colors.orangeAccent, + ), + EewWaveLineLayer.pWave( + color: Colors.blue, + ), + ]; +} + +@Riverpod(keepAlive: true) +class EewPsWaveSourceLayerController extends _$EewPsWaveSourceLayerController { + @override + EewPsWaveSourceLayer build() { + final travelTime = ref.watch(travelTimeDepthMapProvider); + final now = ref + .watch( + timeTickerProvider( + const Duration(milliseconds: 100), + ), + ) + .valueOrNull ?? + DateTime.now(); + + final aliveEews = ref.watch(eewAliveTelegramProvider); + final items = (aliveEews ?? []) + .whereNot( + (eew) => eew.isIpfOnePoint || eew.isLevelEew || (eew.isPlum ?? false), + ) + .map((eew) { + final latitude = eew.latitude; + final longitude = eew.longitude; + final depth = eew.depth; + final originTime = eew.originTime; + if (latitude == null || + longitude == null || + depth == null || + originTime == null) { + print( + 'latitude: $latitude, longitude: $longitude, depth: $depth, originTime: $originTime', + ); + return null; + } + final time = now.difference(originTime).inMilliseconds / 1000; + final result = travelTime.getTravelTime(depth ~/ 10 * 10, time); + return EewPsWaveLayerItem( + latitude: latitude, + longitude: longitude, + travelTime: result, + isWarning: eew.isWarning ?? false, + ); + }) + .nonNulls + .toList(); + + return EewPsWaveSourceLayer( + id: 'eew_ps_wave_source', + items: items, + ); + } +} diff --git a/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart b/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart new file mode 100644 index 00000000..9e727eac --- /dev/null +++ b/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart @@ -0,0 +1,63 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use + +part of 'eew_ps_wave_controller.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$eewPsWaveFillLayerControllerHash() => + r'd2847c0bda179a226d632093bda9f0f61ea7b7cb'; + +/// See also [EewPsWaveFillLayerController]. +@ProviderFor(EewPsWaveFillLayerController) +final eewPsWaveFillLayerControllerProvider = NotifierProvider< + EewPsWaveFillLayerController, List>.internal( + EewPsWaveFillLayerController.new, + name: r'eewPsWaveFillLayerControllerProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewPsWaveFillLayerControllerHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$EewPsWaveFillLayerController = Notifier>; +String _$eewPsWaveLineLayerControllerHash() => + r'6fb53c0cb954d6e81d61c9fded22504627f325f1'; + +/// See also [EewPsWaveLineLayerController]. +@ProviderFor(EewPsWaveLineLayerController) +final eewPsWaveLineLayerControllerProvider = NotifierProvider< + EewPsWaveLineLayerController, List>.internal( + EewPsWaveLineLayerController.new, + name: r'eewPsWaveLineLayerControllerProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewPsWaveLineLayerControllerHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$EewPsWaveLineLayerController = Notifier>; +String _$eewPsWaveSourceLayerControllerHash() => + r'2250d315dd054e0a774c9dbbb47402e19345af4e'; + +/// See also [EewPsWaveSourceLayerController]. +@ProviderFor(EewPsWaveSourceLayerController) +final eewPsWaveSourceLayerControllerProvider = NotifierProvider< + EewPsWaveSourceLayerController, EewPsWaveSourceLayer>.internal( + EewPsWaveSourceLayerController.new, + name: r'eewPsWaveSourceLayerControllerProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewPsWaveSourceLayerControllerHash, + dependencies: null, + allTransitiveDependencies: null, +); + +typedef _$EewPsWaveSourceLayerController = Notifier; +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart new file mode 100644 index 00000000..ad538711 --- /dev/null +++ b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart @@ -0,0 +1,251 @@ +import 'package:collection/collection.dart'; +import 'package:eqmonitor/core/provider/travel_time/provider/travel_time_provider.dart'; +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; +import 'package:eqmonitor/feature/map/data/provider/map_style_util.dart'; +import 'package:flutter/services.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:latlong2/latlong.dart' as lat_long; +import 'package:maplibre_gl/maplibre_gl.dart'; + +part 'eew_ps_wave_layer.freezed.dart'; + +@freezed +class EewPsWaveSourceLayer extends MapLayer with _$EewPsWaveSourceLayer { + const factory EewPsWaveSourceLayer({ + required String id, + required List items, + @Default(true) bool visible, + @Default('eew_ps_wave_source') String sourceId, + @Default(null) double? minZoom, + @Default(null) double? maxZoom, + dynamic filter, + }) = _EewPsWaveSourceLayer; + + const EewPsWaveSourceLayer._(); + + @override + Map toGeoJsonSource() { + final json = { + 'type': 'FeatureCollection', + 'features': items.map((e) => e.toGeoJsonFeatures()).flattened.toList(), + }; + return json; + } + + @override + LayerProperties? toLayerProperties() => null; + + @override + String get geoJsonSourceHash => items.hashCode.toString(); + + @override + String get layerPropertiesHash => ''; +} + +@freezed +class EewPsWaveLayerItem with _$EewPsWaveLayerItem { + const factory EewPsWaveLayerItem({ + required double latitude, + required double longitude, + required TravelTimeResult travelTime, + required bool isWarning, + }) = _EewPsWaveLayerItem; + + const EewPsWaveLayerItem._(); + + List> toGeoJsonFeatures() { + final sTravel = this.travelTime.sDistance; + final pTravel = this.travelTime.pDistance; + const distance = lat_long.Distance(); + + return [ + if (sTravel != null) + { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + [ + for (final bearing + in List.generate(91, (index) => index * 4)) + () { + final latLng = distance.offset( + lat_long.LatLng(latitude, longitude), + sTravel * 1000, + bearing, + ); + return [latLng.longitude, latLng.latitude]; + }(), + ], + ], + }, + 'properties': { + 'type': 's', + 'is_warning': isWarning, + }, + }, + if (pTravel != null) + { + 'type': 'Feature', + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + [ + for (final bearing + in List.generate(91, (index) => index * 4)) + () { + final latLng = distance.offset( + lat_long.LatLng(latitude, longitude), + pTravel * 1000, + bearing, + ); + return [latLng.longitude, latLng.latitude]; + }(), + ], + ], + }, + 'properties': { + 'type': 'p', + 'is_warning': isWarning, + }, + }, + ]; + } +} + +@freezed +class EewWaveFillLayer extends MapLayer with _$EewWaveFillLayer { + const factory EewWaveFillLayer({ + required String id, + required Color color, + required dynamic filter, + @Default(true) bool visible, + @Default('eew_ps_wave_source') String sourceId, + @Default(null) double? minZoom, + @Default(null) double? maxZoom, + }) = _EewWaveFillLayer; + + const EewWaveFillLayer._(); + + factory EewWaveFillLayer.pWave({ + required Color color, + }) => + EewWaveFillLayer( + id: 'eew_wave_fill_p', + color: color, + filter: [ + '==', + 'type', + 'p', + ], + ); + + factory EewWaveFillLayer.sWaveWarning({ + required Color color, + }) => + EewWaveFillLayer( + id: 'eew_wave_fill_s_warning', + color: color, + filter: [ + 'all', + ['==', 'type', 's'], + ['==', 'is_warning', true], + ], + ); + + factory EewWaveFillLayer.sWaveNotWarning({ + required Color color, + }) => + EewWaveFillLayer( + id: 'eew_wave_fill_s_not_warning', + color: color, + filter: [ + 'all', + ['==', 'type', 's'], + ['==', 'is_warning', false], + ], + ); + + @override + Map? toGeoJsonSource() => null; + + @override + LayerProperties toLayerProperties() => FillLayerProperties( + fillColor: color.toHexStringRGB(), + ); + + @override + String get geoJsonSourceHash => ''; + + @override + String get layerPropertiesHash => '${color.hex}'; +} + +@freezed +class EewWaveLineLayer extends MapLayer with _$EewWaveLineLayer { + const factory EewWaveLineLayer({ + required String id, + required Color color, + required dynamic filter, + @Default(true) bool visible, + @Default('eew_ps_wave_source') String sourceId, + @Default(null) double? minZoom, + @Default(null) double? maxZoom, + }) = _EewWaveLineLayer; + + const EewWaveLineLayer._(); + + factory EewWaveLineLayer.pWave({ + required Color color, + }) => + EewWaveLineLayer( + id: 'eew_wave_line_p', + color: color, + filter: [ + '==', + 'type', + 'p', + ], + ); + + factory EewWaveLineLayer.sWaveWarning({ + required Color color, + }) => + EewWaveLineLayer( + id: 'eew_wave_line_s', + color: color, + filter: [ + 'all', + ['==', 'type', 's'], + ['==', 'is_warning', true], + ], + ); + + factory EewWaveLineLayer.sWaveNotWarning({ + required Color color, + }) => + EewWaveLineLayer( + id: 'eew_wave_line_s_not_warning', + color: color, + filter: [ + 'all', + ['==', 'type', 's'], + ['==', 'is_warning', false], + ], + ); + + @override + Map? toGeoJsonSource() => null; + + @override + LayerProperties toLayerProperties() => LineLayerProperties( + lineColor: color.toHexStringRGB(), + lineCap: 'round', + ); + + @override + String get geoJsonSourceHash => ''; + + @override + String get layerPropertiesHash => '${color.hex}'; +} diff --git a/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart new file mode 100644 index 00000000..a8ad51ec --- /dev/null +++ b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart @@ -0,0 +1,1028 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'eew_ps_wave_layer.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$EewPsWaveSourceLayer { + String get id => throw _privateConstructorUsedError; + List get items => throw _privateConstructorUsedError; + bool get visible => throw _privateConstructorUsedError; + String get sourceId => throw _privateConstructorUsedError; + double? get minZoom => throw _privateConstructorUsedError; + double? get maxZoom => throw _privateConstructorUsedError; + dynamic get filter => throw _privateConstructorUsedError; + + /// Create a copy of EewPsWaveSourceLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewPsWaveSourceLayerCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewPsWaveSourceLayerCopyWith<$Res> { + factory $EewPsWaveSourceLayerCopyWith(EewPsWaveSourceLayer value, + $Res Function(EewPsWaveSourceLayer) then) = + _$EewPsWaveSourceLayerCopyWithImpl<$Res, EewPsWaveSourceLayer>; + @useResult + $Res call( + {String id, + List items, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + dynamic filter}); +} + +/// @nodoc +class _$EewPsWaveSourceLayerCopyWithImpl<$Res, + $Val extends EewPsWaveSourceLayer> + implements $EewPsWaveSourceLayerCopyWith<$Res> { + _$EewPsWaveSourceLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewPsWaveSourceLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? items = null, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + Object? filter = freezed, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + items: null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewPsWaveSourceLayerImplCopyWith<$Res> + implements $EewPsWaveSourceLayerCopyWith<$Res> { + factory _$$EewPsWaveSourceLayerImplCopyWith(_$EewPsWaveSourceLayerImpl value, + $Res Function(_$EewPsWaveSourceLayerImpl) then) = + __$$EewPsWaveSourceLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String id, + List items, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + dynamic filter}); +} + +/// @nodoc +class __$$EewPsWaveSourceLayerImplCopyWithImpl<$Res> + extends _$EewPsWaveSourceLayerCopyWithImpl<$Res, _$EewPsWaveSourceLayerImpl> + implements _$$EewPsWaveSourceLayerImplCopyWith<$Res> { + __$$EewPsWaveSourceLayerImplCopyWithImpl(_$EewPsWaveSourceLayerImpl _value, + $Res Function(_$EewPsWaveSourceLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of EewPsWaveSourceLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? items = null, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + Object? filter = freezed, + }) { + return _then(_$EewPsWaveSourceLayerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + items: null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + )); + } +} + +/// @nodoc + +class _$EewPsWaveSourceLayerImpl extends _EewPsWaveSourceLayer { + const _$EewPsWaveSourceLayerImpl( + {required this.id, + required final List items, + this.visible = true, + this.sourceId = 'eew_ps_wave_source', + this.minZoom = null, + this.maxZoom = null, + this.filter}) + : _items = items, + super._(); + + @override + final String id; + final List _items; + @override + List get items { + if (_items is EqualUnmodifiableListView) return _items; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_items); + } + + @override + @JsonKey() + final bool visible; + @override + @JsonKey() + final String sourceId; + @override + @JsonKey() + final double? minZoom; + @override + @JsonKey() + final double? maxZoom; + @override + final dynamic filter; + + @override + String toString() { + return 'EewPsWaveSourceLayer(id: $id, items: $items, visible: $visible, sourceId: $sourceId, minZoom: $minZoom, maxZoom: $maxZoom, filter: $filter)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewPsWaveSourceLayerImpl && + (identical(other.id, id) || other.id == id) && + const DeepCollectionEquality().equals(other._items, _items) && + (identical(other.visible, visible) || other.visible == visible) && + (identical(other.sourceId, sourceId) || + other.sourceId == sourceId) && + (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom) && + const DeepCollectionEquality().equals(other.filter, filter)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + const DeepCollectionEquality().hash(_items), + visible, + sourceId, + minZoom, + maxZoom, + const DeepCollectionEquality().hash(filter)); + + /// Create a copy of EewPsWaveSourceLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewPsWaveSourceLayerImplCopyWith<_$EewPsWaveSourceLayerImpl> + get copyWith => + __$$EewPsWaveSourceLayerImplCopyWithImpl<_$EewPsWaveSourceLayerImpl>( + this, _$identity); +} + +abstract class _EewPsWaveSourceLayer extends EewPsWaveSourceLayer { + const factory _EewPsWaveSourceLayer( + {required final String id, + required final List items, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom, + final dynamic filter}) = _$EewPsWaveSourceLayerImpl; + const _EewPsWaveSourceLayer._() : super._(); + + @override + String get id; + @override + List get items; + @override + bool get visible; + @override + String get sourceId; + @override + double? get minZoom; + @override + double? get maxZoom; + @override + dynamic get filter; + + /// Create a copy of EewPsWaveSourceLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewPsWaveSourceLayerImplCopyWith<_$EewPsWaveSourceLayerImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$EewPsWaveLayerItem { + double get latitude => throw _privateConstructorUsedError; + double get longitude => throw _privateConstructorUsedError; + TravelTimeResult get travelTime => throw _privateConstructorUsedError; + bool get isWarning => throw _privateConstructorUsedError; + + /// Create a copy of EewPsWaveLayerItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewPsWaveLayerItemCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewPsWaveLayerItemCopyWith<$Res> { + factory $EewPsWaveLayerItemCopyWith( + EewPsWaveLayerItem value, $Res Function(EewPsWaveLayerItem) then) = + _$EewPsWaveLayerItemCopyWithImpl<$Res, EewPsWaveLayerItem>; + @useResult + $Res call( + {double latitude, + double longitude, + TravelTimeResult travelTime, + bool isWarning}); +} + +/// @nodoc +class _$EewPsWaveLayerItemCopyWithImpl<$Res, $Val extends EewPsWaveLayerItem> + implements $EewPsWaveLayerItemCopyWith<$Res> { + _$EewPsWaveLayerItemCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewPsWaveLayerItem + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? latitude = null, + Object? longitude = null, + Object? travelTime = null, + Object? isWarning = null, + }) { + return _then(_value.copyWith( + latitude: null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + travelTime: null == travelTime + ? _value.travelTime + : travelTime // ignore: cast_nullable_to_non_nullable + as TravelTimeResult, + isWarning: null == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewPsWaveLayerItemImplCopyWith<$Res> + implements $EewPsWaveLayerItemCopyWith<$Res> { + factory _$$EewPsWaveLayerItemImplCopyWith(_$EewPsWaveLayerItemImpl value, + $Res Function(_$EewPsWaveLayerItemImpl) then) = + __$$EewPsWaveLayerItemImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {double latitude, + double longitude, + TravelTimeResult travelTime, + bool isWarning}); +} + +/// @nodoc +class __$$EewPsWaveLayerItemImplCopyWithImpl<$Res> + extends _$EewPsWaveLayerItemCopyWithImpl<$Res, _$EewPsWaveLayerItemImpl> + implements _$$EewPsWaveLayerItemImplCopyWith<$Res> { + __$$EewPsWaveLayerItemImplCopyWithImpl(_$EewPsWaveLayerItemImpl _value, + $Res Function(_$EewPsWaveLayerItemImpl) _then) + : super(_value, _then); + + /// Create a copy of EewPsWaveLayerItem + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? latitude = null, + Object? longitude = null, + Object? travelTime = null, + Object? isWarning = null, + }) { + return _then(_$EewPsWaveLayerItemImpl( + latitude: null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + travelTime: null == travelTime + ? _value.travelTime + : travelTime // ignore: cast_nullable_to_non_nullable + as TravelTimeResult, + isWarning: null == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc + +class _$EewPsWaveLayerItemImpl extends _EewPsWaveLayerItem { + const _$EewPsWaveLayerItemImpl( + {required this.latitude, + required this.longitude, + required this.travelTime, + required this.isWarning}) + : super._(); + + @override + final double latitude; + @override + final double longitude; + @override + final TravelTimeResult travelTime; + @override + final bool isWarning; + + @override + String toString() { + return 'EewPsWaveLayerItem(latitude: $latitude, longitude: $longitude, travelTime: $travelTime, isWarning: $isWarning)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewPsWaveLayerItemImpl && + (identical(other.latitude, latitude) || + other.latitude == latitude) && + (identical(other.longitude, longitude) || + other.longitude == longitude) && + (identical(other.travelTime, travelTime) || + other.travelTime == travelTime) && + (identical(other.isWarning, isWarning) || + other.isWarning == isWarning)); + } + + @override + int get hashCode => + Object.hash(runtimeType, latitude, longitude, travelTime, isWarning); + + /// Create a copy of EewPsWaveLayerItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewPsWaveLayerItemImplCopyWith<_$EewPsWaveLayerItemImpl> get copyWith => + __$$EewPsWaveLayerItemImplCopyWithImpl<_$EewPsWaveLayerItemImpl>( + this, _$identity); +} + +abstract class _EewPsWaveLayerItem extends EewPsWaveLayerItem { + const factory _EewPsWaveLayerItem( + {required final double latitude, + required final double longitude, + required final TravelTimeResult travelTime, + required final bool isWarning}) = _$EewPsWaveLayerItemImpl; + const _EewPsWaveLayerItem._() : super._(); + + @override + double get latitude; + @override + double get longitude; + @override + TravelTimeResult get travelTime; + @override + bool get isWarning; + + /// Create a copy of EewPsWaveLayerItem + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewPsWaveLayerItemImplCopyWith<_$EewPsWaveLayerItemImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$EewWaveFillLayer { + String get id => throw _privateConstructorUsedError; + Color get color => throw _privateConstructorUsedError; + dynamic get filter => throw _privateConstructorUsedError; + bool get visible => throw _privateConstructorUsedError; + String get sourceId => throw _privateConstructorUsedError; + double? get minZoom => throw _privateConstructorUsedError; + double? get maxZoom => throw _privateConstructorUsedError; + + /// Create a copy of EewWaveFillLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewWaveFillLayerCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewWaveFillLayerCopyWith<$Res> { + factory $EewWaveFillLayerCopyWith( + EewWaveFillLayer value, $Res Function(EewWaveFillLayer) then) = + _$EewWaveFillLayerCopyWithImpl<$Res, EewWaveFillLayer>; + @useResult + $Res call( + {String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class _$EewWaveFillLayerCopyWithImpl<$Res, $Val extends EewWaveFillLayer> + implements $EewWaveFillLayerCopyWith<$Res> { + _$EewWaveFillLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewWaveFillLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? color = null, + Object? filter = freezed, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewWaveFillLayerImplCopyWith<$Res> + implements $EewWaveFillLayerCopyWith<$Res> { + factory _$$EewWaveFillLayerImplCopyWith(_$EewWaveFillLayerImpl value, + $Res Function(_$EewWaveFillLayerImpl) then) = + __$$EewWaveFillLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class __$$EewWaveFillLayerImplCopyWithImpl<$Res> + extends _$EewWaveFillLayerCopyWithImpl<$Res, _$EewWaveFillLayerImpl> + implements _$$EewWaveFillLayerImplCopyWith<$Res> { + __$$EewWaveFillLayerImplCopyWithImpl(_$EewWaveFillLayerImpl _value, + $Res Function(_$EewWaveFillLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of EewWaveFillLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? color = null, + Object? filter = freezed, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_$EewWaveFillLayerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc + +class _$EewWaveFillLayerImpl extends _EewWaveFillLayer { + const _$EewWaveFillLayerImpl( + {required this.id, + required this.color, + required this.filter, + this.visible = true, + this.sourceId = 'eew_ps_wave_source', + this.minZoom = null, + this.maxZoom = null}) + : super._(); + + @override + final String id; + @override + final Color color; + @override + final dynamic filter; + @override + @JsonKey() + final bool visible; + @override + @JsonKey() + final String sourceId; + @override + @JsonKey() + final double? minZoom; + @override + @JsonKey() + final double? maxZoom; + + @override + String toString() { + return 'EewWaveFillLayer(id: $id, color: $color, filter: $filter, visible: $visible, sourceId: $sourceId, minZoom: $minZoom, maxZoom: $maxZoom)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewWaveFillLayerImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.color, color) || other.color == color) && + const DeepCollectionEquality().equals(other.filter, filter) && + (identical(other.visible, visible) || other.visible == visible) && + (identical(other.sourceId, sourceId) || + other.sourceId == sourceId) && + (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + color, + const DeepCollectionEquality().hash(filter), + visible, + sourceId, + minZoom, + maxZoom); + + /// Create a copy of EewWaveFillLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewWaveFillLayerImplCopyWith<_$EewWaveFillLayerImpl> get copyWith => + __$$EewWaveFillLayerImplCopyWithImpl<_$EewWaveFillLayerImpl>( + this, _$identity); +} + +abstract class _EewWaveFillLayer extends EewWaveFillLayer { + const factory _EewWaveFillLayer( + {required final String id, + required final Color color, + required final dynamic filter, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom}) = _$EewWaveFillLayerImpl; + const _EewWaveFillLayer._() : super._(); + + @override + String get id; + @override + Color get color; + @override + dynamic get filter; + @override + bool get visible; + @override + String get sourceId; + @override + double? get minZoom; + @override + double? get maxZoom; + + /// Create a copy of EewWaveFillLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewWaveFillLayerImplCopyWith<_$EewWaveFillLayerImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +mixin _$EewWaveLineLayer { + String get id => throw _privateConstructorUsedError; + Color get color => throw _privateConstructorUsedError; + dynamic get filter => throw _privateConstructorUsedError; + bool get visible => throw _privateConstructorUsedError; + String get sourceId => throw _privateConstructorUsedError; + double? get minZoom => throw _privateConstructorUsedError; + double? get maxZoom => throw _privateConstructorUsedError; + + /// Create a copy of EewWaveLineLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewWaveLineLayerCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewWaveLineLayerCopyWith<$Res> { + factory $EewWaveLineLayerCopyWith( + EewWaveLineLayer value, $Res Function(EewWaveLineLayer) then) = + _$EewWaveLineLayerCopyWithImpl<$Res, EewWaveLineLayer>; + @useResult + $Res call( + {String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class _$EewWaveLineLayerCopyWithImpl<$Res, $Val extends EewWaveLineLayer> + implements $EewWaveLineLayerCopyWith<$Res> { + _$EewWaveLineLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewWaveLineLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? color = null, + Object? filter = freezed, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewWaveLineLayerImplCopyWith<$Res> + implements $EewWaveLineLayerCopyWith<$Res> { + factory _$$EewWaveLineLayerImplCopyWith(_$EewWaveLineLayerImpl value, + $Res Function(_$EewWaveLineLayerImpl) then) = + __$$EewWaveLineLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class __$$EewWaveLineLayerImplCopyWithImpl<$Res> + extends _$EewWaveLineLayerCopyWithImpl<$Res, _$EewWaveLineLayerImpl> + implements _$$EewWaveLineLayerImplCopyWith<$Res> { + __$$EewWaveLineLayerImplCopyWithImpl(_$EewWaveLineLayerImpl _value, + $Res Function(_$EewWaveLineLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of EewWaveLineLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? color = null, + Object? filter = freezed, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_$EewWaveLineLayerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc + +class _$EewWaveLineLayerImpl extends _EewWaveLineLayer { + const _$EewWaveLineLayerImpl( + {required this.id, + required this.color, + required this.filter, + this.visible = true, + this.sourceId = 'eew_ps_wave_source', + this.minZoom = null, + this.maxZoom = null}) + : super._(); + + @override + final String id; + @override + final Color color; + @override + final dynamic filter; + @override + @JsonKey() + final bool visible; + @override + @JsonKey() + final String sourceId; + @override + @JsonKey() + final double? minZoom; + @override + @JsonKey() + final double? maxZoom; + + @override + String toString() { + return 'EewWaveLineLayer(id: $id, color: $color, filter: $filter, visible: $visible, sourceId: $sourceId, minZoom: $minZoom, maxZoom: $maxZoom)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewWaveLineLayerImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.color, color) || other.color == color) && + const DeepCollectionEquality().equals(other.filter, filter) && + (identical(other.visible, visible) || other.visible == visible) && + (identical(other.sourceId, sourceId) || + other.sourceId == sourceId) && + (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + color, + const DeepCollectionEquality().hash(filter), + visible, + sourceId, + minZoom, + maxZoom); + + /// Create a copy of EewWaveLineLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewWaveLineLayerImplCopyWith<_$EewWaveLineLayerImpl> get copyWith => + __$$EewWaveLineLayerImplCopyWithImpl<_$EewWaveLineLayerImpl>( + this, _$identity); +} + +abstract class _EewWaveLineLayer extends EewWaveLineLayer { + const factory _EewWaveLineLayer( + {required final String id, + required final Color color, + required final dynamic filter, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom}) = _$EewWaveLineLayerImpl; + const _EewWaveLineLayer._() : super._(); + + @override + String get id; + @override + Color get color; + @override + dynamic get filter; + @override + bool get visible; + @override + String get sourceId; + @override + double? get minZoom; + @override + double? get maxZoom; + + /// Create a copy of EewWaveLineLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewWaveLineLayerImplCopyWith<_$EewWaveLineLayerImpl> get copyWith => + throw _privateConstructorUsedError; +} From 2941936afcf5002f769082d0af399edacab0381f Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 05:20:45 +0900 Subject: [PATCH 36/70] =?UTF-8?q?refactor:=20=E5=9C=B0=E5=9B=B3=E3=83=AC?= =?UTF-8?q?=E3=82=A4=E3=83=A4=E3=83=BC=E9=96=A2=E9=80=A3=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/data/layer/base/map_layer.dart | 30 +-- .../data/layer/base/map_layer.freezed.dart | 214 ------------------ .../eqapi_types/lib/src/extension/eew_v1.dart | 8 - 3 files changed, 2 insertions(+), 250 deletions(-) delete mode 100644 app/lib/feature/map/data/layer/base/map_layer.freezed.dart delete mode 100644 packages/eqapi_types/lib/src/extension/eew_v1.dart diff --git a/app/lib/feature/map/data/layer/base/map_layer.dart b/app/lib/feature/map/data/layer/base/map_layer.dart index d3fd0539..30b9af49 100644 --- a/app/lib/feature/map/data/layer/base/map_layer.dart +++ b/app/lib/feature/map/data/layer/base/map_layer.dart @@ -1,14 +1,11 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; -part 'map_layer.freezed.dart'; - abstract class MapLayer { const MapLayer(); - Map toGeoJsonSource(); + Map? toGeoJsonSource(); String get geoJsonSourceHash; - LayerProperties toLayerProperties(); + LayerProperties? toLayerProperties(); String get layerPropertiesHash; String get id; @@ -18,26 +15,3 @@ abstract class MapLayer { double? get maxZoom; dynamic get filter; } - -@freezed -class CachedMapLayer with _$CachedMapLayer { - const factory CachedMapLayer({ - required MapLayer layer, - required String geoJsonSourceHash, - required String layerPropertiesHash, - required String? belowLayerId, - }) = _CachedMapLayer; - - const CachedMapLayer._(); - - factory CachedMapLayer.fromLayer({ - required MapLayer layer, - String? belowLayerId, - }) => - CachedMapLayer( - layer: layer, - geoJsonSourceHash: layer.geoJsonSourceHash, - layerPropertiesHash: layer.layerPropertiesHash, - belowLayerId: belowLayerId, - ); -} diff --git a/app/lib/feature/map/data/layer/base/map_layer.freezed.dart b/app/lib/feature/map/data/layer/base/map_layer.freezed.dart deleted file mode 100644 index d8a15a27..00000000 --- a/app/lib/feature/map/data/layer/base/map_layer.freezed.dart +++ /dev/null @@ -1,214 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'map_layer.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$CachedMapLayer { - MapLayer get layer => throw _privateConstructorUsedError; - String get geoJsonSourceHash => throw _privateConstructorUsedError; - String get layerPropertiesHash => throw _privateConstructorUsedError; - String? get belowLayerId => throw _privateConstructorUsedError; - - /// Create a copy of CachedMapLayer - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CachedMapLayerCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $CachedMapLayerCopyWith<$Res> { - factory $CachedMapLayerCopyWith( - CachedMapLayer value, $Res Function(CachedMapLayer) then) = - _$CachedMapLayerCopyWithImpl<$Res, CachedMapLayer>; - @useResult - $Res call( - {MapLayer layer, - String geoJsonSourceHash, - String layerPropertiesHash, - String? belowLayerId}); -} - -/// @nodoc -class _$CachedMapLayerCopyWithImpl<$Res, $Val extends CachedMapLayer> - implements $CachedMapLayerCopyWith<$Res> { - _$CachedMapLayerCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CachedMapLayer - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? layer = null, - Object? geoJsonSourceHash = null, - Object? layerPropertiesHash = null, - Object? belowLayerId = freezed, - }) { - return _then(_value.copyWith( - layer: null == layer - ? _value.layer - : layer // ignore: cast_nullable_to_non_nullable - as MapLayer, - geoJsonSourceHash: null == geoJsonSourceHash - ? _value.geoJsonSourceHash - : geoJsonSourceHash // ignore: cast_nullable_to_non_nullable - as String, - layerPropertiesHash: null == layerPropertiesHash - ? _value.layerPropertiesHash - : layerPropertiesHash // ignore: cast_nullable_to_non_nullable - as String, - belowLayerId: freezed == belowLayerId - ? _value.belowLayerId - : belowLayerId // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$CachedMapLayerImplCopyWith<$Res> - implements $CachedMapLayerCopyWith<$Res> { - factory _$$CachedMapLayerImplCopyWith(_$CachedMapLayerImpl value, - $Res Function(_$CachedMapLayerImpl) then) = - __$$CachedMapLayerImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {MapLayer layer, - String geoJsonSourceHash, - String layerPropertiesHash, - String? belowLayerId}); -} - -/// @nodoc -class __$$CachedMapLayerImplCopyWithImpl<$Res> - extends _$CachedMapLayerCopyWithImpl<$Res, _$CachedMapLayerImpl> - implements _$$CachedMapLayerImplCopyWith<$Res> { - __$$CachedMapLayerImplCopyWithImpl( - _$CachedMapLayerImpl _value, $Res Function(_$CachedMapLayerImpl) _then) - : super(_value, _then); - - /// Create a copy of CachedMapLayer - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? layer = null, - Object? geoJsonSourceHash = null, - Object? layerPropertiesHash = null, - Object? belowLayerId = freezed, - }) { - return _then(_$CachedMapLayerImpl( - layer: null == layer - ? _value.layer - : layer // ignore: cast_nullable_to_non_nullable - as MapLayer, - geoJsonSourceHash: null == geoJsonSourceHash - ? _value.geoJsonSourceHash - : geoJsonSourceHash // ignore: cast_nullable_to_non_nullable - as String, - layerPropertiesHash: null == layerPropertiesHash - ? _value.layerPropertiesHash - : layerPropertiesHash // ignore: cast_nullable_to_non_nullable - as String, - belowLayerId: freezed == belowLayerId - ? _value.belowLayerId - : belowLayerId // ignore: cast_nullable_to_non_nullable - as String?, - )); - } -} - -/// @nodoc - -class _$CachedMapLayerImpl extends _CachedMapLayer { - const _$CachedMapLayerImpl( - {required this.layer, - required this.geoJsonSourceHash, - required this.layerPropertiesHash, - required this.belowLayerId}) - : super._(); - - @override - final MapLayer layer; - @override - final String geoJsonSourceHash; - @override - final String layerPropertiesHash; - @override - final String? belowLayerId; - - @override - String toString() { - return 'CachedMapLayer(layer: $layer, geoJsonSourceHash: $geoJsonSourceHash, layerPropertiesHash: $layerPropertiesHash, belowLayerId: $belowLayerId)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CachedMapLayerImpl && - (identical(other.layer, layer) || other.layer == layer) && - (identical(other.geoJsonSourceHash, geoJsonSourceHash) || - other.geoJsonSourceHash == geoJsonSourceHash) && - (identical(other.layerPropertiesHash, layerPropertiesHash) || - other.layerPropertiesHash == layerPropertiesHash) && - (identical(other.belowLayerId, belowLayerId) || - other.belowLayerId == belowLayerId)); - } - - @override - int get hashCode => Object.hash( - runtimeType, layer, geoJsonSourceHash, layerPropertiesHash, belowLayerId); - - /// Create a copy of CachedMapLayer - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CachedMapLayerImplCopyWith<_$CachedMapLayerImpl> get copyWith => - __$$CachedMapLayerImplCopyWithImpl<_$CachedMapLayerImpl>( - this, _$identity); -} - -abstract class _CachedMapLayer extends CachedMapLayer { - const factory _CachedMapLayer( - {required final MapLayer layer, - required final String geoJsonSourceHash, - required final String layerPropertiesHash, - required final String? belowLayerId}) = _$CachedMapLayerImpl; - const _CachedMapLayer._() : super._(); - - @override - MapLayer get layer; - @override - String get geoJsonSourceHash; - @override - String get layerPropertiesHash; - @override - String? get belowLayerId; - - /// Create a copy of CachedMapLayer - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CachedMapLayerImplCopyWith<_$CachedMapLayerImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/packages/eqapi_types/lib/src/extension/eew_v1.dart b/packages/eqapi_types/lib/src/extension/eew_v1.dart deleted file mode 100644 index 380d745f..00000000 --- a/packages/eqapi_types/lib/src/extension/eew_v1.dart +++ /dev/null @@ -1,8 +0,0 @@ -import 'package:eqapi_types/eqapi_types.dart'; - -extension EewV1Ex on EewV1 { - bool get isLevelEew => - !(isPlum ?? false) && accuracy?.epicenters[0] == 1 && originTime == null; - bool get isIpfOnePoint => - !(isPlum ?? false) && accuracy?.epicenters[0] == 1 && !isLevelEew; -} From 727958d2e176b9c03e55fe4e323553e8e4093209 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 05:20:51 +0900 Subject: [PATCH 37/70] =?UTF-8?q?refactor:=20=E8=B5=B0=E6=99=82=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E9=96=A2=E9=80=A3=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/travel_time_provider.dart | 12 +++++--- .../provider/travel_time_provider.g.dart | 30 +++++++++++++++---- .../provider/travel_time_provider_test.dart | 22 ++++++-------- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/app/lib/core/provider/travel_time/provider/travel_time_provider.dart b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart index a02a6bbe..cc07afb1 100644 --- a/app/lib/core/provider/travel_time/provider/travel_time_provider.dart +++ b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart @@ -8,16 +8,20 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'travel_time_provider.g.dart'; @Riverpod(keepAlive: true) -Future travelTime(Ref ref) async { +TravelTimeTables travelTime(Ref ref) => + ref.watch(travelTimeInternalProvider).requireValue; + +@Riverpod(keepAlive: true) +Future travelTimeInternal(Ref ref) async { final dataSource = ref.watch(travelTimeDataSourceProvider); return TravelTimeTables(table: await dataSource.loadTables()); } @Riverpod(keepAlive: true) -Future travelTimeDepthMap( +TravelTimeDepthMap travelTimeDepthMap( Ref ref, -) async { - final state = await ref.watch(travelTimeProvider.future); +) { + final state = ref.watch(travelTimeProvider); return state.table.groupListsBy((e) => e.depth); } diff --git a/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart b/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart index 83e2a495..3bca1b31 100644 --- a/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart +++ b/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart @@ -8,11 +8,11 @@ part of 'travel_time_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$travelTimeHash() => r'390c9a0aec373a40dec642325d1da143ea74862a'; +String _$travelTimeHash() => r'64b0091c63436d40dd0f6043fcc05e804ad00964'; /// See also [travelTime]. @ProviderFor(travelTime) -final travelTimeProvider = FutureProvider.internal( +final travelTimeProvider = Provider.internal( travelTime, name: r'travelTimeProvider', debugGetCreateSourceHash: @@ -23,13 +23,31 @@ final travelTimeProvider = FutureProvider.internal( @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef TravelTimeRef = FutureProviderRef; +typedef TravelTimeRef = ProviderRef; +String _$travelTimeInternalHash() => + r'e3fd821da9e8d04c0ff59076ebb98b85ac978e3f'; + +/// See also [travelTimeInternal]. +@ProviderFor(travelTimeInternal) +final travelTimeInternalProvider = FutureProvider.internal( + travelTimeInternal, + name: r'travelTimeInternalProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$travelTimeInternalHash, + dependencies: null, + allTransitiveDependencies: null, +); + +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element +typedef TravelTimeInternalRef = FutureProviderRef; String _$travelTimeDepthMapHash() => - r'371546dc657fab0f9a010710f05044931d62b973'; + r'dae2dec61f482a44877c74c71d28b94d4065c643'; /// See also [travelTimeDepthMap]. @ProviderFor(travelTimeDepthMap) -final travelTimeDepthMapProvider = FutureProvider.internal( +final travelTimeDepthMapProvider = Provider.internal( travelTimeDepthMap, name: r'travelTimeDepthMapProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') @@ -41,6 +59,6 @@ final travelTimeDepthMapProvider = FutureProvider.internal( @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef TravelTimeDepthMapRef = FutureProviderRef; +typedef TravelTimeDepthMapRef = ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart b/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart index 8e923875..957f6d67 100644 --- a/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart +++ b/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart @@ -8,7 +8,7 @@ void main() { // Wait for loading setUp(() async { - await container.read(travelTimeDepthMapProvider.future); + await container.read(travelTimeInternalProvider.future); }); test('travelTimeDepthMap', () { @@ -22,9 +22,8 @@ void main() { // https://zenn.dev/boocsan/articles/travel-time-table-converter-adcal2020?#%E5%8B%95%E4%BD%9C%E7%A2%BA%E8%AA%8D より test( '20km 20sec', - () async { - final travelMap = - await container.read(travelTimeDepthMapProvider.future); + () { + final travelMap = container.read(travelTimeDepthMapProvider); final result = travelMap.getTravelTime(20, 20); expect(result.pDistance, 122.35900962861072); expect(result.sDistance, 67.68853695324285); @@ -32,9 +31,8 @@ void main() { ); test( '100km 200sec', - () async { - final travelMap = - await container.read(travelTimeDepthMapProvider.future); + () { + final travelMap = container.read(travelTimeDepthMapProvider); final result = travelMap.getTravelTime(100, 200); expect(result.pDistance, 1603.2552083333333); expect(result.sDistance, 868.2417083144026); @@ -42,9 +40,8 @@ void main() { ); test( '200km 200sec', - () async { - final travelMap = - await container.read(travelTimeDepthMapProvider.future); + () { + final travelMap = container.read(travelTimeDepthMapProvider); final result = travelMap.getTravelTime(200, 200); expect(result.pDistance, 1639.8745519713261); expect(result.sDistance, 874.7576045627376); @@ -52,9 +49,8 @@ void main() { ); test( '300km 200sec', - () async { - final travelMap = - await container.read(travelTimeDepthMapProvider.future); + () { + final travelMap = container.read(travelTimeDepthMapProvider); final result = travelMap.getTravelTime(300, 200); expect(result.pDistance, 1672.7323943661972); expect(result.sDistance, 869.2659627953747); From 2f2cd40c92a9af40c46586376e964dfa9cc639b6 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 05:20:57 +0900 Subject: [PATCH 38/70] =?UTF-8?q?refactor:=20=E3=81=9D=E3=81=AE=E4=BB=96?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4=E7=90=86=E3=81=A8?= =?UTF-8?q?=E4=BE=9D=E5=AD=98=E9=96=A2=E4=BF=82=E3=81=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/custom_provider_observer.dart | 2 + .../home/component/map/home_map_content.dart | 12 +- app/lib/feature/map/ui/declarative_map.dart | 165 +++++++++++------- app/lib/main.dart | 2 + .../eqapi_types/lib/src/model/v1/eew.dart | 7 + .../lib/src/model/v1/eew.freezed.dart | 8 +- packages/eqapi_types/lib/src/src.dart | 1 - 7 files changed, 126 insertions(+), 71 deletions(-) diff --git a/app/lib/core/provider/custom_provider_observer.dart b/app/lib/core/provider/custom_provider_observer.dart index 0ccfc8b6..46b60e83 100644 --- a/app/lib/core/provider/custom_provider_observer.dart +++ b/app/lib/core/provider/custom_provider_observer.dart @@ -33,6 +33,8 @@ class CustomProviderObserver extends ProviderObserver { ) => switch (provider.name) { 'timeTickerProvider' || 'eewAliveTelegramProvider' => null, + _ when provider.name?.contains('LayerControllerProvider') ?? false => + null, _ => log( '${provider.name}', name: 'didDisposeProvider', diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart index 8f20d3c6..ed0db4c4 100644 --- a/app/lib/feature/home/component/map/home_map_content.dart +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -2,6 +2,7 @@ import 'package:eqmonitor/feature/home/data/notifier/home_configuration_notifier import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/eew_hypocenter_layer_controller.dart'; +import 'package:eqmonitor/feature/map/data/controller/eew_ps_wave_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; import 'package:eqmonitor/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; @@ -51,7 +52,9 @@ class HomeMapContent extends HookConsumerWidget { controller: mapController, initialCameraPosition: cameraPosition, layers: [ - if (isKyoshinLayerEnabled) kyoshinLayer, + ...ref.watch( + eewPsWaveLineLayerControllerProvider, + ), ref.watch( eewHypocenterLayerControllerProvider(EewHypocenterIcon.normal), ), @@ -60,6 +63,13 @@ class HomeMapContent extends HookConsumerWidget { EewHypocenterIcon.lowPrecise, ), ), + if (isKyoshinLayerEnabled) kyoshinLayer, + ...ref.watch( + eewPsWaveFillLayerControllerProvider, + ), + ref.watch( + eewPsWaveSourceLayerControllerProvider, + ), ], ), ); diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 51e4dbdf..f77cfdaa 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'dart:developer'; -import 'package:collection/collection.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; @@ -78,9 +77,10 @@ class DeclarativeMap extends StatefulHookConsumerWidget { } class _DeclarativeMapState extends ConsumerState { - final Map _addedLayers = {}; + final Map _addedLayers = {}; + final Map _addedSources = {}; // レイヤー操作のロック - bool _isUpdatingLayers = false; + bool _isUpdatingLayers = true; @override Widget build(BuildContext context) { @@ -91,9 +91,14 @@ class _DeclarativeMapState extends ConsumerState { widget.controller.setController(controller); }, onStyleLoadedCallback: () async { - widget.onStyleLoadedCallback?.call(); - await widget.controller.addHypocenterImages(); - await _updateLayers(); + try { + widget.onStyleLoadedCallback?.call(); + await widget.controller.addHypocenterImages(); + _isUpdatingLayers = false; + await _updateLayers(); + } finally { + _isUpdatingLayers = false; + } }, onCameraIdle: () { final position = widget.controller.controller?.cameraPosition; @@ -130,73 +135,88 @@ class _DeclarativeMapState extends ConsumerState { _isUpdatingLayers = true; // 削除探索 - for (final layer in _addedLayers.values) { - if (!widget.layers.any((e) => e.id == layer.layer.id)) { - await controller.removeLayer(layer.layer.id); - await controller.removeSource(layer.layer.sourceId); - _addedLayers.remove(layer.layer.id); - } + final layersToRemove = _addedLayers.entries + .where((entry) => !widget.layers.any((e) => e.id == entry.key)) + .toList(); + + for (final entry in layersToRemove) { + await controller.removeLayer(entry.key); + await controller.removeSource(entry.value.sourceId); + _addedLayers.remove(entry.key); + _addedSources.remove(entry.value.sourceId); } - widget.layers.forEachIndexed( - (index, layer) async { - final belowLayerId = index > 0 ? widget.layers[index - 1].id : null; + for (var i = 0; i < widget.layers.length; i++) { + final layer = widget.layers[i]; + final belowLayerId = i > 0 ? widget.layers[i - 1].id : null; - if (_addedLayers.containsKey(layer.id)) { - final cachedLayer = _addedLayers[layer.id]!; - // レイヤーの更新 - if (cachedLayer.layer != layer) { - final isLayerPropertiesChanged = - cachedLayer.layerPropertiesHash != layer.layerPropertiesHash; - final isGeoJsonSourceChanged = - cachedLayer.geoJsonSourceHash != layer.geoJsonSourceHash; - final isFilterChanged = cachedLayer.layer.filter != layer.filter; + if (_addedLayers.containsKey(layer.id)) { + final cachedLayer = _addedLayers[layer.id]!; + // レイヤーの更新 + if (cachedLayer != layer) { + final isLayerPropertiesChanged = + cachedLayer.layerPropertiesHash != layer.layerPropertiesHash; + final isGeoJsonSourceChanged = + cachedLayer.geoJsonSourceHash != layer.geoJsonSourceHash; + final isFilterChanged = cachedLayer.filter != layer.filter; - // style check - if (isLayerPropertiesChanged) { + // style check + if (isLayerPropertiesChanged) { + final layerProperties = layer.toLayerProperties(); + if (layerProperties != null) { await controller.setLayerProperties( layer.id, - layer.toLayerProperties(), - ); - _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( - layerPropertiesHash: layer.layerPropertiesHash, + layerProperties, ); + _addedLayers[layer.id] = layer; } - // geoJsonSource check - if (isGeoJsonSourceChanged) { + } + // geoJsonSource check + if (isGeoJsonSourceChanged) { + final geoJsonSource = layer.toGeoJsonSource(); + if (geoJsonSource != null) { await controller.setGeoJsonSource( layer.sourceId, - layer.toGeoJsonSource(), - ); - _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( - geoJsonSourceHash: layer.geoJsonSourceHash, - ); - } - // filter check - if (isFilterChanged) { - await controller.setFilter( - layer.id, - layer.filter, - ); - _addedLayers[layer.id] = _addedLayers[layer.id]!.copyWith( - layer: layer, + geoJsonSource, ); + _addedLayers[layer.id] = layer; } } - } else { - print('adding new layer: ${layer.id}'); - // 新規レイヤーの追加 + // filter check + if (isFilterChanged) { + await controller.setFilter( + layer.id, + layer.filter, + ); + _addedLayers[layer.id] = layer; + } + } + } else { + // 新規レイヤーの追加 + if (!_addedSources.containsKey(layer.sourceId)) { await _addLayer( layer: layer, belowLayerId: belowLayerId, ); + _addedSources[layer.sourceId] = layer.id; + } else { + // ソースは既に存在するので、レイヤーのみを追加 + final layerProperties = layer.toLayerProperties(); + if (layerProperties != null) { + print( + '[ADD] layer only: ${layer.id} (source: ${layer.sourceId})', + ); + await controller.addLayer( + layer.sourceId, + layer.id, + layerProperties, + belowLayerId: belowLayerId, + ); + } } - _addedLayers[layer.id] = CachedMapLayer.fromLayer( - layer: layer, - belowLayerId: belowLayerId, - ); - }, - ); + _addedLayers[layer.id] = layer; + } + } } finally { // ロック解放 _isUpdatingLayers = false; @@ -208,18 +228,31 @@ class _DeclarativeMapState extends ConsumerState { String? belowLayerId, }) async { final controller = widget.controller.controller!; - await controller.removeSource(layer.sourceId); await controller.removeLayer(layer.id); - await controller.addGeoJsonSource( - layer.sourceId, - layer.toGeoJsonSource(), - ); - await controller.addLayer( - layer.sourceId, - layer.id, - layer.toLayerProperties(), - belowLayerId: belowLayerId, - ); + await controller.removeSource(layer.sourceId); + final geoJsonSource = layer.toGeoJsonSource(); + if (geoJsonSource != null) { + print('[ADD] geoJsonSource: ${layer.sourceId} (layer: ${layer.id})'); + await controller.addGeoJsonSource( + layer.sourceId, + geoJsonSource, + ); + } else { + print('no geoJsonSource: ${layer.sourceId}'); + } + final layerProperties = layer.toLayerProperties(); + if (layerProperties != null) { + print('[ADD] layer: ${layer.id} (source: ${layer.sourceId})'); + await controller.removeLayer(layer.id); + await controller.addLayer( + layer.sourceId, + layer.id, + layerProperties, + belowLayerId: belowLayerId, + ); + } else { + print('no layerProperties: ${layer.id}'); + } } Future _updateAllLayers() async { diff --git a/app/lib/main.dart b/app/lib/main.dart index 5a625ee8..730b8202 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -16,6 +16,7 @@ import 'package:eqmonitor/core/provider/kmoni_observation_points/provider/kyoshi import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/core/provider/package_info.dart'; import 'package:eqmonitor/core/provider/shared_preferences.dart'; +import 'package:eqmonitor/core/provider/travel_time/provider/travel_time_provider.dart'; import 'package:eqmonitor/core/util/license/init_licenses.dart'; import 'package:eqmonitor/feature/donation/data/donation_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart'; @@ -166,6 +167,7 @@ Future main() async { await ( container .read(kyoshinMonitorInternalObservationPointsConvertedProvider.future), + container.read(travelTimeInternalProvider.future), container.read(permissionNotifierProvider.notifier).initialize(), ).wait; diff --git a/packages/eqapi_types/lib/src/model/v1/eew.dart b/packages/eqapi_types/lib/src/model/v1/eew.dart index 0d756542..2c710f19 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.dart @@ -36,6 +36,13 @@ class EewV1 with _$EewV1 implements V1Database { }) = _EewV1; factory EewV1.fromJson(Map json) => _$EewV1FromJson(json); + + const EewV1._(); + + bool get isLevelEew => + !(isPlum ?? false) && accuracy?.epicenters[0] == 1 && originTime == null; + bool get isIpfOnePoint => + !(isPlum ?? false) && accuracy?.epicenters[0] == 1 && !isLevelEew; } @freezed diff --git a/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart b/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart index cb26e38f..7d804318 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart @@ -451,7 +451,7 @@ class __$$EewV1ImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$EewV1Impl implements _EewV1 { +class _$EewV1Impl extends _EewV1 { const _$EewV1Impl( {required this.id, required this.eventId, @@ -479,7 +479,8 @@ class _$EewV1Impl implements _EewV1 { this.forecastMaxLpgmIntensity, this.forecastMaxLpgmIntensityIsOver, final List? regions}) - : _regions = regions; + : _regions = regions, + super._(); factory _$EewV1Impl.fromJson(Map json) => _$$EewV1ImplFromJson(json); @@ -654,7 +655,7 @@ class _$EewV1Impl implements _EewV1 { } } -abstract class _EewV1 implements EewV1 { +abstract class _EewV1 extends EewV1 { const factory _EewV1( {required final int id, required final int eventId, @@ -682,6 +683,7 @@ abstract class _EewV1 implements EewV1 { final JmaForecastLgIntensity? forecastMaxLpgmIntensity, final bool? forecastMaxLpgmIntensityIsOver, final List? regions}) = _$EewV1Impl; + const _EewV1._() : super._(); factory _EewV1.fromJson(Map json) = _$EewV1Impl.fromJson; diff --git a/packages/eqapi_types/lib/src/src.dart b/packages/eqapi_types/lib/src/src.dart index 70d3a668..145b5871 100644 --- a/packages/eqapi_types/lib/src/src.dart +++ b/packages/eqapi_types/lib/src/src.dart @@ -1,7 +1,6 @@ export 'enum/area_forecast_local_eew.dart'; export 'enum/area_information_prefecture_earthquake.dart'; export 'enum/enum.dart'; -export 'extension/eew_v1.dart'; export 'extension/int_to_string.dart'; export 'model/core.dart'; export 'model/v1/app_information.dart'; From cb35e9832885d12e3bf519e5f4dadbf0bcd29aaa Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Sun, 9 Feb 2025 20:24:08 +0000 Subject: [PATCH 39/70] Auto format --- .../feature/map/data/controller/eew_ps_wave_controller.g.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart b/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart index 9e727eac..d3d3ce45 100644 --- a/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart +++ b/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart @@ -43,7 +43,7 @@ final eewPsWaveLineLayerControllerProvider = NotifierProvider< typedef _$EewPsWaveLineLayerController = Notifier>; String _$eewPsWaveSourceLayerControllerHash() => - r'2250d315dd054e0a774c9dbbb47402e19345af4e'; + r'37f68660c059a7e755fe5c7c1bdd5e0fc8161ea9'; /// See also [EewPsWaveSourceLayerController]. @ProviderFor(EewPsWaveSourceLayerController) From 562620835051a668cef1a71c924f163da51b5585 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 05:24:18 +0900 Subject: [PATCH 40/70] =?UTF-8?q?refactor:=20=E3=83=87=E3=83=90=E3=83=83?= =?UTF-8?q?=E3=82=B0=E9=96=A2=E9=80=A3=E3=81=AE=E8=A6=81=E7=B4=A0=E3=82=92?= =?UTF-8?q?=E5=B8=B8=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/feature/home/page/home_page.dart | 37 +++++++++++------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index 561df91a..cc7e8f2a 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -8,7 +8,6 @@ import 'package:eqmonitor/feature/home/component/map/home_map_view.dart'; import 'package:eqmonitor/feature/home/component/shake-detect/shake_detection_card.dart'; import 'package:eqmonitor/feature/home/component/sheet/home_earthquake_history_sheet.dart'; import 'package:eqmonitor/feature/shake_detection/provider/shake_detection_provider.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:sheet/sheet.dart'; @@ -23,24 +22,23 @@ class HomePage extends HookConsumerWidget { children: [ const HomeMapView(), const _Sheet(), - if (kDebugMode) - Align( - alignment: Alignment.centerRight, - child: FloatingActionButton.small( - onPressed: () async => Navigator.of(context).push( - ModalBottomSheetRoute( - isScrollControlled: false, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16), - ), + Align( + alignment: Alignment.centerRight, + child: FloatingActionButton.small( + onPressed: () async => Navigator.of(context).push( + ModalBottomSheetRoute( + isScrollControlled: false, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), ), - builder: (context) => const _DebugModal(), ), + builder: (context) => const _DebugModal(), ), - child: const Icon(Icons.bug_report), ), + child: const Icon(Icons.bug_report), ), + ), ], ), ); @@ -133,12 +131,11 @@ class _SheetBody extends ConsumerWidget { const EewWidgets(), const _ShakeDetectionList(), const HomeEarthquakeHistorySheet(), - if (kDebugMode) - ListTile( - title: const Text('デバッグページ'), - leading: const Icon(Icons.bug_report), - onTap: () async => const DebuggerRoute().push(context), - ), + ListTile( + title: const Text('デバッグページ'), + leading: const Icon(Icons.bug_report), + onTap: () async => const DebuggerRoute().push(context), + ), ], ), ), From 164a89392ec3369ee1aee6ae11e8d5863a5bf3eb Mon Sep 17 00:00:00 2001 From: Ryotaro Onoue <73390859+YumNumm@users.noreply.github.com> Date: Mon, 10 Feb 2025 05:41:51 +0900 Subject: [PATCH 41/70] =?UTF-8?q?check-pull-request.yaml=20=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-pull-request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-pull-request.yaml b/.github/workflows/check-pull-request.yaml index d9ac7669..bf272838 100644 --- a/.github/workflows/check-pull-request.yaml +++ b/.github/workflows/check-pull-request.yaml @@ -65,7 +65,7 @@ jobs: run: melos run rebuild --no-select - name: format - run: melos format --no-select + run: melos format - name: check difference run: | From dfaff44f87c76aa81019ae94f7d85855484cda4d Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Sun, 9 Feb 2025 20:45:16 +0000 Subject: [PATCH 42/70] Auto format --- .../provider/travel_time/provider/travel_time_provider.dart | 4 ++-- app/lib/feature/map/data/provider/map_style_util.dart | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/lib/core/provider/travel_time/provider/travel_time_provider.dart b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart index cc07afb1..ab8919ee 100644 --- a/app/lib/core/provider/travel_time/provider/travel_time_provider.dart +++ b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart @@ -20,8 +20,8 @@ Future travelTimeInternal(Ref ref) async { @Riverpod(keepAlive: true) TravelTimeDepthMap travelTimeDepthMap( Ref ref, -) { - final state = ref.watch(travelTimeProvider); +) { + final state = ref.watch(travelTimeProvider); return state.table.groupListsBy((e) => e.depth); } diff --git a/app/lib/feature/map/data/provider/map_style_util.dart b/app/lib/feature/map/data/provider/map_style_util.dart index 0ed8f803..0fad9c07 100644 --- a/app/lib/feature/map/data/provider/map_style_util.dart +++ b/app/lib/feature/map/data/provider/map_style_util.dart @@ -1,4 +1,3 @@ - import 'dart:convert'; import 'dart:io'; import 'dart:ui'; From 83f493ae3793a43c2efca2bd0f0418004c22e4da Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 14:32:26 +0900 Subject: [PATCH 43/70] ci: Improve App Store Connect build number retrieval process --- .github/workflows/deploy.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e9b0a95d..b17837ad 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -92,6 +92,7 @@ jobs: uses: ./.github/actions/setup-macos-environment - name: Create App Store Connect API Token + id: create-app-store-connect-api-token uses: ./.github/actions/generate-app-store-connect-jwt with: app_store_connect_api_key_id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} @@ -99,19 +100,22 @@ jobs: - name: Fetch latest build number id: fetch-latest-build-number + env: + JWT: ${{ steps.create-app-store-connect-api-token.outputs.jwt }} run: | PLATFORM=IOS APP_ID=6447546703 - BUILD_NUMBER=$( - curl -s https://api.appstoreconnect.apple.com/v1/builds \ - -G \ + curl -s https://api.appstoreconnect.apple.com/v1/builds \ + -H "Authorization: Bearer $JWT" \ + -H "Content-Type: application/json" \ -d "filter[platform]=${PLATFORM}" \ -d "filter[id]=${APP_ID}" \ -d "sort=-version" \ -d "fields[builds]=version" \ - -d "limit=1" | \ - jq -r '.data | if length == 0 then 0 else .[0].attributes.version end' - ) + -d "limit=1" + > build_number.json + cat build_number.json | jq -r '.data.[0].attributes' + BUILD_NUMBER=$(jq -r '.data | if length == 0 then 0 else .[0].attributes.version end' build_number.json) BUILD_NUMBER=$((BUILD_NUMBER + 1)) echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_OUTPUT echo "Build Number set to ${BUILD_NUMBER}." From 9ee02ae06e764b822e3fc76ff858322b48c05dc2 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 14:40:13 +0900 Subject: [PATCH 44/70] chore: Update App Store Connect API key ID --- scripts/app-store-connect-api-key.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/app-store-connect-api-key.ts b/scripts/app-store-connect-api-key.ts index 59605a74..0f5d3879 100644 --- a/scripts/app-store-connect-api-key.ts +++ b/scripts/app-store-connect-api-key.ts @@ -1,7 +1,7 @@ import { sign } from "jsonwebtoken"; import fs from "node:fs"; const env = { - keyId: "4LQFA4R675", + keyId: "78559SHQLB", issuerId: "fd4cca56-716b-4f03-8e44-de72a03453db", }; const header = { From 5c1f4a824d1d53be6c3a6fb46353651dd792928d Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 14:51:35 +0900 Subject: [PATCH 45/70] =?UTF-8?q?fix:=20App=20Store=20Connect=20API?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E3=81=AE=E4=BF=AE=E6=AD=A3=20-=20API?= =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=AB=E3=82=BF=E3=83=BC=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=82=92=E4=BF=AE=E6=AD=A3=20-=20JW?= =?UTF-8?q?T=E3=81=AE=E6=9C=89=E5=8A=B9=E6=9C=9F=E9=99=90=E3=82=921?= =?UTF-8?q?=E5=88=86=E3=81=AB=E7=9F=AD=E7=B8=AE=20-=20AuthKey.p8=E3=81=AE?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E5=89=8A=E9=99=A4=E5=87=A6=E7=90=86=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20-=20.gitignore=E3=81=ABp8=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/generate-app-store-connect-jwt/action.yaml | 5 +++++ .github/workflows/deploy.yaml | 7 +++---- .gitignore | 3 ++- scripts/app-store-connect-api-key.ts | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/actions/generate-app-store-connect-jwt/action.yaml b/.github/actions/generate-app-store-connect-jwt/action.yaml index c74b1515..1fd821b1 100644 --- a/.github/actions/generate-app-store-connect-jwt/action.yaml +++ b/.github/actions/generate-app-store-connect-jwt/action.yaml @@ -27,3 +27,8 @@ runs: run: | jwt=$(bun run scripts/app-store-connect-api-key.ts) echo "jwt=$jwt" >> $GITHUB_OUTPUT + + - name: Remove App Store Connect API Key + shell: bash + run: | + rm AuthKey.p8 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b17837ad..4ab036bf 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -103,18 +103,17 @@ jobs: env: JWT: ${{ steps.create-app-store-connect-api-token.outputs.jwt }} run: | - PLATFORM=IOS APP_ID=6447546703 curl -s https://api.appstoreconnect.apple.com/v1/builds \ + -G \ -H "Authorization: Bearer $JWT" \ -H "Content-Type: application/json" \ - -d "filter[platform]=${PLATFORM}" \ - -d "filter[id]=${APP_ID}" \ + -d "filter[app]=${APP_ID}" \ -d "sort=-version" \ -d "fields[builds]=version" \ -d "limit=1" > build_number.json - cat build_number.json | jq -r '.data.[0].attributes' + cat build_number.json | jq -r '.' BUILD_NUMBER=$(jq -r '.data | if length == 0 then 0 else .[0].attributes.version end' build_number.json) BUILD_NUMBER=$((BUILD_NUMBER + 1)) echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_OUTPUT diff --git a/.gitignore b/.gitignore index d86ef67f..e6210daf 100644 --- a/.gitignore +++ b/.gitignore @@ -174,5 +174,6 @@ secret/ # DerivedData **/DerivedData/ - /*.sql + +*.p8 diff --git a/scripts/app-store-connect-api-key.ts b/scripts/app-store-connect-api-key.ts index 0f5d3879..a238a54d 100644 --- a/scripts/app-store-connect-api-key.ts +++ b/scripts/app-store-connect-api-key.ts @@ -19,7 +19,7 @@ const jwt = sign( { header, algorithm: "ES256", - expiresIn: "2m", + expiresIn: "1m", } ); From c5d3cd6ffa218dbe9a5f50fe1d2f80b7d3fc454d Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 14:55:46 +0900 Subject: [PATCH 46/70] ci: Refine App Store Connect JWT generation and build retrieval --- .github/actions/generate-app-store-connect-jwt/action.yaml | 2 ++ .github/workflows/deploy.yaml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/generate-app-store-connect-jwt/action.yaml b/.github/actions/generate-app-store-connect-jwt/action.yaml index 1fd821b1..c0fb71e7 100644 --- a/.github/actions/generate-app-store-connect-jwt/action.yaml +++ b/.github/actions/generate-app-store-connect-jwt/action.yaml @@ -26,6 +26,8 @@ runs: shell: bash run: | jwt=$(bun run scripts/app-store-connect-api-key.ts) + // 最初の10文字だけ stdoutに出力 + echo $jwt | head -c 10 echo "jwt=$jwt" >> $GITHUB_OUTPUT - name: Remove App Store Connect API Key diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 4ab036bf..ce7acb4a 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -95,7 +95,6 @@ jobs: id: create-app-store-connect-api-token uses: ./.github/actions/generate-app-store-connect-jwt with: - app_store_connect_api_key_id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} app_store_connect_api_key_base64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} - name: Fetch latest build number From 5071c4ebe24f3dd064231e6ee991dfd33a1b4981 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 14:58:50 +0900 Subject: [PATCH 47/70] feat(ios): Add photo library usage description and update Xcode project settings --- app/ios/Runner.xcodeproj/project.pbxproj | 2 +- app/ios/Runner/Info.plist | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index bdd8252e..ca57aa5a 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ diff --git a/app/ios/Runner/Info.plist b/app/ios/Runner/Info.plist index dbe05355..e2f8f007 100644 --- a/app/ios/Runner/Info.plist +++ b/app/ios/Runner/Info.plist @@ -58,6 +58,8 @@ 現在地の地震情報を通知・表示するために、位置情報を利用します NSLocationWhenInUseUsageDescription 現在地に即した地震情報を表示するために、位置情報を利用します + NSPhotoLibraryUsageDescription + アプリ内で画像を保存するために写真ライブラリへのアクセスが必要です UIApplicationSupportsIndirectInputEvents UIBackgroundModes From c25d6014fa13f340e372c1bb02d1fb2e1200c42e Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 15:00:54 +0900 Subject: [PATCH 48/70] refactor: Improve deploy workflow syntax and formatting --- .github/workflows/deploy.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ce7acb4a..61b56ab4 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -110,7 +110,7 @@ jobs: -d "filter[app]=${APP_ID}" \ -d "sort=-version" \ -d "fields[builds]=version" \ - -d "limit=1" + -d "limit=1" \ > build_number.json cat build_number.json | jq -r '.' BUILD_NUMBER=$(jq -r '.data | if length == 0 then 0 else .[0].attributes.version end' build_number.json) @@ -161,7 +161,8 @@ jobs: -allowProvisioningUpdates \ -authenticationKeyIssuerID ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} \ -authenticationKeyID ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} \ - -authenticationKeyPath ${{ github.workspace }}/app/ios/AuthKey_${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}.p8 | xcbeautify + -authenticationKeyPath ${{ github.workspace }}/app/ios/AuthKey_${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}.p8 \ + | xcbeautify - name: List files run: | From 609c6631a257fae2925d35164f1d611fef1cb65d Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 15:05:17 +0900 Subject: [PATCH 49/70] =?UTF-8?q?[ci]=20App=20Store=20Connect=20API?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=9F=E3=83=93=E3=83=AB?= =?UTF-8?q?=E3=83=89=E7=95=AA=E5=8F=B7=E3=81=AE=E8=87=AA=E5=8B=95=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AA=E3=83=A1=E3=83=B3=E3=83=88=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=82=92=E5=BE=A9=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yaml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 61b56ab4..4e62b0e8 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -91,33 +91,6 @@ jobs: - name: Setup macOS Environment uses: ./.github/actions/setup-macos-environment - - name: Create App Store Connect API Token - id: create-app-store-connect-api-token - uses: ./.github/actions/generate-app-store-connect-jwt - with: - app_store_connect_api_key_base64: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }} - - - name: Fetch latest build number - id: fetch-latest-build-number - env: - JWT: ${{ steps.create-app-store-connect-api-token.outputs.jwt }} - run: | - APP_ID=6447546703 - curl -s https://api.appstoreconnect.apple.com/v1/builds \ - -G \ - -H "Authorization: Bearer $JWT" \ - -H "Content-Type: application/json" \ - -d "filter[app]=${APP_ID}" \ - -d "sort=-version" \ - -d "fields[builds]=version" \ - -d "limit=1" \ - > build_number.json - cat build_number.json | jq -r '.' - BUILD_NUMBER=$(jq -r '.data | if length == 0 then 0 else .[0].attributes.version end' build_number.json) - BUILD_NUMBER=$((BUILD_NUMBER + 1)) - echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_OUTPUT - echo "Build Number set to ${BUILD_NUMBER}." - - name: Extract Dotenv run: | echo "${{ secrets.DOTENV }}" | base64 -d > environment.tar.gz @@ -127,10 +100,7 @@ jobs: - name: Build iOS working-directory: app - env: - BUILD_NUMBER: ${{ steps.fetch-latest-build-number.outputs.BUILD_NUMBER }} run: | - echo "BUILD_NUMBER=${BUILD_NUMBER}" flutter build ipa \ --no-codesign \ --build-number=${BUILD_NUMBER} \ From b68d8ecf158e8ca298143dfc2a6b9eedbb61801c Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 15:06:04 +0900 Subject: [PATCH 50/70] fix: restore build number auto increment in iOS build workflow --- .github/workflows/deploy.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 4e62b0e8..0a5dab88 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -103,7 +103,6 @@ jobs: run: | flutter build ipa \ --no-codesign \ - --build-number=${BUILD_NUMBER} \ --dart-define-from-file=../environment/.env.prod - name: Extract App Store Connect API Key From a4fd82b7a5ef417f28223b07e8a7167e7dc5d1d9 Mon Sep 17 00:00:00 2001 From: Ryotaro Onoue <73390859+YumNumm@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:20:53 +0900 Subject: [PATCH 51/70] =?UTF-8?q?action.yaml=20=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup-macos-environment/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-macos-environment/action.yaml b/.github/actions/setup-macos-environment/action.yaml index 83f22850..eb1874aa 100644 --- a/.github/actions/setup-macos-environment/action.yaml +++ b/.github/actions/setup-macos-environment/action.yaml @@ -7,7 +7,7 @@ runs: # https://github.com/maxim-lobanov/setup-xcode - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: - xcode-version: 16.1 + xcode-version: 16.2 - name: Show Xcode version shell: bash From 9aabbdbcecc41ee78ad3e9c62e047e8497eed5a6 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 15:53:46 +0900 Subject: [PATCH 52/70] =?UTF-8?q?feat:=20=E3=83=87=E3=83=90=E3=83=83?= =?UTF-8?q?=E3=82=B0=E3=83=A2=E3=83=BC=E3=83=89=E5=88=87=E3=82=8A=E6=9B=BF?= =?UTF-8?q?=E3=81=88=E3=82=B9=E3=82=A4=E3=83=83=E3=83=81=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/children/config/debug/debugger_page.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/lib/feature/settings/children/config/debug/debugger_page.dart b/app/lib/feature/settings/children/config/debug/debugger_page.dart index 8a609a86..5b1394ba 100644 --- a/app/lib/feature/settings/children/config/debug/debugger_page.dart +++ b/app/lib/feature/settings/children/config/debug/debugger_page.dart @@ -1,4 +1,5 @@ import 'package:eqmonitor/core/component/container/bordered_container.dart'; +import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; import 'package:eqmonitor/core/provider/notification_token.dart'; import 'package:eqmonitor/core/provider/telegram_url/provider/telegram_url_provider.dart'; import 'package:eqmonitor/core/router/router.dart'; @@ -37,6 +38,7 @@ class _DebugWidget extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final theme = Theme.of(context); + final debugger = ref.watch(debuggerProvider); return Card( margin: const EdgeInsets.all(4), @@ -59,6 +61,13 @@ class _DebugWidget extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ const SheetHeader(title: 'デバッグメニュー'), + SwitchListTile( + title: const Text('デバッグモード'), + subtitle: Text(debugger.isDebugger ? 'ON' : 'OFF'), + value: debugger.isDebugger, + onChanged: (value) => + ref.read(debuggerProvider.notifier).setDebugger(value: value), + ), ListTile( title: const Text('Flavor'), leading: const Icon(Icons.flag), From 0b1eeb2b0d5f26ccf24c0046a5d55d4ec6c6ceda Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 15:54:13 +0900 Subject: [PATCH 53/70] =?UTF-8?q?refactor:=20=E3=83=87=E3=83=90=E3=83=83?= =?UTF-8?q?=E3=82=B0=E3=83=A2=E3=83=BC=E3=83=89=E9=96=A2=E9=80=A3=E3=81=AE?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=88=86=E5=B2=90=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/core/router/router.dart | 11 +---------- app/lib/feature/eew/data/eew_telegram.dart | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/app/lib/core/router/router.dart b/app/lib/core/router/router.dart index 91abae3f..6715505a 100644 --- a/app/lib/core/router/router.dart +++ b/app/lib/core/router/router.dart @@ -66,16 +66,7 @@ GoRouter goRouter(Ref ref) => GoRouter( analytics: FirebaseAnalytics.instance, ), ], - debugLogDiagnostics: true, - redirect: (context, state) { - final isDebugger = ref.read(debuggerProvider).isDebugger || kDebugMode; - if ((state.fullPath?.contains('debug') ?? false) && !isDebugger) { - throw GoRouterRedirectException( - 'Debugger is not enabled in production mode.', - ); - } - return null; - }, + debugLogDiagnostics: kDebugMode, ); class GoRouterRedirectException implements Exception { diff --git a/app/lib/feature/eew/data/eew_telegram.dart b/app/lib/feature/eew/data/eew_telegram.dart index 271239f4..02accf0e 100644 --- a/app/lib/feature/eew/data/eew_telegram.dart +++ b/app/lib/feature/eew/data/eew_telegram.dart @@ -81,13 +81,7 @@ class Eew extends _$Eew { } void upsert(EewV1 eew) { - if (kDebugMode || ref.read(debuggerProvider).isDebugger) { _upsert(eew); - } else { - throw UnimplementedError( - 'This operation is not permitted in release mode', - ); - } } } From bedb3924574a6710216771ca154960c455e2bc69 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Mon, 10 Feb 2025 15:56:11 +0900 Subject: [PATCH 54/70] =?UTF-8?q?refactor:=20=E8=A8=AD=E5=AE=9A=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=A8=E3=83=87=E3=83=90=E3=83=83=E3=82=B0=E3=83=A2?= =?UTF-8?q?=E3=83=BC=E3=83=80=E3=83=AB=E3=81=B8=E3=81=AE=E9=81=B7=E7=A7=BB?= =?UTF-8?q?=E3=82=92=E3=82=B7=E3=83=BC=E3=83=88=E3=81=AB=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/feature/home/page/home_page.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index cc7e8f2a..6be2088a 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -131,6 +131,11 @@ class _SheetBody extends ConsumerWidget { const EewWidgets(), const _ShakeDetectionList(), const HomeEarthquakeHistorySheet(), + ListTile( + title: const Text('設定'), + leading: const Icon(Icons.settings), + onTap: () async => const SettingsRoute().push(context), + ), ListTile( title: const Text('デバッグページ'), leading: const Icon(Icons.bug_report), From 0423d6f94bb4058df326f5ee44cf363e72bc3f8c Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Mon, 10 Feb 2025 06:57:34 +0000 Subject: [PATCH 55/70] Auto format --- app/lib/core/router/router.g.dart | 2 +- app/lib/feature/eew/data/eew_telegram.dart | 2 +- app/lib/feature/eew/data/eew_telegram.g.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/core/router/router.g.dart b/app/lib/core/router/router.g.dart index 4635adc0..ba136415 100644 --- a/app/lib/core/router/router.g.dart +++ b/app/lib/core/router/router.g.dart @@ -764,7 +764,7 @@ bool _$boolConverter(String value) { // RiverpodGenerator // ************************************************************************** -String _$goRouterHash() => r'1cb9b56b88405a60613af2de63c7bff6c5c19444'; +String _$goRouterHash() => r'33d706207b0bd6fae8cada54e07cc22f87464581'; /// See also [goRouter]. @ProviderFor(goRouter) diff --git a/app/lib/feature/eew/data/eew_telegram.dart b/app/lib/feature/eew/data/eew_telegram.dart index 02accf0e..323fe46c 100644 --- a/app/lib/feature/eew/data/eew_telegram.dart +++ b/app/lib/feature/eew/data/eew_telegram.dart @@ -81,7 +81,7 @@ class Eew extends _$Eew { } void upsert(EewV1 eew) { - _upsert(eew); + _upsert(eew); } } diff --git a/app/lib/feature/eew/data/eew_telegram.g.dart b/app/lib/feature/eew/data/eew_telegram.g.dart index 5a750820..e45901b0 100644 --- a/app/lib/feature/eew/data/eew_telegram.g.dart +++ b/app/lib/feature/eew/data/eew_telegram.g.dart @@ -24,7 +24,7 @@ final _eewRestProvider = FutureProvider>.internal( @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element typedef _EewRestRef = FutureProviderRef>; -String _$eewHash() => r'fcf2455d2039c8233f88a5accd9fbf0faeba841d'; +String _$eewHash() => r'93658ea88458788029f4a06ba8ee090cad543865'; /// See also [Eew]. @ProviderFor(Eew) From 57c4537b30e26b50ff8e99fe225cf69067989610 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Tue, 11 Feb 2025 19:39:59 +0900 Subject: [PATCH 56/70] chore: Update Flutter SDK to version 3.27.4 --- .fvmrc | 2 +- .vscode/settings.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.fvmrc b/.fvmrc index 69d6f3cd..c2783c69 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { "flutter": "3.27.4" -} +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 4b78d823..3f669a9f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "dart.flutterSdkPath": ".fvm/versions/3.27.3", + "dart.flutterSdkPath": ".fvm/versions/3.27.4", "search.exclude": { "**/.fvm": true, "*.geojson": true @@ -18,4 +18,4 @@ "dart": { "flutterSdkPath": ".fvm/versions/$latest_version" } -} +} \ No newline at end of file From 3177fdb2f16a8ec673a70ec58ba3ba4ae48110da Mon Sep 17 00:00:00 2001 From: YumNumm Date: Tue, 11 Feb 2025 19:40:10 +0900 Subject: [PATCH 57/70] refactor: Remove debugger-related files and update references --- .../provider/debugger/debugger_model.dart | 15 -- .../debugger/debugger_model.freezed.dart | 186 ------------------ .../provider/debugger/debugger_model.g.dart | 34 ---- .../provider/debugger/debugger_provider.dart | 49 ----- app/lib/core/router/router.dart | 6 +- app/lib/core/router/router.g.dart | 2 +- app/lib/feature/eew/data/eew_telegram.dart | 2 - .../eew_hypocenter_layer_controller.dart | 1 - .../{debugger_page.dart => debug_page.dart} | 18 +- .../features/debug/debug_provider.dart | 33 ++++ .../features/debug/debug_provider.g.dart} | 19 +- app/lib/feature/settings/settings_screen.dart | 6 +- 12 files changed, 57 insertions(+), 314 deletions(-) delete mode 100644 app/lib/core/provider/debugger/debugger_model.dart delete mode 100644 app/lib/core/provider/debugger/debugger_model.freezed.dart delete mode 100644 app/lib/core/provider/debugger/debugger_model.g.dart delete mode 100644 app/lib/core/provider/debugger/debugger_provider.dart rename app/lib/feature/settings/children/config/debug/{debugger_page.dart => debug_page.dart} (92%) create mode 100644 app/lib/feature/settings/features/debug/debug_provider.dart rename app/lib/{core/provider/debugger/debugger_provider.g.dart => feature/settings/features/debug/debug_provider.g.dart} (63%) diff --git a/app/lib/core/provider/debugger/debugger_model.dart b/app/lib/core/provider/debugger/debugger_model.dart deleted file mode 100644 index c47600f2..00000000 --- a/app/lib/core/provider/debugger/debugger_model.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'debugger_model.freezed.dart'; -part 'debugger_model.g.dart'; - -@freezed -class DebuggerModel with _$DebuggerModel { - const factory DebuggerModel({ - @Default(false) bool isDebugger, - @Default(false) bool isDeveloper, - }) = _DebuggerModel; - - factory DebuggerModel.fromJson(Map json) => - _$DebuggerModelFromJson(json); -} diff --git a/app/lib/core/provider/debugger/debugger_model.freezed.dart b/app/lib/core/provider/debugger/debugger_model.freezed.dart deleted file mode 100644 index ef5e7b50..00000000 --- a/app/lib/core/provider/debugger/debugger_model.freezed.dart +++ /dev/null @@ -1,186 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'debugger_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -DebuggerModel _$DebuggerModelFromJson(Map json) { - return _DebuggerModel.fromJson(json); -} - -/// @nodoc -mixin _$DebuggerModel { - bool get isDebugger => throw _privateConstructorUsedError; - bool get isDeveloper => throw _privateConstructorUsedError; - - /// Serializes this DebuggerModel to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DebuggerModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $DebuggerModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $DebuggerModelCopyWith<$Res> { - factory $DebuggerModelCopyWith( - DebuggerModel value, $Res Function(DebuggerModel) then) = - _$DebuggerModelCopyWithImpl<$Res, DebuggerModel>; - @useResult - $Res call({bool isDebugger, bool isDeveloper}); -} - -/// @nodoc -class _$DebuggerModelCopyWithImpl<$Res, $Val extends DebuggerModel> - implements $DebuggerModelCopyWith<$Res> { - _$DebuggerModelCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of DebuggerModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isDebugger = null, - Object? isDeveloper = null, - }) { - return _then(_value.copyWith( - isDebugger: null == isDebugger - ? _value.isDebugger - : isDebugger // ignore: cast_nullable_to_non_nullable - as bool, - isDeveloper: null == isDeveloper - ? _value.isDeveloper - : isDeveloper // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$DebuggerModelImplCopyWith<$Res> - implements $DebuggerModelCopyWith<$Res> { - factory _$$DebuggerModelImplCopyWith( - _$DebuggerModelImpl value, $Res Function(_$DebuggerModelImpl) then) = - __$$DebuggerModelImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool isDebugger, bool isDeveloper}); -} - -/// @nodoc -class __$$DebuggerModelImplCopyWithImpl<$Res> - extends _$DebuggerModelCopyWithImpl<$Res, _$DebuggerModelImpl> - implements _$$DebuggerModelImplCopyWith<$Res> { - __$$DebuggerModelImplCopyWithImpl( - _$DebuggerModelImpl _value, $Res Function(_$DebuggerModelImpl) _then) - : super(_value, _then); - - /// Create a copy of DebuggerModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isDebugger = null, - Object? isDeveloper = null, - }) { - return _then(_$DebuggerModelImpl( - isDebugger: null == isDebugger - ? _value.isDebugger - : isDebugger // ignore: cast_nullable_to_non_nullable - as bool, - isDeveloper: null == isDeveloper - ? _value.isDeveloper - : isDeveloper // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$DebuggerModelImpl implements _DebuggerModel { - const _$DebuggerModelImpl( - {this.isDebugger = false, this.isDeveloper = false}); - - factory _$DebuggerModelImpl.fromJson(Map json) => - _$$DebuggerModelImplFromJson(json); - - @override - @JsonKey() - final bool isDebugger; - @override - @JsonKey() - final bool isDeveloper; - - @override - String toString() { - return 'DebuggerModel(isDebugger: $isDebugger, isDeveloper: $isDeveloper)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DebuggerModelImpl && - (identical(other.isDebugger, isDebugger) || - other.isDebugger == isDebugger) && - (identical(other.isDeveloper, isDeveloper) || - other.isDeveloper == isDeveloper)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, isDebugger, isDeveloper); - - /// Create a copy of DebuggerModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$DebuggerModelImplCopyWith<_$DebuggerModelImpl> get copyWith => - __$$DebuggerModelImplCopyWithImpl<_$DebuggerModelImpl>(this, _$identity); - - @override - Map toJson() { - return _$$DebuggerModelImplToJson( - this, - ); - } -} - -abstract class _DebuggerModel implements DebuggerModel { - const factory _DebuggerModel( - {final bool isDebugger, final bool isDeveloper}) = _$DebuggerModelImpl; - - factory _DebuggerModel.fromJson(Map json) = - _$DebuggerModelImpl.fromJson; - - @override - bool get isDebugger; - @override - bool get isDeveloper; - - /// Create a copy of DebuggerModel - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$DebuggerModelImplCopyWith<_$DebuggerModelImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/app/lib/core/provider/debugger/debugger_model.g.dart b/app/lib/core/provider/debugger/debugger_model.g.dart deleted file mode 100644 index 9c964b4d..00000000 --- a/app/lib/core/provider/debugger/debugger_model.g.dart +++ /dev/null @@ -1,34 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use - -part of 'debugger_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$DebuggerModelImpl _$$DebuggerModelImplFromJson(Map json) => - $checkedCreate( - r'_$DebuggerModelImpl', - json, - ($checkedConvert) { - final val = _$DebuggerModelImpl( - isDebugger: - $checkedConvert('is_debugger', (v) => v as bool? ?? false), - isDeveloper: - $checkedConvert('is_developer', (v) => v as bool? ?? false), - ); - return val; - }, - fieldKeyMap: const { - 'isDebugger': 'is_debugger', - 'isDeveloper': 'is_developer' - }, - ); - -Map _$$DebuggerModelImplToJson(_$DebuggerModelImpl instance) => - { - 'is_debugger': instance.isDebugger, - 'is_developer': instance.isDeveloper, - }; diff --git a/app/lib/core/provider/debugger/debugger_provider.dart b/app/lib/core/provider/debugger/debugger_provider.dart deleted file mode 100644 index 2719304e..00000000 --- a/app/lib/core/provider/debugger/debugger_provider.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'dart:convert'; - -import 'package:eqmonitor/core/provider/debugger/debugger_model.dart'; -import 'package:eqmonitor/core/provider/shared_preferences.dart'; -import 'package:flutter/foundation.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -part 'debugger_provider.g.dart'; - -@riverpod -class Debugger extends _$Debugger { - @override - DebuggerModel build() { - _prefs = ref.read(sharedPreferencesProvider); - if (kDebugMode) { - return const DebuggerModel( - isDebugger: true, - isDeveloper: true, - ); - } - return _getDebugger(); - } - - late SharedPreferences _prefs; - - static const _key = 'debugger'; - - DebuggerModel _getDebugger() { - final json = _prefs.getString(_key); - if (json == null) { - return const DebuggerModel(); - } - try { - return DebuggerModel.fromJson(jsonDecode(json) as Map); - } on Exception catch (_) { - return const DebuggerModel(); - } - } - - Future save() async { - await _prefs.setString(_key, jsonEncode(state.toJson())); - } - - Future setDebugger({required bool value}) async { - state = state.copyWith(isDebugger: value); - await save(); - } -} diff --git a/app/lib/core/router/router.dart b/app/lib/core/router/router.dart index 6715505a..4797365a 100644 --- a/app/lib/core/router/router.dart +++ b/app/lib/core/router/router.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/app.dart'; -import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/core/provider/shared_preferences.dart'; import 'package:eqmonitor/feature/donation/ui/donation_executed_screen.dart'; @@ -23,7 +22,7 @@ import 'package:eqmonitor/feature/settings/children/application_info/privacy_pol import 'package:eqmonitor/feature/settings/children/application_info/term_of_service_screen.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/api_endpoint_selector/http_api_endpoint_selector_page.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/api_endpoint_selector/websocket_api_endpoint_selector_page.dart'; -import 'package:eqmonitor/feature/settings/children/config/debug/debugger_page.dart'; +import 'package:eqmonitor/feature/settings/children/config/debug/debug_page.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/playground/playground_page.dart'; import 'package:eqmonitor/feature/settings/children/config/earthquake_history/earthquake_history_config_page.dart'; @@ -289,8 +288,7 @@ class DebuggerRoute extends GoRouteData { const DebuggerRoute(); @override - Widget build(BuildContext context, GoRouterState state) => - const DebuggerPage(); + Widget build(BuildContext context, GoRouterState state) => const DebugPage(); } class HttpApiEndpointSelectorRoute extends GoRouteData { diff --git a/app/lib/core/router/router.g.dart b/app/lib/core/router/router.g.dart index ba136415..2ff1189f 100644 --- a/app/lib/core/router/router.g.dart +++ b/app/lib/core/router/router.g.dart @@ -630,7 +630,7 @@ extension $DonationRouteExtension on DonationRoute { extension $DonationExecutedRouteExtension on DonationExecutedRoute { static DonationExecutedRoute _fromState(GoRouterState state) => DonationExecutedRoute( - $extra: state.extra as (StoreProduct, CustomerInfo), + $extra: state.extra as (InvalidType, InvalidType), ); String get location => GoRouteData.$location( diff --git a/app/lib/feature/eew/data/eew_telegram.dart b/app/lib/feature/eew/data/eew_telegram.dart index 323fe46c..f5d0ced7 100644 --- a/app/lib/feature/eew/data/eew_telegram.dart +++ b/app/lib/feature/eew/data/eew_telegram.dart @@ -5,11 +5,9 @@ import 'dart:ui'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; import 'package:eqmonitor/core/provider/app_lifecycle.dart'; -import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/core/provider/websocket/websocket_provider.dart'; import 'package:extensions/extensions.dart'; -import 'package:flutter/foundation.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:web_socket_client/web_socket_client.dart'; diff --git a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart index d08e4c51..f24af12a 100644 --- a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart +++ b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart @@ -1,4 +1,3 @@ -import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/provider/time_ticker.dart'; import 'package:eqmonitor/feature/eew/data/eew_alive_telegram.dart'; import 'package:eqmonitor/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart'; diff --git a/app/lib/feature/settings/children/config/debug/debugger_page.dart b/app/lib/feature/settings/children/config/debug/debug_page.dart similarity index 92% rename from app/lib/feature/settings/children/config/debug/debugger_page.dart rename to app/lib/feature/settings/children/config/debug/debug_page.dart index 5b1394ba..20084cc2 100644 --- a/app/lib/feature/settings/children/config/debug/debugger_page.dart +++ b/app/lib/feature/settings/children/config/debug/debug_page.dart @@ -1,5 +1,4 @@ import 'package:eqmonitor/core/component/container/bordered_container.dart'; -import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; import 'package:eqmonitor/core/provider/notification_token.dart'; import 'package:eqmonitor/core/provider/telegram_url/provider/telegram_url_provider.dart'; import 'package:eqmonitor/core/router/router.dart'; @@ -8,20 +7,21 @@ import 'package:eqmonitor/feature/home/component/sheet/sheet_header.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart'; import 'package:eqmonitor/feature/settings/children/config/debug/playground/playground_page.dart'; +import 'package:eqmonitor/feature/settings/features/debug/debug_provider.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -class DebuggerPage extends ConsumerWidget { - const DebuggerPage({super.key}); +class DebugPage extends ConsumerWidget { + const DebugPage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { return Scaffold( appBar: AppBar( - title: const Text('Debugger'), + title: const Text('Debug Page'), ), body: ListView( children: const [ @@ -38,7 +38,7 @@ class _DebugWidget extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final theme = Theme.of(context); - final debugger = ref.watch(debuggerProvider); + final isDebugEnabled = ref.watch(debugProvider); return Card( margin: const EdgeInsets.all(4), @@ -63,10 +63,10 @@ class _DebugWidget extends ConsumerWidget { const SheetHeader(title: 'デバッグメニュー'), SwitchListTile( title: const Text('デバッグモード'), - subtitle: Text(debugger.isDebugger ? 'ON' : 'OFF'), - value: debugger.isDebugger, - onChanged: (value) => - ref.read(debuggerProvider.notifier).setDebugger(value: value), + subtitle: Text(isDebugEnabled ? 'ON' : 'OFF'), + value: isDebugEnabled, + onChanged: (value) async => + ref.read(debugProvider.notifier).save(isEnabled: value), ), ListTile( title: const Text('Flavor'), diff --git a/app/lib/feature/settings/features/debug/debug_provider.dart b/app/lib/feature/settings/features/debug/debug_provider.dart new file mode 100644 index 00000000..4cf3fff5 --- /dev/null +++ b/app/lib/feature/settings/features/debug/debug_provider.dart @@ -0,0 +1,33 @@ +import 'package:eqmonitor/core/provider/shared_preferences.dart'; +import 'package:flutter/foundation.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +part 'debug_provider.g.dart'; + +@riverpod +class Debug extends _$Debug { + @override + bool build() { + final savedState = _getIsEnabled(); + if (savedState == null) { + return kDebugMode; + } + return savedState; + } + + static const _key = 'debug'; + + bool? _getIsEnabled() { + final prefs = ref.read(sharedPreferencesProvider); + return prefs.getBool(_key); + } + + Future save({ + required bool isEnabled, + }) async { + state = isEnabled; + + final prefs = ref.read(sharedPreferencesProvider); + await prefs.setBool(_key, isEnabled); + } +} diff --git a/app/lib/core/provider/debugger/debugger_provider.g.dart b/app/lib/feature/settings/features/debug/debug_provider.g.dart similarity index 63% rename from app/lib/core/provider/debugger/debugger_provider.g.dart rename to app/lib/feature/settings/features/debug/debug_provider.g.dart index 01db0d7d..0fe61a5e 100644 --- a/app/lib/core/provider/debugger/debugger_provider.g.dart +++ b/app/lib/feature/settings/features/debug/debug_provider.g.dart @@ -2,26 +2,25 @@ // ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use -part of 'debugger_provider.dart'; +part of 'debug_provider.dart'; // ************************************************************************** // RiverpodGenerator // ************************************************************************** -String _$debuggerHash() => r'fbfaebdbe7c11fb9fe76a0e3a74b4768b8045186'; +String _$debugHash() => r'85e7e71c874d4d76bf46d2d03c11826c40319162'; -/// See also [Debugger]. -@ProviderFor(Debugger) -final debuggerProvider = - AutoDisposeNotifierProvider.internal( - Debugger.new, - name: r'debuggerProvider', +/// See also [Debug]. +@ProviderFor(Debug) +final debugProvider = AutoDisposeNotifierProvider.internal( + Debug.new, + name: r'debugProvider', debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$debuggerHash, + const bool.fromEnvironment('dart.vm.product') ? null : _$debugHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$Debugger = AutoDisposeNotifier; +typedef _$Debug = AutoDisposeNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/settings_screen.dart b/app/lib/feature/settings/settings_screen.dart index 73590639..110433c9 100644 --- a/app/lib/feature/settings/settings_screen.dart +++ b/app/lib/feature/settings/settings_screen.dart @@ -4,10 +4,10 @@ import 'dart:io'; import 'package:eqmonitor/core/api/api_authentication_notifier.dart'; import 'package:eqmonitor/core/component/container/bordered_container.dart'; -import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; import 'package:eqmonitor/core/provider/package_info.dart'; import 'package:eqmonitor/core/router/router.dart'; import 'package:eqmonitor/feature/settings/component/settings_section_header.dart'; +import 'package:eqmonitor/feature/settings/features/debug/debug_provider.dart'; import 'package:eqmonitor/feature/settings/features/feedback/data/custom_feedback.dart'; import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:feedback/feedback.dart'; @@ -24,7 +24,7 @@ class SettingsScreen extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final isDebugger = ref.watch(debuggerProvider).isDebugger; + final isDebugEnabled = ref.watch(debugProvider); final theme = Theme.of(context); final textTheme = theme.textTheme; @@ -112,7 +112,7 @@ class SettingsScreen extends ConsumerWidget { ), ), ), - if (isDebugger) ...[ + if (isDebugEnabled) ...[ Center( child: Text( 'Debug Mode', From a9221f970176f0750877a24402f9ce90ec387881 Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:43:37 +0000 Subject: [PATCH 58/70] Auto format --- app/lib/core/router/router.g.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/core/router/router.g.dart b/app/lib/core/router/router.g.dart index 2ff1189f..ba136415 100644 --- a/app/lib/core/router/router.g.dart +++ b/app/lib/core/router/router.g.dart @@ -630,7 +630,7 @@ extension $DonationRouteExtension on DonationRoute { extension $DonationExecutedRouteExtension on DonationExecutedRoute { static DonationExecutedRoute _fromState(GoRouterState state) => DonationExecutedRoute( - $extra: state.extra as (InvalidType, InvalidType), + $extra: state.extra as (StoreProduct, CustomerInfo), ); String get location => GoRouteData.$location( From a67b686b9ea82b51cc0259eec62a3b933ca6ed8f Mon Sep 17 00:00:00 2001 From: YumNumm Date: Tue, 11 Feb 2025 20:33:44 +0900 Subject: [PATCH 59/70] chore: Update Xcode project object version to 54 --- app/ios/Runner.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ios/Runner.xcodeproj/project.pbxproj b/app/ios/Runner.xcodeproj/project.pbxproj index ca57aa5a..bdd8252e 100644 --- a/app/ios/Runner.xcodeproj/project.pbxproj +++ b/app/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 60; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ From e3f6c6bcaa2e07afb4835d2dd4b64e77d01dd218 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Thu, 13 Feb 2025 00:20:56 +0900 Subject: [PATCH 60/70] chore: Update Xcode version to 16.1 --- .github/actions/setup-macos-environment/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-macos-environment/action.yaml b/.github/actions/setup-macos-environment/action.yaml index eb1874aa..83f22850 100644 --- a/.github/actions/setup-macos-environment/action.yaml +++ b/.github/actions/setup-macos-environment/action.yaml @@ -7,7 +7,7 @@ runs: # https://github.com/maxim-lobanov/setup-xcode - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: - xcode-version: 16.2 + xcode-version: 16.1 - name: Show Xcode version shell: bash From 97c74c1c2c7e6b4bc8d04eeeada3f73a604c9a37 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Thu, 13 Feb 2025 00:21:12 +0900 Subject: [PATCH 61/70] feat: Add null safety for map layer source handling and enhance JmaForecastIntensity --- .../eew_estimated_intensity_controller.dart | 41 +++ .../eew_estimated_intensity_controller.g.dart | 187 ++++++++++++ .../map/data/layer/base/map_layer.dart | 2 +- .../eew_estimated_intensity_layer.dart | 55 ++++ ...eew_estimated_intensity_layer.freezed.dart | 288 ++++++++++++++++++ app/lib/feature/map/ui/declarative_map.dart | 53 ++-- packages/eqapi_types/lib/src/model/core.dart | 4 + 7 files changed, 611 insertions(+), 19 deletions(-) create mode 100644 app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart create mode 100644 app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart create mode 100644 app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart create mode 100644 app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart diff --git a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart new file mode 100644 index 00000000..f6fa9419 --- /dev/null +++ b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart @@ -0,0 +1,41 @@ +import 'package:collection/collection.dart'; +import 'package:eqapi_types/eqapi_types.dart'; +import 'package:eqmonitor/core/provider/config/theme/intensity_color/intensity_color_provider.dart'; +import 'package:eqmonitor/core/provider/config/theme/intensity_color/model/intensity_color_model.dart'; +import 'package:eqmonitor/feature/eew/data/eew_alive_telegram.dart'; +import 'package:eqmonitor/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart'; +import 'package:riverpod_annotation/riverpod_annotation.dart'; + +part 'eew_estimated_intensity_controller.g.dart'; + +@Riverpod(keepAlive: true) +class EewEstimatedIntensityLayerController + extends _$EewEstimatedIntensityLayerController { + @override + EewEstimatedIntensityLayer build(JmaForecastIntensity intensity) { + final intensityColorMap = + ref.watch(intensityColorProvider).fromJmaForecastIntensity(intensity); + final backgroundColor = intensityColorMap.background; + + final aliveEews = ref.watch(eewAliveTelegramProvider); + final regionCodes = (aliveEews ?? []) + .map((eew) => eew.regions) + .nonNulls + .flattened + .where( + (eew) => eew.forecastMaxInt.toDisplayMaxInt().maxInt == intensity, + ) + .map((eew) => eew.code) + .toList(); + return EewEstimatedIntensityLayer( + id: 'eew_estimated_intensity_layer_${intensity.name}', + color: backgroundColor, + filter: [ + 'in', + ['get', 'maxIntensity'], + 'literal', + regionCodes, + ], + ); + } +} diff --git a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart new file mode 100644 index 00000000..00ec5f68 --- /dev/null +++ b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart @@ -0,0 +1,187 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint, duplicate_ignore, deprecated_member_use + +part of 'eew_estimated_intensity_controller.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$eewEstimatedIntensityLayerControllerHash() => + r'e53998fcbaa10fbffd38792b335f694ddc3efb27'; + +/// Copied from Dart SDK +class _SystemHash { + _SystemHash._(); + + static int combine(int hash, int value) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + value); + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10)); + return hash ^ (hash >> 6); + } + + static int finish(int hash) { + // ignore: parameter_assignments + hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); + // ignore: parameter_assignments + hash = hash ^ (hash >> 11); + return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); + } +} + +abstract class _$EewEstimatedIntensityLayerController + extends BuildlessNotifier { + late final JmaForecastIntensity intensity; + + EewEstimatedIntensityLayer build( + JmaForecastIntensity intensity, + ); +} + +/// See also [EewEstimatedIntensityLayerController]. +@ProviderFor(EewEstimatedIntensityLayerController) +const eewEstimatedIntensityLayerControllerProvider = + EewEstimatedIntensityLayerControllerFamily(); + +/// See also [EewEstimatedIntensityLayerController]. +class EewEstimatedIntensityLayerControllerFamily + extends Family { + /// See also [EewEstimatedIntensityLayerController]. + const EewEstimatedIntensityLayerControllerFamily(); + + /// See also [EewEstimatedIntensityLayerController]. + EewEstimatedIntensityLayerControllerProvider call( + JmaForecastIntensity intensity, + ) { + return EewEstimatedIntensityLayerControllerProvider( + intensity, + ); + } + + @override + EewEstimatedIntensityLayerControllerProvider getProviderOverride( + covariant EewEstimatedIntensityLayerControllerProvider provider, + ) { + return call( + provider.intensity, + ); + } + + static const Iterable? _dependencies = null; + + @override + Iterable? get dependencies => _dependencies; + + static const Iterable? _allTransitiveDependencies = null; + + @override + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; + + @override + String? get name => r'eewEstimatedIntensityLayerControllerProvider'; +} + +/// See also [EewEstimatedIntensityLayerController]. +class EewEstimatedIntensityLayerControllerProvider extends NotifierProviderImpl< + EewEstimatedIntensityLayerController, EewEstimatedIntensityLayer> { + /// See also [EewEstimatedIntensityLayerController]. + EewEstimatedIntensityLayerControllerProvider( + JmaForecastIntensity intensity, + ) : this._internal( + () => EewEstimatedIntensityLayerController()..intensity = intensity, + from: eewEstimatedIntensityLayerControllerProvider, + name: r'eewEstimatedIntensityLayerControllerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewEstimatedIntensityLayerControllerHash, + dependencies: + EewEstimatedIntensityLayerControllerFamily._dependencies, + allTransitiveDependencies: EewEstimatedIntensityLayerControllerFamily + ._allTransitiveDependencies, + intensity: intensity, + ); + + EewEstimatedIntensityLayerControllerProvider._internal( + super._createNotifier, { + required super.name, + required super.dependencies, + required super.allTransitiveDependencies, + required super.debugGetCreateSourceHash, + required super.from, + required this.intensity, + }) : super.internal(); + + final JmaForecastIntensity intensity; + + @override + EewEstimatedIntensityLayer runNotifierBuild( + covariant EewEstimatedIntensityLayerController notifier, + ) { + return notifier.build( + intensity, + ); + } + + @override + Override overrideWith( + EewEstimatedIntensityLayerController Function() create) { + return ProviderOverride( + origin: this, + override: EewEstimatedIntensityLayerControllerProvider._internal( + () => create()..intensity = intensity, + from: from, + name: null, + dependencies: null, + allTransitiveDependencies: null, + debugGetCreateSourceHash: null, + intensity: intensity, + ), + ); + } + + @override + NotifierProviderElement createElement() { + return _EewEstimatedIntensityLayerControllerProviderElement(this); + } + + @override + bool operator ==(Object other) { + return other is EewEstimatedIntensityLayerControllerProvider && + other.intensity == intensity; + } + + @override + int get hashCode { + var hash = _SystemHash.combine(0, runtimeType.hashCode); + hash = _SystemHash.combine(hash, intensity.hashCode); + + return _SystemHash.finish(hash); + } +} + +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element +mixin EewEstimatedIntensityLayerControllerRef + on NotifierProviderRef { + /// The parameter `intensity` of this provider. + JmaForecastIntensity get intensity; +} + +class _EewEstimatedIntensityLayerControllerProviderElement + extends NotifierProviderElement + with EewEstimatedIntensityLayerControllerRef { + _EewEstimatedIntensityLayerControllerProviderElement(super.provider); + + @override + JmaForecastIntensity get intensity => + (origin as EewEstimatedIntensityLayerControllerProvider).intensity; +} +// ignore_for_file: type=lint +// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/layer/base/map_layer.dart b/app/lib/feature/map/data/layer/base/map_layer.dart index 30b9af49..df521728 100644 --- a/app/lib/feature/map/data/layer/base/map_layer.dart +++ b/app/lib/feature/map/data/layer/base/map_layer.dart @@ -9,7 +9,7 @@ abstract class MapLayer { String get layerPropertiesHash; String get id; - String get sourceId; + String? get sourceId; bool? get visible; double? get minZoom; double? get maxZoom; diff --git a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart new file mode 100644 index 00000000..eb19c979 --- /dev/null +++ b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart @@ -0,0 +1,55 @@ +import 'package:eqapi_types/eqapi_types.dart'; +import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; +import 'package:eqmonitor/feature/map/data/provider/map_style_util.dart'; +import 'package:flutter/material.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:maplibre_gl/maplibre_gl.dart'; + +part 'eew_estimated_intensity_layer.freezed.dart'; + +@freezed +class EewEstimatedIntensityLayer extends MapLayer + with _$EewEstimatedIntensityLayer { + const factory EewEstimatedIntensityLayer({ + required String id, + required Color color, + required dynamic filter, + @Default(true) bool visible, + @Default('areaForecastLocalE') String sourceId, + @Default(null) double? minZoom, + @Default(null) double? maxZoom, + }) = _EewEstimatedIntensityLayer; + + const EewEstimatedIntensityLayer._(); + + factory EewEstimatedIntensityLayer.fromJmaForecastIntensity({ + required JmaForecastIntensity intensity, + required Color color, + required List regionCodes, + }) => + EewEstimatedIntensityLayer( + id: 'eew_estimated_intensity_layer_${intensity.name}', + color: color, + sourceId: BaseLayer.areaForecastLocalEFill.name, + filter: [ + 'in', + ['get', 'code'], + 'literal', + regionCodes, + ], + ); + + @override + Map? toGeoJsonSource() => null; + + @override + LayerProperties toLayerProperties() => FillLayerProperties( + fillColor: color.toHexStringRGB(), + ); + + @override + String get geoJsonSourceHash => ''; + + @override + String get layerPropertiesHash => '${color.hex}'; +} diff --git a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart new file mode 100644 index 00000000..565f074b --- /dev/null +++ b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart @@ -0,0 +1,288 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'eew_estimated_intensity_layer.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$EewEstimatedIntensityLayer { + String get id => throw _privateConstructorUsedError; + Color get color => throw _privateConstructorUsedError; + dynamic get filter => throw _privateConstructorUsedError; + bool get visible => throw _privateConstructorUsedError; + String get sourceId => throw _privateConstructorUsedError; + double? get minZoom => throw _privateConstructorUsedError; + double? get maxZoom => throw _privateConstructorUsedError; + + /// Create a copy of EewEstimatedIntensityLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $EewEstimatedIntensityLayerCopyWith + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $EewEstimatedIntensityLayerCopyWith<$Res> { + factory $EewEstimatedIntensityLayerCopyWith(EewEstimatedIntensityLayer value, + $Res Function(EewEstimatedIntensityLayer) then) = + _$EewEstimatedIntensityLayerCopyWithImpl<$Res, + EewEstimatedIntensityLayer>; + @useResult + $Res call( + {String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class _$EewEstimatedIntensityLayerCopyWithImpl<$Res, + $Val extends EewEstimatedIntensityLayer> + implements $EewEstimatedIntensityLayerCopyWith<$Res> { + _$EewEstimatedIntensityLayerCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of EewEstimatedIntensityLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? color = null, + Object? filter = freezed, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$EewEstimatedIntensityLayerImplCopyWith<$Res> + implements $EewEstimatedIntensityLayerCopyWith<$Res> { + factory _$$EewEstimatedIntensityLayerImplCopyWith( + _$EewEstimatedIntensityLayerImpl value, + $Res Function(_$EewEstimatedIntensityLayerImpl) then) = + __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom}); +} + +/// @nodoc +class __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res> + extends _$EewEstimatedIntensityLayerCopyWithImpl<$Res, + _$EewEstimatedIntensityLayerImpl> + implements _$$EewEstimatedIntensityLayerImplCopyWith<$Res> { + __$$EewEstimatedIntensityLayerImplCopyWithImpl( + _$EewEstimatedIntensityLayerImpl _value, + $Res Function(_$EewEstimatedIntensityLayerImpl) _then) + : super(_value, _then); + + /// Create a copy of EewEstimatedIntensityLayer + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? color = null, + Object? filter = freezed, + Object? visible = null, + Object? sourceId = null, + Object? minZoom = freezed, + Object? maxZoom = freezed, + }) { + return _then(_$EewEstimatedIntensityLayerImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + )); + } +} + +/// @nodoc + +class _$EewEstimatedIntensityLayerImpl extends _EewEstimatedIntensityLayer { + const _$EewEstimatedIntensityLayerImpl( + {required this.id, + required this.color, + required this.filter, + this.visible = true, + this.sourceId = 'areaForecastLocalE', + this.minZoom = null, + this.maxZoom = null}) + : super._(); + + @override + final String id; + @override + final Color color; + @override + final dynamic filter; + @override + @JsonKey() + final bool visible; + @override + @JsonKey() + final String sourceId; + @override + @JsonKey() + final double? minZoom; + @override + @JsonKey() + final double? maxZoom; + + @override + String toString() { + return 'EewEstimatedIntensityLayer(id: $id, color: $color, filter: $filter, visible: $visible, sourceId: $sourceId, minZoom: $minZoom, maxZoom: $maxZoom)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$EewEstimatedIntensityLayerImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.color, color) || other.color == color) && + const DeepCollectionEquality().equals(other.filter, filter) && + (identical(other.visible, visible) || other.visible == visible) && + (identical(other.sourceId, sourceId) || + other.sourceId == sourceId) && + (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && + (identical(other.maxZoom, maxZoom) || other.maxZoom == maxZoom)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + id, + color, + const DeepCollectionEquality().hash(filter), + visible, + sourceId, + minZoom, + maxZoom); + + /// Create a copy of EewEstimatedIntensityLayer + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$EewEstimatedIntensityLayerImplCopyWith<_$EewEstimatedIntensityLayerImpl> + get copyWith => __$$EewEstimatedIntensityLayerImplCopyWithImpl< + _$EewEstimatedIntensityLayerImpl>(this, _$identity); +} + +abstract class _EewEstimatedIntensityLayer extends EewEstimatedIntensityLayer { + const factory _EewEstimatedIntensityLayer( + {required final String id, + required final Color color, + required final dynamic filter, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom}) = _$EewEstimatedIntensityLayerImpl; + const _EewEstimatedIntensityLayer._() : super._(); + + @override + String get id; + @override + Color get color; + @override + dynamic get filter; + @override + bool get visible; + @override + String get sourceId; + @override + double? get minZoom; + @override + double? get maxZoom; + + /// Create a copy of EewEstimatedIntensityLayer + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$EewEstimatedIntensityLayerImplCopyWith<_$EewEstimatedIntensityLayerImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index f77cfdaa..7a68b522 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -141,7 +141,10 @@ class _DeclarativeMapState extends ConsumerState { for (final entry in layersToRemove) { await controller.removeLayer(entry.key); - await controller.removeSource(entry.value.sourceId); + final sourceId = entry.value.sourceId; + if (sourceId != null) { + await controller.removeSource(sourceId); + } _addedLayers.remove(entry.key); _addedSources.remove(entry.value.sourceId); } @@ -154,10 +157,13 @@ class _DeclarativeMapState extends ConsumerState { final cachedLayer = _addedLayers[layer.id]!; // レイヤーの更新 if (cachedLayer != layer) { + final sourceId = layer.sourceId; + final isLayerPropertiesChanged = cachedLayer.layerPropertiesHash != layer.layerPropertiesHash; final isGeoJsonSourceChanged = - cachedLayer.geoJsonSourceHash != layer.geoJsonSourceHash; + cachedLayer.geoJsonSourceHash != layer.geoJsonSourceHash && + sourceId != null; final isFilterChanged = cachedLayer.filter != layer.filter; // style check @@ -176,7 +182,7 @@ class _DeclarativeMapState extends ConsumerState { final geoJsonSource = layer.toGeoJsonSource(); if (geoJsonSource != null) { await controller.setGeoJsonSource( - layer.sourceId, + sourceId, geoJsonSource, ); _addedLayers[layer.id] = layer; @@ -194,20 +200,24 @@ class _DeclarativeMapState extends ConsumerState { } else { // 新規レイヤーの追加 if (!_addedSources.containsKey(layer.sourceId)) { - await _addLayer( - layer: layer, - belowLayerId: belowLayerId, - ); - _addedSources[layer.sourceId] = layer.id; + final sourceId = layer.sourceId; + if (sourceId != null) { + await _addLayer( + layer: layer, + belowLayerId: belowLayerId, + ); + _addedSources[sourceId] = layer.id; + } } else { // ソースは既に存在するので、レイヤーのみを追加 final layerProperties = layer.toLayerProperties(); - if (layerProperties != null) { + final sourceId = layer.sourceId; + if (layerProperties != null && sourceId != null) { print( - '[ADD] layer only: ${layer.id} (source: ${layer.sourceId})', + '[ADD] layer only: ${layer.id} (source: $sourceId)', ); await controller.addLayer( - layer.sourceId, + sourceId, layer.id, layerProperties, belowLayerId: belowLayerId, @@ -229,23 +239,27 @@ class _DeclarativeMapState extends ConsumerState { }) async { final controller = widget.controller.controller!; await controller.removeLayer(layer.id); - await controller.removeSource(layer.sourceId); + final sourceId = layer.sourceId; + if (sourceId == null) { + return; + } + await controller.removeSource(sourceId); final geoJsonSource = layer.toGeoJsonSource(); if (geoJsonSource != null) { - print('[ADD] geoJsonSource: ${layer.sourceId} (layer: ${layer.id})'); + print('[ADD] geoJsonSource: $sourceId (layer: ${layer.id})'); await controller.addGeoJsonSource( - layer.sourceId, + sourceId, geoJsonSource, ); } else { - print('no geoJsonSource: ${layer.sourceId}'); + print('no geoJsonSource: $sourceId'); } final layerProperties = layer.toLayerProperties(); if (layerProperties != null) { - print('[ADD] layer: ${layer.id} (source: ${layer.sourceId})'); + print('[ADD] layer: ${layer.id} (source: $sourceId)'); await controller.removeLayer(layer.id); await controller.addLayer( - layer.sourceId, + sourceId, layer.id, layerProperties, belowLayerId: belowLayerId, @@ -259,7 +273,10 @@ class _DeclarativeMapState extends ConsumerState { final controller = widget.controller.controller!; for (final layer in widget.layers) { await controller.removeLayer(layer.id); - await controller.removeSource(layer.sourceId); + final sourceId = layer.sourceId; + if (sourceId != null) { + await controller.removeSource(sourceId); + } _addedLayers.remove(layer.id); } await _updateLayers(); diff --git a/packages/eqapi_types/lib/src/model/core.dart b/packages/eqapi_types/lib/src/model/core.dart index 0269e674..46268f07 100644 --- a/packages/eqapi_types/lib/src/model/core.dart +++ b/packages/eqapi_types/lib/src/model/core.dart @@ -95,6 +95,10 @@ enum JmaForecastIntensity { return index >= other.index; } + int compareTo(JmaForecastIntensity other) { + return index.compareTo(other.index); + } + static JmaForecastIntensity? fromRealtimeIntensity(double intensity) => switch (intensity) { < -0.5 => null, From 277db6eea7159d5ff25707e0be3133c3ab01a9a8 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Thu, 13 Feb 2025 01:28:12 +0900 Subject: [PATCH 62/70] feat: Improve earthquake history data refresh mechanism --- .../earthquake_history/data/earthquake_history_notifier.dart | 5 ++++- .../data/earthquake_history_notifier.g.dart | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart index ec31d66e..2f76568e 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart @@ -38,7 +38,6 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { // 検索条件を指定していないNotifierでのみ、30秒ごとにデータ再取得するタイマーを設定 if (parameter == const EarthquakeHistoryParameter()) { - // 30秒ごとにデータ再取得するタイマー final refetchTimer = Timer.periodic( const Duration(minutes: 5), (_) => _refreshIfWebsocketNotConnected(), @@ -205,6 +204,10 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { if (parameter != const EarthquakeHistoryParameter()) { log('parameter is not default'); return; + } + // フォアグラウンドじゃない時は何もしない + if (ref.read(appLifecycleProvider) != AppLifecycleState.resumed) { + } log('refreshIfWebsocketNotConnected'); diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart index 19baa845..365e50a7 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart @@ -166,7 +166,7 @@ class _EarthquakeV1ExtendedProviderElement } String _$earthquakeHistoryNotifierHash() => - r'9bd3287ffebe715627458b3083d8d7596acbb7b1'; + r'3b45fdf69aa430492122bb1332d5dd53f7880b79'; abstract class _$EarthquakeHistoryNotifier extends BuildlessAutoDisposeAsyncNotifier { From 8beec671775f2c2f06e14f82c9c3e676c946e83f Mon Sep 17 00:00:00 2001 From: YumNumm Date: Thu, 13 Feb 2025 01:28:55 +0900 Subject: [PATCH 63/70] feat: Enhance EEW map layer rendering and estimated intensity visualization --- .../data/earthquake_history_notifier.dart | 3 +- .../data/earthquake_history_notifier.g.dart | 2 +- .../home/component/map/home_map_content.dart | 4 +++ app/lib/feature/home/page/home_page.dart | 33 +++++++++++++++++++ .../eew_estimated_intensity_controller.dart | 11 ++----- .../eew_estimated_intensity_controller.g.dart | 2 +- .../eew_estimated_intensity_layer.dart | 5 ++- ...eew_estimated_intensity_layer.freezed.dart | 26 +++++++-------- .../eew_hypocenter/eew_hypocenter_layer.dart | 3 +- app/lib/feature/map/ui/declarative_map.dart | 32 ++++++++++++++---- 10 files changed, 87 insertions(+), 34 deletions(-) diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart index 2f76568e..dab4f542 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart @@ -207,7 +207,8 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { } // フォアグラウンドじゃない時は何もしない if (ref.read(appLifecycleProvider) != AppLifecycleState.resumed) { - + log('app is not resumed'); + return; } log('refreshIfWebsocketNotConnected'); diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart index 365e50a7..7bdf87af 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart @@ -166,7 +166,7 @@ class _EarthquakeV1ExtendedProviderElement } String _$earthquakeHistoryNotifierHash() => - r'3b45fdf69aa430492122bb1332d5dd53f7880b79'; + r'6a341ff23d02ef7a6c7904cbb565b160cc853195'; abstract class _$EarthquakeHistoryNotifier extends BuildlessAutoDisposeAsyncNotifier { diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart index ed0db4c4..30acca52 100644 --- a/app/lib/feature/home/component/map/home_map_content.dart +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -1,6 +1,8 @@ +import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/feature/home/data/notifier/home_configuration_notifier.dart'; import 'package:eqmonitor/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; +import 'package:eqmonitor/feature/map/data/controller/eew_estimated_intensity_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/eew_hypocenter_layer_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/eew_ps_wave_controller.dart'; import 'package:eqmonitor/feature/map/data/controller/kyoshin_monitor_layer_controller.dart'; @@ -52,6 +54,8 @@ class HomeMapContent extends HookConsumerWidget { controller: mapController, initialCameraPosition: cameraPosition, layers: [ + for (final intensity in JmaForecastIntensity.values) + ref.watch(eewEstimatedIntensityLayerControllerProvider(intensity)), ...ref.watch( eewPsWaveLineLayerControllerProvider, ), diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index 6be2088a..fd0c59a8 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -1,6 +1,7 @@ import 'dart:math'; import 'package:eqapi_types/eqapi_types.dart'; +import 'package:eqmonitor/core/provider/jma_code_table_provider.dart'; import 'package:eqmonitor/core/router/router.dart'; import 'package:eqmonitor/feature/eew/data/eew_telegram.dart'; import 'package:eqmonitor/feature/home/component/eew/eew_widget.dart'; @@ -205,7 +206,39 @@ class _DebugModal extends ConsumerWidget { originTime: DateTime.now(), forecastMaxIntensity: JmaForecastIntensity.values[ Random().nextInt(JmaForecastIntensity.values.length)], + regions: [ + for (final region in ref + .read(jmaCodeTableProvider) + .areaForecastLocalEew + .items) + () { + if (Random().nextDouble() > 0.8) { + return EstimatedIntensityRegion( + code: region.code, + name: region.name, + arrivalTime: null, + isPlum: false, + isWarning: false, + forecastMaxInt: ForecastMaxInt( + from: JmaForecastIntensity.one, + to: JmaForecastIntensityOver + .values[Random().nextInt( + JmaForecastIntensityOver.values.length, + )], + ), + forecastMaxLgInt: ForecastMaxLgInt( + from: JmaForecastLgIntensity.one, + to: JmaForecastLgIntensityOver + .values[Random().nextInt( + JmaForecastLgIntensityOver.values.length, + )], + ), + ); + } + }(), + ].nonNulls.toList(), ); + print(eew.regions); ref.read(eewProvider.notifier).upsert(eew); }, ), diff --git a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart index f6fa9419..0ad57c3c 100644 --- a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart +++ b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart @@ -27,15 +27,10 @@ class EewEstimatedIntensityLayerController ) .map((eew) => eew.code) .toList(); - return EewEstimatedIntensityLayer( - id: 'eew_estimated_intensity_layer_${intensity.name}', + return EewEstimatedIntensityLayer.fromJmaForecastIntensity( color: backgroundColor, - filter: [ - 'in', - ['get', 'maxIntensity'], - 'literal', - regionCodes, - ], + intensity: intensity, + regionCodes: regionCodes, ); } } diff --git a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart index 00ec5f68..6b20492f 100644 --- a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart +++ b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart @@ -9,7 +9,7 @@ part of 'eew_estimated_intensity_controller.dart'; // ************************************************************************** String _$eewEstimatedIntensityLayerControllerHash() => - r'e53998fcbaa10fbffd38792b335f694ddc3efb27'; + r'e7d1b6f1913930349b3a31fb5d84a4ff0e7cd30b'; /// Copied from Dart SDK class _SystemHash { diff --git a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart index eb19c979..fa2284ac 100644 --- a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart +++ b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart @@ -15,7 +15,7 @@ class EewEstimatedIntensityLayer extends MapLayer required Color color, required dynamic filter, @Default(true) bool visible, - @Default('areaForecastLocalE') String sourceId, + @Default(null) String? sourceId, @Default(null) double? minZoom, @Default(null) double? maxZoom, }) = _EewEstimatedIntensityLayer; @@ -30,7 +30,6 @@ class EewEstimatedIntensityLayer extends MapLayer EewEstimatedIntensityLayer( id: 'eew_estimated_intensity_layer_${intensity.name}', color: color, - sourceId: BaseLayer.areaForecastLocalEFill.name, filter: [ 'in', ['get', 'code'], @@ -51,5 +50,5 @@ class EewEstimatedIntensityLayer extends MapLayer String get geoJsonSourceHash => ''; @override - String get layerPropertiesHash => '${color.hex}'; + String get layerPropertiesHash => '${color.hex}$filter'; } diff --git a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart index 565f074b..ed6cb8f6 100644 --- a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart +++ b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart @@ -20,7 +20,7 @@ mixin _$EewEstimatedIntensityLayer { Color get color => throw _privateConstructorUsedError; dynamic get filter => throw _privateConstructorUsedError; bool get visible => throw _privateConstructorUsedError; - String get sourceId => throw _privateConstructorUsedError; + String? get sourceId => throw _privateConstructorUsedError; double? get minZoom => throw _privateConstructorUsedError; double? get maxZoom => throw _privateConstructorUsedError; @@ -43,7 +43,7 @@ abstract class $EewEstimatedIntensityLayerCopyWith<$Res> { Color color, dynamic filter, bool visible, - String sourceId, + String? sourceId, double? minZoom, double? maxZoom}); } @@ -68,7 +68,7 @@ class _$EewEstimatedIntensityLayerCopyWithImpl<$Res, Object? color = null, Object? filter = freezed, Object? visible = null, - Object? sourceId = null, + Object? sourceId = freezed, Object? minZoom = freezed, Object? maxZoom = freezed, }) { @@ -89,10 +89,10 @@ class _$EewEstimatedIntensityLayerCopyWithImpl<$Res, ? _value.visible : visible // ignore: cast_nullable_to_non_nullable as bool, - sourceId: null == sourceId + sourceId: freezed == sourceId ? _value.sourceId : sourceId // ignore: cast_nullable_to_non_nullable - as String, + as String?, minZoom: freezed == minZoom ? _value.minZoom : minZoom // ignore: cast_nullable_to_non_nullable @@ -119,7 +119,7 @@ abstract class _$$EewEstimatedIntensityLayerImplCopyWith<$Res> Color color, dynamic filter, bool visible, - String sourceId, + String? sourceId, double? minZoom, double? maxZoom}); } @@ -143,7 +143,7 @@ class __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res> Object? color = null, Object? filter = freezed, Object? visible = null, - Object? sourceId = null, + Object? sourceId = freezed, Object? minZoom = freezed, Object? maxZoom = freezed, }) { @@ -164,10 +164,10 @@ class __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res> ? _value.visible : visible // ignore: cast_nullable_to_non_nullable as bool, - sourceId: null == sourceId + sourceId: freezed == sourceId ? _value.sourceId : sourceId // ignore: cast_nullable_to_non_nullable - as String, + as String?, minZoom: freezed == minZoom ? _value.minZoom : minZoom // ignore: cast_nullable_to_non_nullable @@ -188,7 +188,7 @@ class _$EewEstimatedIntensityLayerImpl extends _EewEstimatedIntensityLayer { required this.color, required this.filter, this.visible = true, - this.sourceId = 'areaForecastLocalE', + this.sourceId = null, this.minZoom = null, this.maxZoom = null}) : super._(); @@ -204,7 +204,7 @@ class _$EewEstimatedIntensityLayerImpl extends _EewEstimatedIntensityLayer { final bool visible; @override @JsonKey() - final String sourceId; + final String? sourceId; @override @JsonKey() final double? minZoom; @@ -259,7 +259,7 @@ abstract class _EewEstimatedIntensityLayer extends EewEstimatedIntensityLayer { required final Color color, required final dynamic filter, final bool visible, - final String sourceId, + final String? sourceId, final double? minZoom, final double? maxZoom}) = _$EewEstimatedIntensityLayerImpl; const _EewEstimatedIntensityLayer._() : super._(); @@ -273,7 +273,7 @@ abstract class _EewEstimatedIntensityLayer extends EewEstimatedIntensityLayer { @override bool get visible; @override - String get sourceId; + String? get sourceId; @override double? get minZoom; @override diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart index 8e34ffc2..80306e39 100644 --- a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart @@ -52,7 +52,8 @@ class EewHypocenterLayer extends MapLayer with _$EewHypocenterLayer { } @override - String get geoJsonSourceHash => hypocenters.hashCode.toString(); + String get geoJsonSourceHash => + hypocenters.map((e) => '${e.latitude},${e.longitude}').join(','); @override LayerProperties toLayerProperties() { diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 7a68b522..20f601d2 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -5,8 +5,10 @@ import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/feature/map/data/controller/declarative_map_controller.dart'; import 'package:eqmonitor/feature/map/data/layer/base/map_layer.dart'; import 'package:eqmonitor/feature/map/data/model/camera_position.dart'; +import 'package:eqmonitor/feature/map/data/provider/map_style_util.dart'; import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; @@ -151,7 +153,9 @@ class _DeclarativeMapState extends ConsumerState { for (var i = 0; i < widget.layers.length; i++) { final layer = widget.layers[i]; - final belowLayerId = i > 0 ? widget.layers[i - 1].id : null; + final belowLayerId = i > 0 + ? widget.layers[i - 1].id + : BaseLayer.areaForecastLocalELine.name; if (_addedLayers.containsKey(layer.id)) { final cachedLayer = _addedLayers[layer.id]!; @@ -170,11 +174,25 @@ class _DeclarativeMapState extends ConsumerState { if (isLayerPropertiesChanged) { final layerProperties = layer.toLayerProperties(); if (layerProperties != null) { - await controller.setLayerProperties( - layer.id, - layerProperties, - ); - _addedLayers[layer.id] = layer; + try { + await controller.setLayerProperties( + layer.id, + layerProperties, + ); + _addedLayers[layer.id] = layer; + } catch (e) { + if (e is PlatformException && + e.code == 'LAYER_NOT_FOUND_ERROR') { + // レイヤーが見つからない場合は、レイヤーを再追加する + await controller.removeLayer(layer.id); + await _addLayer( + layer: layer, + belowLayerId: belowLayerId, + ); + } else { + rethrow; + } + } } } // geoJsonSource check @@ -198,8 +216,10 @@ class _DeclarativeMapState extends ConsumerState { } } } else { + print('add layer: ${layer.id}'); // 新規レイヤーの追加 if (!_addedSources.containsKey(layer.sourceId)) { + print('add source: ${layer.sourceId}'); final sourceId = layer.sourceId; if (sourceId != null) { await _addLayer( From 3148808664b498c47da6285cd8f73fb623d60fa2 Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Thu, 13 Feb 2025 02:21:24 +0000 Subject: [PATCH 64/70] Auto format --- pubspec.lock | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 600bea94..90ff5d2c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1717,14 +1717,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" - shorebird_code_push: - dependency: transitive - description: - name: shorebird_code_push - sha256: "36cda512b6fc9cba781e03e649e1adef9139a86d2d3f273609c3c9c0323c0265" - url: "https://pub.dev" - source: hosted - version: "2.0.2" sky_engine: dependency: transitive description: flutter From 08c50404e6aaf0b378cf7cbe8c9229146c6eaf64 Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Thu, 13 Feb 2025 02:57:05 +0000 Subject: [PATCH 65/70] Auto format --- pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.lock b/pubspec.lock index 90ff5d2c..f62a670b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1680,7 +1680,7 @@ packages: dependency: transitive description: path: sheet - ref: HEAD + ref: main resolved-ref: f5be540e399a82ee94b0b4195a3d33095b5821db url: "https://github.com/YumNumm/modal_bottom_sheet.git" source: git From b583b41e5eed22d0ddfa787d6b9f7051414748fd Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Thu, 13 Feb 2025 03:01:20 +0000 Subject: [PATCH 66/70] Auto format --- app/lib/app.dart | 15 +- .../core/api/api_authentication_notifier.dart | 15 +- .../api/api_authentication_notifier.g.dart | 17 +- .../core/api/api_authentication_payload.dart | 6 +- .../api/api_authentication_payload.g.dart | 21 +- app/lib/core/api/eq_api.dart | 12 +- app/lib/core/api/jma_parameter_api.dart | 5 +- app/lib/core/api/jma_parameter_api.g.dart | 7 +- .../core/component/button/action_button.dart | 89 +- app/lib/core/component/chip/custom_chip.dart | 5 +- .../chip/date_range_filter_chip.dart | 21 +- .../component/chip/depth_filter_chip.dart | 47 +- .../component/chip/intensity_filter_chip.dart | 49 +- .../component/chip/magnitude_filter_chip.dart | 51 +- .../component/container/blur_container.dart | 14 +- .../container/bordered_container.dart | 14 +- app/lib/core/component/error/error_card.dart | 46 +- .../intenisty/intensity_icon_type.dart | 7 +- .../jma_forecast_intensity_icon.dart | 195 +- .../jma_forecast_lg_intensity_icon.dart | 17 +- .../intenisty/jma_intensity_icon.dart | 153 +- .../intenisty/jma_lg_intensity_icon.dart | 107 +- .../core/component/sheet/app_sheet_route.dart | 35 +- .../component/sheet/basic_modal_sheet.dart | 15 +- .../sheet/sheet_floating_action_buttons.dart | 3 +- .../core/component/widget/app_list_tile.dart | 81 +- .../component/widget/dio_exception_text.dart | 12 +- app/lib/core/extension/async_value.dart | 10 +- .../double_to_jma_forecast_intensity.dart | 48 +- app/lib/core/extension/map_to_list.dart | 11 +- app/lib/core/extension/string_ex.dart | 6 +- app/lib/core/fcm/channels.dart | 5 +- app/lib/core/foundation/result.dart | 5 +- app/lib/core/hook/use_sheet_controller.dart | 11 +- app/lib/core/provider/app_lifecycle.g.dart | 16 +- .../application_documents_directory.g.dart | 7 +- .../earthquake_history_config_provider.dart | 6 +- .../earthquake_history_config_provider.g.dart | 15 +- .../earthquake_history_config_model.dart | 12 +- ...rthquake_history_config_model.freezed.dart | 439 +- .../earthquake_history_config_model.g.dart | 148 +- .../notification/fcm_topic_manager.dart | 12 +- .../notification/fcm_topic_manager.g.dart | 17 +- .../model/permission_state.freezed.dart | 180 +- .../permission/model/permission_state.g.dart | 57 +- .../permission/permission_notifier.dart | 15 +- .../permission/permission_notifier.g.dart | 17 +- .../intensity_color_provider.dart | 7 +- .../intensity_color_provider.g.dart | 17 +- .../model/intensity_color_model.dart | 318 +- .../model/intensity_color_model.freezed.dart | 477 ++- .../model/intensity_color_model.g.dart | 160 +- .../provider/custom_provider_observer.dart | 82 +- app/lib/core/provider/device_info.g.dart | 14 +- app/lib/core/provider/dio_provider.dart | 4 +- app/lib/core/provider/dio_provider.g.dart | 17 +- .../data/estimated_intensity_data_source.dart | 20 +- .../estimated_intensity_data_source.g.dart | 21 +- .../estimated_intensity_provider.dart | 71 +- .../estimated_intensity_provider.freezed.dart | 171 +- .../estimated_intensity_provider.g.dart | 47 +- .../firebase/firebase_crashlytics.g.dart | 7 +- .../firebase/firebase_messaging.g.dart | 7 +- .../firebase_messaging_interaction.dart | 4 +- .../firebase_messaging_interaction.g.dart | 17 +- .../provider/jma_code_table_provider.dart | 4 +- .../provider/jma_parameter/jma_parameter.dart | 28 +- .../jma_parameter/jma_parameter.g.dart | 33 +- .../kmoni_observation_point.freezed.dart | 228 +- .../kyoshin_observation_points_provider.dart | 30 +- ...kyoshin_observation_points_provider.g.dart | 80 +- app/lib/core/provider/log/talker.dart | 22 +- .../core/provider/map/jma_map_provider.dart | 23 +- .../core/provider/map/jma_map_provider.g.dart | 7 +- app/lib/core/provider/notification_token.dart | 9 +- .../provider/notification_token.freezed.dart | 120 +- .../core/provider/notification_token.g.dart | 55 +- .../ntp/ntp_config_model.freezed.dart | 113 +- .../core/provider/ntp/ntp_config_model.g.dart | 36 +- app/lib/core/provider/ntp/ntp_provider.dart | 14 +- .../core/provider/ntp/ntp_state_model.dart | 6 +- .../provider/ntp/ntp_state_model.freezed.dart | 81 +- .../core/provider/ntp/ntp_state_model.g.dart | 23 +- app/lib/core/provider/periodic_timer.g.dart | 56 +- app/lib/core/provider/secure_storage.dart | 10 +- app/lib/core/provider/secure_storage.g.dart | 7 +- .../core/provider/shared_preferences.g.dart | 7 +- .../model/telegram_url_model.freezed.dart | 115 +- .../model/telegram_url_model.g.dart | 50 +- .../provider/telegram_url_provider.g.dart | 16 +- app/lib/core/provider/time_ticker.dart | 3 +- app/lib/core/provider/time_ticker.g.dart | 44 +- .../data/travel_time_data_source.g.dart | 7 +- .../travel_time/model/travel_time_table.dart | 5 +- .../model/travel_time_table.freezed.dart | 200 +- .../provider/travel_time_provider.dart | 14 +- .../provider/travel_time_provider.g.dart | 14 +- .../websocket/websocket_provider.dart | 32 +- .../websocket/websocket_provider.g.dart | 76 +- app/lib/core/router/router.dart | 146 +- app/lib/core/router/router.g.dart | 401 +- app/lib/core/theme/build_theme.dart | 5 +- app/lib/core/theme/custom_colors.dart | 12 +- app/lib/core/theme/platform_brightness.g.dart | 17 +- app/lib/core/theme/theme_provider.g.dart | 34 +- app/lib/core/util/env.dart | 15 +- .../core/util/fullscreen_loading_overlay.dart | 4 +- app/lib/core/util/license/init_licenses.dart | 38 +- .../donation/data/donation_notifier.dart | 21 +- .../donation/data/donation_notifier.g.dart | 50 +- .../donation/ui/donation_choice_modal.dart | 43 +- .../donation/ui/donation_executed_screen.dart | 66 +- .../feature/donation/ui/donation_screen.dart | 171 +- .../data/earthquake_history_notifier.dart | 204 +- .../data/earthquake_history_notifier.g.dart | 114 +- .../data/earthquake_history_repository.dart | 13 +- .../data/earthquake_history_repository.g.dart | 21 +- .../model/earthquake_history_parameter.dart | 26 +- .../earthquake_history_parameter.freezed.dart | 241 +- .../earthquake_history_list_tile.dart | 72 +- .../earthquake_history_not_found.dart | 24 +- .../ui/earthquake_history_screen.dart | 236 +- .../earthquake_history_details_notifier.dart | 32 +- ...earthquake_history_details_notifier.g.dart | 73 +- .../earthquake_hypo_info_widget.dart | 191 +- .../ui/component/earthquake_map.dart | 827 ++-- .../ui/component/prefecture_intensity.dart | 362 +- .../ui/component/prefecture_intensity.g.dart | 96 +- .../component/prefecture_lpgm_intensity.dart | 247 +- .../prefecture_lpgm_intensity.g.dart | 98 +- .../ui/screen/earthquake_history_details.dart | 101 +- ...hquake_history_early_details_notifier.dart | 9 +- ...uake_history_early_details_notifier.g.dart | 53 +- .../earthquake_history_early_notifier.dart | 61 +- .../earthquake_history_early_notifier.g.dart | 69 +- .../earthquake_history_early_repository.dart | 17 +- ...earthquake_history_early_repository.g.dart | 21 +- .../earthquake_history_early_parameter.dart | 38 +- ...quake_history_early_parameter.freezed.dart | 373 +- .../earthquake_history_early_parameter.g.dart | 117 +- .../earthquake_history_early_sort_chip.dart | 71 +- .../earthquake_early_hypo_info_widget.dart | 125 +- .../earthquake_history_early_list_tile.dart | 71 +- .../earthquake_history_early_not_found.dart | 14 +- ...rthquake_history_early_details_screen.dart | 203 +- .../ui/earthquake_history_early_screen.dart | 296 +- .../feature/eew/data/eew_alive_telegram.dart | 14 +- .../eew/data/eew_alive_telegram.g.dart | 46 +- app/lib/feature/eew/data/eew_by_event_id.dart | 4 +- .../feature/eew/data/eew_by_event_id.g.dart | 56 +- app/lib/feature/eew/data/eew_telegram.dart | 15 +- .../feature/eew/ui/components/eew_table.dart | 233 +- .../screen/eew_details_by_event_id_page.dart | 30 +- .../eew/ui/screen/eew_details_screen.dart | 21 +- .../home/component/eew/eew_widget.dart | 250 +- .../home/component/map/home_map_content.dart | 20 +- .../component/map/home_map_layer_modal.dart | 104 +- .../home/component/map/home_map_view.dart | 52 +- .../map/kyoshin_monitor_scale_card.dart | 12 +- .../parameter/parameter_loader_widget.dart | 106 +- .../shake-detect/shake_detection_card.dart | 19 +- .../sheet/earthquake_history_widget.dart | 79 +- .../sheet/home_earthquake_history_sheet.dart | 70 +- .../home/component/sheet/sheet_header.dart | 6 +- .../home_configuration_model.freezed.dart | 87 +- .../model/home_configuration_model.g.dart | 32 +- .../notifier/home_configuration_notifier.dart | 7 +- .../home_configuration_notifier.g.dart | 15 +- app/lib/feature/home/page/home_page.dart | 116 +- .../page/information_history_page.dart | 143 +- .../repository/information_repository.dart | 10 +- .../repository/information_repository.g.dart | 7 +- .../information_history_view_model.dart | 19 +- .../information_history_view_model.g.dart | 15 +- .../information_history_details_page.dart | 24 +- .../data/api/kyoshin_monitor_dio.dart | 30 +- .../data/api/kyoshin_monitor_dio.g.dart | 7 +- ...oshin_monitor_web_api_client_provider.dart | 13 +- ...hin_monitor_web_api_client_provider.g.dart | 38 +- .../kyoshin_monitor_web_api_data_source.dart | 7 +- ...kyoshin_monitor_web_api_data_source.g.dart | 42 +- .../data/kyoshin_color_map_data_source.dart | 4 +- .../kyoshin_color_map_model.freezed.dart | 151 +- .../data/model/kyoshin_color_map_model.g.dart | 38 +- .../model/kyoshin_monitor_settings_model.dart | 8 +- ...yoshin_monitor_settings_model.freezed.dart | 501 ++- .../kyoshin_monitor_settings_model.g.dart | 193 +- .../data/model/kyoshin_monitor_state.dart | 10 +- .../model/kyoshin_monitor_state.freezed.dart | 518 ++- .../data/model/kyoshin_monitor_state.g.dart | 185 +- .../kyoshin_monitor_timer_state.freezed.dart | 121 +- .../model/kyoshin_monitor_timer_state.g.dart | 48 +- .../notifier/kyoshin_monitor_notifier.dart | 123 +- .../notifier/kyoshin_monitor_notifier.g.dart | 17 +- .../kyoshin_monitor_timer_notifier.dart | 99 +- .../kyoshin_monitor_timer_notifier.g.dart | 36 +- .../data/provider/kyoshin_color_map.dart | 4 +- .../data/provider/kyoshin_color_map.g.dart | 7 +- ...oshin_monitor_image_parser_provider.g.dart | 17 +- ...yoshin_monitor_maintenance_provider.g.dart | 21 +- .../provider/kyoshin_monitor_settings.dart | 7 +- .../provider/kyoshin_monitor_settings.g.dart | 13 +- .../kyoshin_monitor_timer_stream.dart | 18 +- .../kyoshin_monitor_timer_stream.g.dart | 17 +- .../kyoshin_monitor_delay_adjust_service.dart | 1 - ...shin_monitor_layer_information_dialog.dart | 32 +- .../kyoshin_monitor_maintenance_card.dart | 47 +- .../components/kyoshin_monitor_scale.dart | 125 +- .../kyoshin_monitor_status_card.dart | 66 +- ...onitor_about_observation_network_page.dart | 35 +- .../page/kyoshin_monitor_about_page.dart | 57 +- .../page/kyoshin_monitor_settings_modal.dart | 210 +- app/lib/feature/location/data/location.dart | 10 +- app/lib/feature/location/data/location.g.dart | 28 +- .../data/location_tracking_mode.g.dart | 17 +- .../data/controller/camera_controller.dart | 17 +- .../data/controller/camera_controller.g.dart | 11 +- .../declarative_map_controller.dart | 4 +- .../eew_estimated_intensity_controller.dart | 24 +- .../eew_estimated_intensity_controller.g.dart | 73 +- .../eew_hypocenter_layer_controller.dart | 51 +- .../eew_hypocenter_layer_controller.g.dart | 72 +- .../controller/eew_ps_wave_controller.dart | 102 +- .../controller/eew_ps_wave_controller.g.dart | 33 +- .../kyoshin_monitor_layer_controller.dart | 145 +- ...shin_monitor_layer_controller.freezed.dart | 365 +- .../kyoshin_monitor_layer_controller.g.dart | 15 +- .../map/data/controller/layer_controller.dart | 9 +- .../data/controller/layer_controller.g.dart | 17 +- .../eew_estimated_intensity_layer.dart | 26 +- ...eew_estimated_intensity_layer.freezed.dart | 274 +- .../eew_hypocenter/eew_hypocenter_layer.dart | 42 +- .../eew_hypocenter_layer.freezed.dart | 368 +- .../layer/eew_ps_wave/eew_ps_wave_layer.dart | 83 +- .../eew_ps_wave_layer.freezed.dart | 916 ++-- .../map/data/model/camera_position.dart | 8 +- .../data/model/camera_position.freezed.dart | 160 +- .../map/data/model/camera_position.g.dart | 43 +- .../map/data/model/map_configuration.dart | 18 +- .../data/model/map_configuration.freezed.dart | 365 +- .../map/data/model/map_configuration.g.dart | 63 +- .../map/data/model/map_style_config.dart | 18 +- .../data/model/map_style_config.freezed.dart | 334 +- .../map/data/model/map_style_config.g.dart | 107 +- .../notifier/map_configuration_notifier.dart | 3 +- .../map_configuration_notifier.g.dart | 17 +- .../map/data/provider/map_style_util.dart | 22 +- .../controller/map_layer_controller_card.dart | 64 +- app/lib/feature/map/ui/declarative_map.dart | 66 +- .../application_info/about_this_app.dart | 21 +- .../application_info/license_page.dart | 13 +- .../privacy_policy_screen.dart | 16 +- .../term_of_service_screen.dart | 16 +- .../http_api_endpoint_selector_page.dart | 18 +- .../websocket_api_endpoint_selector_page.dart | 18 +- .../children/config/debug/debug_page.dart | 90 +- .../hypocenter_icon/hypocenter_icon_page.dart | 55 +- .../debug_kyoshin_monitor.dart | 121 +- .../debug/playground/playground_page.dart | 88 +- .../earthquake_history_config_page.dart | 147 +- ...uake_notification_settings_view_model.dart | 5 +- ...ke_notification_settings_view_model.g.dart | 27 +- .../eew_notification_settings_view_model.dart | 5 +- ...ew_notification_settings_view_model.g.dart | 11 +- .../component/settings_section_header.dart | 10 +- .../features/debug/debug_provider.dart | 4 +- .../color_scheme_config_page.dart | 34 +- .../display_settings/ui/display_settings.dart | 71 +- .../feedback/data/custom_feedback.dart | 3 +- .../data/custom_feedback.freezed.dart | 137 +- .../feedback/data/custom_feedback.g.dart | 30 +- .../features/feedback/feedback_screen.dart | 44 +- ...fication_local_settings_model.freezed.dart | 585 +-- .../notification_local_settings_model.g.dart | 261 +- .../notification_local_settings_notifier.dart | 161 +- ...otification_local_settings_notifier.g.dart | 15 +- .../ui/notification_local_settings_page.dart | 4 +- .../notification_remote_settings_state.dart | 13 +- ...ication_remote_settings_state.freezed.dart | 796 ++-- .../notification_remote_settings_state.g.dart | 252 +- ...notification_remote_settings_notifier.dart | 70 +- ...tification_remote_settings_notifier.g.dart | 16 +- ...ification_remote_settings_saved_state.dart | 164 +- ...ication_remote_settings_saved_state.g.dart | 50 +- .../service/fcm_token_change_detector.g.dart | 17 +- ...ication_remote_authentication_service.dart | 37 +- ...ation_remote_authentication_service.g.dart | 21 +- ...ation_remote_settings_migrate_service.dart | 11 +- ...ion_remote_settings_migrate_service.g.dart | 27 +- .../components/earthquake_status_widget.dart | 89 +- .../ui/components/eew_status_widget.dart | 95 +- .../ui/notification_remote_settings_page.dart | 145 +- ...ation_remote_settings_earthquake_page.dart | 399 +- ...notification_remote_settings_eew_page.dart | 382 +- app/lib/feature/settings/settings_screen.dart | 97 +- .../setup/component/background_image.dart | 44 +- .../component/earthquake_restriction.dart | 62 +- .../setup/pages/introduction_page.dart | 53 +- .../setup/pages/notification_setting.dart | 12 +- .../setup/pages/quick_guide_about_eew.dart | 5 +- .../feature/setup/screen/setup_screen.dart | 12 +- .../shake_detection_kmoni_merged_event.dart | 5 +- ..._detection_kmoni_merged_event.freezed.dart | 609 +-- .../shake_detection_kmoni_merged_event.g.dart | 169 +- .../provider/shake_detection_provider.dart | 145 +- .../provider/shake_detection_provider.g.dart | 62 +- app/lib/feature/talker/talker_page.dart | 5 +- app/lib/gen/assets.gen.dart | 51 +- app/lib/main.dart | 114 +- .../core/provider/periodic_timer_test.dart | 165 +- .../provider/travel_time_provider_test.dart | 69 +- app/test/core/util/event_id_test.dart | 35 +- .../websocket/websocket_provider_test.dart | 85 +- .../earthquake_history_notifier_test.dart | 719 ++-- .../earthquake_history_list_tile_test.dart | 902 ++-- .../lib/src/model/replay_data.dart | 27 +- .../lib/src/model/replay_data.freezed.dart | 1115 ++--- .../lib/src/model/replay_data.g.dart | 314 +- .../lib/src/model/replay_file_header.dart | 3 +- .../src/model/replay_file_header.freezed.dart | 194 +- .../lib/src/model/replay_file_header.g.dart | 67 +- .../lib/src/parser/replay_data_parser.dart | 29 +- packages/earthquake_replay/lib/test.dart | 4 +- .../eqapi_client/lib/src/children/auth.g.dart | 154 +- .../lib/src/children/objects.g.dart | 42 +- .../eqapi_client/lib/src/children/v1.g.dart | 327 +- .../eqapi_client/lib/src/eqapi_client.dart | 5 +- .../eqapi_client/lib/src/eqapi_client.g.dart | 63 +- .../lib/src/enum/area_forecast_local_eew.dart | 3 +- ...rea_information_prefecture_earthquake.dart | 3 +- packages/eqapi_types/lib/src/model/core.dart | 42 +- .../src/model/v1/app_information.freezed.dart | 307 +- .../lib/src/model/v1/app_information.g.dart | 114 +- .../src/model/v1/auth/fcm_token_request.dart | 4 +- .../v1/auth/fcm_token_request.freezed.dart | 67 +- .../model/v1/auth/fcm_token_request.g.dart | 25 +- .../v1/auth/fcm_token_response.freezed.dart | 120 +- .../model/v1/auth/fcm_token_response.g.dart | 34 +- ...notification_settings_request.freezed.dart | 384 +- .../auth/notification_settings_request.g.dart | 128 +- ...otification_settings_response.freezed.dart | 169 +- .../notification_settings_response.g.dart | 57 +- .../devices_earthquake_settings.freezed.dart | 212 +- .../v1/devices_earthquake_settings.g.dart | 69 +- .../v1/devices_eew_settings.freezed.dart | 193 +- .../src/model/v1/devices_eew_settings.g.dart | 69 +- .../lib/src/model/v1/earthquake.freezed.dart | 1603 +++---- .../lib/src/model/v1/earthquake.g.dart | 479 ++- .../lib/src/model/v1/earthquake_early.dart | 10 +- .../model/v1/earthquake_early.freezed.dart | 337 +- .../lib/src/model/v1/earthquake_early.g.dart | 96 +- .../v1/earthquake_early_event.freezed.dart | 901 ++-- .../model/v1/earthquake_early_event.g.dart | 284 +- .../lib/src/model/v1/eew.freezed.dart | 1442 ++++--- .../eqapi_types/lib/src/model/v1/eew.g.dart | 337 +- .../lib/src/model/v1/information.dart | 17 +- .../lib/src/model/v1/information.freezed.dart | 333 +- .../lib/src/model/v1/information.g.dart | 61 +- .../v1/intensity_sub_division.freezed.dart | 208 +- .../model/v1/intensity_sub_division.g.dart | 64 +- .../src/model/v1/response/region.freezed.dart | 214 +- .../lib/src/model/v1/response/region.g.dart | 18 +- .../v1/shake_detection_event.freezed.dart | 976 +++-- .../src/model/v1/shake_detection_event.g.dart | 304 +- .../lib/src/model/v1/telegram.freezed.dart | 387 +- .../lib/src/model/v1/telegram.g.dart | 18 +- .../eqapi_types/lib/src/model/v1/tsunami.dart | 64 +- .../lib/src/model/v1/tsunami.freezed.dart | 3757 +++++++++-------- .../lib/src/model/v1/tsunami.g.dart | 1099 +++-- .../realtime_postgres_changes_payload.dart | 252 +- ...time_postgres_changes_payload.freezed.dart | 830 ++-- .../realtime_postgres_changes_payload.g.dart | 190 +- .../lib/src/model/v3/information_v3.dart | 15 +- .../src/model/v3/information_v3.freezed.dart | 312 +- .../lib/src/model/v3/information_v3.g.dart | 77 +- .../test/src/model/v1/earthquake_test.dart | 212 +- .../model/v1/shake_detection_event_test.dart | 95 +- ...ealtime_postgres_changes_payload_test.dart | 153 +- packages/extensions/lib/src/color.dart | 4 +- .../jma_code_table_converter_internal.dart | 10 +- .../jma_map/bin/jma_map_protobuf_gen.dart | 97 +- .../lib/jma_parameter_api_client.dart | 16 +- .../lib/jma_parameter_api_client.g.dart | 127 +- .../lib/converter/earthquake.dart | 53 +- .../lib/dmdata/common.freezed.dart | 237 +- .../lib/dmdata/common.g.dart | 54 +- .../lib/dmdata/earthquake.freezed.dart | 586 +-- .../lib/dmdata/earthquake.g.dart | 143 +- .../lib/dmdata/tsunami.freezed.dart | 527 ++- .../lib/dmdata/tsunami.g.dart | 126 +- .../bin/kyoshin_monitor_api.dart | 53 +- .../api/kyoshin_monitor_web_api_client.dart | 8 +- .../api/kyoshin_monitor_web_api_client.g.dart | 249 +- .../lpgm_kyoshin_monitor_web_api_client.dart | 14 +- ...lpgm_kyoshin_monitor_web_api_client.g.dart | 165 +- .../kyoshin_monitor_web_api_data_source.dart | 24 +- ...m_kyoshin_monitor_web_api_data_source.dart | 24 +- .../lib/src/model/app_api/prefecture.dart | 5 +- .../model/app_api/real_time_data.freezed.dart | 275 +- .../src/model/app_api/real_time_data.g.dart | 75 +- .../src/model/app_api/site_list.freezed.dart | 379 +- .../lib/src/model/app_api/site_list.g.dart | 91 +- .../lib/src/model/result.dart | 6 +- .../lib/src/model/result.freezed.dart | 83 +- .../lib/src/model/result.g.dart | 24 +- .../lib/src/model/security.dart | 6 +- .../lib/src/model/security.freezed.dart | 83 +- .../lib/src/model/security.g.dart | 23 +- .../src/model/web_api/data_time.freezed.dart | 162 +- .../lib/src/model/web_api/data_time.g.dart | 57 +- .../lib/src/model/web_api/eew.freezed.dart | 635 +-- .../lib/src/model/web_api/eew.g.dart | 166 +- .../lib/src/model/web_api/jma_intensity.dart | 66 +- .../kyoshin_monitor_web_api_response.dart | 5 +- .../web_api/maintenance_message.freezed.dart | 193 +- .../model/web_api/maintenance_message.g.dart | 68 +- .../bin/export.dart | 77 +- .../kyoshin_monitor_image_exception.dart | 9 +- .../kyoshin_monitor_observation_point.dart | 3 +- ...hin_monitor_observation_point.freezed.dart | 386 +- .../kyoshin_monitor_observation_point.g.dart | 84 +- .../parser/kyoshin_monitor_image_parser.dart | 41 +- .../lib/src/util/hsv_color.dart | 16 +- ..._observation_point_converter_internal.dart | 57 +- packages/lat_lng/lib/src/lat_lng.dart | 5 +- .../lat_lng/lib/src/lat_lng_boundary.dart | 5 +- packages/msgpack_dart/example/benchmark.dart | 112 +- packages/msgpack_dart/lib/msgpack_dart.dart | 5 +- .../msgpack_dart/lib/src/data_writer.dart | 27 +- .../msgpack_dart/lib/src/deserializer.dart | 13 +- .../lib/src/extension/ext_decoder.dart | 12 +- packages/msgpack_dart/lib/src/serializer.dart | 11 +- .../msgpack_dart/test/msgpack_dart_test.dart | 179 +- 433 files changed, 26891 insertions(+), 25705 deletions(-) diff --git a/app/lib/app.dart b/app/lib/app.dart index f88cfbc2..a5c5601e 100644 --- a/app/lib/app.dart +++ b/app/lib/app.dart @@ -23,10 +23,9 @@ class App extends HookConsumerWidget { final routerConfig = ref.watch(goRouterProvider); final app = BetterFeedback( - feedbackBuilder: (p0, p1, p2) => CustomFeedbackForm( - onSubmit: p1, - scrollController: p2, - ), + feedbackBuilder: + (p0, p1, p2) => + CustomFeedbackForm(onSubmit: p1, scrollController: p2), child: DynamicColorBuilder( builder: (lightDynamic, darkDynamic) { // Fictitious brand color. @@ -56,9 +55,7 @@ class App extends HookConsumerWidget { darkCustomColors = darkCustomColors.harmonized(darkColorScheme); } else { // Otherwise, use fallback schemes. - lightColorScheme = ColorScheme.fromSeed( - seedColor: brandBlue, - ); + lightColorScheme = ColorScheme.fromSeed(seedColor: brandBlue); darkColorScheme = ColorScheme.fromSeed( seedColor: brandBlue, brightness: Brightness.dark, @@ -81,9 +78,7 @@ class App extends HookConsumerWidget { GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], - supportedLocales: const [ - Locale('ja', 'JP'), - ], + supportedLocales: const [Locale('ja', 'JP')], builder: (context, child) { return UpgradeAlert( navigatorKey: routerConfig.routerDelegate.navigatorKey, diff --git a/app/lib/core/api/api_authentication_notifier.dart b/app/lib/core/api/api_authentication_notifier.dart index 78b55ec3..4f237e0e 100644 --- a/app/lib/core/api/api_authentication_notifier.dart +++ b/app/lib/core/api/api_authentication_notifier.dart @@ -17,20 +17,14 @@ class ApiAuthenticationNotifier extends _$ApiAuthenticationNotifier { static const _secureStorageKey = 'api_token'; - Future save({ - required String token, - }) async { + Future save({required String token}) async { final secureStorage = ref.watch(secureStorageProvider); await secureStorage.write(key: _secureStorageKey, value: token); state = AsyncData(token); } - Future< - ({ - String id, - String role, - })> extractPayload() async { + Future<({String id, String role})> extractPayload() async { final token = state.valueOrNull; if (token == null) { throw UnauthorizedException(); @@ -40,10 +34,7 @@ class ApiAuthenticationNotifier extends _$ApiAuthenticationNotifier { final id = map['id'] as String; final role = map['role'] as String; - return ( - id: id, - role: role, - ); + return (id: id, role: role); } static Map parseJwt(String token) { diff --git a/app/lib/core/api/api_authentication_notifier.g.dart b/app/lib/core/api/api_authentication_notifier.g.dart index 458b5320..e92d3921 100644 --- a/app/lib/core/api/api_authentication_notifier.g.dart +++ b/app/lib/core/api/api_authentication_notifier.g.dart @@ -15,14 +15,15 @@ String _$apiAuthenticationNotifierHash() => @ProviderFor(ApiAuthenticationNotifier) final apiAuthenticationNotifierProvider = AsyncNotifierProvider.internal( - ApiAuthenticationNotifier.new, - name: r'apiAuthenticationNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$apiAuthenticationNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + ApiAuthenticationNotifier.new, + name: r'apiAuthenticationNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$apiAuthenticationNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$ApiAuthenticationNotifier = AsyncNotifier; // ignore_for_file: type=lint diff --git a/app/lib/core/api/api_authentication_payload.dart b/app/lib/core/api/api_authentication_payload.dart index a6b0ab7b..f8a20c2e 100644 --- a/app/lib/core/api/api_authentication_payload.dart +++ b/app/lib/core/api/api_authentication_payload.dart @@ -6,11 +6,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'api_authentication_payload.g.dart'; @Riverpod(keepAlive: true) -Future< - ({ - String id, - String role, - })> apiAuthenticationPayload(Ref ref) async { +Future<({String id, String role})> apiAuthenticationPayload(Ref ref) async { final state = await ref.watch(apiAuthenticationNotifierProvider.future); if (state == null) { throw UnauthorizedException(); diff --git a/app/lib/core/api/api_authentication_payload.g.dart b/app/lib/core/api/api_authentication_payload.g.dart index 97799df2..ef90230e 100644 --- a/app/lib/core/api/api_authentication_payload.g.dart +++ b/app/lib/core/api/api_authentication_payload.g.dart @@ -15,18 +15,19 @@ String _$apiAuthenticationPayloadHash() => @ProviderFor(apiAuthenticationPayload) final apiAuthenticationPayloadProvider = FutureProvider<({String id, String role})>.internal( - apiAuthenticationPayload, - name: r'apiAuthenticationPayloadProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$apiAuthenticationPayloadHash, - dependencies: null, - allTransitiveDependencies: null, -); + apiAuthenticationPayload, + name: r'apiAuthenticationPayloadProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$apiAuthenticationPayloadHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef ApiAuthenticationPayloadRef - = FutureProviderRef<({String id, String role})>; +typedef ApiAuthenticationPayloadRef = + FutureProviderRef<({String id, String role})>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/api/eq_api.dart b/app/lib/core/api/eq_api.dart index 5eaab245..15e2156e 100644 --- a/app/lib/core/api/eq_api.dart +++ b/app/lib/core/api/eq_api.dart @@ -21,11 +21,8 @@ EqApi eqApi(Ref ref) { return EqApi( dio: dio, - objectsDio: Dio( - BaseOptions( - baseUrl: 'https://object.eqmonitor.app', - ), - )..interceptors.add( + objectsDio: Dio(BaseOptions(baseUrl: 'https://object.eqmonitor.app')) + ..interceptors.add( TalkerDioLogger( settings: TalkerDioLoggerSettings( errorPen: AnsiPen()..red(), @@ -39,10 +36,7 @@ EqApi eqApi(Ref ref) { } /// Repositoryで利用 -typedef EqApiV1Response = ({ - int count, - List items, -}); +typedef EqApiV1Response = ({int count, List items}); /// HttpResponse のheaderから`count`の値を取得するために利用 extension ResponseEx on Response { diff --git a/app/lib/core/api/jma_parameter_api.dart b/app/lib/core/api/jma_parameter_api.dart index fb42e773..e42a8069 100644 --- a/app/lib/core/api/jma_parameter_api.dart +++ b/app/lib/core/api/jma_parameter_api.dart @@ -9,10 +9,7 @@ part 'jma_parameter_api.g.dart'; JmaParameterApiClient jmaParameterApiClient(Ref ref) { return JmaParameterApiClient( client: Dio( - BaseOptions( - headers: {}, - baseUrl: 'https://object.eqmonitor.app', - ), + BaseOptions(headers: {}, baseUrl: 'https://object.eqmonitor.app'), ), ); } diff --git a/app/lib/core/api/jma_parameter_api.g.dart b/app/lib/core/api/jma_parameter_api.g.dart index a8d5e2ab..1cfd5bf0 100644 --- a/app/lib/core/api/jma_parameter_api.g.dart +++ b/app/lib/core/api/jma_parameter_api.g.dart @@ -16,9 +16,10 @@ String _$jmaParameterApiClientHash() => final jmaParameterApiClientProvider = Provider.internal( jmaParameterApiClient, name: r'jmaParameterApiClientProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$jmaParameterApiClientHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$jmaParameterApiClientHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/component/button/action_button.dart b/app/lib/core/component/button/action_button.dart index 06b1d8a6..5fda8a84 100644 --- a/app/lib/core/component/button/action_button.dart +++ b/app/lib/core/component/button/action_button.dart @@ -28,11 +28,7 @@ class ActionButton extends StatelessWidget { required void Function() onPressed, required Widget child, }) { - return ActionButton( - onPressed: onPressed, - isEnabled: false, - child: child, - ); + return ActionButton(onPressed: onPressed, isEnabled: false, child: child); } factory ActionButton.text({ @@ -40,52 +36,46 @@ class ActionButton extends StatelessWidget { required String text, required BuildContext context, Color? accentColor, - }) => - ActionButton( - onPressed: onPressed, - accentColor: accentColor, - isEnabled: true, - padding: const EdgeInsets.symmetric( - vertical: 4, - ), - child: Flexible( - child: Center( - child: Text( - text, - style: Theme.of(context).textTheme.titleMedium!.copyWith( - fontWeight: FontWeight.bold, - color: Colors.white, - letterSpacing: 1.1, - ), - ), + }) => ActionButton( + onPressed: onPressed, + accentColor: accentColor, + isEnabled: true, + padding: const EdgeInsets.symmetric(vertical: 4), + child: Flexible( + child: Center( + child: Text( + text, + style: Theme.of(context).textTheme.titleMedium!.copyWith( + fontWeight: FontWeight.bold, + color: Colors.white, + letterSpacing: 1.1, ), ), - ); + ), + ), + ); factory ActionButton.textOutline({ required void Function() onPressed, required String text, required BuildContext context, Color? textColor, - }) => - ActionButton( - onPressed: onPressed, - accentColor: Colors.transparent, - isEnabled: true, - padding: const EdgeInsets.symmetric( - vertical: 4, + }) => ActionButton( + onPressed: onPressed, + accentColor: Colors.transparent, + isEnabled: true, + padding: const EdgeInsets.symmetric(vertical: 4), + child: Center( + child: Text( + text, + style: Theme.of(context).textTheme.titleMedium!.copyWith( + fontWeight: FontWeight.bold, + color: textColor, + letterSpacing: 1.1, ), - child: Center( - child: Text( - text, - style: Theme.of(context).textTheme.titleMedium!.copyWith( - fontWeight: FontWeight.bold, - color: textColor, - letterSpacing: 1.1, - ), - ), - ), - ); + ), + ), + ); final void Function() onPressed; final bool isEnabled; @@ -99,27 +89,18 @@ class ActionButton extends StatelessWidget { final enabledWidget = BorderedContainer( accentColor: accentColor ?? Colors.blue[800]!, onPressed: onPressed, - child: Padding( - padding: padding, - child: child, - ), + child: Padding(padding: padding, child: child), ); final disabledWidget = DecoratedBox( decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(16)), color: Colors.white.withValues(alpha: 0.75), - border: const Border.fromBorderSide( - BorderSide( - color: Colors.grey, - ), - ), + border: const Border.fromBorderSide(BorderSide(color: Colors.grey)), ), child: child, ); return AnimatedSwitcher( - duration: const Duration( - milliseconds: 150, - ), + duration: const Duration(milliseconds: 150), child: isEnabled ? enabledWidget : disabledWidget, ); } diff --git a/app/lib/core/component/chip/custom_chip.dart b/app/lib/core/component/chip/custom_chip.dart index 7933a323..d9ed2aaa 100644 --- a/app/lib/core/component/chip/custom_chip.dart +++ b/app/lib/core/component/chip/custom_chip.dart @@ -26,10 +26,7 @@ class CustomChip extends StatelessWidget { ), ), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 4, - horizontal: 8, - ), + padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), child: child, ), ), diff --git a/app/lib/core/component/chip/date_range_filter_chip.dart b/app/lib/core/component/chip/date_range_filter_chip.dart index f224701b..9423f09c 100644 --- a/app/lib/core/component/chip/date_range_filter_chip.dart +++ b/app/lib/core/component/chip/date_range_filter_chip.dart @@ -2,12 +2,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class DateRangeFilterChip extends StatelessWidget { - const DateRangeFilterChip({ - this.min, - this.max, - this.onChanged, - super.key, - }); + const DateRangeFilterChip({this.min, this.max, this.onChanged, super.key}); /// 震度の範囲が変更された時に呼ばれる /// `min` と `max` にはそれぞれ下限値と上限値が渡される @@ -40,12 +35,14 @@ class DateRangeFilterChip extends StatelessWidget { onChanged?.call(result.start, result.end); } }, - label: (range.isAllSelected) - ? const Text('地震発生日') - : Text(range.toRangeString), - onDeleted: range.isAllSelected - ? null - : () => onChanged?.call(initialMin, initialMax), + label: + (range.isAllSelected) + ? const Text('地震発生日') + : Text(range.toRangeString), + onDeleted: + range.isAllSelected + ? null + : () => onChanged?.call(initialMin, initialMax), selected: !range.isAllSelected, selectedColor: Theme.of(context).colorScheme.secondaryContainer, ); diff --git a/app/lib/core/component/chip/depth_filter_chip.dart b/app/lib/core/component/chip/depth_filter_chip.dart index b9e0090b..0b32c1f3 100644 --- a/app/lib/core/component/chip/depth_filter_chip.dart +++ b/app/lib/core/component/chip/depth_filter_chip.dart @@ -2,12 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; class DepthFilterChip extends StatelessWidget { - const DepthFilterChip({ - this.min, - this.max, - this.onChanged, - super.key, - }); + const DepthFilterChip({this.min, this.max, this.onChanged, super.key}); /// マグニチュードの範囲が変更された時に呼ばれる /// `min` と `max` にはそれぞれ下限値と上限値が渡される @@ -29,24 +24,24 @@ class DepthFilterChip extends StatelessWidget { final result = await showModalBottomSheet<(int?, int?)?>( clipBehavior: Clip.antiAlias, context: context, - builder: (context) => _DepthFilterModal( - currentMin: min, - currentMax: max, - ), + builder: + (context) => _DepthFilterModal(currentMin: min, currentMax: max), ); if (result != null) { onChanged?.call(result.min, result.max); } }, - label: (range.isAllSelected) - ? const Text('震源の深さ') - : Text( - range.toRangeString, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - onDeleted: range.isAllSelected - ? null - : () => onChanged?.call(initialMin, initialMax), + label: + (range.isAllSelected) + ? const Text('震源の深さ') + : Text( + range.toRangeString, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + onDeleted: + range.isAllSelected + ? null + : () => onChanged?.call(initialMin, initialMax), selected: !range.isAllSelected, selectedColor: Theme.of(context).colorScheme.secondaryContainer, ); @@ -102,10 +97,7 @@ class _DepthFilterModal extends HookWidget { ), const SizedBox(height: 24), RangeSlider( - values: RangeValues( - min.value.toDouble(), - max.value.toDouble(), - ), + values: RangeValues(min.value.toDouble(), max.value.toDouble()), min: initialMin.toDouble(), max: initialMax.toDouble(), onChanged: (state) { @@ -113,10 +105,7 @@ class _DepthFilterModal extends HookWidget { (state.start.toInt() / 10).roundToDouble().toInt() * 10; max.value = (state.end.toInt() / 10).roundToDouble().toInt() * 10; }, - labels: RangeLabels( - '${min.value}km', - '${max.value}km', - ), + labels: RangeLabels('${min.value}km', '${max.value}km'), divisions: (initialMax - initialMin) ~/ 10, ), const SizedBox(height: 16), @@ -137,8 +126,8 @@ class _DepthFilterModal extends HookWidget { child: const Text('キャンセル'), ), TextButton( - onPressed: () => - Navigator.of(context).pop((min.value, max.value)), + onPressed: + () => Navigator.of(context).pop((min.value, max.value)), child: const Text('完了'), ), ], diff --git a/app/lib/core/component/chip/intensity_filter_chip.dart b/app/lib/core/component/chip/intensity_filter_chip.dart index 4f1bb857..19cd2e34 100644 --- a/app/lib/core/component/chip/intensity_filter_chip.dart +++ b/app/lib/core/component/chip/intensity_filter_chip.dart @@ -3,12 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; class IntensityFilterChip extends StatelessWidget { - const IntensityFilterChip({ - this.min, - this.max, - this.onChanged, - super.key, - }); + const IntensityFilterChip({this.min, this.max, this.onChanged, super.key}); /// 震度の範囲が変更された時に呼ばれる /// `min` と `max` にはそれぞれ下限値と上限値が渡される @@ -29,26 +24,27 @@ class IntensityFilterChip extends StatelessWidget { onSelected: (_) async { final result = await showModalBottomSheet<(JmaIntensity?, JmaIntensity?)?>( - clipBehavior: Clip.antiAlias, - context: context, - builder: (context) => _IntensityFilterModal( - currentMin: min, - currentMax: max, - ), - ); + clipBehavior: Clip.antiAlias, + context: context, + builder: + (context) => + _IntensityFilterModal(currentMin: min, currentMax: max), + ); if (result != null) { onChanged?.call(result.min, result.max); } }, - label: (range.isAllSelected) - ? const Text('最大観測震度') - : Text( - range.toRangeString, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - onDeleted: range.isAllSelected - ? null - : () => onChanged?.call(initialMin, initialMax), + label: + (range.isAllSelected) + ? const Text('最大観測震度') + : Text( + range.toRangeString, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + onDeleted: + range.isAllSelected + ? null + : () => onChanged?.call(initialMin, initialMax), selected: !range.isAllSelected, selectedColor: Theme.of(context).colorScheme.secondaryContainer, ); @@ -113,10 +109,7 @@ class _IntensityFilterModal extends HookWidget { min.value = JmaIntensity.values[state.start.toInt()]; max.value = JmaIntensity.values[state.end.toInt()]; }, - labels: RangeLabels( - '震度${min.value}', - '震度${max.value}', - ), + labels: RangeLabels('震度${min.value}', '震度${max.value}'), divisions: JmaIntensity.seven.index, ), const SizedBox(height: 16), @@ -137,8 +130,8 @@ class _IntensityFilterModal extends HookWidget { child: const Text('キャンセル'), ), TextButton( - onPressed: () => - Navigator.of(context).pop((min.value, max.value)), + onPressed: + () => Navigator.of(context).pop((min.value, max.value)), child: const Text('完了'), ), ], diff --git a/app/lib/core/component/chip/magnitude_filter_chip.dart b/app/lib/core/component/chip/magnitude_filter_chip.dart index d061a7bb..6d4c5f3e 100644 --- a/app/lib/core/component/chip/magnitude_filter_chip.dart +++ b/app/lib/core/component/chip/magnitude_filter_chip.dart @@ -2,12 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; class MagnitudeFilterChip extends StatelessWidget { - const MagnitudeFilterChip({ - this.min, - this.max, - this.onChanged, - super.key, - }); + const MagnitudeFilterChip({this.min, this.max, this.onChanged, super.key}); /// マグニチュードの範囲が変更された時に呼ばれる /// `min` と `max` にはそれぞれ下限値と上限値が渡される @@ -29,24 +24,25 @@ class MagnitudeFilterChip extends StatelessWidget { final result = await showModalBottomSheet<(double?, double?)?>( clipBehavior: Clip.antiAlias, context: context, - builder: (context) => _MagnitudeFilterModal( - currentMin: min, - currentMax: max, - ), + builder: + (context) => + _MagnitudeFilterModal(currentMin: min, currentMax: max), ); if (result != null) { onChanged?.call(result.min, result.max); } }, - label: (range.isAllSelected) - ? const Text('マグニチュード') - : Text( - range.toRangeString, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - onDeleted: range.isAllSelected - ? null - : () => onChanged?.call(initialMin, initialMax), + label: + (range.isAllSelected) + ? const Text('マグニチュード') + : Text( + range.toRangeString, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + onDeleted: + range.isAllSelected + ? null + : () => onChanged?.call(initialMin, initialMax), selected: !range.isAllSelected, selectedColor: Theme.of(context).colorScheme.secondaryContainer, ); @@ -99,21 +95,16 @@ class _MagnitudeFilterModal extends HookWidget { ), const SizedBox(height: 24), RangeSlider( - values: RangeValues( - min.value, - max.value, - ), + values: RangeValues(min.value, max.value), max: 9, onChanged: (state) { // 小数第1位以下切り捨て min.value = (state.start * 10).floorToDouble() / 10; max.value = (state.end * 10).floorToDouble() / 10; }, - labels: RangeLabels( - 'M${min.value}', - 'M${max.value}', - ), - divisions: (MagnitudeFilterChip.initialMax - + labels: RangeLabels('M${min.value}', 'M${max.value}'), + divisions: + (MagnitudeFilterChip.initialMax - MagnitudeFilterChip.initialMin) .toInt() * 10, @@ -136,8 +127,8 @@ class _MagnitudeFilterModal extends HookWidget { child: const Text('キャンセル'), ), TextButton( - onPressed: () => - Navigator.of(context).pop((min.value, max.value)), + onPressed: + () => Navigator.of(context).pop((min.value, max.value)), child: const Text('完了'), ), ], diff --git a/app/lib/core/component/container/blur_container.dart b/app/lib/core/component/container/blur_container.dart index a38113ef..a24d00ca 100644 --- a/app/lib/core/component/container/blur_container.dart +++ b/app/lib/core/component/container/blur_container.dart @@ -28,22 +28,14 @@ class BlurContainer extends StatelessWidget { return DecoratedBox( decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(borderRadius)), - border: Border.all( - color: borderColor, - width: borderWidth, - ), + border: Border.all(color: borderColor, width: borderWidth), ), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(borderRadius)), child: BackdropFilter( - filter: ImageFilter.blur( - sigmaX: blurRadius, - sigmaY: blurRadius, - ), + filter: ImageFilter.blur(sigmaX: blurRadius, sigmaY: blurRadius), child: DecoratedBox( - decoration: BoxDecoration( - color: blurColor, - ), + decoration: BoxDecoration(color: blurColor), child: child, ), ), diff --git a/app/lib/core/component/container/bordered_container.dart b/app/lib/core/component/container/bordered_container.dart index ae317e94..1c0ebfa3 100644 --- a/app/lib/core/component/container/bordered_container.dart +++ b/app/lib/core/component/container/bordered_container.dart @@ -5,10 +5,7 @@ class BorderedContainer extends StatelessWidget { required this.child, this.accentColor, this.padding = const EdgeInsets.all(12), - this.margin = const EdgeInsets.symmetric( - vertical: 4, - horizontal: 8, - ), + this.margin = const EdgeInsets.symmetric(vertical: 4, horizontal: 8), this.elevation = 0, this.borderRadius = const BorderRadius.all(Radius.circular(16)), this.onPressed, @@ -41,16 +38,11 @@ class BorderedContainer extends StatelessWidget { margin: margin, child: InkWell( onTap: onPressed, - child: Padding( - padding: padding, - child: child, - ), + child: Padding(padding: padding, child: child), ), ); if (onPressed != null) { - return Ink( - child: card, - ); + return Ink(child: card); } return card; } diff --git a/app/lib/core/component/error/error_card.dart b/app/lib/core/component/error/error_card.dart index bd3cde2c..57899370 100644 --- a/app/lib/core/component/error/error_card.dart +++ b/app/lib/core/component/error/error_card.dart @@ -53,11 +53,7 @@ class ErrorCard extends StatelessWidget { Row( mainAxisSize: MainAxisSize.min, children: [ - Icon( - Icons.error, - size: 48, - color: colorScheme.error, - ), + Icon(Icons.error, size: 48, color: colorScheme.error), const SizedBox(width: 16), Flexible( child: Text( @@ -92,11 +88,11 @@ class ErrorCard extends StatelessWidget { if (onReload != null) ...[ const SizedBox(height: 8), FilledButton.tonalIcon( - onPressed: () async => - FullScreenCircularProgressIndicator.showUntil( - context, - onReload!, - ), + onPressed: + () async => FullScreenCircularProgressIndicator.showUntil( + context, + onReload!, + ), icon: const Icon(Icons.refresh), label: const Text('再読み込み'), style: FilledButton.styleFrom( @@ -120,13 +116,15 @@ class ErrorCard extends StatelessWidget { {'error': final String errorMsg} => errorMsg, {'code': final String code, 'details': final String details} => '$code: $details', - _ => 'エラーが発生しました\n' - '少し時間をおいて再度お試しください。\n' - '解消されない場合は、この画面のスクリーンショットを開発者へ送信してください', + _ => + 'エラーが発生しました\n' + '少し時間をおいて再度お試しください。\n' + '解消されない場合は、この画面のスクリーンショットを開発者へ送信してください', }; final statusCode = response.statusCode; if (statusCode != null) { - final baseMessage = onDioExceptionStatusOverride?.call(statusCode) ?? + final baseMessage = + onDioExceptionStatusOverride?.call(statusCode) ?? switch (statusCode) { 400 => '不正なリクエストです', 403 => 'アクセスが拒否されました', @@ -148,16 +146,16 @@ class ErrorCard extends StatelessWidget { } else { final message = switch (error) { DioException(:final type) => switch (type) { - DioExceptionType.badCertificate => 'SSL証明書が不正です', - DioExceptionType.badResponse => 'サーバーからのレスポンスが不正です', - DioExceptionType.connectionTimeout => 'サーバーとの接続がタイムアウトしました', - DioExceptionType.receiveTimeout => 'サーバーからのレスポンスがタイムアウトしました', - DioExceptionType.sendTimeout => 'サーバーへのリクエストがタイムアウトしました', - DioExceptionType.connectionError => - 'サーバーとの接続に失敗しました。ネットワーク接続を確認してください', - DioExceptionType.unknown => '不明なエラーが発生しました', - DioExceptionType.cancel => 'キャンセルされました', - }, + DioExceptionType.badCertificate => 'SSL証明書が不正です', + DioExceptionType.badResponse => 'サーバーからのレスポンスが不正です', + DioExceptionType.connectionTimeout => 'サーバーとの接続がタイムアウトしました', + DioExceptionType.receiveTimeout => 'サーバーからのレスポンスがタイムアウトしました', + DioExceptionType.sendTimeout => 'サーバーへのリクエストがタイムアウトしました', + DioExceptionType.connectionError => + 'サーバーとの接続に失敗しました。ネットワーク接続を確認してください', + DioExceptionType.unknown => '不明なエラーが発生しました', + DioExceptionType.cancel => 'キャンセルされました', + }, _ => 'エラーが発生しました', }; return message; diff --git a/app/lib/core/component/intenisty/intensity_icon_type.dart b/app/lib/core/component/intenisty/intensity_icon_type.dart index 259c56af..b8fee130 100644 --- a/app/lib/core/component/intenisty/intensity_icon_type.dart +++ b/app/lib/core/component/intenisty/intensity_icon_type.dart @@ -1,6 +1 @@ -enum IntensityIconType { - filled, - small, - smallWithoutText, - ; -} +enum IntensityIconType { filled, small, smallWithoutText } diff --git a/app/lib/core/component/intenisty/jma_forecast_intensity_icon.dart b/app/lib/core/component/intenisty/jma_forecast_intensity_icon.dart index 4e4c9713..7762ddf8 100644 --- a/app/lib/core/component/intenisty/jma_forecast_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_forecast_intensity_icon.dart @@ -29,12 +29,14 @@ class JmaForecastIntensityWidget extends ConsumerWidget { final colorScheme = intensityColorModel.fromJmaForecastIntensity(intensity); final (fg, bg) = (colorScheme.foreground, colorScheme.background); // 震度の整数部分 - final intensityMainText = - intensity.type.replaceAll('-', '').replaceAll('+', ''); + final intensityMainText = intensity.type + .replaceAll('-', '') + .replaceAll('+', ''); // 震度の弱・強の表記 - final intensitySubText = intensity.type.contains('-') - ? '弱' - : intensity.type.contains('+') + final intensitySubText = + intensity.type.contains('-') + ? '弱' + : intensity.type.contains('+') ? '強' : ''; @@ -128,136 +130,129 @@ class JmaForecastIntensityIcon extends ConsumerWidget { final colorScheme = intensityColorModel.fromJmaForecastIntensity(intensity); final (fg, bg) = (colorScheme.foreground, colorScheme.background); // 震度の整数部分 - final intensityMainText = - intensity.type.replaceAll('-', '').replaceAll('+', ''); + final intensityMainText = intensity.type + .replaceAll('-', '') + .replaceAll('+', ''); // 震度の弱・強の表記 - final suffix = intensity.type.contains('-') - ? '-' - : intensity.type.contains('+') + final suffix = + intensity.type.contains('-') + ? '-' + : intensity.type.contains('+') ? '+' : ''; - final intensitySubText = intensity.type.contains('-') - ? '弱' - : intensity.type.contains('+') + final intensitySubText = + intensity.type.contains('-') + ? '弱' + : intensity.type.contains('+') ? '強' : ''; - final borderColor = Color.lerp( - bg, - fg, - 0.3, - )!; + 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, + 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( + intensityMainText, + style: TextStyle( + color: fg, + fontSize: 100, + fontWeight: FontWeight.w900, + fontFamily: FontFamily.jetBrainsMono, + ), + ), + Text( + suffix, + style: TextStyle( + color: fg, + fontSize: 80, + fontWeight: FontWeight.w900, + fontFamily: FontFamily.jetBrainsMono, + fontFamilyFallback: const [FontFamily.notoSansJP], + ), + ), + ], ), ), - child: Center( - child: FittedBox( - fit: BoxFit.scaleDown, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + ), + ), + ), + 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: size, + width: size, + child: DecoratedBox( + decoration: BoxDecoration( + color: bg, + // 角丸にする + borderRadius: BorderRadius.circular(size / 5), + ), + child: Center( + child: FittedBox( + fit: BoxFit.scaleDown, + child: Row( + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + if (customText != null) Text( - intensityMainText, + customText!, style: TextStyle( color: fg, fontSize: 100, fontWeight: FontWeight.w900, fontFamily: FontFamily.jetBrainsMono, ), - ), + ) + else ...[ Text( - suffix, + intensityMainText, style: TextStyle( color: fg, - fontSize: 80, + fontSize: 100, fontWeight: FontWeight.w900, fontFamily: FontFamily.jetBrainsMono, - fontFamilyFallback: const [FontFamily.notoSansJP], ), ), - ], - ), - ), - ), - ), - ), - 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: size, - width: size, - child: DecoratedBox( - decoration: BoxDecoration( - color: bg, - // 角丸にする - borderRadius: BorderRadius.circular(size / 5), - ), - child: Center( - child: FittedBox( - fit: BoxFit.scaleDown, - child: Row( - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - if (customText != null) + if (showSuffix) Text( - customText!, + intensitySubText, style: TextStyle( color: fg, - fontSize: 100, - fontWeight: FontWeight.w900, - fontFamily: FontFamily.jetBrainsMono, - ), - ) - else ...[ - Text( - intensityMainText, - style: TextStyle( - color: fg, - fontSize: 100, + fontSize: 50, fontWeight: FontWeight.w900, fontFamily: FontFamily.jetBrainsMono, + fontFamilyFallback: const [FontFamily.notoSansJP], ), ), - if (showSuffix) - Text( - intensitySubText, - style: TextStyle( - color: fg, - fontSize: 50, - fontWeight: FontWeight.w900, - fontFamily: FontFamily.jetBrainsMono, - fontFamilyFallback: const [FontFamily.notoSansJP], - ), - ), - ], ], - ), + ], ), ), ), ), + ), }; } } diff --git a/app/lib/core/component/intenisty/jma_forecast_lg_intensity_icon.dart b/app/lib/core/component/intenisty/jma_forecast_lg_intensity_icon.dart index 334957a4..fa71f44d 100644 --- a/app/lib/core/component/intenisty/jma_forecast_lg_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_forecast_lg_intensity_icon.dart @@ -26,16 +26,19 @@ class JmaForecastLgIntensityWidget extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final intensityColorModel = (colorModel ?? ref.watch(intensityColorProvider))!; - final colorScheme = - intensityColorModel.fromJmaForecastLgIntensity(intensity); + final colorScheme = intensityColorModel.fromJmaForecastLgIntensity( + intensity, + ); final (fg, bg) = (colorScheme.foreground, colorScheme.background); // 震度の整数部分 - final intensityMainText = - intensity.type.replaceAll('-', '').replaceAll('+', ''); + final intensityMainText = intensity.type + .replaceAll('-', '') + .replaceAll('+', ''); // 震度の弱・強の表記 - final intensitySubText = intensity.type.contains('-') - ? '弱' - : intensity.type.contains('+') + final intensitySubText = + intensity.type.contains('-') + ? '弱' + : intensity.type.contains('+') ? '強' : ''; diff --git a/app/lib/core/component/intenisty/jma_intensity_icon.dart b/app/lib/core/component/intenisty/jma_intensity_icon.dart index 3d355d75..480ebf8f 100644 --- a/app/lib/core/component/intenisty/jma_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_intensity_icon.dart @@ -33,40 +33,36 @@ class JmaIntensityIcon extends ConsumerWidget { _ => intensity.type.replaceAll('-', '').replaceAll('+', ''), }; // 震度の弱・強の表記 - final suffix = intensity.type.contains('-') - ? '-' - : intensity.type.contains('+') + final suffix = + intensity.type.contains('-') + ? '-' + : intensity.type.contains('+') ? '+' : ''; final intensitySubText = switch (intensity) { JmaIntensity.fiveUpperNoInput => '弱以上', - _ => intensity.type.contains('-') - ? '弱' - : intensity.type.contains('+') - ? '強' - : '', + _ => + intensity.type.contains('-') + ? '弱' + : intensity.type.contains('+') + ? '強' + : '', }; - final borderColor = Color.lerp( - bg, - fg, - 0.3, - )!; + 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: (intensity == JmaIntensity.fiveUpperNoInput) - ? const SizedBox.shrink() - : Center( + height: size, + width: size, + child: DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: bg, + border: Border.all(color: borderColor, width: 5), + ), + child: + (intensity == JmaIntensity.fiveUpperNoInput) + ? const SizedBox.shrink() + : Center( child: Padding( padding: const EdgeInsets.all(2), child: FittedBox( @@ -99,76 +95,73 @@ class JmaIntensityIcon extends ConsumerWidget { ), ), ), - ), ), + ), IntensityIconType.smallWithoutText => SizedBox( - height: size, - width: size, - child: DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: bg, - border: Border.all( - color: borderColor, - width: 5, - ), - ), + height: size, + width: size, + child: DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: bg, + border: Border.all(color: borderColor, width: 5), ), ), + ), IntensityIconType.filled => SizedBox( - height: size, - width: size, - child: DecoratedBox( - decoration: BoxDecoration( - color: bg, - // 角丸にする - borderRadius: BorderRadius.circular(size / 5), - ), - 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 ...[ + height: size, + width: size, + child: DecoratedBox( + decoration: BoxDecoration( + color: bg, + // 角丸にする + borderRadius: BorderRadius.circular(size / 5), + ), + 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, + ), + ), + if (showSuffix) Text( - intensityMainText, + intensitySubText, style: TextStyle( color: fg, - fontSize: 100, + fontSize: 50, fontWeight: FontWeight.w900, fontFamily: FontFamily.jetBrainsMono, + fontFamilyFallback: const [FontFamily.notoSansJP], ), ), - if (showSuffix) - Text( - intensitySubText, - style: TextStyle( - color: fg, - fontSize: 50, - fontWeight: FontWeight.w900, - fontFamily: FontFamily.jetBrainsMono, - fontFamilyFallback: const [FontFamily.notoSansJP], - ), - ), - ], ], - ), + ], ), ), ), ), + ), }; } } diff --git a/app/lib/core/component/intenisty/jma_lg_intensity_icon.dart b/app/lib/core/component/intenisty/jma_lg_intensity_icon.dart index 242bd911..c2e757e3 100644 --- a/app/lib/core/component/intenisty/jma_lg_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_lg_intensity_icon.dart @@ -26,73 +26,64 @@ class JmaLgIntensityIcon extends ConsumerWidget { final colorScheme = intensityColorModel.fromJmaLgIntensity(intensity); final (fg, bg) = (colorScheme.foreground, colorScheme.background); - final borderColor = Color.lerp( - bg, - fg, - 0.3, - )!; + 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, - ), + 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, - ), - ), + height: size, + width: size, + child: DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: bg, + border: Border.all(color: borderColor, width: 5), ), ), + ), IntensityIconType.filled => SizedBox( - height: size, - width: size, - child: DecoratedBox( - decoration: BoxDecoration( - color: bg, - // 角丸にする - borderRadius: BorderRadius.circular(size / 5), - ), - child: Center( - child: FittedBox( - fit: BoxFit.scaleDown, - child: (customText != null) - ? Text( + height: size, + width: size, + child: DecoratedBox( + decoration: BoxDecoration( + color: bg, + // 角丸にする + borderRadius: BorderRadius.circular(size / 5), + ), + child: Center( + child: FittedBox( + fit: BoxFit.scaleDown, + child: + (customText != null) + ? Text( customText!, style: TextStyle( color: fg, @@ -101,7 +92,7 @@ class JmaLgIntensityIcon extends ConsumerWidget { fontFamily: FontFamily.jetBrainsMono, ), ) - : Text( + : Text( intensity.type, style: TextStyle( color: fg, @@ -110,10 +101,10 @@ class JmaLgIntensityIcon extends ConsumerWidget { fontFamily: FontFamily.jetBrainsMono, ), ), - ), ), ), ), + ), }; } } diff --git a/app/lib/core/component/sheet/app_sheet_route.dart b/app/lib/core/component/sheet/app_sheet_route.dart index f7d0bf70..63e465ab 100644 --- a/app/lib/core/component/sheet/app_sheet_route.dart +++ b/app/lib/core/component/sheet/app_sheet_route.dart @@ -3,26 +3,23 @@ import 'package:sheet/route.dart'; import 'package:sheet/sheet.dart'; class AppSheetRoute extends SheetRoute { - AppSheetRoute({ - required super.builder, - super.initialExtent = 0.6, - }) : super( - fit: SheetFit.loose, - stops: [initialExtent, 1], - decorationBuilder: (context, child) => SafeArea( - bottom: false, - child: Material( - elevation: 2, - clipBehavior: Clip.hardEdge, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16), + AppSheetRoute({required super.builder, super.initialExtent = 0.6}) + : super( + fit: SheetFit.loose, + stops: [initialExtent, 1], + decorationBuilder: + (context, child) => SafeArea( + bottom: false, + child: Material( + elevation: 2, + clipBehavior: Clip.hardEdge, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(16)), ), + child: child, ), - child: child, ), - ), - animationCurve: Curves.easeOutExpo, - duration: const Duration(milliseconds: 250), - ); + animationCurve: Curves.easeOutExpo, + duration: const Duration(milliseconds: 250), + ); } diff --git a/app/lib/core/component/sheet/basic_modal_sheet.dart b/app/lib/core/component/sheet/basic_modal_sheet.dart index 2268242d..a2de1853 100644 --- a/app/lib/core/component/sheet/basic_modal_sheet.dart +++ b/app/lib/core/component/sheet/basic_modal_sheet.dart @@ -31,9 +31,7 @@ class BasicModalSheet extends HookWidget { Sheet( backgroundColor: Colors.transparent, initialExtent: size.height * 0.2, - physics: const SnapSheetPhysics( - stops: [0.2, 0.5, 1], - ), + physics: const SnapSheetPhysics(stops: [0.2, 0.5, 1]), child: DecoratedBox( decoration: BoxDecoration( borderRadius: const BorderRadius.vertical( @@ -47,11 +45,7 @@ class BasicModalSheet extends HookWidget { child: SafeArea( top: hasAppBar, bottom: false, - child: SingleChildScrollView( - child: Column( - children: children, - ), - ), + child: SingleChildScrollView(child: Column(children: children)), ), ), ), @@ -67,10 +61,7 @@ class BasicModalSheet extends HookWidget { bottom: false, child: Padding( padding: const EdgeInsets.only(right: 8), - child: SizedBox( - width: sheetWidth, - child: sheet, - ), + child: SizedBox(width: sheetWidth, child: sheet), ), ), ); diff --git a/app/lib/core/component/sheet/sheet_floating_action_buttons.dart b/app/lib/core/component/sheet/sheet_floating_action_buttons.dart index c87c0ce8..b9856d67 100644 --- a/app/lib/core/component/sheet/sheet_floating_action_buttons.dart +++ b/app/lib/core/component/sheet/sheet_floating_action_buttons.dart @@ -27,7 +27,8 @@ class SheetFloatingActionButtons extends HookWidget { final size = MediaQuery.sizeOf(context); final padding = MediaQuery.paddingOf(context); // safearea取得 - final height = size.height - + final height = + size.height - (padding.top + // SafeAreaのtop部分, AppBarの高さ (hasAppBar ? AppBar().preferredSize.height : 0)); diff --git a/app/lib/core/component/widget/app_list_tile.dart b/app/lib/core/component/widget/app_list_tile.dart index 3b2bda81..816f31a0 100644 --- a/app/lib/core/component/widget/app_list_tile.dart +++ b/app/lib/core/component/widget/app_list_tile.dart @@ -8,29 +8,27 @@ class AppListTile extends StatelessWidget { // ignore: avoid_positional_boolean_parameters required void Function(bool) onChanged, Widget? trailing, - }) => - AppListTile._( - title: title, - subtitle: subtitle, - value: value, - onChanged: onChanged, - trailing: trailing, - type: _AppListTileType.switchListTile, - ); + }) => AppListTile._( + title: title, + subtitle: subtitle, + value: value, + onChanged: onChanged, + trailing: trailing, + type: _AppListTileType.switchListTile, + ); factory AppListTile.listTile({ required String title, required String subtitle, Widget? trailing, void Function()? onTap, - }) => - AppListTile._( - title: title, - subtitle: subtitle, - trailing: trailing, - onTap: onTap, - type: _AppListTileType.listTile, - ); + }) => AppListTile._( + title: title, + subtitle: subtitle, + trailing: trailing, + onTap: onTap, + type: _AppListTileType.listTile, + ); const AppListTile._({ required this.title, @@ -65,39 +63,26 @@ class AppListTile extends StatelessWidget { return switch (type) { _AppListTileType.switchListTile => SwitchListTile.adaptive( - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - ), - shape: shape, - tileColor: backgroundColor, - title: Text( - title, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - subtitle: Text(subtitle), - value: value!, - onChanged: onChanged, - ), + contentPadding: const EdgeInsets.symmetric(horizontal: 16), + shape: shape, + tileColor: backgroundColor, + title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)), + subtitle: Text(subtitle), + value: value!, + onChanged: onChanged, + ), _AppListTileType.listTile => ListTile( - onTap: onTap, - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - ), - shape: shape, - tileColor: backgroundColor, - textColor: textColor, - title: Text( - title, - style: const TextStyle(fontWeight: FontWeight.bold), - ), - subtitle: Text(subtitle), - trailing: trailing, - ), + onTap: onTap, + contentPadding: const EdgeInsets.symmetric(horizontal: 16), + shape: shape, + tileColor: backgroundColor, + textColor: textColor, + title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)), + subtitle: Text(subtitle), + trailing: trailing, + ), }; } } -enum _AppListTileType { - switchListTile, - listTile, -} +enum _AppListTileType { switchListTile, listTile } diff --git a/app/lib/core/component/widget/dio_exception_text.dart b/app/lib/core/component/widget/dio_exception_text.dart index 3737aabe..3713d3f9 100644 --- a/app/lib/core/component/widget/dio_exception_text.dart +++ b/app/lib/core/component/widget/dio_exception_text.dart @@ -2,10 +2,7 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; class DioExceptionText extends StatelessWidget { - const DioExceptionText({ - required this.exception, - super.key, - }); + const DioExceptionText({required this.exception, super.key}); final DioException exception; @@ -14,8 +11,7 @@ class DioExceptionText extends StatelessWidget { final text = switch (exception.type) { DioExceptionType.connectionTimeout || DioExceptionType.sendTimeout || - DioExceptionType.receiveTimeout => - '接続がタイムアウトしました', + DioExceptionType.receiveTimeout => '接続がタイムアウトしました', DioExceptionType.badResponse => '不正なレスポンスが返されました', DioExceptionType.cancel => 'リクエストがキャンセルされました', DioExceptionType.badCertificate => '証明書のエラーが発生しました', @@ -26,9 +22,7 @@ class DioExceptionText extends StatelessWidget { final errorCodeText = ' (エラーコード: $errorCode)'; return Text( text + errorCodeText, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + style: const TextStyle(fontWeight: FontWeight.bold), ); } } diff --git a/app/lib/core/extension/async_value.dart b/app/lib/core/extension/async_value.dart index 2d588bf7..4e8ecd4b 100644 --- a/app/lib/core/extension/async_value.dart +++ b/app/lib/core/extension/async_value.dart @@ -52,13 +52,9 @@ extension AsyncValueX on AsyncValue { String defaultMessage = 'エラーが発生しました', }) { if (!isLoading && hasError) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - error!.toString(), - ), - ), - ); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text(error!.toString()))); } } } diff --git a/app/lib/core/extension/double_to_jma_forecast_intensity.dart b/app/lib/core/extension/double_to_jma_forecast_intensity.dart index b8c644ea..eb135a22 100644 --- a/app/lib/core/extension/double_to_jma_forecast_intensity.dart +++ b/app/lib/core/extension/double_to_jma_forecast_intensity.dart @@ -2,32 +2,32 @@ import 'package:eqapi_types/eqapi_types.dart'; extension JmaForecastIntensityDouble on double { JmaForecastIntensity? get toJmaForecastIntensity => switch (this) { - < -0.5 => null, - < 0.5 => JmaForecastIntensity.zero, - < 1.5 => JmaForecastIntensity.one, - < 2.5 => JmaForecastIntensity.two, - < 3.5 => JmaForecastIntensity.three, - < 4.5 => JmaForecastIntensity.four, - < 5.0 => JmaForecastIntensity.fiveLower, - < 5.5 => JmaForecastIntensity.fiveUpper, - < 6.0 => JmaForecastIntensity.sixLower, - < 6.5 => JmaForecastIntensity.sixUpper, - _ => JmaForecastIntensity.seven, - }; + < -0.5 => null, + < 0.5 => JmaForecastIntensity.zero, + < 1.5 => JmaForecastIntensity.one, + < 2.5 => JmaForecastIntensity.two, + < 3.5 => JmaForecastIntensity.three, + < 4.5 => JmaForecastIntensity.four, + < 5.0 => JmaForecastIntensity.fiveLower, + < 5.5 => JmaForecastIntensity.fiveUpper, + < 6.0 => JmaForecastIntensity.sixLower, + < 6.5 => JmaForecastIntensity.sixUpper, + _ => JmaForecastIntensity.seven, + }; } extension JmaForecastIntensityEx on JmaForecastIntensity { (double min, double max) get toRealtimeValue => switch (this) { - JmaForecastIntensity.zero => (double.negativeInfinity, 0.5), - JmaForecastIntensity.one => (0.5, 1.5), - JmaForecastIntensity.two => (1.5, 2.5), - JmaForecastIntensity.three => (2.5, 3.5), - JmaForecastIntensity.four => (3.5, 4.5), - JmaForecastIntensity.fiveLower => (4.5, 5.0), - JmaForecastIntensity.fiveUpper => (5.0, 5.5), - JmaForecastIntensity.sixLower => (5.5, 6.0), - JmaForecastIntensity.sixUpper => (6.0, 6.5), - JmaForecastIntensity.seven => (6.5, double.infinity), - _ => throw UnimplementedError(), - }; + JmaForecastIntensity.zero => (double.negativeInfinity, 0.5), + JmaForecastIntensity.one => (0.5, 1.5), + JmaForecastIntensity.two => (1.5, 2.5), + JmaForecastIntensity.three => (2.5, 3.5), + JmaForecastIntensity.four => (3.5, 4.5), + JmaForecastIntensity.fiveLower => (4.5, 5.0), + JmaForecastIntensity.fiveUpper => (5.0, 5.5), + JmaForecastIntensity.sixLower => (5.5, 6.0), + JmaForecastIntensity.sixUpper => (6.0, 6.5), + JmaForecastIntensity.seven => (6.5, double.infinity), + _ => throw UnimplementedError(), + }; } diff --git a/app/lib/core/extension/map_to_list.dart b/app/lib/core/extension/map_to_list.dart index 63c715b1..86338197 100644 --- a/app/lib/core/extension/map_to_list.dart +++ b/app/lib/core/extension/map_to_list.dart @@ -1,11 +1,4 @@ extension MapToListEx on Map { - List< - ({ - K key, - V value, - })> get toList => entries - .map( - (el) => (key: el.key, value: el.value), - ) - .toList(); + List<({K key, V value})> get toList => + entries.map((el) => (key: el.key, value: el.value)).toList(); } diff --git a/app/lib/core/extension/string_ex.dart b/app/lib/core/extension/string_ex.dart index f817f42f..6f464930 100644 --- a/app/lib/core/extension/string_ex.dart +++ b/app/lib/core/extension/string_ex.dart @@ -3,9 +3,5 @@ import 'dart:convert'; import 'package:crypto/crypto.dart' as crypto; extension Sha512Ex on String { - String get sha512 => crypto.sha512 - .convert( - utf8.encode(this), - ) - .toString(); + String get sha512 => crypto.sha512.convert(utf8.encode(this)).toString(); } diff --git a/app/lib/core/fcm/channels.dart b/app/lib/core/fcm/channels.dart index 31ab01e2..1f2837b1 100644 --- a/app/lib/core/fcm/channels.dart +++ b/app/lib/core/fcm/channels.dart @@ -145,10 +145,7 @@ final List notificationChannels = [ ]; final List notificationChannelGroups = [ - const AndroidNotificationChannelGroup( - 'eew', - '緊急地震速報', - ), + const AndroidNotificationChannelGroup('eew', '緊急地震速報'), const AndroidNotificationChannelGroup( 'earthquake', '地震通知', diff --git a/app/lib/core/foundation/result.dart b/app/lib/core/foundation/result.dart index 5ef62bb9..90488edb 100644 --- a/app/lib/core/foundation/result.dart +++ b/app/lib/core/foundation/result.dart @@ -38,10 +38,7 @@ final class Success extends Result { /// Resultクラスに準拠したFailureクラス final class Failure extends Result { - const Failure( - this.exception, [ - this.stackTrace, - ]); + const Failure(this.exception, [this.stackTrace]); final E exception; final StackTrace? stackTrace; diff --git a/app/lib/core/hook/use_sheet_controller.dart b/app/lib/core/hook/use_sheet_controller.dart index 9e7cb78f..03dd9117 100644 --- a/app/lib/core/hook/use_sheet_controller.dart +++ b/app/lib/core/hook/use_sheet_controller.dart @@ -4,14 +4,11 @@ import 'package:sheet/sheet.dart'; SheetController useSheetController({ String debugLabel = 'useSheetController', -}) => - use(_UseSheetControllerHook(debugLabel: debugLabel)); +}) => use(_UseSheetControllerHook(debugLabel: debugLabel)); class _UseSheetControllerHook extends Hook { // ignore: unused_element - const _UseSheetControllerHook({ - this.debugLabel = 'useSheetController', - }); + const _UseSheetControllerHook({this.debugLabel = 'useSheetController'}); final String debugLabel; @@ -22,9 +19,7 @@ class _UseSheetControllerHook extends Hook { class _UseSheetControllerHookState extends HookState { - late final _sheetController = SheetController( - debugLabel: hook.debugLabel, - ); + late final _sheetController = SheetController(debugLabel: hook.debugLabel); @override SheetController build(BuildContext context) => SheetController(); diff --git a/app/lib/core/provider/app_lifecycle.g.dart b/app/lib/core/provider/app_lifecycle.g.dart index c19e255e..78cf2e84 100644 --- a/app/lib/core/provider/app_lifecycle.g.dart +++ b/app/lib/core/provider/app_lifecycle.g.dart @@ -16,13 +16,15 @@ String _$appLifecycleHash() => r'9e357a2c4983fa88f3ed65162de86ce5813fb838'; @ProviderFor(AppLifecycle) final appLifecycleProvider = NotifierProvider.internal( - AppLifecycle.new, - name: r'appLifecycleProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$appLifecycleHash, - dependencies: null, - allTransitiveDependencies: null, -); + AppLifecycle.new, + name: r'appLifecycleProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$appLifecycleHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$AppLifecycle = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/application_documents_directory.g.dart b/app/lib/core/provider/application_documents_directory.g.dart index a41fd8f5..075ead24 100644 --- a/app/lib/core/provider/application_documents_directory.g.dart +++ b/app/lib/core/provider/application_documents_directory.g.dart @@ -16,9 +16,10 @@ String _$applicationDocumentsDirectoryHash() => final applicationDocumentsDirectoryProvider = Provider.internal( applicationDocumentsDirectory, name: r'applicationDocumentsDirectoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$applicationDocumentsDirectoryHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$applicationDocumentsDirectoryHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.dart b/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.dart index 6efea211..07549290 100644 --- a/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.dart +++ b/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.dart @@ -22,10 +22,8 @@ class EarthquakeHistoryConfig extends _$EarthquakeHistoryConfig { static const _key = 'earthquake_history_config'; - Future _save() async => ref.read(sharedPreferencesProvider).setString( - _key, - jsonEncode(state), - ); + Future _save() async => + ref.read(sharedPreferencesProvider).setString(_key, jsonEncode(state)); EarthquakeHistoryConfigModel? _load() { final jsonString = ref.read(sharedPreferencesProvider).getString(_key); diff --git a/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.g.dart b/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.g.dart index a975ff26..c3ad18b5 100644 --- a/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.g.dart +++ b/app/lib/core/provider/config/earthquake_history/earthquake_history_config_provider.g.dart @@ -14,17 +14,20 @@ String _$earthquakeHistoryConfigHash() => /// See also [EarthquakeHistoryConfig]. @ProviderFor(EarthquakeHistoryConfig) final earthquakeHistoryConfigProvider = AutoDisposeNotifierProvider< - EarthquakeHistoryConfig, EarthquakeHistoryConfigModel>.internal( + EarthquakeHistoryConfig, + EarthquakeHistoryConfigModel +>.internal( EarthquakeHistoryConfig.new, name: r'earthquakeHistoryConfigProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryConfigHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryConfigHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$EarthquakeHistoryConfig - = AutoDisposeNotifier; +typedef _$EarthquakeHistoryConfig = + AutoDisposeNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.dart b/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.dart index f0f528c5..8d024af7 100644 --- a/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.dart +++ b/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.dart @@ -42,14 +42,10 @@ class EarthquakeHistoryDetailConfig with _$EarthquakeHistoryDetailConfig { }) = _EarthquakeHistoryDetailConfig; factory EarthquakeHistoryDetailConfig.fromJson(Map json) => - _$EarthquakeHistoryDetailConfigFromJson(json).copyWith( - showingLpgmIntensity: false, - ); + _$EarthquakeHistoryDetailConfigFromJson( + json, + ).copyWith(showingLpgmIntensity: false); } /// 地震履歴詳細画面における震度の表示方法 -enum IntensityFillMode { - fillCity, - fillRegion, - none; -} +enum IntensityFillMode { fillCity, fillRegion, none } diff --git a/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.freezed.dart b/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.freezed.dart index fe9c26ab..98be0a16 100644 --- a/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.freezed.dart +++ b/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.freezed.dart @@ -12,10 +12,12 @@ part of 'earthquake_history_config_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EarthquakeHistoryConfigModel _$EarthquakeHistoryConfigModelFromJson( - Map json) { + Map json, +) { return _EarthquakeHistoryConfigModel.fromJson(json); } @@ -32,27 +34,34 @@ mixin _$EarthquakeHistoryConfigModel { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHistoryConfigModelCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHistoryConfigModelCopyWith<$Res> { factory $EarthquakeHistoryConfigModelCopyWith( - EarthquakeHistoryConfigModel value, - $Res Function(EarthquakeHistoryConfigModel) then) = - _$EarthquakeHistoryConfigModelCopyWithImpl<$Res, - EarthquakeHistoryConfigModel>; + EarthquakeHistoryConfigModel value, + $Res Function(EarthquakeHistoryConfigModel) then, + ) = + _$EarthquakeHistoryConfigModelCopyWithImpl< + $Res, + EarthquakeHistoryConfigModel + >; @useResult - $Res call( - {EarthquakeHistoryListConfig list, EarthquakeHistoryDetailConfig detail}); + $Res call({ + EarthquakeHistoryListConfig list, + EarthquakeHistoryDetailConfig detail, + }); $EarthquakeHistoryListConfigCopyWith<$Res> get list; $EarthquakeHistoryDetailConfigCopyWith<$Res> get detail; } /// @nodoc -class _$EarthquakeHistoryConfigModelCopyWithImpl<$Res, - $Val extends EarthquakeHistoryConfigModel> +class _$EarthquakeHistoryConfigModelCopyWithImpl< + $Res, + $Val extends EarthquakeHistoryConfigModel +> implements $EarthquakeHistoryConfigModelCopyWith<$Res> { _$EarthquakeHistoryConfigModelCopyWithImpl(this._value, this._then); @@ -65,20 +74,22 @@ class _$EarthquakeHistoryConfigModelCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? list = null, - Object? detail = null, - }) { - return _then(_value.copyWith( - list: null == list - ? _value.list - : list // ignore: cast_nullable_to_non_nullable - as EarthquakeHistoryListConfig, - detail: null == detail - ? _value.detail - : detail // ignore: cast_nullable_to_non_nullable - as EarthquakeHistoryDetailConfig, - ) as $Val); + $Res call({Object? list = null, Object? detail = null}) { + return _then( + _value.copyWith( + list: + null == list + ? _value.list + : list // ignore: cast_nullable_to_non_nullable + as EarthquakeHistoryListConfig, + detail: + null == detail + ? _value.detail + : detail // ignore: cast_nullable_to_non_nullable + as EarthquakeHistoryDetailConfig, + ) + as $Val, + ); } /// Create a copy of EarthquakeHistoryConfigModel @@ -106,13 +117,15 @@ class _$EarthquakeHistoryConfigModelCopyWithImpl<$Res, abstract class _$$EarthquakeHistoryConfigModelImplCopyWith<$Res> implements $EarthquakeHistoryConfigModelCopyWith<$Res> { factory _$$EarthquakeHistoryConfigModelImplCopyWith( - _$EarthquakeHistoryConfigModelImpl value, - $Res Function(_$EarthquakeHistoryConfigModelImpl) then) = - __$$EarthquakeHistoryConfigModelImplCopyWithImpl<$Res>; + _$EarthquakeHistoryConfigModelImpl value, + $Res Function(_$EarthquakeHistoryConfigModelImpl) then, + ) = __$$EarthquakeHistoryConfigModelImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {EarthquakeHistoryListConfig list, EarthquakeHistoryDetailConfig detail}); + $Res call({ + EarthquakeHistoryListConfig list, + EarthquakeHistoryDetailConfig detail, + }); @override $EarthquakeHistoryListConfigCopyWith<$Res> get list; @@ -122,32 +135,36 @@ abstract class _$$EarthquakeHistoryConfigModelImplCopyWith<$Res> /// @nodoc class __$$EarthquakeHistoryConfigModelImplCopyWithImpl<$Res> - extends _$EarthquakeHistoryConfigModelCopyWithImpl<$Res, - _$EarthquakeHistoryConfigModelImpl> + extends + _$EarthquakeHistoryConfigModelCopyWithImpl< + $Res, + _$EarthquakeHistoryConfigModelImpl + > implements _$$EarthquakeHistoryConfigModelImplCopyWith<$Res> { __$$EarthquakeHistoryConfigModelImplCopyWithImpl( - _$EarthquakeHistoryConfigModelImpl _value, - $Res Function(_$EarthquakeHistoryConfigModelImpl) _then) - : super(_value, _then); + _$EarthquakeHistoryConfigModelImpl _value, + $Res Function(_$EarthquakeHistoryConfigModelImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHistoryConfigModel /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? list = null, - Object? detail = null, - }) { - return _then(_$EarthquakeHistoryConfigModelImpl( - list: null == list - ? _value.list - : list // ignore: cast_nullable_to_non_nullable - as EarthquakeHistoryListConfig, - detail: null == detail - ? _value.detail - : detail // ignore: cast_nullable_to_non_nullable - as EarthquakeHistoryDetailConfig, - )); + $Res call({Object? list = null, Object? detail = null}) { + return _then( + _$EarthquakeHistoryConfigModelImpl( + list: + null == list + ? _value.list + : list // ignore: cast_nullable_to_non_nullable + as EarthquakeHistoryListConfig, + detail: + null == detail + ? _value.detail + : detail // ignore: cast_nullable_to_non_nullable + as EarthquakeHistoryDetailConfig, + ), + ); } } @@ -155,12 +172,14 @@ class __$$EarthquakeHistoryConfigModelImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeHistoryConfigModelImpl implements _EarthquakeHistoryConfigModel { - const _$EarthquakeHistoryConfigModelImpl( - {required this.list, required this.detail}); + const _$EarthquakeHistoryConfigModelImpl({ + required this.list, + required this.detail, + }); factory _$EarthquakeHistoryConfigModelImpl.fromJson( - Map json) => - _$$EarthquakeHistoryConfigModelImplFromJson(json); + Map json, + ) => _$$EarthquakeHistoryConfigModelImplFromJson(json); @override final EarthquakeHistoryListConfig list; @@ -191,24 +210,24 @@ class _$EarthquakeHistoryConfigModelImpl @override @pragma('vm:prefer-inline') _$$EarthquakeHistoryConfigModelImplCopyWith< - _$EarthquakeHistoryConfigModelImpl> - get copyWith => __$$EarthquakeHistoryConfigModelImplCopyWithImpl< - _$EarthquakeHistoryConfigModelImpl>(this, _$identity); + _$EarthquakeHistoryConfigModelImpl + > + get copyWith => __$$EarthquakeHistoryConfigModelImplCopyWithImpl< + _$EarthquakeHistoryConfigModelImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeHistoryConfigModelImplToJson( - this, - ); + return _$$EarthquakeHistoryConfigModelImplToJson(this); } } abstract class _EarthquakeHistoryConfigModel implements EarthquakeHistoryConfigModel { - const factory _EarthquakeHistoryConfigModel( - {required final EarthquakeHistoryListConfig list, - required final EarthquakeHistoryDetailConfig detail}) = - _$EarthquakeHistoryConfigModelImpl; + const factory _EarthquakeHistoryConfigModel({ + required final EarthquakeHistoryListConfig list, + required final EarthquakeHistoryDetailConfig detail, + }) = _$EarthquakeHistoryConfigModelImpl; factory _EarthquakeHistoryConfigModel.fromJson(Map json) = _$EarthquakeHistoryConfigModelImpl.fromJson; @@ -223,12 +242,14 @@ abstract class _EarthquakeHistoryConfigModel @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHistoryConfigModelImplCopyWith< - _$EarthquakeHistoryConfigModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$EarthquakeHistoryConfigModelImpl + > + get copyWith => throw _privateConstructorUsedError; } EarthquakeHistoryListConfig _$EarthquakeHistoryListConfigFromJson( - Map json) { + Map json, +) { return _EarthquakeHistoryListConfig.fromJson(json); } @@ -247,23 +268,28 @@ mixin _$EarthquakeHistoryListConfig { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHistoryListConfigCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHistoryListConfigCopyWith<$Res> { factory $EarthquakeHistoryListConfigCopyWith( - EarthquakeHistoryListConfig value, - $Res Function(EarthquakeHistoryListConfig) then) = - _$EarthquakeHistoryListConfigCopyWithImpl<$Res, - EarthquakeHistoryListConfig>; + EarthquakeHistoryListConfig value, + $Res Function(EarthquakeHistoryListConfig) then, + ) = + _$EarthquakeHistoryListConfigCopyWithImpl< + $Res, + EarthquakeHistoryListConfig + >; @useResult $Res call({bool isFillBackground, bool includeTestTelegrams}); } /// @nodoc -class _$EarthquakeHistoryListConfigCopyWithImpl<$Res, - $Val extends EarthquakeHistoryListConfig> +class _$EarthquakeHistoryListConfigCopyWithImpl< + $Res, + $Val extends EarthquakeHistoryListConfig +> implements $EarthquakeHistoryListConfigCopyWith<$Res> { _$EarthquakeHistoryListConfigCopyWithImpl(this._value, this._then); @@ -280,16 +306,21 @@ class _$EarthquakeHistoryListConfigCopyWithImpl<$Res, Object? isFillBackground = null, Object? includeTestTelegrams = null, }) { - return _then(_value.copyWith( - isFillBackground: null == isFillBackground - ? _value.isFillBackground - : isFillBackground // ignore: cast_nullable_to_non_nullable - as bool, - includeTestTelegrams: null == includeTestTelegrams - ? _value.includeTestTelegrams - : includeTestTelegrams // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + isFillBackground: + null == isFillBackground + ? _value.isFillBackground + : isFillBackground // ignore: cast_nullable_to_non_nullable + as bool, + includeTestTelegrams: + null == includeTestTelegrams + ? _value.includeTestTelegrams + : includeTestTelegrams // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } @@ -297,9 +328,9 @@ class _$EarthquakeHistoryListConfigCopyWithImpl<$Res, abstract class _$$EarthquakeHistoryListConfigImplCopyWith<$Res> implements $EarthquakeHistoryListConfigCopyWith<$Res> { factory _$$EarthquakeHistoryListConfigImplCopyWith( - _$EarthquakeHistoryListConfigImpl value, - $Res Function(_$EarthquakeHistoryListConfigImpl) then) = - __$$EarthquakeHistoryListConfigImplCopyWithImpl<$Res>; + _$EarthquakeHistoryListConfigImpl value, + $Res Function(_$EarthquakeHistoryListConfigImpl) then, + ) = __$$EarthquakeHistoryListConfigImplCopyWithImpl<$Res>; @override @useResult $Res call({bool isFillBackground, bool includeTestTelegrams}); @@ -307,13 +338,16 @@ abstract class _$$EarthquakeHistoryListConfigImplCopyWith<$Res> /// @nodoc class __$$EarthquakeHistoryListConfigImplCopyWithImpl<$Res> - extends _$EarthquakeHistoryListConfigCopyWithImpl<$Res, - _$EarthquakeHistoryListConfigImpl> + extends + _$EarthquakeHistoryListConfigCopyWithImpl< + $Res, + _$EarthquakeHistoryListConfigImpl + > implements _$$EarthquakeHistoryListConfigImplCopyWith<$Res> { __$$EarthquakeHistoryListConfigImplCopyWithImpl( - _$EarthquakeHistoryListConfigImpl _value, - $Res Function(_$EarthquakeHistoryListConfigImpl) _then) - : super(_value, _then); + _$EarthquakeHistoryListConfigImpl _value, + $Res Function(_$EarthquakeHistoryListConfigImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHistoryListConfig /// with the given fields replaced by the non-null parameter values. @@ -323,16 +357,20 @@ class __$$EarthquakeHistoryListConfigImplCopyWithImpl<$Res> Object? isFillBackground = null, Object? includeTestTelegrams = null, }) { - return _then(_$EarthquakeHistoryListConfigImpl( - isFillBackground: null == isFillBackground - ? _value.isFillBackground - : isFillBackground // ignore: cast_nullable_to_non_nullable - as bool, - includeTestTelegrams: null == includeTestTelegrams - ? _value.includeTestTelegrams - : includeTestTelegrams // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$EarthquakeHistoryListConfigImpl( + isFillBackground: + null == isFillBackground + ? _value.isFillBackground + : isFillBackground // ignore: cast_nullable_to_non_nullable + as bool, + includeTestTelegrams: + null == includeTestTelegrams + ? _value.includeTestTelegrams + : includeTestTelegrams // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } @@ -340,12 +378,14 @@ class __$$EarthquakeHistoryListConfigImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeHistoryListConfigImpl implements _EarthquakeHistoryListConfig { - const _$EarthquakeHistoryListConfigImpl( - {this.isFillBackground = true, this.includeTestTelegrams = false}); + const _$EarthquakeHistoryListConfigImpl({ + this.isFillBackground = true, + this.includeTestTelegrams = false, + }); factory _$EarthquakeHistoryListConfigImpl.fromJson( - Map json) => - _$$EarthquakeHistoryListConfigImplFromJson(json); + Map json, + ) => _$$EarthquakeHistoryListConfigImplFromJson(json); /// 背景塗りつぶしの有無 @override @@ -384,22 +424,22 @@ class _$EarthquakeHistoryListConfigImpl @override @pragma('vm:prefer-inline') _$$EarthquakeHistoryListConfigImplCopyWith<_$EarthquakeHistoryListConfigImpl> - get copyWith => __$$EarthquakeHistoryListConfigImplCopyWithImpl< - _$EarthquakeHistoryListConfigImpl>(this, _$identity); + get copyWith => __$$EarthquakeHistoryListConfigImplCopyWithImpl< + _$EarthquakeHistoryListConfigImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeHistoryListConfigImplToJson( - this, - ); + return _$$EarthquakeHistoryListConfigImplToJson(this); } } abstract class _EarthquakeHistoryListConfig implements EarthquakeHistoryListConfig { - const factory _EarthquakeHistoryListConfig( - {final bool isFillBackground, - final bool includeTestTelegrams}) = _$EarthquakeHistoryListConfigImpl; + const factory _EarthquakeHistoryListConfig({ + final bool isFillBackground, + final bool includeTestTelegrams, + }) = _$EarthquakeHistoryListConfigImpl; factory _EarthquakeHistoryListConfig.fromJson(Map json) = _$EarthquakeHistoryListConfigImpl.fromJson; @@ -417,11 +457,12 @@ abstract class _EarthquakeHistoryListConfig @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHistoryListConfigImplCopyWith<_$EarthquakeHistoryListConfigImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } EarthquakeHistoryDetailConfig _$EarthquakeHistoryDetailConfigFromJson( - Map json) { + Map json, +) { return _EarthquakeHistoryDetailConfig.fromJson(json); } @@ -443,26 +484,32 @@ mixin _$EarthquakeHistoryDetailConfig { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHistoryDetailConfigCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHistoryDetailConfigCopyWith<$Res> { factory $EarthquakeHistoryDetailConfigCopyWith( - EarthquakeHistoryDetailConfig value, - $Res Function(EarthquakeHistoryDetailConfig) then) = - _$EarthquakeHistoryDetailConfigCopyWithImpl<$Res, - EarthquakeHistoryDetailConfig>; + EarthquakeHistoryDetailConfig value, + $Res Function(EarthquakeHistoryDetailConfig) then, + ) = + _$EarthquakeHistoryDetailConfigCopyWithImpl< + $Res, + EarthquakeHistoryDetailConfig + >; @useResult - $Res call( - {IntensityFillMode intensityFillMode, - bool showIntensityIcon, - bool showingLpgmIntensity}); + $Res call({ + IntensityFillMode intensityFillMode, + bool showIntensityIcon, + bool showingLpgmIntensity, + }); } /// @nodoc -class _$EarthquakeHistoryDetailConfigCopyWithImpl<$Res, - $Val extends EarthquakeHistoryDetailConfig> +class _$EarthquakeHistoryDetailConfigCopyWithImpl< + $Res, + $Val extends EarthquakeHistoryDetailConfig +> implements $EarthquakeHistoryDetailConfigCopyWith<$Res> { _$EarthquakeHistoryDetailConfigCopyWithImpl(this._value, this._then); @@ -480,20 +527,26 @@ class _$EarthquakeHistoryDetailConfigCopyWithImpl<$Res, Object? showIntensityIcon = null, Object? showingLpgmIntensity = null, }) { - return _then(_value.copyWith( - intensityFillMode: null == intensityFillMode - ? _value.intensityFillMode - : intensityFillMode // ignore: cast_nullable_to_non_nullable - as IntensityFillMode, - showIntensityIcon: null == showIntensityIcon - ? _value.showIntensityIcon - : showIntensityIcon // ignore: cast_nullable_to_non_nullable - as bool, - showingLpgmIntensity: null == showingLpgmIntensity - ? _value.showingLpgmIntensity - : showingLpgmIntensity // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + intensityFillMode: + null == intensityFillMode + ? _value.intensityFillMode + : intensityFillMode // ignore: cast_nullable_to_non_nullable + as IntensityFillMode, + showIntensityIcon: + null == showIntensityIcon + ? _value.showIntensityIcon + : showIntensityIcon // ignore: cast_nullable_to_non_nullable + as bool, + showingLpgmIntensity: + null == showingLpgmIntensity + ? _value.showingLpgmIntensity + : showingLpgmIntensity // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } @@ -501,26 +554,30 @@ class _$EarthquakeHistoryDetailConfigCopyWithImpl<$Res, abstract class _$$EarthquakeHistoryDetailConfigImplCopyWith<$Res> implements $EarthquakeHistoryDetailConfigCopyWith<$Res> { factory _$$EarthquakeHistoryDetailConfigImplCopyWith( - _$EarthquakeHistoryDetailConfigImpl value, - $Res Function(_$EarthquakeHistoryDetailConfigImpl) then) = - __$$EarthquakeHistoryDetailConfigImplCopyWithImpl<$Res>; + _$EarthquakeHistoryDetailConfigImpl value, + $Res Function(_$EarthquakeHistoryDetailConfigImpl) then, + ) = __$$EarthquakeHistoryDetailConfigImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {IntensityFillMode intensityFillMode, - bool showIntensityIcon, - bool showingLpgmIntensity}); + $Res call({ + IntensityFillMode intensityFillMode, + bool showIntensityIcon, + bool showingLpgmIntensity, + }); } /// @nodoc class __$$EarthquakeHistoryDetailConfigImplCopyWithImpl<$Res> - extends _$EarthquakeHistoryDetailConfigCopyWithImpl<$Res, - _$EarthquakeHistoryDetailConfigImpl> + extends + _$EarthquakeHistoryDetailConfigCopyWithImpl< + $Res, + _$EarthquakeHistoryDetailConfigImpl + > implements _$$EarthquakeHistoryDetailConfigImplCopyWith<$Res> { __$$EarthquakeHistoryDetailConfigImplCopyWithImpl( - _$EarthquakeHistoryDetailConfigImpl _value, - $Res Function(_$EarthquakeHistoryDetailConfigImpl) _then) - : super(_value, _then); + _$EarthquakeHistoryDetailConfigImpl _value, + $Res Function(_$EarthquakeHistoryDetailConfigImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHistoryDetailConfig /// with the given fields replaced by the non-null parameter values. @@ -531,20 +588,25 @@ class __$$EarthquakeHistoryDetailConfigImplCopyWithImpl<$Res> Object? showIntensityIcon = null, Object? showingLpgmIntensity = null, }) { - return _then(_$EarthquakeHistoryDetailConfigImpl( - intensityFillMode: null == intensityFillMode - ? _value.intensityFillMode - : intensityFillMode // ignore: cast_nullable_to_non_nullable - as IntensityFillMode, - showIntensityIcon: null == showIntensityIcon - ? _value.showIntensityIcon - : showIntensityIcon // ignore: cast_nullable_to_non_nullable - as bool, - showingLpgmIntensity: null == showingLpgmIntensity - ? _value.showingLpgmIntensity - : showingLpgmIntensity // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$EarthquakeHistoryDetailConfigImpl( + intensityFillMode: + null == intensityFillMode + ? _value.intensityFillMode + : intensityFillMode // ignore: cast_nullable_to_non_nullable + as IntensityFillMode, + showIntensityIcon: + null == showIntensityIcon + ? _value.showIntensityIcon + : showIntensityIcon // ignore: cast_nullable_to_non_nullable + as bool, + showingLpgmIntensity: + null == showingLpgmIntensity + ? _value.showingLpgmIntensity + : showingLpgmIntensity // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } @@ -552,14 +614,15 @@ class __$$EarthquakeHistoryDetailConfigImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeHistoryDetailConfigImpl implements _EarthquakeHistoryDetailConfig { - const _$EarthquakeHistoryDetailConfigImpl( - {this.intensityFillMode = IntensityFillMode.fillCity, - this.showIntensityIcon = true, - this.showingLpgmIntensity = false}); + const _$EarthquakeHistoryDetailConfigImpl({ + this.intensityFillMode = IntensityFillMode.fillCity, + this.showIntensityIcon = true, + this.showingLpgmIntensity = false, + }); factory _$EarthquakeHistoryDetailConfigImpl.fromJson( - Map json) => - _$$EarthquakeHistoryDetailConfigImplFromJson(json); + Map json, + ) => _$$EarthquakeHistoryDetailConfigImplFromJson(json); /// 震度の表示方法 @override @@ -597,7 +660,11 @@ class _$EarthquakeHistoryDetailConfigImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, intensityFillMode, showIntensityIcon, showingLpgmIntensity); + runtimeType, + intensityFillMode, + showIntensityIcon, + showingLpgmIntensity, + ); /// Create a copy of EarthquakeHistoryDetailConfig /// with the given fields replaced by the non-null parameter values. @@ -605,24 +672,25 @@ class _$EarthquakeHistoryDetailConfigImpl @override @pragma('vm:prefer-inline') _$$EarthquakeHistoryDetailConfigImplCopyWith< - _$EarthquakeHistoryDetailConfigImpl> - get copyWith => __$$EarthquakeHistoryDetailConfigImplCopyWithImpl< - _$EarthquakeHistoryDetailConfigImpl>(this, _$identity); + _$EarthquakeHistoryDetailConfigImpl + > + get copyWith => __$$EarthquakeHistoryDetailConfigImplCopyWithImpl< + _$EarthquakeHistoryDetailConfigImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeHistoryDetailConfigImplToJson( - this, - ); + return _$$EarthquakeHistoryDetailConfigImplToJson(this); } } abstract class _EarthquakeHistoryDetailConfig implements EarthquakeHistoryDetailConfig { - const factory _EarthquakeHistoryDetailConfig( - {final IntensityFillMode intensityFillMode, - final bool showIntensityIcon, - final bool showingLpgmIntensity}) = _$EarthquakeHistoryDetailConfigImpl; + const factory _EarthquakeHistoryDetailConfig({ + final IntensityFillMode intensityFillMode, + final bool showIntensityIcon, + final bool showingLpgmIntensity, + }) = _$EarthquakeHistoryDetailConfigImpl; factory _EarthquakeHistoryDetailConfig.fromJson(Map json) = _$EarthquakeHistoryDetailConfigImpl.fromJson; @@ -644,6 +712,7 @@ abstract class _EarthquakeHistoryDetailConfig @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHistoryDetailConfigImplCopyWith< - _$EarthquakeHistoryDetailConfigImpl> - get copyWith => throw _privateConstructorUsedError; + _$EarthquakeHistoryDetailConfigImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.g.dart b/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.g.dart index 72704ffe..90cc478c 100644 --- a/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.g.dart +++ b/app/lib/core/provider/config/earthquake_history/model/earthquake_history_config_model.g.dart @@ -9,93 +9,97 @@ part of 'earthquake_history_config_model.dart'; // ************************************************************************** _$EarthquakeHistoryConfigModelImpl _$$EarthquakeHistoryConfigModelImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeHistoryConfigModelImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeHistoryConfigModelImpl( - list: $checkedConvert( - 'list', - (v) => EarthquakeHistoryListConfig.fromJson( - v as Map)), - detail: $checkedConvert( - 'detail', - (v) => EarthquakeHistoryDetailConfig.fromJson( - v as Map)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EarthquakeHistoryConfigModelImpl', json, ( + $checkedConvert, +) { + final val = _$EarthquakeHistoryConfigModelImpl( + list: $checkedConvert( + 'list', + (v) => EarthquakeHistoryListConfig.fromJson(v as Map), + ), + detail: $checkedConvert( + 'detail', + (v) => EarthquakeHistoryDetailConfig.fromJson(v as Map), + ), + ); + return val; +}); Map _$$EarthquakeHistoryConfigModelImplToJson( - _$EarthquakeHistoryConfigModelImpl instance) => - { - 'list': instance.list, - 'detail': instance.detail, - }; + _$EarthquakeHistoryConfigModelImpl instance, +) => {'list': instance.list, 'detail': instance.detail}; _$EarthquakeHistoryListConfigImpl _$$EarthquakeHistoryListConfigImplFromJson( - Map json) => + Map json, +) => $checkedCreate( + r'_$EarthquakeHistoryListConfigImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeHistoryListConfigImpl( + isFillBackground: $checkedConvert( + 'is_fill_background', + (v) => v as bool? ?? true, + ), + includeTestTelegrams: $checkedConvert( + 'include_test_telegrams', + (v) => v as bool? ?? false, + ), + ); + return val; + }, + fieldKeyMap: const { + 'isFillBackground': 'is_fill_background', + 'includeTestTelegrams': 'include_test_telegrams', + }, +); + +Map _$$EarthquakeHistoryListConfigImplToJson( + _$EarthquakeHistoryListConfigImpl instance, +) => { + 'is_fill_background': instance.isFillBackground, + 'include_test_telegrams': instance.includeTestTelegrams, +}; + +_$EarthquakeHistoryDetailConfigImpl +_$$EarthquakeHistoryDetailConfigImplFromJson(Map json) => $checkedCreate( - r'_$EarthquakeHistoryListConfigImpl', + r'_$EarthquakeHistoryDetailConfigImpl', json, ($checkedConvert) { - final val = _$EarthquakeHistoryListConfigImpl( - isFillBackground: - $checkedConvert('is_fill_background', (v) => v as bool? ?? true), - includeTestTelegrams: $checkedConvert( - 'include_test_telegrams', (v) => v as bool? ?? false), + final val = _$EarthquakeHistoryDetailConfigImpl( + intensityFillMode: $checkedConvert( + 'intensity_fill_mode', + (v) => + $enumDecodeNullable(_$IntensityFillModeEnumMap, v) ?? + IntensityFillMode.fillCity, + ), + showIntensityIcon: $checkedConvert( + 'show_intensity_icon', + (v) => v as bool? ?? true, + ), + showingLpgmIntensity: $checkedConvert( + 'showing_lpgm_intensity', + (v) => v as bool? ?? false, + ), ); return val; }, fieldKeyMap: const { - 'isFillBackground': 'is_fill_background', - 'includeTestTelegrams': 'include_test_telegrams' + 'intensityFillMode': 'intensity_fill_mode', + 'showIntensityIcon': 'show_intensity_icon', + 'showingLpgmIntensity': 'showing_lpgm_intensity', }, ); -Map _$$EarthquakeHistoryListConfigImplToJson( - _$EarthquakeHistoryListConfigImpl instance) => - { - 'is_fill_background': instance.isFillBackground, - 'include_test_telegrams': instance.includeTestTelegrams, - }; - -_$EarthquakeHistoryDetailConfigImpl - _$$EarthquakeHistoryDetailConfigImplFromJson(Map json) => - $checkedCreate( - r'_$EarthquakeHistoryDetailConfigImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeHistoryDetailConfigImpl( - intensityFillMode: $checkedConvert( - 'intensity_fill_mode', - (v) => - $enumDecodeNullable(_$IntensityFillModeEnumMap, v) ?? - IntensityFillMode.fillCity), - showIntensityIcon: $checkedConvert( - 'show_intensity_icon', (v) => v as bool? ?? true), - showingLpgmIntensity: $checkedConvert( - 'showing_lpgm_intensity', (v) => v as bool? ?? false), - ); - return val; - }, - fieldKeyMap: const { - 'intensityFillMode': 'intensity_fill_mode', - 'showIntensityIcon': 'show_intensity_icon', - 'showingLpgmIntensity': 'showing_lpgm_intensity' - }, - ); - Map _$$EarthquakeHistoryDetailConfigImplToJson( - _$EarthquakeHistoryDetailConfigImpl instance) => - { - 'intensity_fill_mode': - _$IntensityFillModeEnumMap[instance.intensityFillMode]!, - 'show_intensity_icon': instance.showIntensityIcon, - 'showing_lpgm_intensity': instance.showingLpgmIntensity, - }; + _$EarthquakeHistoryDetailConfigImpl instance, +) => { + 'intensity_fill_mode': + _$IntensityFillModeEnumMap[instance.intensityFillMode]!, + 'show_intensity_icon': instance.showIntensityIcon, + 'showing_lpgm_intensity': instance.showingLpgmIntensity, +}; const _$IntensityFillModeEnumMap = { IntensityFillMode.fillCity: 'fillCity', diff --git a/app/lib/core/provider/config/notification/fcm_topic_manager.dart b/app/lib/core/provider/config/notification/fcm_topic_manager.dart index 807e8e64..fbbadc1f 100644 --- a/app/lib/core/provider/config/notification/fcm_topic_manager.dart +++ b/app/lib/core/provider/config/notification/fcm_topic_manager.dart @@ -29,10 +29,9 @@ class FcmTopicManager extends _$FcmTopicManager { state = [...state]..remove(topic.topic); return Result.success(null); } on Exception catch (error, stackTrace) { - await ref.read(firebaseCrashlyticsProvider).recordError( - error, - stackTrace, - ); + await ref + .read(firebaseCrashlyticsProvider) + .recordError(error, stackTrace); return Result.failure(error); } } @@ -72,7 +71,7 @@ class FcmEarthquakeTopic implements FcmTopic { String get topic { final suffix = intensity?.type.replaceAll('-', 'lower').replaceAll('+', 'upper') ?? - 'all'; + 'all'; return 'earthquake_$suffix'; } } @@ -80,8 +79,7 @@ class FcmEarthquakeTopic implements FcmTopic { enum FcmTopics { all('all'), notice('notice'), - vzse40('vzse40'), - ; + vzse40('vzse40'); const FcmTopics(this.topic); final String topic; diff --git a/app/lib/core/provider/config/notification/fcm_topic_manager.g.dart b/app/lib/core/provider/config/notification/fcm_topic_manager.g.dart index ec80d30f..b6830d36 100644 --- a/app/lib/core/provider/config/notification/fcm_topic_manager.g.dart +++ b/app/lib/core/provider/config/notification/fcm_topic_manager.g.dart @@ -14,14 +14,15 @@ String _$fcmTopicManagerHash() => r'967211da3f9d8def37c763112c042f64e6fa3c91'; @ProviderFor(FcmTopicManager) final fcmTopicManagerProvider = NotifierProvider>.internal( - FcmTopicManager.new, - name: r'fcmTopicManagerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$fcmTopicManagerHash, - dependencies: null, - allTransitiveDependencies: null, -); + FcmTopicManager.new, + name: r'fcmTopicManagerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$fcmTopicManagerHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$FcmTopicManager = Notifier>; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/config/permission/model/permission_state.freezed.dart b/app/lib/core/provider/config/permission/model/permission_state.freezed.dart index 18cb77c0..faf196fe 100644 --- a/app/lib/core/provider/config/permission/model/permission_state.freezed.dart +++ b/app/lib/core/provider/config/permission/model/permission_state.freezed.dart @@ -12,7 +12,8 @@ part of 'permission_state.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); PermissionStateModel _$PermissionStateModelFromJson(Map json) { return _PermissionStateModel.fromJson(json); @@ -37,20 +38,24 @@ mixin _$PermissionStateModel { /// @nodoc abstract class $PermissionStateModelCopyWith<$Res> { - factory $PermissionStateModelCopyWith(PermissionStateModel value, - $Res Function(PermissionStateModel) then) = - _$PermissionStateModelCopyWithImpl<$Res, PermissionStateModel>; + factory $PermissionStateModelCopyWith( + PermissionStateModel value, + $Res Function(PermissionStateModel) then, + ) = _$PermissionStateModelCopyWithImpl<$Res, PermissionStateModel>; @useResult - $Res call( - {bool notification, - bool criticalAlert, - bool location, - bool backgroundLocation}); + $Res call({ + bool notification, + bool criticalAlert, + bool location, + bool backgroundLocation, + }); } /// @nodoc -class _$PermissionStateModelCopyWithImpl<$Res, - $Val extends PermissionStateModel> +class _$PermissionStateModelCopyWithImpl< + $Res, + $Val extends PermissionStateModel +> implements $PermissionStateModelCopyWith<$Res> { _$PermissionStateModelCopyWithImpl(this._value, this._then); @@ -69,49 +74,59 @@ class _$PermissionStateModelCopyWithImpl<$Res, Object? location = null, Object? backgroundLocation = null, }) { - return _then(_value.copyWith( - notification: null == notification - ? _value.notification - : notification // ignore: cast_nullable_to_non_nullable - as bool, - criticalAlert: null == criticalAlert - ? _value.criticalAlert - : criticalAlert // ignore: cast_nullable_to_non_nullable - as bool, - location: null == location - ? _value.location - : location // ignore: cast_nullable_to_non_nullable - as bool, - backgroundLocation: null == backgroundLocation - ? _value.backgroundLocation - : backgroundLocation // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + notification: + null == notification + ? _value.notification + : notification // ignore: cast_nullable_to_non_nullable + as bool, + criticalAlert: + null == criticalAlert + ? _value.criticalAlert + : criticalAlert // ignore: cast_nullable_to_non_nullable + as bool, + location: + null == location + ? _value.location + : location // ignore: cast_nullable_to_non_nullable + as bool, + backgroundLocation: + null == backgroundLocation + ? _value.backgroundLocation + : backgroundLocation // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } /// @nodoc abstract class _$$PermissionStateModelImplCopyWith<$Res> implements $PermissionStateModelCopyWith<$Res> { - factory _$$PermissionStateModelImplCopyWith(_$PermissionStateModelImpl value, - $Res Function(_$PermissionStateModelImpl) then) = - __$$PermissionStateModelImplCopyWithImpl<$Res>; + factory _$$PermissionStateModelImplCopyWith( + _$PermissionStateModelImpl value, + $Res Function(_$PermissionStateModelImpl) then, + ) = __$$PermissionStateModelImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {bool notification, - bool criticalAlert, - bool location, - bool backgroundLocation}); + $Res call({ + bool notification, + bool criticalAlert, + bool location, + bool backgroundLocation, + }); } /// @nodoc class __$$PermissionStateModelImplCopyWithImpl<$Res> extends _$PermissionStateModelCopyWithImpl<$Res, _$PermissionStateModelImpl> implements _$$PermissionStateModelImplCopyWith<$Res> { - __$$PermissionStateModelImplCopyWithImpl(_$PermissionStateModelImpl _value, - $Res Function(_$PermissionStateModelImpl) _then) - : super(_value, _then); + __$$PermissionStateModelImplCopyWithImpl( + _$PermissionStateModelImpl _value, + $Res Function(_$PermissionStateModelImpl) _then, + ) : super(_value, _then); /// Create a copy of PermissionStateModel /// with the given fields replaced by the non-null parameter values. @@ -123,35 +138,42 @@ class __$$PermissionStateModelImplCopyWithImpl<$Res> Object? location = null, Object? backgroundLocation = null, }) { - return _then(_$PermissionStateModelImpl( - notification: null == notification - ? _value.notification - : notification // ignore: cast_nullable_to_non_nullable - as bool, - criticalAlert: null == criticalAlert - ? _value.criticalAlert - : criticalAlert // ignore: cast_nullable_to_non_nullable - as bool, - location: null == location - ? _value.location - : location // ignore: cast_nullable_to_non_nullable - as bool, - backgroundLocation: null == backgroundLocation - ? _value.backgroundLocation - : backgroundLocation // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$PermissionStateModelImpl( + notification: + null == notification + ? _value.notification + : notification // ignore: cast_nullable_to_non_nullable + as bool, + criticalAlert: + null == criticalAlert + ? _value.criticalAlert + : criticalAlert // ignore: cast_nullable_to_non_nullable + as bool, + location: + null == location + ? _value.location + : location // ignore: cast_nullable_to_non_nullable + as bool, + backgroundLocation: + null == backgroundLocation + ? _value.backgroundLocation + : backgroundLocation // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } /// @nodoc @JsonSerializable() class _$PermissionStateModelImpl implements _PermissionStateModel { - const _$PermissionStateModelImpl( - {this.notification = false, - this.criticalAlert = false, - this.location = false, - this.backgroundLocation = false}); + const _$PermissionStateModelImpl({ + this.notification = false, + this.criticalAlert = false, + this.location = false, + this.backgroundLocation = false, + }); factory _$PermissionStateModelImpl.fromJson(Map json) => _$$PermissionStateModelImplFromJson(json); @@ -192,7 +214,12 @@ class _$PermissionStateModelImpl implements _PermissionStateModel { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, notification, criticalAlert, location, backgroundLocation); + runtimeType, + notification, + criticalAlert, + location, + backgroundLocation, + ); /// Create a copy of PermissionStateModel /// with the given fields replaced by the non-null parameter values. @@ -200,24 +227,25 @@ class _$PermissionStateModelImpl implements _PermissionStateModel { @override @pragma('vm:prefer-inline') _$$PermissionStateModelImplCopyWith<_$PermissionStateModelImpl> - get copyWith => - __$$PermissionStateModelImplCopyWithImpl<_$PermissionStateModelImpl>( - this, _$identity); + get copyWith => + __$$PermissionStateModelImplCopyWithImpl<_$PermissionStateModelImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$PermissionStateModelImplToJson( - this, - ); + return _$$PermissionStateModelImplToJson(this); } } abstract class _PermissionStateModel implements PermissionStateModel { - const factory _PermissionStateModel( - {final bool notification, - final bool criticalAlert, - final bool location, - final bool backgroundLocation}) = _$PermissionStateModelImpl; + const factory _PermissionStateModel({ + final bool notification, + final bool criticalAlert, + final bool location, + final bool backgroundLocation, + }) = _$PermissionStateModelImpl; factory _PermissionStateModel.fromJson(Map json) = _$PermissionStateModelImpl.fromJson; @@ -236,5 +264,5 @@ abstract class _PermissionStateModel implements PermissionStateModel { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$PermissionStateModelImplCopyWith<_$PermissionStateModelImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/core/provider/config/permission/model/permission_state.g.dart b/app/lib/core/provider/config/permission/model/permission_state.g.dart index 965358bd..8a7008a2 100644 --- a/app/lib/core/provider/config/permission/model/permission_state.g.dart +++ b/app/lib/core/provider/config/permission/model/permission_state.g.dart @@ -9,33 +9,36 @@ part of 'permission_state.dart'; // ************************************************************************** _$PermissionStateModelImpl _$$PermissionStateModelImplFromJson( - Map json) => - $checkedCreate( - r'_$PermissionStateModelImpl', - json, - ($checkedConvert) { - final val = _$PermissionStateModelImpl( - notification: - $checkedConvert('notification', (v) => v as bool? ?? false), - criticalAlert: - $checkedConvert('critical_alert', (v) => v as bool? ?? false), - location: $checkedConvert('location', (v) => v as bool? ?? false), - backgroundLocation: $checkedConvert( - 'background_location', (v) => v as bool? ?? false), - ); - return val; - }, - fieldKeyMap: const { - 'criticalAlert': 'critical_alert', - 'backgroundLocation': 'background_location' - }, + Map json, +) => $checkedCreate( + r'_$PermissionStateModelImpl', + json, + ($checkedConvert) { + final val = _$PermissionStateModelImpl( + notification: $checkedConvert('notification', (v) => v as bool? ?? false), + criticalAlert: $checkedConvert( + 'critical_alert', + (v) => v as bool? ?? false, + ), + location: $checkedConvert('location', (v) => v as bool? ?? false), + backgroundLocation: $checkedConvert( + 'background_location', + (v) => v as bool? ?? false, + ), ); + return val; + }, + fieldKeyMap: const { + 'criticalAlert': 'critical_alert', + 'backgroundLocation': 'background_location', + }, +); Map _$$PermissionStateModelImplToJson( - _$PermissionStateModelImpl instance) => - { - 'notification': instance.notification, - 'critical_alert': instance.criticalAlert, - 'location': instance.location, - 'background_location': instance.backgroundLocation, - }; + _$PermissionStateModelImpl instance, +) => { + 'notification': instance.notification, + 'critical_alert': instance.criticalAlert, + 'location': instance.location, + 'background_location': instance.backgroundLocation, +}; diff --git a/app/lib/core/provider/config/permission/permission_notifier.dart b/app/lib/core/provider/config/permission/permission_notifier.dart index 905bc127..0fdc2266 100644 --- a/app/lib/core/provider/config/permission/permission_notifier.dart +++ b/app/lib/core/provider/config/permission/permission_notifier.dart @@ -28,18 +28,15 @@ class PermissionNotifier extends _$PermissionNotifier { await ref.read(firebaseMessagingProvider).getNotificationSettings(); await ref .read(firebaseMessagingProvider) - .setForegroundNotificationPresentationOptions( - alert: true, - badge: true, - ); + .setForegroundNotificationPresentationOptions(alert: true, badge: true); state = PermissionStateModel( notification: switch (notificationPermission.authorizationStatus) { AuthorizationStatus.authorized || - AuthorizationStatus.provisional => - true, + AuthorizationStatus.provisional => true, _ => false, }, - criticalAlert: notificationPermission.criticalAlert == + criticalAlert: + notificationPermission.criticalAlert == AppleNotificationSetting.enabled, backgroundLocation: await Permission.locationAlways.status == PermissionStatus.granted, @@ -54,7 +51,9 @@ class PermissionNotifier extends _$PermissionNotifier { } Future requestNotificationPermission() async { - final result = await ref.read(firebaseMessagingProvider).requestPermission( + final result = await ref + .read(firebaseMessagingProvider) + .requestPermission( announcement: true, criticalAlert: true, carPlay: true, diff --git a/app/lib/core/provider/config/permission/permission_notifier.g.dart b/app/lib/core/provider/config/permission/permission_notifier.g.dart index 72d4368c..38bfd43f 100644 --- a/app/lib/core/provider/config/permission/permission_notifier.g.dart +++ b/app/lib/core/provider/config/permission/permission_notifier.g.dart @@ -15,14 +15,15 @@ String _$permissionNotifierHash() => @ProviderFor(PermissionNotifier) final permissionNotifierProvider = NotifierProvider.internal( - PermissionNotifier.new, - name: r'permissionNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$permissionNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + PermissionNotifier.new, + name: r'permissionNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$permissionNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$PermissionNotifier = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.dart b/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.dart index f9c5449b..bbf9549c 100644 --- a/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.dart +++ b/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.dart @@ -23,10 +23,9 @@ class IntensityColor extends _$IntensityColor { Future update(IntensityColorModel model) async { state = model; - await ref.read(sharedPreferencesProvider).setString( - _key, - jsonEncode(model.toJson()), - ); + await ref + .read(sharedPreferencesProvider) + .setString(_key, jsonEncode(model.toJson())); } IntensityColorModel? load() { diff --git a/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.g.dart b/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.g.dart index 0bc27c1c..7f3f60fe 100644 --- a/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.g.dart +++ b/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.g.dart @@ -14,14 +14,15 @@ String _$intensityColorHash() => r'9c5f1148d0001d84e37f1a0bb14d65cdaee14795'; @ProviderFor(IntensityColor) final intensityColorProvider = NotifierProvider.internal( - IntensityColor.new, - name: r'intensityColorProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$intensityColorHash, - dependencies: null, - allTransitiveDependencies: null, -); + IntensityColor.new, + name: r'intensityColorProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$intensityColorHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$IntensityColor = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.dart b/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.dart index 6d752898..279b7043 100644 --- a/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.dart +++ b/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.dart @@ -40,160 +40,156 @@ class IntensityColorModel with _$IntensityColorModel { required Color sixLower, required Color sixUpper, required Color seven, - }) => - IntensityColorModel( - unknown: TextColorModel.fromBackground(unknwon), - zero: TextColorModel.fromBackground(zero), - one: TextColorModel.fromBackground(one), - two: TextColorModel.fromBackground(two), - three: TextColorModel.fromBackground(three), - four: TextColorModel.fromBackground(four), - fiveLower: TextColorModel.fromBackground(fiveLower), - fiveUpper: TextColorModel.fromBackground(fiveUpper), - sixLower: TextColorModel.fromBackground(sixLower), - sixUpper: TextColorModel.fromBackground(sixUpper), - seven: TextColorModel.fromBackground(seven), - ); + }) => IntensityColorModel( + unknown: TextColorModel.fromBackground(unknwon), + zero: TextColorModel.fromBackground(zero), + one: TextColorModel.fromBackground(one), + two: TextColorModel.fromBackground(two), + three: TextColorModel.fromBackground(three), + four: TextColorModel.fromBackground(four), + fiveLower: TextColorModel.fromBackground(fiveLower), + fiveUpper: TextColorModel.fromBackground(fiveUpper), + sixLower: TextColorModel.fromBackground(sixLower), + sixUpper: TextColorModel.fromBackground(sixUpper), + seven: TextColorModel.fromBackground(seven), + ); factory IntensityColorModel.jma() => const IntensityColorModel( - zero: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 255, 255, 255), - ), - one: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 242, 242, 242), - ), - two: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 0, 170, 255), - ), - three: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 0, 65, 255), - ), - four: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 250, 230, 160), - ), - fiveLower: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 255, 230, 0), - ), - fiveUpper: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 255, 153, 0), - ), - sixLower: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 255, 40, 0), - ), - sixUpper: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 165, 0, 33), - ), - seven: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 180, 0, 104), - ), - unknown: TextColorModel( - foreground: Colors.white, - background: Colors.black, - ), - ); + zero: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 255, 255, 255), + ), + one: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 242, 242, 242), + ), + two: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 0, 170, 255), + ), + three: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 0, 65, 255), + ), + four: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 250, 230, 160), + ), + fiveLower: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 255, 230, 0), + ), + fiveUpper: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 255, 153, 0), + ), + sixLower: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 255, 40, 0), + ), + sixUpper: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 165, 0, 33), + ), + seven: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 180, 0, 104), + ), + unknown: TextColorModel(foreground: Colors.white, background: Colors.black), + ); factory IntensityColorModel.eqmonitor() => IntensityColorModel( - zero: const TextColorModel( - foreground: Colors.black, - background: Colors.white, - ), - one: const TextColorModel( - foreground: Colors.black, - background: Colors.lightBlueAccent, - ), - two: TextColorModel( - foreground: Colors.black, - background: Colors.greenAccent.shade100, - ), - three: TextColorModel( - foreground: Colors.black, - background: Colors.greenAccent.shade700, - ), - four: TextColorModel( - foreground: Colors.black, - background: Colors.yellow.shade400, - ), - fiveLower: const TextColorModel( - foreground: Colors.black, - background: Colors.amber, - ), - fiveUpper: TextColorModel( - foreground: Colors.black, - background: Colors.orange.shade800, - ), - sixLower: const TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 255, 40, 0), - ), - sixUpper: const TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 165, 0, 33), - ), - seven: const TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 200, 0, 255), - ), - unknown: const TextColorModel( - foreground: Colors.white, - background: Colors.black, - ), - ); + zero: const TextColorModel( + foreground: Colors.black, + background: Colors.white, + ), + one: const TextColorModel( + foreground: Colors.black, + background: Colors.lightBlueAccent, + ), + two: TextColorModel( + foreground: Colors.black, + background: Colors.greenAccent.shade100, + ), + three: TextColorModel( + foreground: Colors.black, + background: Colors.greenAccent.shade700, + ), + four: TextColorModel( + foreground: Colors.black, + background: Colors.yellow.shade400, + ), + fiveLower: const TextColorModel( + foreground: Colors.black, + background: Colors.amber, + ), + fiveUpper: TextColorModel( + foreground: Colors.black, + background: Colors.orange.shade800, + ), + sixLower: const TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 255, 40, 0), + ), + sixUpper: const TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 165, 0, 33), + ), + seven: const TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 200, 0, 255), + ), + unknown: const TextColorModel( + foreground: Colors.white, + background: Colors.black, + ), + ); factory IntensityColorModel.earthQuickly() => const IntensityColorModel( - zero: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 48, 48, 48), - ), - one: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 32, 80, 112), - ), - two: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 48, 143, 191), - ), - three: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 132, 211, 132), - ), - four: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 255, 231, 48), - ), - fiveLower: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 255, 160, 48), - ), - fiveUpper: TextColorModel( - foreground: Colors.black, - background: Color.fromARGB(255, 239, 100, 0), - ), - sixLower: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 207, 16, 16), - ), - sixUpper: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 112, 16, 16), - ), - seven: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 171, 32, 178), - ), - unknown: TextColorModel( - foreground: Colors.white, - background: Color.fromARGB(255, 47, 79, 79), - ), - ); + zero: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 48, 48, 48), + ), + one: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 32, 80, 112), + ), + two: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 48, 143, 191), + ), + three: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 132, 211, 132), + ), + four: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 255, 231, 48), + ), + fiveLower: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 255, 160, 48), + ), + fiveUpper: TextColorModel( + foreground: Colors.black, + background: Color.fromARGB(255, 239, 100, 0), + ), + sixLower: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 207, 16, 16), + ), + sixUpper: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 112, 16, 16), + ), + seven: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 171, 32, 178), + ), + unknown: TextColorModel( + foreground: Colors.white, + background: Color.fromARGB(255, 47, 79, 79), + ), + ); } @freezed @@ -209,10 +205,10 @@ class TextColorModel with _$TextColorModel { _$TextColorModelFromJson(json); factory TextColorModel.fromBackground(Color background) => TextColorModel( - foreground: - background.computeLuminance() > 0.5 ? Colors.black : Colors.white, - background: background, - ); + foreground: + background.computeLuminance() > 0.5 ? Colors.black : Colors.white, + background: background, + ); } extension IntensityColorModelExt on IntensityColorModel { @@ -240,9 +236,7 @@ extension IntensityColorModelExt on IntensityColorModel { } } - TextColorModel fromJmaLgIntensity( - JmaLgIntensity intensity, - ) => + TextColorModel fromJmaLgIntensity(JmaLgIntensity intensity) => switch (intensity) { JmaLgIntensity.zero => zero, JmaLgIntensity.one => three, @@ -251,9 +245,7 @@ extension IntensityColorModelExt on IntensityColorModel { JmaLgIntensity.four => seven, }; - TextColorModel fromJmaForecastIntensity( - JmaForecastIntensity intensity, - ) { + TextColorModel fromJmaForecastIntensity(JmaForecastIntensity intensity) { switch (intensity) { case JmaForecastIntensity.zero: return zero; @@ -280,9 +272,7 @@ extension IntensityColorModelExt on IntensityColorModel { } } - TextColorModel fromJmaForecastLgIntensity( - JmaForecastLgIntensity intensity, - ) => + TextColorModel fromJmaForecastLgIntensity(JmaForecastLgIntensity intensity) => switch (intensity) { JmaForecastLgIntensity.zero => zero, JmaForecastLgIntensity.one => three, @@ -295,9 +285,7 @@ extension IntensityColorModelExt on IntensityColorModel { Color colorFromJson(String color) => Color(int.parse(color, radix: 16)); String colorToJson(Color color) { - final sRgb = color.withValues( - colorSpace: ColorSpace.sRGB, - ); + final sRgb = color.withValues(colorSpace: ColorSpace.sRGB); final r = (sRgb.r * 255).toInt(); final g = (sRgb.g * 255).toInt(); final b = (sRgb.b * 255).toInt(); diff --git a/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.freezed.dart b/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.freezed.dart index 8f302f0f..39c3a578 100644 --- a/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.freezed.dart +++ b/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.freezed.dart @@ -12,7 +12,8 @@ part of 'intensity_color_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); IntensityColorModel _$IntensityColorModelFromJson(Map json) { return _IntensityColorModel.fromJson(json); @@ -45,21 +46,23 @@ mixin _$IntensityColorModel { /// @nodoc abstract class $IntensityColorModelCopyWith<$Res> { factory $IntensityColorModelCopyWith( - IntensityColorModel value, $Res Function(IntensityColorModel) then) = - _$IntensityColorModelCopyWithImpl<$Res, IntensityColorModel>; + IntensityColorModel value, + $Res Function(IntensityColorModel) then, + ) = _$IntensityColorModelCopyWithImpl<$Res, IntensityColorModel>; @useResult - $Res call( - {TextColorModel unknown, - TextColorModel zero, - TextColorModel one, - TextColorModel two, - TextColorModel three, - TextColorModel four, - TextColorModel fiveLower, - TextColorModel fiveUpper, - TextColorModel sixLower, - TextColorModel sixUpper, - TextColorModel seven}); + $Res call({ + TextColorModel unknown, + TextColorModel zero, + TextColorModel one, + TextColorModel two, + TextColorModel three, + TextColorModel four, + TextColorModel fiveLower, + TextColorModel fiveUpper, + TextColorModel sixLower, + TextColorModel sixUpper, + TextColorModel seven, + }); $TextColorModelCopyWith<$Res> get unknown; $TextColorModelCopyWith<$Res> get zero; @@ -101,52 +104,66 @@ class _$IntensityColorModelCopyWithImpl<$Res, $Val extends IntensityColorModel> Object? sixUpper = null, Object? seven = null, }) { - return _then(_value.copyWith( - unknown: null == unknown - ? _value.unknown - : unknown // ignore: cast_nullable_to_non_nullable - as TextColorModel, - zero: null == zero - ? _value.zero - : zero // ignore: cast_nullable_to_non_nullable - as TextColorModel, - one: null == one - ? _value.one - : one // ignore: cast_nullable_to_non_nullable - as TextColorModel, - two: null == two - ? _value.two - : two // ignore: cast_nullable_to_non_nullable - as TextColorModel, - three: null == three - ? _value.three - : three // ignore: cast_nullable_to_non_nullable - as TextColorModel, - four: null == four - ? _value.four - : four // ignore: cast_nullable_to_non_nullable - as TextColorModel, - fiveLower: null == fiveLower - ? _value.fiveLower - : fiveLower // ignore: cast_nullable_to_non_nullable - as TextColorModel, - fiveUpper: null == fiveUpper - ? _value.fiveUpper - : fiveUpper // ignore: cast_nullable_to_non_nullable - as TextColorModel, - sixLower: null == sixLower - ? _value.sixLower - : sixLower // ignore: cast_nullable_to_non_nullable - as TextColorModel, - sixUpper: null == sixUpper - ? _value.sixUpper - : sixUpper // ignore: cast_nullable_to_non_nullable - as TextColorModel, - seven: null == seven - ? _value.seven - : seven // ignore: cast_nullable_to_non_nullable - as TextColorModel, - ) as $Val); + return _then( + _value.copyWith( + unknown: + null == unknown + ? _value.unknown + : unknown // ignore: cast_nullable_to_non_nullable + as TextColorModel, + zero: + null == zero + ? _value.zero + : zero // ignore: cast_nullable_to_non_nullable + as TextColorModel, + one: + null == one + ? _value.one + : one // ignore: cast_nullable_to_non_nullable + as TextColorModel, + two: + null == two + ? _value.two + : two // ignore: cast_nullable_to_non_nullable + as TextColorModel, + three: + null == three + ? _value.three + : three // ignore: cast_nullable_to_non_nullable + as TextColorModel, + four: + null == four + ? _value.four + : four // ignore: cast_nullable_to_non_nullable + as TextColorModel, + fiveLower: + null == fiveLower + ? _value.fiveLower + : fiveLower // ignore: cast_nullable_to_non_nullable + as TextColorModel, + fiveUpper: + null == fiveUpper + ? _value.fiveUpper + : fiveUpper // ignore: cast_nullable_to_non_nullable + as TextColorModel, + sixLower: + null == sixLower + ? _value.sixLower + : sixLower // ignore: cast_nullable_to_non_nullable + as TextColorModel, + sixUpper: + null == sixUpper + ? _value.sixUpper + : sixUpper // ignore: cast_nullable_to_non_nullable + as TextColorModel, + seven: + null == seven + ? _value.seven + : seven // ignore: cast_nullable_to_non_nullable + as TextColorModel, + ) + as $Val, + ); } /// Create a copy of IntensityColorModel @@ -263,23 +280,25 @@ class _$IntensityColorModelCopyWithImpl<$Res, $Val extends IntensityColorModel> /// @nodoc abstract class _$$IntensityColorModelImplCopyWith<$Res> implements $IntensityColorModelCopyWith<$Res> { - factory _$$IntensityColorModelImplCopyWith(_$IntensityColorModelImpl value, - $Res Function(_$IntensityColorModelImpl) then) = - __$$IntensityColorModelImplCopyWithImpl<$Res>; + factory _$$IntensityColorModelImplCopyWith( + _$IntensityColorModelImpl value, + $Res Function(_$IntensityColorModelImpl) then, + ) = __$$IntensityColorModelImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {TextColorModel unknown, - TextColorModel zero, - TextColorModel one, - TextColorModel two, - TextColorModel three, - TextColorModel four, - TextColorModel fiveLower, - TextColorModel fiveUpper, - TextColorModel sixLower, - TextColorModel sixUpper, - TextColorModel seven}); + $Res call({ + TextColorModel unknown, + TextColorModel zero, + TextColorModel one, + TextColorModel two, + TextColorModel three, + TextColorModel four, + TextColorModel fiveLower, + TextColorModel fiveUpper, + TextColorModel sixLower, + TextColorModel sixUpper, + TextColorModel seven, + }); @override $TextColorModelCopyWith<$Res> get unknown; @@ -309,9 +328,10 @@ abstract class _$$IntensityColorModelImplCopyWith<$Res> class __$$IntensityColorModelImplCopyWithImpl<$Res> extends _$IntensityColorModelCopyWithImpl<$Res, _$IntensityColorModelImpl> implements _$$IntensityColorModelImplCopyWith<$Res> { - __$$IntensityColorModelImplCopyWithImpl(_$IntensityColorModelImpl _value, - $Res Function(_$IntensityColorModelImpl) _then) - : super(_value, _then); + __$$IntensityColorModelImplCopyWithImpl( + _$IntensityColorModelImpl _value, + $Res Function(_$IntensityColorModelImpl) _then, + ) : super(_value, _then); /// Create a copy of IntensityColorModel /// with the given fields replaced by the non-null parameter values. @@ -330,70 +350,84 @@ class __$$IntensityColorModelImplCopyWithImpl<$Res> Object? sixUpper = null, Object? seven = null, }) { - return _then(_$IntensityColorModelImpl( - unknown: null == unknown - ? _value.unknown - : unknown // ignore: cast_nullable_to_non_nullable - as TextColorModel, - zero: null == zero - ? _value.zero - : zero // ignore: cast_nullable_to_non_nullable - as TextColorModel, - one: null == one - ? _value.one - : one // ignore: cast_nullable_to_non_nullable - as TextColorModel, - two: null == two - ? _value.two - : two // ignore: cast_nullable_to_non_nullable - as TextColorModel, - three: null == three - ? _value.three - : three // ignore: cast_nullable_to_non_nullable - as TextColorModel, - four: null == four - ? _value.four - : four // ignore: cast_nullable_to_non_nullable - as TextColorModel, - fiveLower: null == fiveLower - ? _value.fiveLower - : fiveLower // ignore: cast_nullable_to_non_nullable - as TextColorModel, - fiveUpper: null == fiveUpper - ? _value.fiveUpper - : fiveUpper // ignore: cast_nullable_to_non_nullable - as TextColorModel, - sixLower: null == sixLower - ? _value.sixLower - : sixLower // ignore: cast_nullable_to_non_nullable - as TextColorModel, - sixUpper: null == sixUpper - ? _value.sixUpper - : sixUpper // ignore: cast_nullable_to_non_nullable - as TextColorModel, - seven: null == seven - ? _value.seven - : seven // ignore: cast_nullable_to_non_nullable - as TextColorModel, - )); + return _then( + _$IntensityColorModelImpl( + unknown: + null == unknown + ? _value.unknown + : unknown // ignore: cast_nullable_to_non_nullable + as TextColorModel, + zero: + null == zero + ? _value.zero + : zero // ignore: cast_nullable_to_non_nullable + as TextColorModel, + one: + null == one + ? _value.one + : one // ignore: cast_nullable_to_non_nullable + as TextColorModel, + two: + null == two + ? _value.two + : two // ignore: cast_nullable_to_non_nullable + as TextColorModel, + three: + null == three + ? _value.three + : three // ignore: cast_nullable_to_non_nullable + as TextColorModel, + four: + null == four + ? _value.four + : four // ignore: cast_nullable_to_non_nullable + as TextColorModel, + fiveLower: + null == fiveLower + ? _value.fiveLower + : fiveLower // ignore: cast_nullable_to_non_nullable + as TextColorModel, + fiveUpper: + null == fiveUpper + ? _value.fiveUpper + : fiveUpper // ignore: cast_nullable_to_non_nullable + as TextColorModel, + sixLower: + null == sixLower + ? _value.sixLower + : sixLower // ignore: cast_nullable_to_non_nullable + as TextColorModel, + sixUpper: + null == sixUpper + ? _value.sixUpper + : sixUpper // ignore: cast_nullable_to_non_nullable + as TextColorModel, + seven: + null == seven + ? _value.seven + : seven // ignore: cast_nullable_to_non_nullable + as TextColorModel, + ), + ); } } /// @nodoc @JsonSerializable() class _$IntensityColorModelImpl implements _IntensityColorModel { - const _$IntensityColorModelImpl( - {required this.unknown, - required this.zero, - required this.one, - required this.two, - required this.three, - required this.four, - required this.fiveLower, - required this.fiveUpper, - required this.sixLower, - required this.sixUpper, - required this.seven}); + const _$IntensityColorModelImpl({ + required this.unknown, + required this.zero, + required this.one, + required this.two, + required this.three, + required this.four, + required this.fiveLower, + required this.fiveUpper, + required this.sixLower, + required this.sixUpper, + required this.seven, + }); factory _$IntensityColorModelImpl.fromJson(Map json) => _$$IntensityColorModelImplFromJson(json); @@ -450,8 +484,20 @@ class _$IntensityColorModelImpl implements _IntensityColorModel { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, unknown, zero, one, two, three, - four, fiveLower, fiveUpper, sixLower, sixUpper, seven); + int get hashCode => Object.hash( + runtimeType, + unknown, + zero, + one, + two, + three, + four, + fiveLower, + fiveUpper, + sixLower, + sixUpper, + seven, + ); /// Create a copy of IntensityColorModel /// with the given fields replaced by the non-null parameter values. @@ -460,29 +506,30 @@ class _$IntensityColorModelImpl implements _IntensityColorModel { @pragma('vm:prefer-inline') _$$IntensityColorModelImplCopyWith<_$IntensityColorModelImpl> get copyWith => __$$IntensityColorModelImplCopyWithImpl<_$IntensityColorModelImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$IntensityColorModelImplToJson( - this, - ); + return _$$IntensityColorModelImplToJson(this); } } abstract class _IntensityColorModel implements IntensityColorModel { - const factory _IntensityColorModel( - {required final TextColorModel unknown, - required final TextColorModel zero, - required final TextColorModel one, - required final TextColorModel two, - required final TextColorModel three, - required final TextColorModel four, - required final TextColorModel fiveLower, - required final TextColorModel fiveUpper, - required final TextColorModel sixLower, - required final TextColorModel sixUpper, - required final TextColorModel seven}) = _$IntensityColorModelImpl; + const factory _IntensityColorModel({ + required final TextColorModel unknown, + required final TextColorModel zero, + required final TextColorModel one, + required final TextColorModel two, + required final TextColorModel three, + required final TextColorModel four, + required final TextColorModel fiveLower, + required final TextColorModel fiveUpper, + required final TextColorModel sixLower, + required final TextColorModel sixUpper, + required final TextColorModel seven, + }) = _$IntensityColorModelImpl; factory _IntensityColorModel.fromJson(Map json) = _$IntensityColorModelImpl.fromJson; @@ -542,12 +589,14 @@ mixin _$TextColorModel { /// @nodoc abstract class $TextColorModelCopyWith<$Res> { factory $TextColorModelCopyWith( - TextColorModel value, $Res Function(TextColorModel) then) = - _$TextColorModelCopyWithImpl<$Res, TextColorModel>; + TextColorModel value, + $Res Function(TextColorModel) then, + ) = _$TextColorModelCopyWithImpl<$Res, TextColorModel>; @useResult - $Res call( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color foreground, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color background}); + $Res call({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color foreground, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color background, + }); } /// @nodoc @@ -564,34 +613,38 @@ class _$TextColorModelCopyWithImpl<$Res, $Val extends TextColorModel> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? foreground = null, - Object? background = null, - }) { - return _then(_value.copyWith( - foreground: null == foreground - ? _value.foreground - : foreground // ignore: cast_nullable_to_non_nullable - as Color, - background: null == background - ? _value.background - : background // ignore: cast_nullable_to_non_nullable - as Color, - ) as $Val); + $Res call({Object? foreground = null, Object? background = null}) { + return _then( + _value.copyWith( + foreground: + null == foreground + ? _value.foreground + : foreground // ignore: cast_nullable_to_non_nullable + as Color, + background: + null == background + ? _value.background + : background // ignore: cast_nullable_to_non_nullable + as Color, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TextColorModelImplCopyWith<$Res> implements $TextColorModelCopyWith<$Res> { - factory _$$TextColorModelImplCopyWith(_$TextColorModelImpl value, - $Res Function(_$TextColorModelImpl) then) = - __$$TextColorModelImplCopyWithImpl<$Res>; + factory _$$TextColorModelImplCopyWith( + _$TextColorModelImpl value, + $Res Function(_$TextColorModelImpl) then, + ) = __$$TextColorModelImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color foreground, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color background}); + $Res call({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color foreground, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color background, + }); } /// @nodoc @@ -599,38 +652,41 @@ class __$$TextColorModelImplCopyWithImpl<$Res> extends _$TextColorModelCopyWithImpl<$Res, _$TextColorModelImpl> implements _$$TextColorModelImplCopyWith<$Res> { __$$TextColorModelImplCopyWithImpl( - _$TextColorModelImpl _value, $Res Function(_$TextColorModelImpl) _then) - : super(_value, _then); + _$TextColorModelImpl _value, + $Res Function(_$TextColorModelImpl) _then, + ) : super(_value, _then); /// Create a copy of TextColorModel /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? foreground = null, - Object? background = null, - }) { - return _then(_$TextColorModelImpl( - foreground: null == foreground - ? _value.foreground - : foreground // ignore: cast_nullable_to_non_nullable - as Color, - background: null == background - ? _value.background - : background // ignore: cast_nullable_to_non_nullable - as Color, - )); + $Res call({Object? foreground = null, Object? background = null}) { + return _then( + _$TextColorModelImpl( + foreground: + null == foreground + ? _value.foreground + : foreground // ignore: cast_nullable_to_non_nullable + as Color, + background: + null == background + ? _value.background + : background // ignore: cast_nullable_to_non_nullable + as Color, + ), + ); } } /// @nodoc @JsonSerializable() class _$TextColorModelImpl implements _TextColorModel { - const _$TextColorModelImpl( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.foreground, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.background}); + const _$TextColorModelImpl({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.foreground, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.background, + }); factory _$TextColorModelImpl.fromJson(Map json) => _$$TextColorModelImplFromJson(json); @@ -669,22 +725,23 @@ class _$TextColorModelImpl implements _TextColorModel { @pragma('vm:prefer-inline') _$$TextColorModelImplCopyWith<_$TextColorModelImpl> get copyWith => __$$TextColorModelImplCopyWithImpl<_$TextColorModelImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$TextColorModelImplToJson( - this, - ); + return _$$TextColorModelImplToJson(this); } } abstract class _TextColorModel implements TextColorModel { - const factory _TextColorModel( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color foreground, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color background}) = _$TextColorModelImpl; + const factory _TextColorModel({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color foreground, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color background, + }) = _$TextColorModelImpl; factory _TextColorModel.fromJson(Map json) = _$TextColorModelImpl.fromJson; diff --git a/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.g.dart b/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.g.dart index 0ea81d6a..98830e8c 100644 --- a/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.g.dart +++ b/app/lib/core/provider/config/theme/intensity_color/model/intensity_color_model.g.dart @@ -9,79 +9,101 @@ part of 'intensity_color_model.dart'; // ************************************************************************** _$IntensityColorModelImpl _$$IntensityColorModelImplFromJson( - Map json) => - $checkedCreate( - r'_$IntensityColorModelImpl', - json, - ($checkedConvert) { - final val = _$IntensityColorModelImpl( - unknown: $checkedConvert('unknown', - (v) => TextColorModel.fromJson(v as Map)), - zero: $checkedConvert('zero', - (v) => TextColorModel.fromJson(v as Map)), - one: $checkedConvert( - 'one', (v) => TextColorModel.fromJson(v as Map)), - two: $checkedConvert( - 'two', (v) => TextColorModel.fromJson(v as Map)), - three: $checkedConvert('three', - (v) => TextColorModel.fromJson(v as Map)), - four: $checkedConvert('four', - (v) => TextColorModel.fromJson(v as Map)), - fiveLower: $checkedConvert('five_lower', - (v) => TextColorModel.fromJson(v as Map)), - fiveUpper: $checkedConvert('five_upper', - (v) => TextColorModel.fromJson(v as Map)), - sixLower: $checkedConvert('six_lower', - (v) => TextColorModel.fromJson(v as Map)), - sixUpper: $checkedConvert('six_upper', - (v) => TextColorModel.fromJson(v as Map)), - seven: $checkedConvert('seven', - (v) => TextColorModel.fromJson(v as Map)), - ); - return val; - }, - fieldKeyMap: const { - 'fiveLower': 'five_lower', - 'fiveUpper': 'five_upper', - 'sixLower': 'six_lower', - 'sixUpper': 'six_upper' - }, + Map json, +) => $checkedCreate( + r'_$IntensityColorModelImpl', + json, + ($checkedConvert) { + final val = _$IntensityColorModelImpl( + unknown: $checkedConvert( + 'unknown', + (v) => TextColorModel.fromJson(v as Map), + ), + zero: $checkedConvert( + 'zero', + (v) => TextColorModel.fromJson(v as Map), + ), + one: $checkedConvert( + 'one', + (v) => TextColorModel.fromJson(v as Map), + ), + two: $checkedConvert( + 'two', + (v) => TextColorModel.fromJson(v as Map), + ), + three: $checkedConvert( + 'three', + (v) => TextColorModel.fromJson(v as Map), + ), + four: $checkedConvert( + 'four', + (v) => TextColorModel.fromJson(v as Map), + ), + fiveLower: $checkedConvert( + 'five_lower', + (v) => TextColorModel.fromJson(v as Map), + ), + fiveUpper: $checkedConvert( + 'five_upper', + (v) => TextColorModel.fromJson(v as Map), + ), + sixLower: $checkedConvert( + 'six_lower', + (v) => TextColorModel.fromJson(v as Map), + ), + sixUpper: $checkedConvert( + 'six_upper', + (v) => TextColorModel.fromJson(v as Map), + ), + seven: $checkedConvert( + 'seven', + (v) => TextColorModel.fromJson(v as Map), + ), ); + return val; + }, + fieldKeyMap: const { + 'fiveLower': 'five_lower', + 'fiveUpper': 'five_upper', + 'sixLower': 'six_lower', + 'sixUpper': 'six_upper', + }, +); Map _$$IntensityColorModelImplToJson( - _$IntensityColorModelImpl instance) => - { - 'unknown': instance.unknown, - 'zero': instance.zero, - 'one': instance.one, - 'two': instance.two, - 'three': instance.three, - 'four': instance.four, - 'five_lower': instance.fiveLower, - 'five_upper': instance.fiveUpper, - 'six_lower': instance.sixLower, - 'six_upper': instance.sixUpper, - 'seven': instance.seven, - }; + _$IntensityColorModelImpl instance, +) => { + 'unknown': instance.unknown, + 'zero': instance.zero, + 'one': instance.one, + 'two': instance.two, + 'three': instance.three, + 'four': instance.four, + 'five_lower': instance.fiveLower, + 'five_upper': instance.fiveUpper, + 'six_lower': instance.sixLower, + 'six_upper': instance.sixUpper, + 'seven': instance.seven, +}; _$TextColorModelImpl _$$TextColorModelImplFromJson(Map json) => - $checkedCreate( - r'_$TextColorModelImpl', - json, - ($checkedConvert) { - final val = _$TextColorModelImpl( - foreground: - $checkedConvert('foreground', (v) => colorFromJson(v as String)), - background: - $checkedConvert('background', (v) => colorFromJson(v as String)), - ); - return val; - }, - ); + $checkedCreate(r'_$TextColorModelImpl', json, ($checkedConvert) { + final val = _$TextColorModelImpl( + foreground: $checkedConvert( + 'foreground', + (v) => colorFromJson(v as String), + ), + background: $checkedConvert( + 'background', + (v) => colorFromJson(v as String), + ), + ); + return val; + }); Map _$$TextColorModelImplToJson( - _$TextColorModelImpl instance) => - { - 'foreground': colorToJson(instance.foreground), - 'background': colorToJson(instance.background), - }; + _$TextColorModelImpl instance, +) => { + 'foreground': colorToJson(instance.foreground), + 'background': colorToJson(instance.background), +}; diff --git a/app/lib/core/provider/custom_provider_observer.dart b/app/lib/core/provider/custom_provider_observer.dart index 46b60e83..2604ad71 100644 --- a/app/lib/core/provider/custom_provider_observer.dart +++ b/app/lib/core/provider/custom_provider_observer.dart @@ -13,33 +13,24 @@ class CustomProviderObserver extends ProviderObserver { ProviderBase provider, Object? value, ProviderContainer container, - ) => - switch (provider.name) { - _ when value.toString().length > 1000 => log( - '${provider.name} (${provider.runtimeType}) ' - '${value?.toString().length} ', - name: 'didAddProvider', - ), - _ => log( - '${provider.name} ($provider)', - name: 'didAddProvider', - ), - }; + ) => switch (provider.name) { + _ when value.toString().length > 1000 => log( + '${provider.name} (${provider.runtimeType}) ' + '${value?.toString().length} ', + name: 'didAddProvider', + ), + _ => log('${provider.name} ($provider)', name: 'didAddProvider'), + }; @override void didDisposeProvider( ProviderBase provider, ProviderContainer container, - ) => - switch (provider.name) { - 'timeTickerProvider' || 'eewAliveTelegramProvider' => null, - _ when provider.name?.contains('LayerControllerProvider') ?? false => - null, - _ => log( - '${provider.name}', - name: 'didDisposeProvider', - ), - }; + ) => switch (provider.name) { + 'timeTickerProvider' || 'eewAliveTelegramProvider' => null, + _ when provider.name?.contains('LayerControllerProvider') ?? false => null, + _ => log('${provider.name}', name: 'didDisposeProvider'), + }; @override void didUpdateProvider( @@ -47,29 +38,24 @@ class CustomProviderObserver extends ProviderObserver { Object? previousValue, Object? newValue, ProviderContainer container, - ) => - switch (provider.name) { - 'mapViewModelProvider' || - 'kyoshinMonitorTimerStreamProvider' || - 'periodicTimerProvider' || - 'timeTickerProvider' || - 'kyoshinMonitorNotifierProvider' => - null, - _ when provider.name?.contains('LayerControllerProvider') ?? false => - null, - _ - when newValue.toString().length + previousValue.toString().length > - 300 => - log( - '${provider.name} (${previousValue.runtimeType} ' - '-> ${newValue.runtimeType})', - name: 'didUpdateProvider', - ), - _ => log( - '${provider.name} ($previousValue -> $newValue)', - name: 'didUpdateProvider', - ), - }; + ) => switch (provider.name) { + 'mapViewModelProvider' || + 'kyoshinMonitorTimerStreamProvider' || + 'periodicTimerProvider' || + 'timeTickerProvider' || + 'kyoshinMonitorNotifierProvider' => null, + _ when provider.name?.contains('LayerControllerProvider') ?? false => null, + _ when newValue.toString().length + previousValue.toString().length > 300 => + log( + '${provider.name} (${previousValue.runtimeType} ' + '-> ${newValue.runtimeType})', + name: 'didUpdateProvider', + ), + _ => log( + '${provider.name} ($previousValue -> $newValue)', + name: 'didUpdateProvider', + ), + }; @override void providerDidFail( @@ -79,10 +65,6 @@ class CustomProviderObserver extends ProviderObserver { ProviderContainer container, ) { talker.handle(error, stackTrace, 'providerDidFail: ${provider.name}'); - log( - '${provider.name} $error', - name: 'providerDidFail', - error: error, - ); + log('${provider.name} $error', name: 'providerDidFail', error: error); } } diff --git a/app/lib/core/provider/device_info.g.dart b/app/lib/core/provider/device_info.g.dart index e5bfde01..12e0a47e 100644 --- a/app/lib/core/provider/device_info.g.dart +++ b/app/lib/core/provider/device_info.g.dart @@ -15,9 +15,10 @@ String _$androidDeviceInfoHash() => r'02f1a66ec8a7e96d418eb9cb0a981fd40d5d2523'; final androidDeviceInfoProvider = Provider.internal( androidDeviceInfo, name: r'androidDeviceInfoProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$androidDeviceInfoHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$androidDeviceInfoHash, dependencies: null, allTransitiveDependencies: null, ); @@ -32,9 +33,10 @@ String _$iosDeviceInfoHash() => r'5c95b3efca6425549ed7e884f54f041a61267149'; final iosDeviceInfoProvider = Provider.internal( iosDeviceInfo, name: r'iosDeviceInfoProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$iosDeviceInfoHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$iosDeviceInfoHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/dio_provider.dart b/app/lib/core/provider/dio_provider.dart index ef8468d6..1a0ef4bc 100644 --- a/app/lib/core/provider/dio_provider.dart +++ b/app/lib/core/provider/dio_provider.dart @@ -33,8 +33,8 @@ Dio dio(Ref ref) { if (ref.watch(isDioProxyEnabledProvider)) { HttpOverrides.global = _HttpOverrides(); dio.httpClientAdapter = IOHttpClientAdapter( - createHttpClient: () => - HttpClient()..findProxy = (url) => 'PROXY 192.168.151.154:9090', + createHttpClient: + () => HttpClient()..findProxy = (url) => 'PROXY 192.168.151.154:9090', ); } dio.interceptors.add( diff --git a/app/lib/core/provider/dio_provider.g.dart b/app/lib/core/provider/dio_provider.g.dart index af5b4bda..711e1b09 100644 --- a/app/lib/core/provider/dio_provider.g.dart +++ b/app/lib/core/provider/dio_provider.g.dart @@ -30,14 +30,15 @@ String _$isDioProxyEnabledHash() => r'716d5c817b377684285a697bf988ce19f0645c81'; @ProviderFor(IsDioProxyEnabled) final isDioProxyEnabledProvider = NotifierProvider.internal( - IsDioProxyEnabled.new, - name: r'isDioProxyEnabledProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$isDioProxyEnabledHash, - dependencies: null, - allTransitiveDependencies: null, -); + IsDioProxyEnabled.new, + name: r'isDioProxyEnabledProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$isDioProxyEnabledHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$IsDioProxyEnabled = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.dart b/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.dart index 23726d0a..cbf28023 100644 --- a/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.dart +++ b/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.dart @@ -7,16 +7,10 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'estimated_intensity_data_source.g.dart'; @Riverpod(keepAlive: true) -EstimatedIntensityDataSource estimatedIntensityDataSource( - Ref ref, -) => +EstimatedIntensityDataSource estimatedIntensityDataSource(Ref ref) => EstimatedIntensityDataSource(); -typedef CalculationPoint = ({ - double lat, - double lon, - double arv400, -}); +typedef CalculationPoint = ({double lat, double lon, double arv400}); class EstimatedIntensityDataSource { Iterable getEstimatedIntensity({ @@ -32,19 +26,17 @@ class EstimatedIntensityDataSource { final faultLength = math.pow(10, 0.5 * momentMagnitude - 1.85) / 2; const distanceCalcular = lat_long_2.Distance(); for (final point in points) { - final epicenterDistance = distanceCalcular.as( + final epicenterDistance = + distanceCalcular.as( lat_long_2.LengthUnit.Kilometer, - lat_long_2.LatLng( - point.lat, - point.lon, - ), + lat_long_2.LatLng(point.lat, point.lon), lat_long_2.LatLng(hypocenter.lat, hypocenter.lon), ) - faultLength; // 断層長を引いた震源距離を求める final distance = math.pow(math.pow(depth, 2) + math.pow(epicenterDistance, 2), 0.5) - - faultLength; + faultLength; // 計算で利用する震源距離の最短は3kmなので、大きいほうをとる final x = math.max(distance, 3); // 工学基板上(Vs=600m/s)での最大速度の推定 diff --git a/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.g.dart b/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.g.dart index b146a6d0..892fa9a2 100644 --- a/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.g.dart +++ b/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.g.dart @@ -15,18 +15,19 @@ String _$estimatedIntensityDataSourceHash() => @ProviderFor(estimatedIntensityDataSource) final estimatedIntensityDataSourceProvider = Provider.internal( - estimatedIntensityDataSource, - name: r'estimatedIntensityDataSourceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$estimatedIntensityDataSourceHash, - dependencies: null, - allTransitiveDependencies: null, -); + estimatedIntensityDataSource, + name: r'estimatedIntensityDataSourceProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$estimatedIntensityDataSourceHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef EstimatedIntensityDataSourceRef - = ProviderRef; +typedef EstimatedIntensityDataSourceRef = + ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart index 2f9dba05..4459fca0 100644 --- a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart +++ b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart @@ -15,11 +15,12 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'estimated_intensity_provider.freezed.dart'; part 'estimated_intensity_provider.g.dart'; -typedef _CachedPoint = ({ - String regionCode, - String cityCode, - EarthquakeParameterStationItem station, -}); +typedef _CachedPoint = + ({ + String regionCode, + String cityCode, + EarthquakeParameterStationItem station, + }); @Riverpod(keepAlive: true) class EstimatedIntensity extends _$EstimatedIntensity { @@ -27,10 +28,7 @@ class EstimatedIntensity extends _$EstimatedIntensity { Future> build() async { ref.listen(eewAliveTelegramProvider, (_, next) async { final parameter = await ref.read(jmaParameterProvider.future); - final result = await calcInIsolate( - next ?? [], - parameter.earthquake, - ); + final result = await calcInIsolate(next ?? [], parameter.earthquake); state = AsyncData(result.toList()); }); final parameter = await ref.read(jmaParameterProvider.future); @@ -64,12 +62,15 @@ class EstimatedIntensity extends _$EstimatedIntensity { } for (final eew in targetEews) { - final result = calculator.getEstimatedIntensity( - points: _calculationPoints!.toList(), - jmaMagnitude: eew.magnitude!, - depth: eew.depth!, - hypocenter: (lat: eew.latitude!, lon: eew.longitude!), - ).toList(); + final result = + calculator + .getEstimatedIntensity( + points: _calculationPoints!.toList(), + jmaMagnitude: eew.magnitude!, + depth: eew.depth!, + hypocenter: (lat: eew.latitude!, lon: eew.longitude!), + ) + .toList(); results.add(result); } @@ -100,23 +101,19 @@ class EstimatedIntensity extends _$EstimatedIntensity { List eews, EarthquakeParameter parameter, ) async => - // TODO(YumNumm): 並列計算 - calc(eews, parameter); + // TODO(YumNumm): 並列計算 + calc(eews, parameter); - List<_CachedPoint> _generateCachedPoints( - EarthquakeParameter earthquake, - ) { + List<_CachedPoint> _generateCachedPoints(EarthquakeParameter earthquake) { final result = <_CachedPoint>[]; for (final region in earthquake.regions) { for (final city in region.cities) { for (final station in city.stations) { - result.add( - ( - regionCode: region.code, - cityCode: city.code, - station: station, - ), - ); + result.add(( + regionCode: region.code, + cityCode: city.code, + station: station, + )); } } } @@ -128,22 +125,18 @@ class EstimatedIntensity extends _$EstimatedIntensity { ) { final result = []; for (final point in points) { - result.add( - ( - lat: point.station.latitude, - lon: point.station.longitude, - arv400: point.station.arv400, - ), - ); + result.add(( + lat: point.station.latitude, + lon: point.station.longitude, + arv400: point.station.arv400, + )); } return result; } } @Riverpod(keepAlive: true) -Stream> estimatedIntensityCity( - Ref ref, -) async* { +Stream> estimatedIntensityCity(Ref ref) async* { final estimatedIntensity = ref.watch(estimatedIntensityProvider).valueOrNull; if (estimatedIntensity != null) { final map = {}; @@ -160,9 +153,7 @@ Stream> estimatedIntensityCity( } @Riverpod(keepAlive: true) -Stream> estimatedIntensityRegion( - Ref ref, -) async* { +Stream> estimatedIntensityRegion(Ref ref) async* { final estimatedIntensity = ref.watch(estimatedIntensityProvider).valueOrNull; log( 'estimatedIntensityRegion: ${estimatedIntensity.runtimeType}, ' diff --git a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.freezed.dart b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.freezed.dart index dfffa81b..c7c13296 100644 --- a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.freezed.dart +++ b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.freezed.dart @@ -12,7 +12,8 @@ part of 'estimated_intensity_provider.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$EstimatedIntensityPoint { @@ -31,20 +32,24 @@ mixin _$EstimatedIntensityPoint { /// @nodoc abstract class $EstimatedIntensityPointCopyWith<$Res> { - factory $EstimatedIntensityPointCopyWith(EstimatedIntensityPoint value, - $Res Function(EstimatedIntensityPoint) then) = - _$EstimatedIntensityPointCopyWithImpl<$Res, EstimatedIntensityPoint>; + factory $EstimatedIntensityPointCopyWith( + EstimatedIntensityPoint value, + $Res Function(EstimatedIntensityPoint) then, + ) = _$EstimatedIntensityPointCopyWithImpl<$Res, EstimatedIntensityPoint>; @useResult - $Res call( - {String regionCode, - String cityCode, - EarthquakeParameterStationItem station, - double intensity}); + $Res call({ + String regionCode, + String cityCode, + EarthquakeParameterStationItem station, + double intensity, + }); } /// @nodoc -class _$EstimatedIntensityPointCopyWithImpl<$Res, - $Val extends EstimatedIntensityPoint> +class _$EstimatedIntensityPointCopyWithImpl< + $Res, + $Val extends EstimatedIntensityPoint +> implements $EstimatedIntensityPointCopyWith<$Res> { _$EstimatedIntensityPointCopyWithImpl(this._value, this._then); @@ -63,24 +68,31 @@ class _$EstimatedIntensityPointCopyWithImpl<$Res, Object? station = null, Object? intensity = null, }) { - return _then(_value.copyWith( - regionCode: null == regionCode - ? _value.regionCode - : regionCode // ignore: cast_nullable_to_non_nullable - as String, - cityCode: null == cityCode - ? _value.cityCode - : cityCode // ignore: cast_nullable_to_non_nullable - as String, - station: null == station - ? _value.station - : station // ignore: cast_nullable_to_non_nullable - as EarthquakeParameterStationItem, - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + return _then( + _value.copyWith( + regionCode: + null == regionCode + ? _value.regionCode + : regionCode // ignore: cast_nullable_to_non_nullable + as String, + cityCode: + null == cityCode + ? _value.cityCode + : cityCode // ignore: cast_nullable_to_non_nullable + as String, + station: + null == station + ? _value.station + : station // ignore: cast_nullable_to_non_nullable + as EarthquakeParameterStationItem, + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } } @@ -88,27 +100,31 @@ class _$EstimatedIntensityPointCopyWithImpl<$Res, abstract class _$$EstimatedIntensityPointImplCopyWith<$Res> implements $EstimatedIntensityPointCopyWith<$Res> { factory _$$EstimatedIntensityPointImplCopyWith( - _$EstimatedIntensityPointImpl value, - $Res Function(_$EstimatedIntensityPointImpl) then) = - __$$EstimatedIntensityPointImplCopyWithImpl<$Res>; + _$EstimatedIntensityPointImpl value, + $Res Function(_$EstimatedIntensityPointImpl) then, + ) = __$$EstimatedIntensityPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String regionCode, - String cityCode, - EarthquakeParameterStationItem station, - double intensity}); + $Res call({ + String regionCode, + String cityCode, + EarthquakeParameterStationItem station, + double intensity, + }); } /// @nodoc class __$$EstimatedIntensityPointImplCopyWithImpl<$Res> - extends _$EstimatedIntensityPointCopyWithImpl<$Res, - _$EstimatedIntensityPointImpl> + extends + _$EstimatedIntensityPointCopyWithImpl< + $Res, + _$EstimatedIntensityPointImpl + > implements _$$EstimatedIntensityPointImplCopyWith<$Res> { __$$EstimatedIntensityPointImplCopyWithImpl( - _$EstimatedIntensityPointImpl _value, - $Res Function(_$EstimatedIntensityPointImpl) _then) - : super(_value, _then); + _$EstimatedIntensityPointImpl _value, + $Res Function(_$EstimatedIntensityPointImpl) _then, + ) : super(_value, _then); /// Create a copy of EstimatedIntensityPoint /// with the given fields replaced by the non-null parameter values. @@ -120,24 +136,30 @@ class __$$EstimatedIntensityPointImplCopyWithImpl<$Res> Object? station = null, Object? intensity = null, }) { - return _then(_$EstimatedIntensityPointImpl( - regionCode: null == regionCode - ? _value.regionCode - : regionCode // ignore: cast_nullable_to_non_nullable - as String, - cityCode: null == cityCode - ? _value.cityCode - : cityCode // ignore: cast_nullable_to_non_nullable - as String, - station: null == station - ? _value.station - : station // ignore: cast_nullable_to_non_nullable - as EarthquakeParameterStationItem, - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as double, - )); + return _then( + _$EstimatedIntensityPointImpl( + regionCode: + null == regionCode + ? _value.regionCode + : regionCode // ignore: cast_nullable_to_non_nullable + as String, + cityCode: + null == cityCode + ? _value.cityCode + : cityCode // ignore: cast_nullable_to_non_nullable + as String, + station: + null == station + ? _value.station + : station // ignore: cast_nullable_to_non_nullable + as EarthquakeParameterStationItem, + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } @@ -146,11 +168,12 @@ class __$$EstimatedIntensityPointImplCopyWithImpl<$Res> class _$EstimatedIntensityPointImpl with DiagnosticableTreeMixin implements _EstimatedIntensityPoint { - const _$EstimatedIntensityPointImpl( - {required this.regionCode, - required this.cityCode, - required this.station, - required this.intensity}); + const _$EstimatedIntensityPointImpl({ + required this.regionCode, + required this.cityCode, + required this.station, + required this.intensity, + }); @override final String regionCode; @@ -201,16 +224,18 @@ class _$EstimatedIntensityPointImpl @override @pragma('vm:prefer-inline') _$$EstimatedIntensityPointImplCopyWith<_$EstimatedIntensityPointImpl> - get copyWith => __$$EstimatedIntensityPointImplCopyWithImpl< - _$EstimatedIntensityPointImpl>(this, _$identity); + get copyWith => __$$EstimatedIntensityPointImplCopyWithImpl< + _$EstimatedIntensityPointImpl + >(this, _$identity); } abstract class _EstimatedIntensityPoint implements EstimatedIntensityPoint { - const factory _EstimatedIntensityPoint( - {required final String regionCode, - required final String cityCode, - required final EarthquakeParameterStationItem station, - required final double intensity}) = _$EstimatedIntensityPointImpl; + const factory _EstimatedIntensityPoint({ + required final String regionCode, + required final String cityCode, + required final EarthquakeParameterStationItem station, + required final double intensity, + }) = _$EstimatedIntensityPointImpl; @override String get regionCode; @@ -226,5 +251,5 @@ abstract class _EstimatedIntensityPoint implements EstimatedIntensityPoint { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EstimatedIntensityPointImplCopyWith<_$EstimatedIntensityPointImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.g.dart b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.g.dart index e1c62d25..442152d4 100644 --- a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.g.dart +++ b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.g.dart @@ -15,14 +15,15 @@ String _$estimatedIntensityCityHash() => @ProviderFor(estimatedIntensityCity) final estimatedIntensityCityProvider = StreamProvider>.internal( - estimatedIntensityCity, - name: r'estimatedIntensityCityProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$estimatedIntensityCityHash, - dependencies: null, - allTransitiveDependencies: null, -); + estimatedIntensityCity, + name: r'estimatedIntensityCityProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$estimatedIntensityCityHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element @@ -34,14 +35,15 @@ String _$estimatedIntensityRegionHash() => @ProviderFor(estimatedIntensityRegion) final estimatedIntensityRegionProvider = StreamProvider>.internal( - estimatedIntensityRegion, - name: r'estimatedIntensityRegionProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$estimatedIntensityRegionHash, - dependencies: null, - allTransitiveDependencies: null, -); + estimatedIntensityRegion, + name: r'estimatedIntensityRegionProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$estimatedIntensityRegionHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element @@ -51,13 +53,16 @@ String _$estimatedIntensityHash() => /// See also [EstimatedIntensity]. @ProviderFor(EstimatedIntensity) -final estimatedIntensityProvider = AsyncNotifierProvider>.internal( +final estimatedIntensityProvider = AsyncNotifierProvider< + EstimatedIntensity, + List +>.internal( EstimatedIntensity.new, name: r'estimatedIntensityProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$estimatedIntensityHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$estimatedIntensityHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/firebase/firebase_crashlytics.g.dart b/app/lib/core/provider/firebase/firebase_crashlytics.g.dart index ee1a1ec4..8e14ea39 100644 --- a/app/lib/core/provider/firebase/firebase_crashlytics.g.dart +++ b/app/lib/core/provider/firebase/firebase_crashlytics.g.dart @@ -16,9 +16,10 @@ String _$firebaseCrashlyticsHash() => final firebaseCrashlyticsProvider = Provider.internal( firebaseCrashlytics, name: r'firebaseCrashlyticsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$firebaseCrashlyticsHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$firebaseCrashlyticsHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/firebase/firebase_messaging.g.dart b/app/lib/core/provider/firebase/firebase_messaging.g.dart index fbf01816..77871d74 100644 --- a/app/lib/core/provider/firebase/firebase_messaging.g.dart +++ b/app/lib/core/provider/firebase/firebase_messaging.g.dart @@ -15,9 +15,10 @@ String _$firebaseMessagingHash() => r'6765ce963b9b8c50186b5132356d60eb68265741'; final firebaseMessagingProvider = Provider.internal( firebaseMessaging, name: r'firebaseMessagingProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$firebaseMessagingHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$firebaseMessagingHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/firebase/firebase_messaging_interaction.dart b/app/lib/core/provider/firebase/firebase_messaging_interaction.dart index bfbb889f..2d867929 100644 --- a/app/lib/core/provider/firebase/firebase_messaging_interaction.dart +++ b/app/lib/core/provider/firebase/firebase_messaging_interaction.dart @@ -6,9 +6,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'firebase_messaging_interaction.g.dart'; @Riverpod(keepAlive: true) -Stream firebaseMessagingInteraction( - Ref ref, -) async* { +Stream firebaseMessagingInteraction(Ref ref) async* { final messaging = ref.watch(firebaseMessagingProvider); final initialMessage = await messaging.getInitialMessage(); if (initialMessage != null) { diff --git a/app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart b/app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart index 0cb2dc60..9cd5964f 100644 --- a/app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart +++ b/app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart @@ -15,14 +15,15 @@ String _$firebaseMessagingInteractionHash() => @ProviderFor(firebaseMessagingInteraction) final firebaseMessagingInteractionProvider = StreamProvider.internal( - firebaseMessagingInteraction, - name: r'firebaseMessagingInteractionProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$firebaseMessagingInteractionHash, - dependencies: null, - allTransitiveDependencies: null, -); + firebaseMessagingInteraction, + name: r'firebaseMessagingInteractionProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$firebaseMessagingInteractionHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element diff --git a/app/lib/core/provider/jma_code_table_provider.dart b/app/lib/core/provider/jma_code_table_provider.dart index ec674411..c54495e9 100644 --- a/app/lib/core/provider/jma_code_table_provider.dart +++ b/app/lib/core/provider/jma_code_table_provider.dart @@ -10,5 +10,5 @@ part 'jma_code_table_provider.g.dart'; JmaCodeTable jmaCodeTable(Ref ref) => throw UnimplementedError(); Future loadJmaCodeTable() async => JmaCodeTable.fromBuffer( - (await rootBundle.load(Assets.jmaCodeTable)).buffer.asUint8List(), - ); + (await rootBundle.load(Assets.jmaCodeTable)).buffer.asUint8List(), +); diff --git a/app/lib/core/provider/jma_parameter/jma_parameter.dart b/app/lib/core/provider/jma_parameter/jma_parameter.dart index e725aae7..7401fa6c 100644 --- a/app/lib/core/provider/jma_parameter/jma_parameter.dart +++ b/app/lib/core/provider/jma_parameter/jma_parameter.dart @@ -14,14 +14,10 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'jma_parameter.g.dart'; -typedef JmaParameterState = ({ - EarthquakeParameter earthquake, - TsunamiParameter tsunami, -}); - -@Riverpod( - keepAlive: true, -) +typedef JmaParameterState = + ({EarthquakeParameter earthquake, TsunamiParameter tsunami}); + +@Riverpod(keepAlive: true) class JmaParameter extends _$JmaParameter { @override Stream build() async* { @@ -67,9 +63,10 @@ class JmaParameter extends _$JmaParameter { final cachedEtag = ref.read(earthquakeParameterEtagProvider); // check Etag - final currentEtag = await ref - .watch(jmaParameterApiClientProvider) - .getEarthquakeParameterHead(); + final currentEtag = + await ref + .watch(jmaParameterApiClientProvider) + .getEarthquakeParameterHead(); talker.log('Earthquake cachedEtag: $cachedEtag, currentEtag: $currentEtag'); if (cachedEtag != null && cachedEtag == currentEtag && !kIsWeb) { return; @@ -88,7 +85,7 @@ class JmaParameter extends _$JmaParameter { } Future> - _getEarthquakeFromLocal() async { + _getEarthquakeFromLocal() async { final dir = ref.read(applicationDocumentsDirectoryProvider); final file = File('${dir.path}/$_earthquakeFileName'); if (file.existsSync()) { @@ -118,9 +115,10 @@ class JmaParameter extends _$JmaParameter { final prefs = ref.watch(sharedPreferencesProvider); final cachedEtag = prefs.getString(_tsunamiKey); // check Etag - final currentEtag = await ref - .watch(jmaParameterApiClientProvider) - .getTsunamiParameterHeadEtag(); + final currentEtag = + await ref + .watch(jmaParameterApiClientProvider) + .getTsunamiParameterHeadEtag(); talker.log('Tsunami cachedEtag: $cachedEtag, currentEtag: $currentEtag'); if (cachedEtag != null && cachedEtag == currentEtag && !kIsWeb) { return; diff --git a/app/lib/core/provider/jma_parameter/jma_parameter.g.dart b/app/lib/core/provider/jma_parameter/jma_parameter.g.dart index 14f7250a..8b6bc599 100644 --- a/app/lib/core/provider/jma_parameter/jma_parameter.g.dart +++ b/app/lib/core/provider/jma_parameter/jma_parameter.g.dart @@ -14,13 +14,15 @@ String _$jmaParameterHash() => r'3df30979a78f46a75386dec2811d41ead379cb5b'; @ProviderFor(JmaParameter) final jmaParameterProvider = StreamNotifierProvider.internal( - JmaParameter.new, - name: r'jmaParameterProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$jmaParameterHash, - dependencies: null, - allTransitiveDependencies: null, -); + JmaParameter.new, + name: r'jmaParameterProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$jmaParameterHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$JmaParameter = StreamNotifier; String _$earthquakeParameterEtagHash() => @@ -30,14 +32,15 @@ String _$earthquakeParameterEtagHash() => @ProviderFor(EarthquakeParameterEtag) final earthquakeParameterEtagProvider = NotifierProvider.internal( - EarthquakeParameterEtag.new, - name: r'earthquakeParameterEtagProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeParameterEtagHash, - dependencies: null, - allTransitiveDependencies: null, -); + EarthquakeParameterEtag.new, + name: r'earthquakeParameterEtagProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeParameterEtagHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$EarthquakeParameterEtag = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/kmoni_observation_points/model/kmoni_observation_point.freezed.dart b/app/lib/core/provider/kmoni_observation_points/model/kmoni_observation_point.freezed.dart index 5f9c3356..8e790a6c 100644 --- a/app/lib/core/provider/kmoni_observation_points/model/kmoni_observation_point.freezed.dart +++ b/app/lib/core/provider/kmoni_observation_points/model/kmoni_observation_point.freezed.dart @@ -12,7 +12,8 @@ part of 'kmoni_observation_point.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$AnalyzedKmoniObservationPoint { @@ -29,29 +30,35 @@ mixin _$AnalyzedKmoniObservationPoint { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $AnalyzedKmoniObservationPointCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $AnalyzedKmoniObservationPointCopyWith<$Res> { factory $AnalyzedKmoniObservationPointCopyWith( - AnalyzedKmoniObservationPoint value, - $Res Function(AnalyzedKmoniObservationPoint) then) = - _$AnalyzedKmoniObservationPointCopyWithImpl<$Res, - AnalyzedKmoniObservationPoint>; + AnalyzedKmoniObservationPoint value, + $Res Function(AnalyzedKmoniObservationPoint) then, + ) = + _$AnalyzedKmoniObservationPointCopyWithImpl< + $Res, + AnalyzedKmoniObservationPoint + >; @useResult - $Res call( - {KyoshinObservationPoint point, - double? intensityValue, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color? intensityColor, - double? pga, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color? pgaColor}); + $Res call({ + KyoshinObservationPoint point, + double? intensityValue, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + Color? intensityColor, + double? pga, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color? pgaColor, + }); } /// @nodoc -class _$AnalyzedKmoniObservationPointCopyWithImpl<$Res, - $Val extends AnalyzedKmoniObservationPoint> +class _$AnalyzedKmoniObservationPointCopyWithImpl< + $Res, + $Val extends AnalyzedKmoniObservationPoint +> implements $AnalyzedKmoniObservationPointCopyWith<$Res> { _$AnalyzedKmoniObservationPointCopyWithImpl(this._value, this._then); @@ -71,28 +78,36 @@ class _$AnalyzedKmoniObservationPointCopyWithImpl<$Res, Object? pga = freezed, Object? pgaColor = freezed, }) { - return _then(_value.copyWith( - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinObservationPoint, - intensityValue: freezed == intensityValue - ? _value.intensityValue - : intensityValue // ignore: cast_nullable_to_non_nullable - as double?, - intensityColor: freezed == intensityColor - ? _value.intensityColor - : intensityColor // ignore: cast_nullable_to_non_nullable - as Color?, - pga: freezed == pga - ? _value.pga - : pga // ignore: cast_nullable_to_non_nullable - as double?, - pgaColor: freezed == pgaColor - ? _value.pgaColor - : pgaColor // ignore: cast_nullable_to_non_nullable - as Color?, - ) as $Val); + return _then( + _value.copyWith( + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinObservationPoint, + intensityValue: + freezed == intensityValue + ? _value.intensityValue + : intensityValue // ignore: cast_nullable_to_non_nullable + as double?, + intensityColor: + freezed == intensityColor + ? _value.intensityColor + : intensityColor // ignore: cast_nullable_to_non_nullable + as Color?, + pga: + freezed == pga + ? _value.pga + : pga // ignore: cast_nullable_to_non_nullable + as double?, + pgaColor: + freezed == pgaColor + ? _value.pgaColor + : pgaColor // ignore: cast_nullable_to_non_nullable + as Color?, + ) + as $Val, + ); } } @@ -100,29 +115,33 @@ class _$AnalyzedKmoniObservationPointCopyWithImpl<$Res, abstract class _$$AnalyzedKmoniObservationPointImplCopyWith<$Res> implements $AnalyzedKmoniObservationPointCopyWith<$Res> { factory _$$AnalyzedKmoniObservationPointImplCopyWith( - _$AnalyzedKmoniObservationPointImpl value, - $Res Function(_$AnalyzedKmoniObservationPointImpl) then) = - __$$AnalyzedKmoniObservationPointImplCopyWithImpl<$Res>; + _$AnalyzedKmoniObservationPointImpl value, + $Res Function(_$AnalyzedKmoniObservationPointImpl) then, + ) = __$$AnalyzedKmoniObservationPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {KyoshinObservationPoint point, - double? intensityValue, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color? intensityColor, - double? pga, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color? pgaColor}); + $Res call({ + KyoshinObservationPoint point, + double? intensityValue, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + Color? intensityColor, + double? pga, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color? pgaColor, + }); } /// @nodoc class __$$AnalyzedKmoniObservationPointImplCopyWithImpl<$Res> - extends _$AnalyzedKmoniObservationPointCopyWithImpl<$Res, - _$AnalyzedKmoniObservationPointImpl> + extends + _$AnalyzedKmoniObservationPointCopyWithImpl< + $Res, + _$AnalyzedKmoniObservationPointImpl + > implements _$$AnalyzedKmoniObservationPointImplCopyWith<$Res> { __$$AnalyzedKmoniObservationPointImplCopyWithImpl( - _$AnalyzedKmoniObservationPointImpl _value, - $Res Function(_$AnalyzedKmoniObservationPointImpl) _then) - : super(_value, _then); + _$AnalyzedKmoniObservationPointImpl _value, + $Res Function(_$AnalyzedKmoniObservationPointImpl) _then, + ) : super(_value, _then); /// Create a copy of AnalyzedKmoniObservationPoint /// with the given fields replaced by the non-null parameter values. @@ -135,28 +154,35 @@ class __$$AnalyzedKmoniObservationPointImplCopyWithImpl<$Res> Object? pga = freezed, Object? pgaColor = freezed, }) { - return _then(_$AnalyzedKmoniObservationPointImpl( - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinObservationPoint, - intensityValue: freezed == intensityValue - ? _value.intensityValue - : intensityValue // ignore: cast_nullable_to_non_nullable - as double?, - intensityColor: freezed == intensityColor - ? _value.intensityColor - : intensityColor // ignore: cast_nullable_to_non_nullable - as Color?, - pga: freezed == pga - ? _value.pga - : pga // ignore: cast_nullable_to_non_nullable - as double?, - pgaColor: freezed == pgaColor - ? _value.pgaColor - : pgaColor // ignore: cast_nullable_to_non_nullable - as Color?, - )); + return _then( + _$AnalyzedKmoniObservationPointImpl( + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinObservationPoint, + intensityValue: + freezed == intensityValue + ? _value.intensityValue + : intensityValue // ignore: cast_nullable_to_non_nullable + as double?, + intensityColor: + freezed == intensityColor + ? _value.intensityColor + : intensityColor // ignore: cast_nullable_to_non_nullable + as Color?, + pga: + freezed == pga + ? _value.pga + : pga // ignore: cast_nullable_to_non_nullable + as double?, + pgaColor: + freezed == pgaColor + ? _value.pgaColor + : pgaColor // ignore: cast_nullable_to_non_nullable + as Color?, + ), + ); } } @@ -164,17 +190,17 @@ class __$$AnalyzedKmoniObservationPointImplCopyWithImpl<$Res> class _$AnalyzedKmoniObservationPointImpl implements _AnalyzedKmoniObservationPoint { - const _$AnalyzedKmoniObservationPointImpl( - {required this.point, - this.intensityValue, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - this.intensityColor, - this.pga, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) this.pgaColor}); + const _$AnalyzedKmoniObservationPointImpl({ + required this.point, + this.intensityValue, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) this.intensityColor, + this.pga, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) this.pgaColor, + }); @override final KyoshinObservationPoint point; -// ここから + // ここから @override final double? intensityValue; @override @@ -208,7 +234,13 @@ class _$AnalyzedKmoniObservationPointImpl @override int get hashCode => Object.hash( - runtimeType, point, intensityValue, intensityColor, pga, pgaColor); + runtimeType, + point, + intensityValue, + intensityColor, + pga, + pgaColor, + ); /// Create a copy of AnalyzedKmoniObservationPoint /// with the given fields replaced by the non-null parameter values. @@ -216,21 +248,24 @@ class _$AnalyzedKmoniObservationPointImpl @override @pragma('vm:prefer-inline') _$$AnalyzedKmoniObservationPointImplCopyWith< - _$AnalyzedKmoniObservationPointImpl> - get copyWith => __$$AnalyzedKmoniObservationPointImplCopyWithImpl< - _$AnalyzedKmoniObservationPointImpl>(this, _$identity); + _$AnalyzedKmoniObservationPointImpl + > + get copyWith => __$$AnalyzedKmoniObservationPointImplCopyWithImpl< + _$AnalyzedKmoniObservationPointImpl + >(this, _$identity); } abstract class _AnalyzedKmoniObservationPoint implements AnalyzedKmoniObservationPoint { - const factory _AnalyzedKmoniObservationPoint( - {required final KyoshinObservationPoint point, - final double? intensityValue, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - final Color? intensityColor, - final double? pga, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - final Color? pgaColor}) = _$AnalyzedKmoniObservationPointImpl; + const factory _AnalyzedKmoniObservationPoint({ + required final KyoshinObservationPoint point, + final double? intensityValue, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + final Color? intensityColor, + final double? pga, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + final Color? pgaColor, + }) = _$AnalyzedKmoniObservationPointImpl; @override KyoshinObservationPoint get point; // ここから @@ -250,6 +285,7 @@ abstract class _AnalyzedKmoniObservationPoint @override @JsonKey(includeFromJson: false, includeToJson: false) _$$AnalyzedKmoniObservationPointImplCopyWith< - _$AnalyzedKmoniObservationPointImpl> - get copyWith => throw _privateConstructorUsedError; + _$AnalyzedKmoniObservationPointImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart b/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart index 81ff6691..d6258db3 100644 --- a/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart +++ b/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart @@ -15,18 +15,20 @@ List kyoshinMonitorObservationPoints(Ref ref) => @Riverpod(keepAlive: true) Future> - kyoshinMonitorInternalObservationPointsConverted(Ref ref) async { - final result = - await ref.watch(kyoshinMonitorInternalObservationPointsProvider.future); - final points = result.points - .map( - (e) => KyoshinMonitorObservationPoint( - code: e.code, - x: e.point.x, - y: e.point.y, - ), - ) - .toList(); +kyoshinMonitorInternalObservationPointsConverted(Ref ref) async { + final result = await ref.watch( + kyoshinMonitorInternalObservationPointsProvider.future, + ); + final points = + result.points + .map( + (e) => KyoshinMonitorObservationPoint( + code: e.code, + x: e.point.x, + y: e.point.y, + ), + ) + .toList(); return points; } @@ -40,7 +42,5 @@ Future kyoshinMonitorInternalObservationPoints( Ref ref, ) async { final binary = await rootBundle.load(Assets.kyoshinObservationPoint); - return KyoshinObservationPoints.fromBuffer( - binary.buffer.asUint8List(), - ); + return KyoshinObservationPoints.fromBuffer(binary.buffer.asUint8List()); } diff --git a/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.g.dart b/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.g.dart index 66934a08..252a2832 100644 --- a/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.g.dart +++ b/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.g.dart @@ -15,19 +15,20 @@ String _$kyoshinMonitorObservationPointsHash() => @ProviderFor(kyoshinMonitorObservationPoints) final kyoshinMonitorObservationPointsProvider = Provider>.internal( - kyoshinMonitorObservationPoints, - name: r'kyoshinMonitorObservationPointsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorObservationPointsHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorObservationPoints, + name: r'kyoshinMonitorObservationPointsProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorObservationPointsHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef KyoshinMonitorObservationPointsRef - = ProviderRef>; +typedef KyoshinMonitorObservationPointsRef = + ProviderRef>; String _$kyoshinMonitorInternalObservationPointsConvertedHash() => r'51427c40b3db363acc7c314492e24e72b2081f6a'; @@ -35,19 +36,20 @@ String _$kyoshinMonitorInternalObservationPointsConvertedHash() => @ProviderFor(kyoshinMonitorInternalObservationPointsConverted) final kyoshinMonitorInternalObservationPointsConvertedProvider = FutureProvider>.internal( - kyoshinMonitorInternalObservationPointsConverted, - name: r'kyoshinMonitorInternalObservationPointsConvertedProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorInternalObservationPointsConvertedHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorInternalObservationPointsConverted, + name: r'kyoshinMonitorInternalObservationPointsConvertedProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorInternalObservationPointsConvertedHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef KyoshinMonitorInternalObservationPointsConvertedRef - = FutureProviderRef>; +typedef KyoshinMonitorInternalObservationPointsConvertedRef = + FutureProviderRef>; String _$kyoshinObservationPointsHash() => r'5ed1439d3d32d21fb6e339c80b5f4070edbafc10'; @@ -55,14 +57,15 @@ String _$kyoshinObservationPointsHash() => @ProviderFor(kyoshinObservationPoints) final kyoshinObservationPointsProvider = Provider.internal( - kyoshinObservationPoints, - name: r'kyoshinObservationPointsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinObservationPointsHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinObservationPoints, + name: r'kyoshinObservationPointsProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinObservationPointsHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element @@ -74,18 +77,19 @@ String _$kyoshinMonitorInternalObservationPointsHash() => @ProviderFor(kyoshinMonitorInternalObservationPoints) final kyoshinMonitorInternalObservationPointsProvider = FutureProvider.internal( - kyoshinMonitorInternalObservationPoints, - name: r'kyoshinMonitorInternalObservationPointsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorInternalObservationPointsHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorInternalObservationPoints, + name: r'kyoshinMonitorInternalObservationPointsProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorInternalObservationPointsHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef KyoshinMonitorInternalObservationPointsRef - = FutureProviderRef; +typedef KyoshinMonitorInternalObservationPointsRef = + FutureProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/log/talker.dart b/app/lib/core/provider/log/talker.dart index 377cdebf..5ded2087 100644 --- a/app/lib/core/provider/log/talker.dart +++ b/app/lib/core/provider/log/talker.dart @@ -72,27 +72,23 @@ class CrashlyticsTalkerObserver implements TalkerObserver { @override void onError(TalkerError err) => unawaited( - FirebaseCrashlytics.instance.log( - 'Error: ${err.message}, ${err.exception}, ${err.stackTrace}', - ), - ); + FirebaseCrashlytics.instance.log( + 'Error: ${err.message}, ${err.exception}, ${err.stackTrace}', + ), + ); @override void onException(TalkerException err) => unawaited( - FirebaseCrashlytics.instance.log( - 'Exception: ${err.message}, ${err.exception}, ${err.stackTrace}', - ), - ); + FirebaseCrashlytics.instance.log( + 'Exception: ${err.message}, ${err.exception}, ${err.stackTrace}', + ), + ); @override void onLog(TalkerData log) { if (log.title == TelegramWebSocketLog('').title) { return; } - unawaited( - FirebaseCrashlytics.instance.log( - log.message.toString(), - ), - ); + unawaited(FirebaseCrashlytics.instance.log(log.message.toString())); } } diff --git a/app/lib/core/provider/map/jma_map_provider.dart b/app/lib/core/provider/map/jma_map_provider.dart index 98ce849c..6bc6830f 100644 --- a/app/lib/core/provider/map/jma_map_provider.dart +++ b/app/lib/core/provider/map/jma_map_provider.dart @@ -11,9 +11,7 @@ Future>> jmaMap( Ref ref, ) async { final bytes = await rootBundle.load(Assets.jmaMap); - final jmaMap = JmaMap.fromBuffer( - bytes.buffer.asUint8List(), - ); + final jmaMap = JmaMap.fromBuffer(bytes.buffer.asUint8List()); return { for (final element in jmaMap.data) element.mapType.mapType: element.data, }; @@ -24,18 +22,17 @@ enum JmaMapType { areaForecastLocalE, areaInformationCity, areaTsunami, - ; } extension JmaMapEx on JmaMap_JmaMapData_JmaMapType { JmaMapType get mapType => switch (this) { - JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_E => - JmaMapType.areaForecastLocalE, - JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_EEW => - JmaMapType.areaForecastLocalEew, - JmaMap_JmaMapData_JmaMapType.AREA_INFORMATION_CITY => - JmaMapType.areaInformationCity, - JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI => JmaMapType.areaTsunami, - _ => throw UnimplementedError(), - }; + JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_E => + JmaMapType.areaForecastLocalE, + JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_EEW => + JmaMapType.areaForecastLocalEew, + JmaMap_JmaMapData_JmaMapType.AREA_INFORMATION_CITY => + JmaMapType.areaInformationCity, + JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI => JmaMapType.areaTsunami, + _ => throw UnimplementedError(), + }; } diff --git a/app/lib/core/provider/map/jma_map_provider.g.dart b/app/lib/core/provider/map/jma_map_provider.g.dart index fc8b0278..f53679e1 100644 --- a/app/lib/core/provider/map/jma_map_provider.g.dart +++ b/app/lib/core/provider/map/jma_map_provider.g.dart @@ -13,7 +13,8 @@ String _$jmaMapHash() => r'644f26223f787fb02550d62f7d6fd3be6b9039e1'; /// See also [jmaMap]. @ProviderFor(jmaMap) final jmaMapProvider = FutureProvider< - Map>>.internal( + Map> +>.internal( jmaMap, name: r'jmaMapProvider', debugGetCreateSourceHash: @@ -24,7 +25,7 @@ final jmaMapProvider = FutureProvider< @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef JmaMapRef = FutureProviderRef< - Map>>; +typedef JmaMapRef = + FutureProviderRef>>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/notification_token.dart b/app/lib/core/provider/notification_token.dart index 56fa5830..2fba76da 100644 --- a/app/lib/core/provider/notification_token.dart +++ b/app/lib/core/provider/notification_token.dart @@ -10,9 +10,7 @@ part 'notification_token.freezed.dart'; part 'notification_token.g.dart'; @riverpod -Future notificationToken( - Ref ref, -) async { +Future notificationToken(Ref ref) async { if (kIsWeb) { throw UnimplementedError(); } @@ -23,10 +21,7 @@ Future notificationToken( } final fcmToken = await messaging.getToken(); - return NotificationTokenModel( - apnsToken: apnsToken, - fcmToken: fcmToken, - ); + return NotificationTokenModel(apnsToken: apnsToken, fcmToken: fcmToken); } @freezed diff --git a/app/lib/core/provider/notification_token.freezed.dart b/app/lib/core/provider/notification_token.freezed.dart index 30246a2e..eeda2c33 100644 --- a/app/lib/core/provider/notification_token.freezed.dart +++ b/app/lib/core/provider/notification_token.freezed.dart @@ -12,10 +12,12 @@ part of 'notification_token.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NotificationTokenModel _$NotificationTokenModelFromJson( - Map json) { + Map json, +) { return _NotificationTokenModel.fromJson(json); } @@ -36,16 +38,19 @@ mixin _$NotificationTokenModel { /// @nodoc abstract class $NotificationTokenModelCopyWith<$Res> { - factory $NotificationTokenModelCopyWith(NotificationTokenModel value, - $Res Function(NotificationTokenModel) then) = - _$NotificationTokenModelCopyWithImpl<$Res, NotificationTokenModel>; + factory $NotificationTokenModelCopyWith( + NotificationTokenModel value, + $Res Function(NotificationTokenModel) then, + ) = _$NotificationTokenModelCopyWithImpl<$Res, NotificationTokenModel>; @useResult $Res call({String? fcmToken, String? apnsToken}); } /// @nodoc -class _$NotificationTokenModelCopyWithImpl<$Res, - $Val extends NotificationTokenModel> +class _$NotificationTokenModelCopyWithImpl< + $Res, + $Val extends NotificationTokenModel +> implements $NotificationTokenModelCopyWith<$Res> { _$NotificationTokenModelCopyWithImpl(this._value, this._then); @@ -58,20 +63,22 @@ class _$NotificationTokenModelCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? fcmToken = freezed, - Object? apnsToken = freezed, - }) { - return _then(_value.copyWith( - fcmToken: freezed == fcmToken - ? _value.fcmToken - : fcmToken // ignore: cast_nullable_to_non_nullable - as String?, - apnsToken: freezed == apnsToken - ? _value.apnsToken - : apnsToken // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + $Res call({Object? fcmToken = freezed, Object? apnsToken = freezed}) { + return _then( + _value.copyWith( + fcmToken: + freezed == fcmToken + ? _value.fcmToken + : fcmToken // ignore: cast_nullable_to_non_nullable + as String?, + apnsToken: + freezed == apnsToken + ? _value.apnsToken + : apnsToken // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } @@ -79,9 +86,9 @@ class _$NotificationTokenModelCopyWithImpl<$Res, abstract class _$$NotificationTokenModelImplCopyWith<$Res> implements $NotificationTokenModelCopyWith<$Res> { factory _$$NotificationTokenModelImplCopyWith( - _$NotificationTokenModelImpl value, - $Res Function(_$NotificationTokenModelImpl) then) = - __$$NotificationTokenModelImplCopyWithImpl<$Res>; + _$NotificationTokenModelImpl value, + $Res Function(_$NotificationTokenModelImpl) then, + ) = __$$NotificationTokenModelImplCopyWithImpl<$Res>; @override @useResult $Res call({String? fcmToken, String? apnsToken}); @@ -89,32 +96,33 @@ abstract class _$$NotificationTokenModelImplCopyWith<$Res> /// @nodoc class __$$NotificationTokenModelImplCopyWithImpl<$Res> - extends _$NotificationTokenModelCopyWithImpl<$Res, - _$NotificationTokenModelImpl> + extends + _$NotificationTokenModelCopyWithImpl<$Res, _$NotificationTokenModelImpl> implements _$$NotificationTokenModelImplCopyWith<$Res> { __$$NotificationTokenModelImplCopyWithImpl( - _$NotificationTokenModelImpl _value, - $Res Function(_$NotificationTokenModelImpl) _then) - : super(_value, _then); + _$NotificationTokenModelImpl _value, + $Res Function(_$NotificationTokenModelImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationTokenModel /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? fcmToken = freezed, - Object? apnsToken = freezed, - }) { - return _then(_$NotificationTokenModelImpl( - fcmToken: freezed == fcmToken - ? _value.fcmToken - : fcmToken // ignore: cast_nullable_to_non_nullable - as String?, - apnsToken: freezed == apnsToken - ? _value.apnsToken - : apnsToken // ignore: cast_nullable_to_non_nullable - as String?, - )); + $Res call({Object? fcmToken = freezed, Object? apnsToken = freezed}) { + return _then( + _$NotificationTokenModelImpl( + fcmToken: + freezed == fcmToken + ? _value.fcmToken + : fcmToken // ignore: cast_nullable_to_non_nullable + as String?, + apnsToken: + freezed == apnsToken + ? _value.apnsToken + : apnsToken // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } @@ -123,8 +131,10 @@ class __$$NotificationTokenModelImplCopyWithImpl<$Res> class _$NotificationTokenModelImpl with DiagnosticableTreeMixin implements _NotificationTokenModel { - const _$NotificationTokenModelImpl( - {required this.fcmToken, required this.apnsToken}); + const _$NotificationTokenModelImpl({ + required this.fcmToken, + required this.apnsToken, + }); factory _$NotificationTokenModelImpl.fromJson(Map json) => _$$NotificationTokenModelImplFromJson(json); @@ -169,21 +179,23 @@ class _$NotificationTokenModelImpl @override @pragma('vm:prefer-inline') _$$NotificationTokenModelImplCopyWith<_$NotificationTokenModelImpl> - get copyWith => __$$NotificationTokenModelImplCopyWithImpl< - _$NotificationTokenModelImpl>(this, _$identity); + get copyWith => + __$$NotificationTokenModelImplCopyWithImpl<_$NotificationTokenModelImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$NotificationTokenModelImplToJson( - this, - ); + return _$$NotificationTokenModelImplToJson(this); } } abstract class _NotificationTokenModel implements NotificationTokenModel { - const factory _NotificationTokenModel( - {required final String? fcmToken, - required final String? apnsToken}) = _$NotificationTokenModelImpl; + const factory _NotificationTokenModel({ + required final String? fcmToken, + required final String? apnsToken, + }) = _$NotificationTokenModelImpl; factory _NotificationTokenModel.fromJson(Map json) = _$NotificationTokenModelImpl.fromJson; @@ -198,5 +210,5 @@ abstract class _NotificationTokenModel implements NotificationTokenModel { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationTokenModelImplCopyWith<_$NotificationTokenModelImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/core/provider/notification_token.g.dart b/app/lib/core/provider/notification_token.g.dart index 2502389e..c14f485c 100644 --- a/app/lib/core/provider/notification_token.g.dart +++ b/app/lib/core/provider/notification_token.g.dart @@ -9,26 +9,26 @@ part of 'notification_token.dart'; // ************************************************************************** _$NotificationTokenModelImpl _$$NotificationTokenModelImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationTokenModelImpl', - json, - ($checkedConvert) { - final val = _$NotificationTokenModelImpl( - fcmToken: $checkedConvert('fcm_token', (v) => v as String?), - apnsToken: $checkedConvert('apns_token', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const {'fcmToken': 'fcm_token', 'apnsToken': 'apns_token'}, + Map json, +) => $checkedCreate( + r'_$NotificationTokenModelImpl', + json, + ($checkedConvert) { + final val = _$NotificationTokenModelImpl( + fcmToken: $checkedConvert('fcm_token', (v) => v as String?), + apnsToken: $checkedConvert('apns_token', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const {'fcmToken': 'fcm_token', 'apnsToken': 'apns_token'}, +); Map _$$NotificationTokenModelImplToJson( - _$NotificationTokenModelImpl instance) => - { - 'fcm_token': instance.fcmToken, - 'apns_token': instance.apnsToken, - }; + _$NotificationTokenModelImpl instance, +) => { + 'fcm_token': instance.fcmToken, + 'apns_token': instance.apnsToken, +}; // ************************************************************************** // RiverpodGenerator @@ -40,18 +40,19 @@ String _$notificationTokenHash() => r'1d7efa28d4e4401069a1a4426fdbbd4b04239c5e'; @ProviderFor(notificationToken) final notificationTokenProvider = AutoDisposeFutureProvider.internal( - notificationToken, - name: r'notificationTokenProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationTokenHash, - dependencies: null, - allTransitiveDependencies: null, -); + notificationToken, + name: r'notificationTokenProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationTokenHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef NotificationTokenRef - = AutoDisposeFutureProviderRef; +typedef NotificationTokenRef = + AutoDisposeFutureProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/ntp/ntp_config_model.freezed.dart b/app/lib/core/provider/ntp/ntp_config_model.freezed.dart index 14495c7b..fa2b7bf4 100644 --- a/app/lib/core/provider/ntp/ntp_config_model.freezed.dart +++ b/app/lib/core/provider/ntp/ntp_config_model.freezed.dart @@ -12,7 +12,8 @@ part of 'ntp_config_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NtpConfigModel _$NtpConfigModelFromJson(Map json) { return _NtpConfigModel.fromJson(json); @@ -37,8 +38,9 @@ mixin _$NtpConfigModel { /// @nodoc abstract class $NtpConfigModelCopyWith<$Res> { factory $NtpConfigModelCopyWith( - NtpConfigModel value, $Res Function(NtpConfigModel) then) = - _$NtpConfigModelCopyWithImpl<$Res, NtpConfigModel>; + NtpConfigModel value, + $Res Function(NtpConfigModel) then, + ) = _$NtpConfigModelCopyWithImpl<$Res, NtpConfigModel>; @useResult $Res call({String lookUpAddress, Duration timeout, Duration interval}); } @@ -62,29 +64,36 @@ class _$NtpConfigModelCopyWithImpl<$Res, $Val extends NtpConfigModel> Object? timeout = null, Object? interval = null, }) { - return _then(_value.copyWith( - lookUpAddress: null == lookUpAddress - ? _value.lookUpAddress - : lookUpAddress // ignore: cast_nullable_to_non_nullable - as String, - timeout: null == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as Duration, - interval: null == interval - ? _value.interval - : interval // ignore: cast_nullable_to_non_nullable - as Duration, - ) as $Val); + return _then( + _value.copyWith( + lookUpAddress: + null == lookUpAddress + ? _value.lookUpAddress + : lookUpAddress // ignore: cast_nullable_to_non_nullable + as String, + timeout: + null == timeout + ? _value.timeout + : timeout // ignore: cast_nullable_to_non_nullable + as Duration, + interval: + null == interval + ? _value.interval + : interval // ignore: cast_nullable_to_non_nullable + as Duration, + ) + as $Val, + ); } } /// @nodoc abstract class _$$NtpConfigModelImplCopyWith<$Res> implements $NtpConfigModelCopyWith<$Res> { - factory _$$NtpConfigModelImplCopyWith(_$NtpConfigModelImpl value, - $Res Function(_$NtpConfigModelImpl) then) = - __$$NtpConfigModelImplCopyWithImpl<$Res>; + factory _$$NtpConfigModelImplCopyWith( + _$NtpConfigModelImpl value, + $Res Function(_$NtpConfigModelImpl) then, + ) = __$$NtpConfigModelImplCopyWithImpl<$Res>; @override @useResult $Res call({String lookUpAddress, Duration timeout, Duration interval}); @@ -95,8 +104,9 @@ class __$$NtpConfigModelImplCopyWithImpl<$Res> extends _$NtpConfigModelCopyWithImpl<$Res, _$NtpConfigModelImpl> implements _$$NtpConfigModelImplCopyWith<$Res> { __$$NtpConfigModelImplCopyWithImpl( - _$NtpConfigModelImpl _value, $Res Function(_$NtpConfigModelImpl) _then) - : super(_value, _then); + _$NtpConfigModelImpl _value, + $Res Function(_$NtpConfigModelImpl) _then, + ) : super(_value, _then); /// Create a copy of NtpConfigModel /// with the given fields replaced by the non-null parameter values. @@ -107,30 +117,36 @@ class __$$NtpConfigModelImplCopyWithImpl<$Res> Object? timeout = null, Object? interval = null, }) { - return _then(_$NtpConfigModelImpl( - lookUpAddress: null == lookUpAddress - ? _value.lookUpAddress - : lookUpAddress // ignore: cast_nullable_to_non_nullable - as String, - timeout: null == timeout - ? _value.timeout - : timeout // ignore: cast_nullable_to_non_nullable - as Duration, - interval: null == interval - ? _value.interval - : interval // ignore: cast_nullable_to_non_nullable - as Duration, - )); + return _then( + _$NtpConfigModelImpl( + lookUpAddress: + null == lookUpAddress + ? _value.lookUpAddress + : lookUpAddress // ignore: cast_nullable_to_non_nullable + as String, + timeout: + null == timeout + ? _value.timeout + : timeout // ignore: cast_nullable_to_non_nullable + as Duration, + interval: + null == interval + ? _value.interval + : interval // ignore: cast_nullable_to_non_nullable + as Duration, + ), + ); } } /// @nodoc @JsonSerializable() class _$NtpConfigModelImpl implements _NtpConfigModel { - const _$NtpConfigModelImpl( - {this.lookUpAddress = 'ntp.nict.jp', - this.timeout = const Duration(seconds: 10), - this.interval = const Duration(minutes: 30)}); + const _$NtpConfigModelImpl({ + this.lookUpAddress = 'ntp.nict.jp', + this.timeout = const Duration(seconds: 10), + this.interval = const Duration(minutes: 30), + }); factory _$NtpConfigModelImpl.fromJson(Map json) => _$$NtpConfigModelImplFromJson(json); @@ -174,21 +190,22 @@ class _$NtpConfigModelImpl implements _NtpConfigModel { @pragma('vm:prefer-inline') _$$NtpConfigModelImplCopyWith<_$NtpConfigModelImpl> get copyWith => __$$NtpConfigModelImplCopyWithImpl<_$NtpConfigModelImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$NtpConfigModelImplToJson( - this, - ); + return _$$NtpConfigModelImplToJson(this); } } abstract class _NtpConfigModel implements NtpConfigModel { - const factory _NtpConfigModel( - {final String lookUpAddress, - final Duration timeout, - final Duration interval}) = _$NtpConfigModelImpl; + const factory _NtpConfigModel({ + final String lookUpAddress, + final Duration timeout, + final Duration interval, + }) = _$NtpConfigModelImpl; factory _NtpConfigModel.fromJson(Map json) = _$NtpConfigModelImpl.fromJson; diff --git a/app/lib/core/provider/ntp/ntp_config_model.g.dart b/app/lib/core/provider/ntp/ntp_config_model.g.dart index 53189ed2..b2599296 100644 --- a/app/lib/core/provider/ntp/ntp_config_model.g.dart +++ b/app/lib/core/provider/ntp/ntp_config_model.g.dart @@ -15,17 +15,23 @@ _$NtpConfigModelImpl _$$NtpConfigModelImplFromJson(Map json) => ($checkedConvert) { final val = _$NtpConfigModelImpl( lookUpAddress: $checkedConvert( - 'look_up_address', (v) => v as String? ?? 'ntp.nict.jp'), + 'look_up_address', + (v) => v as String? ?? 'ntp.nict.jp', + ), timeout: $checkedConvert( - 'timeout', - (v) => v == null - ? const Duration(seconds: 10) - : Duration(microseconds: (v as num).toInt())), + 'timeout', + (v) => + v == null + ? const Duration(seconds: 10) + : Duration(microseconds: (v as num).toInt()), + ), interval: $checkedConvert( - 'interval', - (v) => v == null - ? const Duration(minutes: 30) - : Duration(microseconds: (v as num).toInt())), + 'interval', + (v) => + v == null + ? const Duration(minutes: 30) + : Duration(microseconds: (v as num).toInt()), + ), ); return val; }, @@ -33,9 +39,9 @@ _$NtpConfigModelImpl _$$NtpConfigModelImplFromJson(Map json) => ); Map _$$NtpConfigModelImplToJson( - _$NtpConfigModelImpl instance) => - { - 'look_up_address': instance.lookUpAddress, - 'timeout': instance.timeout.inMicroseconds, - 'interval': instance.interval.inMicroseconds, - }; + _$NtpConfigModelImpl instance, +) => { + 'look_up_address': instance.lookUpAddress, + 'timeout': instance.timeout.inMicroseconds, + 'interval': instance.interval.inMicroseconds, +}; diff --git a/app/lib/core/provider/ntp/ntp_provider.dart b/app/lib/core/provider/ntp/ntp_provider.dart index de4384a1..7815b164 100644 --- a/app/lib/core/provider/ntp/ntp_provider.dart +++ b/app/lib/core/provider/ntp/ntp_provider.dart @@ -17,12 +17,9 @@ class Ntp extends _$Ntp { final config = ref.watch(ntpConfigProvider); final interval = config.interval; - final timer = Timer.periodic( - interval, - (_) async { - await sync(); - }, - ); + final timer = Timer.periodic(interval, (_) async { + await sync(); + }); ref.onDispose(timer.cancel); return const NtpStateModel(); @@ -46,10 +43,7 @@ class Ntp extends _$Ntp { ); } - state = state.copyWith( - offset: offset, - updatedAt: DateTime.now(), - ); + state = state.copyWith(offset: offset, updatedAt: DateTime.now()); talker.logCustom(NtpLog('NTP Time Sync: offset ${offset}ms')); } diff --git a/app/lib/core/provider/ntp/ntp_state_model.dart b/app/lib/core/provider/ntp/ntp_state_model.dart index 648e1c2d..89ac8345 100644 --- a/app/lib/core/provider/ntp/ntp_state_model.dart +++ b/app/lib/core/provider/ntp/ntp_state_model.dart @@ -5,10 +5,8 @@ part 'ntp_state_model.g.dart'; @freezed class NtpStateModel with _$NtpStateModel { - const factory NtpStateModel({ - int? offset, - DateTime? updatedAt, - }) = _NtpStateModel; + const factory NtpStateModel({int? offset, DateTime? updatedAt}) = + _NtpStateModel; factory NtpStateModel.fromJson(Map json) => _$NtpStateModelFromJson(json); diff --git a/app/lib/core/provider/ntp/ntp_state_model.freezed.dart b/app/lib/core/provider/ntp/ntp_state_model.freezed.dart index 91ba8dac..390d0ae8 100644 --- a/app/lib/core/provider/ntp/ntp_state_model.freezed.dart +++ b/app/lib/core/provider/ntp/ntp_state_model.freezed.dart @@ -12,7 +12,8 @@ part of 'ntp_state_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NtpStateModel _$NtpStateModelFromJson(Map json) { return _NtpStateModel.fromJson(json); @@ -36,8 +37,9 @@ mixin _$NtpStateModel { /// @nodoc abstract class $NtpStateModelCopyWith<$Res> { factory $NtpStateModelCopyWith( - NtpStateModel value, $Res Function(NtpStateModel) then) = - _$NtpStateModelCopyWithImpl<$Res, NtpStateModel>; + NtpStateModel value, + $Res Function(NtpStateModel) then, + ) = _$NtpStateModelCopyWithImpl<$Res, NtpStateModel>; @useResult $Res call({int? offset, DateTime? updatedAt}); } @@ -56,20 +58,22 @@ class _$NtpStateModelCopyWithImpl<$Res, $Val extends NtpStateModel> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? offset = freezed, - Object? updatedAt = freezed, - }) { - return _then(_value.copyWith( - offset: freezed == offset - ? _value.offset - : offset // ignore: cast_nullable_to_non_nullable - as int?, - updatedAt: freezed == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - ) as $Val); + $Res call({Object? offset = freezed, Object? updatedAt = freezed}) { + return _then( + _value.copyWith( + offset: + freezed == offset + ? _value.offset + : offset // ignore: cast_nullable_to_non_nullable + as int?, + updatedAt: + freezed == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + ) + as $Val, + ); } } @@ -77,8 +81,9 @@ class _$NtpStateModelCopyWithImpl<$Res, $Val extends NtpStateModel> abstract class _$$NtpStateModelImplCopyWith<$Res> implements $NtpStateModelCopyWith<$Res> { factory _$$NtpStateModelImplCopyWith( - _$NtpStateModelImpl value, $Res Function(_$NtpStateModelImpl) then) = - __$$NtpStateModelImplCopyWithImpl<$Res>; + _$NtpStateModelImpl value, + $Res Function(_$NtpStateModelImpl) then, + ) = __$$NtpStateModelImplCopyWithImpl<$Res>; @override @useResult $Res call({int? offset, DateTime? updatedAt}); @@ -89,27 +94,29 @@ class __$$NtpStateModelImplCopyWithImpl<$Res> extends _$NtpStateModelCopyWithImpl<$Res, _$NtpStateModelImpl> implements _$$NtpStateModelImplCopyWith<$Res> { __$$NtpStateModelImplCopyWithImpl( - _$NtpStateModelImpl _value, $Res Function(_$NtpStateModelImpl) _then) - : super(_value, _then); + _$NtpStateModelImpl _value, + $Res Function(_$NtpStateModelImpl) _then, + ) : super(_value, _then); /// Create a copy of NtpStateModel /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? offset = freezed, - Object? updatedAt = freezed, - }) { - return _then(_$NtpStateModelImpl( - offset: freezed == offset - ? _value.offset - : offset // ignore: cast_nullable_to_non_nullable - as int?, - updatedAt: freezed == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - )); + $Res call({Object? offset = freezed, Object? updatedAt = freezed}) { + return _then( + _$NtpStateModelImpl( + offset: + freezed == offset + ? _value.offset + : offset // ignore: cast_nullable_to_non_nullable + as int?, + updatedAt: + freezed == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + ), + ); } } @@ -155,9 +162,7 @@ class _$NtpStateModelImpl implements _NtpStateModel { @override Map toJson() { - return _$$NtpStateModelImplToJson( - this, - ); + return _$$NtpStateModelImplToJson(this); } } diff --git a/app/lib/core/provider/ntp/ntp_state_model.g.dart b/app/lib/core/provider/ntp/ntp_state_model.g.dart index 6031dd91..fdb0be60 100644 --- a/app/lib/core/provider/ntp/ntp_state_model.g.dart +++ b/app/lib/core/provider/ntp/ntp_state_model.g.dart @@ -9,19 +9,16 @@ part of 'ntp_state_model.dart'; // ************************************************************************** _$NtpStateModelImpl _$$NtpStateModelImplFromJson(Map json) => - $checkedCreate( - r'_$NtpStateModelImpl', - json, - ($checkedConvert) { - final val = _$NtpStateModelImpl( - offset: $checkedConvert('offset', (v) => (v as num?)?.toInt()), - updatedAt: $checkedConvert('updated_at', - (v) => v == null ? null : DateTime.parse(v as String)), - ); - return val; - }, - fieldKeyMap: const {'updatedAt': 'updated_at'}, - ); + $checkedCreate(r'_$NtpStateModelImpl', json, ($checkedConvert) { + final val = _$NtpStateModelImpl( + offset: $checkedConvert('offset', (v) => (v as num?)?.toInt()), + updatedAt: $checkedConvert( + 'updated_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; + }, fieldKeyMap: const {'updatedAt': 'updated_at'}); Map _$$NtpStateModelImplToJson(_$NtpStateModelImpl instance) => { diff --git a/app/lib/core/provider/periodic_timer.g.dart b/app/lib/core/provider/periodic_timer.g.dart index 99fdae76..0b251405 100644 --- a/app/lib/core/provider/periodic_timer.g.dart +++ b/app/lib/core/provider/periodic_timer.g.dart @@ -35,9 +35,7 @@ abstract class _$PeriodicTimer extends BuildlessAutoDisposeStreamNotifier { late final Key key; - Stream build( - Key key, - ); + Stream build(Key key); } /// See also [PeriodicTimer]. @@ -50,21 +48,15 @@ class PeriodicTimerFamily extends Family> { const PeriodicTimerFamily(); /// See also [PeriodicTimer]. - PeriodicTimerProvider call( - Key key, - ) { - return PeriodicTimerProvider( - key, - ); + PeriodicTimerProvider call(Key key) { + return PeriodicTimerProvider(key); } @override PeriodicTimerProvider getProviderOverride( covariant PeriodicTimerProvider provider, ) { - return call( - provider.key, - ); + return call(provider.key); } static const Iterable? _dependencies = null; @@ -86,21 +78,20 @@ class PeriodicTimerFamily extends Family> { class PeriodicTimerProvider extends AutoDisposeStreamNotifierProviderImpl { /// See also [PeriodicTimer]. - PeriodicTimerProvider( - Key key, - ) : this._internal( - () => PeriodicTimer()..key = key, - from: periodicTimerProvider, - name: r'periodicTimerProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$periodicTimerHash, - dependencies: PeriodicTimerFamily._dependencies, - allTransitiveDependencies: - PeriodicTimerFamily._allTransitiveDependencies, - key: key, - ); + PeriodicTimerProvider(Key key) + : this._internal( + () => PeriodicTimer()..key = key, + from: periodicTimerProvider, + name: r'periodicTimerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$periodicTimerHash, + dependencies: PeriodicTimerFamily._dependencies, + allTransitiveDependencies: + PeriodicTimerFamily._allTransitiveDependencies, + key: key, + ); PeriodicTimerProvider._internal( super._createNotifier, { @@ -115,12 +106,8 @@ class PeriodicTimerProvider final Key key; @override - Stream runNotifierBuild( - covariant PeriodicTimer notifier, - ) { - return notifier.build( - key, - ); + Stream runNotifierBuild(covariant PeriodicTimer notifier) { + return notifier.build(key); } @override @@ -141,7 +128,7 @@ class PeriodicTimerProvider @override AutoDisposeStreamNotifierProviderElement - createElement() { + createElement() { return _PeriodicTimerProviderElement(this); } @@ -174,5 +161,6 @@ class _PeriodicTimerProviderElement @override Key get key => (origin as PeriodicTimerProvider).key; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/secure_storage.dart b/app/lib/core/provider/secure_storage.dart index 5398a304..649715ef 100644 --- a/app/lib/core/provider/secure_storage.dart +++ b/app/lib/core/provider/secure_storage.dart @@ -6,10 +6,6 @@ part 'secure_storage.g.dart'; @Riverpod(keepAlive: true) FlutterSecureStorage secureStorage(Ref ref) => const FlutterSecureStorage( - aOptions: AndroidOptions( - resetOnError: true, - ), - iOptions: IOSOptions( - groupId: 'group.net.yumnumm.eqmonitor', - ), - ); + aOptions: AndroidOptions(resetOnError: true), + iOptions: IOSOptions(groupId: 'group.net.yumnumm.eqmonitor'), +); diff --git a/app/lib/core/provider/secure_storage.g.dart b/app/lib/core/provider/secure_storage.g.dart index 733ae396..96088385 100644 --- a/app/lib/core/provider/secure_storage.g.dart +++ b/app/lib/core/provider/secure_storage.g.dart @@ -15,9 +15,10 @@ String _$secureStorageHash() => r'e9fc957f66ce98042ac32ef37cbcd216a7323cd6'; final secureStorageProvider = Provider.internal( secureStorage, name: r'secureStorageProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$secureStorageHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$secureStorageHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/shared_preferences.g.dart b/app/lib/core/provider/shared_preferences.g.dart index 0e0c2181..6dd187b6 100644 --- a/app/lib/core/provider/shared_preferences.g.dart +++ b/app/lib/core/provider/shared_preferences.g.dart @@ -15,9 +15,10 @@ String _$sharedPreferencesHash() => r'6bbc55d4dc38d5979ff916112845bcc4a4a3a1ea'; final sharedPreferencesProvider = Provider.internal( sharedPreferences, name: r'sharedPreferencesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$sharedPreferencesHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$sharedPreferencesHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/telegram_url/model/telegram_url_model.freezed.dart b/app/lib/core/provider/telegram_url/model/telegram_url_model.freezed.dart index fec6bbdf..026cda02 100644 --- a/app/lib/core/provider/telegram_url/model/telegram_url_model.freezed.dart +++ b/app/lib/core/provider/telegram_url/model/telegram_url_model.freezed.dart @@ -12,7 +12,8 @@ part of 'telegram_url_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); TelegramUrlModel _$TelegramUrlModelFromJson(Map json) { return _TelegramUrlModel.fromJson(json); @@ -37,8 +38,9 @@ mixin _$TelegramUrlModel { /// @nodoc abstract class $TelegramUrlModelCopyWith<$Res> { factory $TelegramUrlModelCopyWith( - TelegramUrlModel value, $Res Function(TelegramUrlModel) then) = - _$TelegramUrlModelCopyWithImpl<$Res, TelegramUrlModel>; + TelegramUrlModel value, + $Res Function(TelegramUrlModel) then, + ) = _$TelegramUrlModelCopyWithImpl<$Res, TelegramUrlModel>; @useResult $Res call({String restApiUrl, String wsApiUrl, String? apiAuthorization}); } @@ -62,29 +64,36 @@ class _$TelegramUrlModelCopyWithImpl<$Res, $Val extends TelegramUrlModel> Object? wsApiUrl = null, Object? apiAuthorization = freezed, }) { - return _then(_value.copyWith( - restApiUrl: null == restApiUrl - ? _value.restApiUrl - : restApiUrl // ignore: cast_nullable_to_non_nullable - as String, - wsApiUrl: null == wsApiUrl - ? _value.wsApiUrl - : wsApiUrl // ignore: cast_nullable_to_non_nullable - as String, - apiAuthorization: freezed == apiAuthorization - ? _value.apiAuthorization - : apiAuthorization // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + restApiUrl: + null == restApiUrl + ? _value.restApiUrl + : restApiUrl // ignore: cast_nullable_to_non_nullable + as String, + wsApiUrl: + null == wsApiUrl + ? _value.wsApiUrl + : wsApiUrl // ignore: cast_nullable_to_non_nullable + as String, + apiAuthorization: + freezed == apiAuthorization + ? _value.apiAuthorization + : apiAuthorization // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TelegramUrlModelImplCopyWith<$Res> implements $TelegramUrlModelCopyWith<$Res> { - factory _$$TelegramUrlModelImplCopyWith(_$TelegramUrlModelImpl value, - $Res Function(_$TelegramUrlModelImpl) then) = - __$$TelegramUrlModelImplCopyWithImpl<$Res>; + factory _$$TelegramUrlModelImplCopyWith( + _$TelegramUrlModelImpl value, + $Res Function(_$TelegramUrlModelImpl) then, + ) = __$$TelegramUrlModelImplCopyWithImpl<$Res>; @override @useResult $Res call({String restApiUrl, String wsApiUrl, String? apiAuthorization}); @@ -94,9 +103,10 @@ abstract class _$$TelegramUrlModelImplCopyWith<$Res> class __$$TelegramUrlModelImplCopyWithImpl<$Res> extends _$TelegramUrlModelCopyWithImpl<$Res, _$TelegramUrlModelImpl> implements _$$TelegramUrlModelImplCopyWith<$Res> { - __$$TelegramUrlModelImplCopyWithImpl(_$TelegramUrlModelImpl _value, - $Res Function(_$TelegramUrlModelImpl) _then) - : super(_value, _then); + __$$TelegramUrlModelImplCopyWithImpl( + _$TelegramUrlModelImpl _value, + $Res Function(_$TelegramUrlModelImpl) _then, + ) : super(_value, _then); /// Create a copy of TelegramUrlModel /// with the given fields replaced by the non-null parameter values. @@ -107,30 +117,36 @@ class __$$TelegramUrlModelImplCopyWithImpl<$Res> Object? wsApiUrl = null, Object? apiAuthorization = freezed, }) { - return _then(_$TelegramUrlModelImpl( - restApiUrl: null == restApiUrl - ? _value.restApiUrl - : restApiUrl // ignore: cast_nullable_to_non_nullable - as String, - wsApiUrl: null == wsApiUrl - ? _value.wsApiUrl - : wsApiUrl // ignore: cast_nullable_to_non_nullable - as String, - apiAuthorization: freezed == apiAuthorization - ? _value.apiAuthorization - : apiAuthorization // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$TelegramUrlModelImpl( + restApiUrl: + null == restApiUrl + ? _value.restApiUrl + : restApiUrl // ignore: cast_nullable_to_non_nullable + as String, + wsApiUrl: + null == wsApiUrl + ? _value.wsApiUrl + : wsApiUrl // ignore: cast_nullable_to_non_nullable + as String, + apiAuthorization: + freezed == apiAuthorization + ? _value.apiAuthorization + : apiAuthorization // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$TelegramUrlModelImpl implements _TelegramUrlModel { - const _$TelegramUrlModelImpl( - {required this.restApiUrl, - required this.wsApiUrl, - required this.apiAuthorization}); + const _$TelegramUrlModelImpl({ + required this.restApiUrl, + required this.wsApiUrl, + required this.apiAuthorization, + }); factory _$TelegramUrlModelImpl.fromJson(Map json) => _$$TelegramUrlModelImplFromJson(json); @@ -172,21 +188,22 @@ class _$TelegramUrlModelImpl implements _TelegramUrlModel { @pragma('vm:prefer-inline') _$$TelegramUrlModelImplCopyWith<_$TelegramUrlModelImpl> get copyWith => __$$TelegramUrlModelImplCopyWithImpl<_$TelegramUrlModelImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$TelegramUrlModelImplToJson( - this, - ); + return _$$TelegramUrlModelImplToJson(this); } } abstract class _TelegramUrlModel implements TelegramUrlModel { - const factory _TelegramUrlModel( - {required final String restApiUrl, - required final String wsApiUrl, - required final String? apiAuthorization}) = _$TelegramUrlModelImpl; + const factory _TelegramUrlModel({ + required final String restApiUrl, + required final String wsApiUrl, + required final String? apiAuthorization, + }) = _$TelegramUrlModelImpl; factory _TelegramUrlModel.fromJson(Map json) = _$TelegramUrlModelImpl.fromJson; diff --git a/app/lib/core/provider/telegram_url/model/telegram_url_model.g.dart b/app/lib/core/provider/telegram_url/model/telegram_url_model.g.dart index cda9c08b..cc549340 100644 --- a/app/lib/core/provider/telegram_url/model/telegram_url_model.g.dart +++ b/app/lib/core/provider/telegram_url/model/telegram_url_model.g.dart @@ -9,30 +9,32 @@ part of 'telegram_url_model.dart'; // ************************************************************************** _$TelegramUrlModelImpl _$$TelegramUrlModelImplFromJson( - Map json) => - $checkedCreate( - r'_$TelegramUrlModelImpl', - json, - ($checkedConvert) { - final val = _$TelegramUrlModelImpl( - restApiUrl: $checkedConvert('rest_api_url', (v) => v as String), - wsApiUrl: $checkedConvert('ws_api_url', (v) => v as String), - apiAuthorization: - $checkedConvert('api_authorization', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const { - 'restApiUrl': 'rest_api_url', - 'wsApiUrl': 'ws_api_url', - 'apiAuthorization': 'api_authorization' - }, + Map json, +) => $checkedCreate( + r'_$TelegramUrlModelImpl', + json, + ($checkedConvert) { + final val = _$TelegramUrlModelImpl( + restApiUrl: $checkedConvert('rest_api_url', (v) => v as String), + wsApiUrl: $checkedConvert('ws_api_url', (v) => v as String), + apiAuthorization: $checkedConvert( + 'api_authorization', + (v) => v as String?, + ), ); + return val; + }, + fieldKeyMap: const { + 'restApiUrl': 'rest_api_url', + 'wsApiUrl': 'ws_api_url', + 'apiAuthorization': 'api_authorization', + }, +); Map _$$TelegramUrlModelImplToJson( - _$TelegramUrlModelImpl instance) => - { - 'rest_api_url': instance.restApiUrl, - 'ws_api_url': instance.wsApiUrl, - 'api_authorization': instance.apiAuthorization, - }; + _$TelegramUrlModelImpl instance, +) => { + 'rest_api_url': instance.restApiUrl, + 'ws_api_url': instance.wsApiUrl, + 'api_authorization': instance.apiAuthorization, +}; diff --git a/app/lib/core/provider/telegram_url/provider/telegram_url_provider.g.dart b/app/lib/core/provider/telegram_url/provider/telegram_url_provider.g.dart index a275eaf5..79977040 100644 --- a/app/lib/core/provider/telegram_url/provider/telegram_url_provider.g.dart +++ b/app/lib/core/provider/telegram_url/provider/telegram_url_provider.g.dart @@ -14,13 +14,15 @@ String _$telegramUrlHash() => r'05cbe69b52b0f42c8223f0020694fbc29736faef'; @ProviderFor(TelegramUrl) final telegramUrlProvider = NotifierProvider.internal( - TelegramUrl.new, - name: r'telegramUrlProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$telegramUrlHash, - dependencies: null, - allTransitiveDependencies: null, -); + TelegramUrl.new, + name: r'telegramUrlProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$telegramUrlHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$TelegramUrl = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/provider/time_ticker.dart b/app/lib/core/provider/time_ticker.dart index 24940fcd..94c757b7 100644 --- a/app/lib/core/provider/time_ticker.dart +++ b/app/lib/core/provider/time_ticker.dart @@ -7,5 +7,4 @@ part 'time_ticker.g.dart'; Stream timeTicker( Ref ref, [ Duration duration = const Duration(seconds: 1), -]) => - Stream.periodic(duration, (_) => DateTime.now()); +]) => Stream.periodic(duration, (_) => DateTime.now()); diff --git a/app/lib/core/provider/time_ticker.g.dart b/app/lib/core/provider/time_ticker.g.dart index 54f5cd9d..feb9a017 100644 --- a/app/lib/core/provider/time_ticker.g.dart +++ b/app/lib/core/provider/time_ticker.g.dart @@ -41,21 +41,15 @@ class TimeTickerFamily extends Family> { const TimeTickerFamily(); /// See also [timeTicker]. - TimeTickerProvider call([ - Duration duration = const Duration(seconds: 1), - ]) { - return TimeTickerProvider( - duration, - ); + TimeTickerProvider call([Duration duration = const Duration(seconds: 1)]) { + return TimeTickerProvider(duration); } @override TimeTickerProvider getProviderOverride( covariant TimeTickerProvider provider, ) { - return call( - provider.duration, - ); + return call(provider.duration); } static final Iterable _dependencies = @@ -78,24 +72,19 @@ class TimeTickerFamily extends Family> { /// See also [timeTicker]. class TimeTickerProvider extends StreamProvider { /// See also [timeTicker]. - TimeTickerProvider([ - Duration duration = const Duration(seconds: 1), - ]) : this._internal( - (ref) => timeTicker( - ref as TimeTickerRef, - duration, - ), - from: timeTickerProvider, - name: r'timeTickerProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$timeTickerHash, - dependencies: TimeTickerFamily._dependencies, - allTransitiveDependencies: - TimeTickerFamily._allTransitiveDependencies, - duration: duration, - ); + TimeTickerProvider([Duration duration = const Duration(seconds: 1)]) + : this._internal( + (ref) => timeTicker(ref as TimeTickerRef, duration), + from: timeTickerProvider, + name: r'timeTickerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$timeTickerHash, + dependencies: TimeTickerFamily._dependencies, + allTransitiveDependencies: TimeTickerFamily._allTransitiveDependencies, + duration: duration, + ); TimeTickerProvider._internal( super._createNotifier, { @@ -160,5 +149,6 @@ class _TimeTickerProviderElement extends StreamProviderElement @override Duration get duration => (origin as TimeTickerProvider).duration; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/travel_time/data/travel_time_data_source.g.dart b/app/lib/core/provider/travel_time/data/travel_time_data_source.g.dart index e31b04de..3ae2e732 100644 --- a/app/lib/core/provider/travel_time/data/travel_time_data_source.g.dart +++ b/app/lib/core/provider/travel_time/data/travel_time_data_source.g.dart @@ -16,9 +16,10 @@ String _$travelTimeDataSourceHash() => final travelTimeDataSourceProvider = Provider.internal( travelTimeDataSource, name: r'travelTimeDataSourceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$travelTimeDataSourceHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$travelTimeDataSourceHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/travel_time/model/travel_time_table.dart b/app/lib/core/provider/travel_time/model/travel_time_table.dart index 6268185e..a06aabb8 100644 --- a/app/lib/core/provider/travel_time/model/travel_time_table.dart +++ b/app/lib/core/provider/travel_time/model/travel_time_table.dart @@ -23,7 +23,6 @@ class TravelTimeTable with _$TravelTimeTable { @freezed class TravelTimeTables with _$TravelTimeTables { - const factory TravelTimeTables({ - required List table, - }) = _TravelTimeTables; + const factory TravelTimeTables({required List table}) = + _TravelTimeTables; } diff --git a/app/lib/core/provider/travel_time/model/travel_time_table.freezed.dart b/app/lib/core/provider/travel_time/model/travel_time_table.freezed.dart index 7405a919..93d2911e 100644 --- a/app/lib/core/provider/travel_time/model/travel_time_table.freezed.dart +++ b/app/lib/core/provider/travel_time/model/travel_time_table.freezed.dart @@ -12,7 +12,8 @@ part of 'travel_time_table.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$TravelTimeTable { @@ -31,8 +32,9 @@ mixin _$TravelTimeTable { /// @nodoc abstract class $TravelTimeTableCopyWith<$Res> { factory $TravelTimeTableCopyWith( - TravelTimeTable value, $Res Function(TravelTimeTable) then) = - _$TravelTimeTableCopyWithImpl<$Res, TravelTimeTable>; + TravelTimeTable value, + $Res Function(TravelTimeTable) then, + ) = _$TravelTimeTableCopyWithImpl<$Res, TravelTimeTable>; @useResult $Res call({double p, double s, int depth, int distance}); } @@ -57,33 +59,41 @@ class _$TravelTimeTableCopyWithImpl<$Res, $Val extends TravelTimeTable> Object? depth = null, Object? distance = null, }) { - return _then(_value.copyWith( - p: null == p - ? _value.p - : p // ignore: cast_nullable_to_non_nullable - as double, - s: null == s - ? _value.s - : s // ignore: cast_nullable_to_non_nullable - as double, - depth: null == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int, - distance: null == distance - ? _value.distance - : distance // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + return _then( + _value.copyWith( + p: + null == p + ? _value.p + : p // ignore: cast_nullable_to_non_nullable + as double, + s: + null == s + ? _value.s + : s // ignore: cast_nullable_to_non_nullable + as double, + depth: + null == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int, + distance: + null == distance + ? _value.distance + : distance // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TravelTimeTableImplCopyWith<$Res> implements $TravelTimeTableCopyWith<$Res> { - factory _$$TravelTimeTableImplCopyWith(_$TravelTimeTableImpl value, - $Res Function(_$TravelTimeTableImpl) then) = - __$$TravelTimeTableImplCopyWithImpl<$Res>; + factory _$$TravelTimeTableImplCopyWith( + _$TravelTimeTableImpl value, + $Res Function(_$TravelTimeTableImpl) then, + ) = __$$TravelTimeTableImplCopyWithImpl<$Res>; @override @useResult $Res call({double p, double s, int depth, int distance}); @@ -94,8 +104,9 @@ class __$$TravelTimeTableImplCopyWithImpl<$Res> extends _$TravelTimeTableCopyWithImpl<$Res, _$TravelTimeTableImpl> implements _$$TravelTimeTableImplCopyWith<$Res> { __$$TravelTimeTableImplCopyWithImpl( - _$TravelTimeTableImpl _value, $Res Function(_$TravelTimeTableImpl) _then) - : super(_value, _then); + _$TravelTimeTableImpl _value, + $Res Function(_$TravelTimeTableImpl) _then, + ) : super(_value, _then); /// Create a copy of TravelTimeTable /// with the given fields replaced by the non-null parameter values. @@ -107,35 +118,42 @@ class __$$TravelTimeTableImplCopyWithImpl<$Res> Object? depth = null, Object? distance = null, }) { - return _then(_$TravelTimeTableImpl( - p: null == p - ? _value.p - : p // ignore: cast_nullable_to_non_nullable - as double, - s: null == s - ? _value.s - : s // ignore: cast_nullable_to_non_nullable - as double, - depth: null == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int, - distance: null == distance - ? _value.distance - : distance // ignore: cast_nullable_to_non_nullable - as int, - )); + return _then( + _$TravelTimeTableImpl( + p: + null == p + ? _value.p + : p // ignore: cast_nullable_to_non_nullable + as double, + s: + null == s + ? _value.s + : s // ignore: cast_nullable_to_non_nullable + as double, + depth: + null == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int, + distance: + null == distance + ? _value.distance + : distance // ignore: cast_nullable_to_non_nullable + as int, + ), + ); } } /// @nodoc class _$TravelTimeTableImpl implements _TravelTimeTable { - const _$TravelTimeTableImpl( - {required this.p, - required this.s, - required this.depth, - required this.distance}); + const _$TravelTimeTableImpl({ + required this.p, + required this.s, + required this.depth, + required this.distance, + }); @override final double p; @@ -173,15 +191,18 @@ class _$TravelTimeTableImpl implements _TravelTimeTable { @pragma('vm:prefer-inline') _$$TravelTimeTableImplCopyWith<_$TravelTimeTableImpl> get copyWith => __$$TravelTimeTableImplCopyWithImpl<_$TravelTimeTableImpl>( - this, _$identity); + this, + _$identity, + ); } abstract class _TravelTimeTable implements TravelTimeTable { - const factory _TravelTimeTable( - {required final double p, - required final double s, - required final int depth, - required final int distance}) = _$TravelTimeTableImpl; + const factory _TravelTimeTable({ + required final double p, + required final double s, + required final int depth, + required final int distance, + }) = _$TravelTimeTableImpl; @override double get p; @@ -214,8 +235,9 @@ mixin _$TravelTimeTables { /// @nodoc abstract class $TravelTimeTablesCopyWith<$Res> { factory $TravelTimeTablesCopyWith( - TravelTimeTables value, $Res Function(TravelTimeTables) then) = - _$TravelTimeTablesCopyWithImpl<$Res, TravelTimeTables>; + TravelTimeTables value, + $Res Function(TravelTimeTables) then, + ) = _$TravelTimeTablesCopyWithImpl<$Res, TravelTimeTables>; @useResult $Res call({List table}); } @@ -234,24 +256,27 @@ class _$TravelTimeTablesCopyWithImpl<$Res, $Val extends TravelTimeTables> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? table = null, - }) { - return _then(_value.copyWith( - table: null == table - ? _value.table - : table // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? table = null}) { + return _then( + _value.copyWith( + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TravelTimeTablesImplCopyWith<$Res> implements $TravelTimeTablesCopyWith<$Res> { - factory _$$TravelTimeTablesImplCopyWith(_$TravelTimeTablesImpl value, - $Res Function(_$TravelTimeTablesImpl) then) = - __$$TravelTimeTablesImplCopyWithImpl<$Res>; + factory _$$TravelTimeTablesImplCopyWith( + _$TravelTimeTablesImpl value, + $Res Function(_$TravelTimeTablesImpl) then, + ) = __$$TravelTimeTablesImplCopyWithImpl<$Res>; @override @useResult $Res call({List table}); @@ -261,23 +286,25 @@ abstract class _$$TravelTimeTablesImplCopyWith<$Res> class __$$TravelTimeTablesImplCopyWithImpl<$Res> extends _$TravelTimeTablesCopyWithImpl<$Res, _$TravelTimeTablesImpl> implements _$$TravelTimeTablesImplCopyWith<$Res> { - __$$TravelTimeTablesImplCopyWithImpl(_$TravelTimeTablesImpl _value, - $Res Function(_$TravelTimeTablesImpl) _then) - : super(_value, _then); + __$$TravelTimeTablesImplCopyWithImpl( + _$TravelTimeTablesImpl _value, + $Res Function(_$TravelTimeTablesImpl) _then, + ) : super(_value, _then); /// Create a copy of TravelTimeTables /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? table = null, - }) { - return _then(_$TravelTimeTablesImpl( - table: null == table - ? _value._table - : table // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? table = null}) { + return _then( + _$TravelTimeTablesImpl( + table: + null == table + ? _value._table + : table // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -285,7 +312,7 @@ class __$$TravelTimeTablesImplCopyWithImpl<$Res> class _$TravelTimeTablesImpl implements _TravelTimeTables { const _$TravelTimeTablesImpl({required final List table}) - : _table = table; + : _table = table; final List _table; @override @@ -319,12 +346,15 @@ class _$TravelTimeTablesImpl implements _TravelTimeTables { @pragma('vm:prefer-inline') _$$TravelTimeTablesImplCopyWith<_$TravelTimeTablesImpl> get copyWith => __$$TravelTimeTablesImplCopyWithImpl<_$TravelTimeTablesImpl>( - this, _$identity); + this, + _$identity, + ); } abstract class _TravelTimeTables implements TravelTimeTables { - const factory _TravelTimeTables( - {required final List table}) = _$TravelTimeTablesImpl; + const factory _TravelTimeTables({ + required final List table, + }) = _$TravelTimeTablesImpl; @override List get table; diff --git a/app/lib/core/provider/travel_time/provider/travel_time_provider.dart b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart index ab8919ee..a6d64846 100644 --- a/app/lib/core/provider/travel_time/provider/travel_time_provider.dart +++ b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart @@ -18,9 +18,7 @@ Future travelTimeInternal(Ref ref) async { } @Riverpod(keepAlive: true) -TravelTimeDepthMap travelTimeDepthMap( - Ref ref, -) { +TravelTimeDepthMap travelTimeDepthMap(Ref ref) { final state = ref.watch(travelTimeProvider); return state.table.groupListsBy((e) => e.depth); } @@ -44,7 +42,7 @@ extension TravelTimeDepthMapCalc on TravelTimeDepthMap { } final p = (duration - p1.p) / (p2.p - p1.p) * (p2.distance - p1.distance) + - p1.distance; + p1.distance; return p; }(); final s = () { @@ -55,7 +53,7 @@ extension TravelTimeDepthMapCalc on TravelTimeDepthMap { } final s = (duration - s1.s) / (s2.s - s1.s) * (s2.distance - s1.distance) + - s1.distance; + s1.distance; return s; }(); return TravelTimeResult(s, p); @@ -80,14 +78,16 @@ extension TravelTimeTablesCalc on TravelTimeTables { if (p1 == null || p2 == null) { return TravelTimeResult(null, null); } - final p = (time - p1.p) / (p2.p - p1.p) * (p2.distance - p1.distance) + + final p = + (time - p1.p) / (p2.p - p1.p) * (p2.distance - p1.distance) + p1.distance; final s1 = lists.firstWhereOrNull((e) => e.s <= time); final s2 = lists.lastWhereOrNull((e) => e.s >= time); if (s1 == null || s2 == null) { return TravelTimeResult(null, p); } - final s = (time - s1.s) / (s2.s - s1.s) * (s2.distance - s1.distance) + + final s = + (time - s1.s) / (s2.s - s1.s) * (s2.distance - s1.distance) + s1.distance; return TravelTimeResult(s, p); } diff --git a/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart b/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart index 3bca1b31..3c20f5bc 100644 --- a/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart +++ b/app/lib/core/provider/travel_time/provider/travel_time_provider.g.dart @@ -32,9 +32,10 @@ String _$travelTimeInternalHash() => final travelTimeInternalProvider = FutureProvider.internal( travelTimeInternal, name: r'travelTimeInternalProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$travelTimeInternalHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$travelTimeInternalHash, dependencies: null, allTransitiveDependencies: null, ); @@ -50,9 +51,10 @@ String _$travelTimeDepthMapHash() => final travelTimeDepthMapProvider = Provider.internal( travelTimeDepthMap, name: r'travelTimeDepthMapProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$travelTimeDepthMapHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$travelTimeDepthMapHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/core/provider/websocket/websocket_provider.dart b/app/lib/core/provider/websocket/websocket_provider.dart index c800fc5d..7146c4d5 100644 --- a/app/lib/core/provider/websocket/websocket_provider.dart +++ b/app/lib/core/provider/websocket/websocket_provider.dart @@ -25,9 +25,7 @@ WebSocket websocket(Ref ref) { ); final socket = WebSocket( uri, - headers: { - HttpHeaders.authorizationHeader: Env.apiAuthorization, - }, + headers: {HttpHeaders.authorizationHeader: Env.apiAuthorization}, pingInterval: const Duration(seconds: 5), backoff: backoff, ); @@ -74,15 +72,13 @@ class WebsocketMessages extends _$WebsocketMessages { ref.onDispose(() { _controller.close(); }); - socket.messages.listen( - (message) { - talker.log('WebSocket message: $message'); - final decoded = jsonDecode(message.toString()); - if (decoded is Map) { - _controller.add(decoded); - } - }, - ); + socket.messages.listen((message) { + talker.log('WebSocket message: $message'); + final decoded = jsonDecode(message.toString()); + if (decoded is Map) { + _controller.add(decoded); + } + }); yield* _controller.stream; } @@ -91,17 +87,13 @@ class WebsocketMessages extends _$WebsocketMessages { } @Riverpod(keepAlive: true) -Stream websocketParsedMessages( - Ref ref, -) { +Stream websocketParsedMessages(Ref ref) { final controller = StreamController(); ref ..listen(websocketMessagesProvider, (previous, next) { final value = next.value; if (value != null) { - controller.add( - RealtimePostgresChangesPayloadBase.fromJson(value), - ); + controller.add(RealtimePostgresChangesPayloadBase.fromJson(value)); } }) ..onDispose(controller.close); @@ -109,9 +101,7 @@ Stream websocketParsedMessages( } @Riverpod(keepAlive: true) -Stream websocketTableMessages( - Ref ref, -) { +Stream websocketTableMessages(Ref ref) { final controller = StreamController(); ref ..listen(websocketParsedMessagesProvider, (previous, next) { diff --git a/app/lib/core/provider/websocket/websocket_provider.g.dart b/app/lib/core/provider/websocket/websocket_provider.g.dart index 05d5a1c3..26697675 100644 --- a/app/lib/core/provider/websocket/websocket_provider.g.dart +++ b/app/lib/core/provider/websocket/websocket_provider.g.dart @@ -31,19 +31,20 @@ String _$websocketParsedMessagesHash() => @ProviderFor(websocketParsedMessages) final websocketParsedMessagesProvider = StreamProvider.internal( - websocketParsedMessages, - name: r'websocketParsedMessagesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$websocketParsedMessagesHash, - dependencies: null, - allTransitiveDependencies: null, -); + websocketParsedMessages, + name: r'websocketParsedMessagesProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$websocketParsedMessagesHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef WebsocketParsedMessagesRef - = StreamProviderRef; +typedef WebsocketParsedMessagesRef = + StreamProviderRef; String _$websocketTableMessagesHash() => r'53916279b0c281a63156b8900900605a867bea1c'; @@ -51,33 +52,35 @@ String _$websocketTableMessagesHash() => @ProviderFor(websocketTableMessages) final websocketTableMessagesProvider = StreamProvider.internal( - websocketTableMessages, - name: r'websocketTableMessagesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$websocketTableMessagesHash, - dependencies: null, - allTransitiveDependencies: null, -); + websocketTableMessages, + name: r'websocketTableMessagesProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$websocketTableMessagesHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef WebsocketTableMessagesRef - = StreamProviderRef; +typedef WebsocketTableMessagesRef = + StreamProviderRef; String _$websocketStatusHash() => r'9c6c47911232f1770b32d1b13f4364abf4900063'; /// See also [WebsocketStatus]. @ProviderFor(WebsocketStatus) final websocketStatusProvider = NotifierProvider.internal( - WebsocketStatus.new, - name: r'websocketStatusProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$websocketStatusHash, - dependencies: null, - allTransitiveDependencies: null, -); + WebsocketStatus.new, + name: r'websocketStatusProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$websocketStatusHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$WebsocketStatus = Notifier; String _$websocketMessagesHash() => r'209382a0f1a8fb3231e709d278d154cf462aa4d6'; @@ -86,14 +89,15 @@ String _$websocketMessagesHash() => r'209382a0f1a8fb3231e709d278d154cf462aa4d6'; @ProviderFor(WebsocketMessages) final websocketMessagesProvider = StreamNotifierProvider>.internal( - WebsocketMessages.new, - name: r'websocketMessagesProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$websocketMessagesHash, - dependencies: null, - allTransitiveDependencies: null, -); + WebsocketMessages.new, + name: r'websocketMessagesProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$websocketMessagesHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$WebsocketMessages = StreamNotifier>; // ignore_for_file: type=lint diff --git a/app/lib/core/router/router.dart b/app/lib/core/router/router.dart index 4797365a..3555b4b4 100644 --- a/app/lib/core/router/router.dart +++ b/app/lib/core/router/router.dart @@ -50,23 +50,18 @@ final isInitializedStateProvider = StateProvider((ref) => false); @Riverpod(keepAlive: true) GoRouter goRouter(Ref ref) => GoRouter( - routes: $appRoutes, - navigatorKey: App.navigatorKey, - initialLocation: - (ref.read(sharedPreferencesProvider).getBool('isInitialized') ?? - false) - ? const HomeRoute().location - : const SetupRoute().location, - observers: [ - _NavigatorObserver( - talker, - ), - FirebaseAnalyticsObserver( - analytics: FirebaseAnalytics.instance, - ), - ], - debugLogDiagnostics: kDebugMode, - ); + routes: $appRoutes, + navigatorKey: App.navigatorKey, + initialLocation: + (ref.read(sharedPreferencesProvider).getBool('isInitialized') ?? false) + ? const HomeRoute().location + : const SetupRoute().location, + observers: [ + _NavigatorObserver(talker), + FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance), + ], + debugLogDiagnostics: kDebugMode, +); class GoRouterRedirectException implements Exception { GoRouterRedirectException(this.message); @@ -74,9 +69,7 @@ class GoRouterRedirectException implements Exception { final String message; } -@TypedGoRoute( - path: '/setup', -) +@TypedGoRoute(path: '/setup') class SetupRoute extends GoRouteData { const SetupRoute(); @@ -98,17 +91,13 @@ class EarthquakeHistoryRoute extends GoRouteData { path: '/earthquake-history-details/:eventId', ) class EarthquakeHistoryDetailsRoute extends GoRouteData { - const EarthquakeHistoryDetailsRoute({ - required this.eventId, - }); + const EarthquakeHistoryDetailsRoute({required this.eventId}); final int eventId; @override Widget build(BuildContext context, GoRouterState state) { - return EarthquakeHistoryDetailsPage( - eventId: eventId, - ); + return EarthquakeHistoryDetailsPage(eventId: eventId); } } @@ -125,17 +114,13 @@ class InformationHistoryRoute extends GoRouteData { path: '/information-history-details', ) class InformationHistoryDetailsRoute extends GoRouteData { - const InformationHistoryDetailsRoute({ - required this.$extra, - }); + const InformationHistoryDetailsRoute({required this.$extra}); final InformationV3 $extra; @override Widget build(BuildContext context, GoRouterState state) => - InformationHistoryDetailsPage( - data: $extra, - ); + InformationHistoryDetailsPage(data: $extra); } @TypedGoRoute( @@ -144,9 +129,7 @@ class InformationHistoryDetailsRoute extends GoRouteData { TypedGoRoute( path: 'earthquake-history-early', routes: [ - TypedGoRoute( - path: 'details/:id', - ), + TypedGoRoute(path: 'details/:id'), ], ), TypedGoRoute( @@ -159,9 +142,7 @@ class HomeRoute extends GoRouteData { @override Page buildPage(BuildContext context, GoRouterState state) => - const MaterialExtendedPage( - child: HomePage(), - ); + const MaterialExtendedPage(child: HomePage()); } @TypedGoRoute(path: '/talker') @@ -178,21 +159,13 @@ class TalkerRoute extends GoRouteData { TypedGoRoute( path: 'notification', routes: [ - TypedGoRoute( - path: 'earthquake', - ), - TypedGoRoute( - path: 'eew', - ), + TypedGoRoute(path: 'earthquake'), + TypedGoRoute(path: 'eew'), ], ), TypedGoRoute( path: 'display', - routes: [ - TypedGoRoute( - path: 'color-schema', - ), - ], + routes: [TypedGoRoute(path: 'color-schema')], ), TypedGoRoute( path: 'kyoshin-monitor-about', @@ -202,28 +175,14 @@ class TalkerRoute extends GoRouteData { ), ], ), - TypedGoRoute( - path: 'term-of-service', - ), - TypedGoRoute( - path: 'privacy-policy', - ), - TypedGoRoute( - path: 'license', - ), - TypedGoRoute( - path: 'earthquake-history', - ), - TypedGoRoute( - path: 'about-this-app', - ), + TypedGoRoute(path: 'term-of-service'), + TypedGoRoute(path: 'privacy-policy'), + TypedGoRoute(path: 'license'), + TypedGoRoute(path: 'earthquake-history'), + TypedGoRoute(path: 'about-this-app'), TypedGoRoute( path: 'donation', - routes: [ - TypedGoRoute( - path: 'executed', - ), - ], + routes: [TypedGoRoute(path: 'executed')], ), TypedGoRoute( path: 'debugger', @@ -234,12 +193,8 @@ class TalkerRoute extends GoRouteData { TypedGoRoute( path: 'websocket-api-endpoint-selector', ), - TypedGoRoute( - path: 'kyoshin-monitor', - ), - TypedGoRoute( - path: 'playground', - ), + TypedGoRoute(path: 'kyoshin-monitor'), + TypedGoRoute(path: 'playground'), ], ), ], @@ -321,17 +276,12 @@ class TermOfServiceRoute extends GoRouteData { this.showAcceptButton = false, }); - final void Function({ - bool isAccepted, - })? $extra; + final void Function({bool isAccepted})? $extra; final bool showAcceptButton; @override Widget build(BuildContext context, GoRouterState state) => - TermOfServiceScreen( - onResult: $extra, - showAcceptButton: showAcceptButton, - ); + TermOfServiceScreen(onResult: $extra, showAcceptButton: showAcceptButton); } class ColorSchemeConfigRoute extends GoRouteData { @@ -348,17 +298,12 @@ class PrivacyPolicyRoute extends GoRouteData { this.showAcceptButton = false, }); - final void Function({ - bool isAccepted, - })? $extra; + final void Function({bool isAccepted})? $extra; final bool showAcceptButton; @override Widget build(BuildContext context, GoRouterState state) => - PrivacyPolicyScreen( - onResult: $extra, - showAcceptButton: showAcceptButton, - ); + PrivacyPolicyScreen(onResult: $extra, showAcceptButton: showAcceptButton); } class LicenseRoute extends GoRouteData { @@ -384,23 +329,16 @@ class DonationRoute extends GoRouteData { Page buildPage(BuildContext context, GoRouterState state) => CustomTransitionPage( child: const DonationScreen(), - transitionsBuilder: (context, animation, secondaryAnimation, child) => - FadeTransition( - opacity: animation, - child: child, - ), + transitionsBuilder: + (context, animation, secondaryAnimation, child) => + FadeTransition(opacity: animation, child: child), ); } -typedef DonationExecutedRouteExtra = ( - StoreProduct, - CustomerInfo, -); +typedef DonationExecutedRouteExtra = (StoreProduct, CustomerInfo); class DonationExecutedRoute extends GoRouteData { - const DonationExecutedRoute({ - required this.$extra, - }); + const DonationExecutedRoute({required this.$extra}); final DonationExecutedRouteExtra $extra; @@ -421,11 +359,7 @@ class _NavigatorObserver extends NavigatorObserver { if (kIsWeb) { return; } - unawaited( - FirebaseAnalytics.instance.logScreenView( - screenName: page, - ), - ); + unawaited(FirebaseAnalytics.instance.logScreenView(screenName: page)); } } } diff --git a/app/lib/core/router/router.g.dart b/app/lib/core/router/router.g.dart index ba136415..14179137 100644 --- a/app/lib/core/router/router.g.dart +++ b/app/lib/core/router/router.g.dart @@ -9,27 +9,25 @@ part of 'router.dart'; // ************************************************************************** List get $appRoutes => [ - $setupRoute, - $earthquakeHistoryRoute, - $earthquakeHistoryDetailsRoute, - $informationHistoryRoute, - $informationHistoryDetailsRoute, - $homeRoute, - $talkerRoute, - $settingsRoute, - ]; + $setupRoute, + $earthquakeHistoryRoute, + $earthquakeHistoryDetailsRoute, + $informationHistoryRoute, + $informationHistoryDetailsRoute, + $homeRoute, + $talkerRoute, + $settingsRoute, +]; RouteBase get $setupRoute => GoRouteData.$route( - path: '/setup', - factory: $SetupRouteExtension._fromState, - ); + path: '/setup', + factory: $SetupRouteExtension._fromState, +); extension $SetupRouteExtension on SetupRoute { static SetupRoute _fromState(GoRouterState state) => const SetupRoute(); - String get location => GoRouteData.$location( - '/setup', - ); + String get location => GoRouteData.$location('/setup'); void go(BuildContext context) => context.go(location); @@ -42,17 +40,15 @@ extension $SetupRouteExtension on SetupRoute { } RouteBase get $earthquakeHistoryRoute => GoRouteData.$route( - path: '/earthquake-history', - factory: $EarthquakeHistoryRouteExtension._fromState, - ); + path: '/earthquake-history', + factory: $EarthquakeHistoryRouteExtension._fromState, +); extension $EarthquakeHistoryRouteExtension on EarthquakeHistoryRoute { static EarthquakeHistoryRoute _fromState(GoRouterState state) => const EarthquakeHistoryRoute(); - String get location => GoRouteData.$location( - '/earthquake-history', - ); + String get location => GoRouteData.$location('/earthquake-history'); void go(BuildContext context) => context.go(location); @@ -65,9 +61,9 @@ extension $EarthquakeHistoryRouteExtension on EarthquakeHistoryRoute { } RouteBase get $earthquakeHistoryDetailsRoute => GoRouteData.$route( - path: '/earthquake-history-details/:eventId', - factory: $EarthquakeHistoryDetailsRouteExtension._fromState, - ); + path: '/earthquake-history-details/:eventId', + factory: $EarthquakeHistoryDetailsRouteExtension._fromState, +); extension $EarthquakeHistoryDetailsRouteExtension on EarthquakeHistoryDetailsRoute { @@ -77,8 +73,8 @@ extension $EarthquakeHistoryDetailsRouteExtension ); String get location => GoRouteData.$location( - '/earthquake-history-details/${Uri.encodeComponent(eventId.toString())}', - ); + '/earthquake-history-details/${Uri.encodeComponent(eventId.toString())}', + ); void go(BuildContext context) => context.go(location); @@ -91,17 +87,15 @@ extension $EarthquakeHistoryDetailsRouteExtension } RouteBase get $informationHistoryRoute => GoRouteData.$route( - path: '/information-history', - factory: $InformationHistoryRouteExtension._fromState, - ); + path: '/information-history', + factory: $InformationHistoryRouteExtension._fromState, +); extension $InformationHistoryRouteExtension on InformationHistoryRoute { static InformationHistoryRoute _fromState(GoRouterState state) => const InformationHistoryRoute(); - String get location => GoRouteData.$location( - '/information-history', - ); + String get location => GoRouteData.$location('/information-history'); void go(BuildContext context) => context.go(location); @@ -114,20 +108,16 @@ extension $InformationHistoryRouteExtension on InformationHistoryRoute { } RouteBase get $informationHistoryDetailsRoute => GoRouteData.$route( - path: '/information-history-details', - factory: $InformationHistoryDetailsRouteExtension._fromState, - ); + path: '/information-history-details', + factory: $InformationHistoryDetailsRouteExtension._fromState, +); extension $InformationHistoryDetailsRouteExtension on InformationHistoryDetailsRoute { static InformationHistoryDetailsRoute _fromState(GoRouterState state) => - InformationHistoryDetailsRoute( - $extra: state.extra as InformationV3, - ); + InformationHistoryDetailsRoute($extra: state.extra as InformationV3); - String get location => GoRouteData.$location( - '/information-history-details', - ); + String get location => GoRouteData.$location('/information-history-details'); void go(BuildContext context) => context.go(location, extra: $extra); @@ -142,32 +132,30 @@ extension $InformationHistoryDetailsRouteExtension } RouteBase get $homeRoute => GoRouteData.$route( - path: '/', - factory: $HomeRouteExtension._fromState, + path: '/', + factory: $HomeRouteExtension._fromState, + routes: [ + GoRouteData.$route( + path: 'earthquake-history-early', + factory: $EarthquakeHistoryEarlyRouteExtension._fromState, routes: [ GoRouteData.$route( - path: 'earthquake-history-early', - factory: $EarthquakeHistoryEarlyRouteExtension._fromState, - routes: [ - GoRouteData.$route( - path: 'details/:id', - factory: $EarthquakeHistoryEarlyDetailsRouteExtension._fromState, - ), - ], - ), - GoRouteData.$route( - path: 'eew-details-by-event-id/:eventId', - factory: $EewDetailsByEventIdRouteExtension._fromState, + path: 'details/:id', + factory: $EarthquakeHistoryEarlyDetailsRouteExtension._fromState, ), ], - ); + ), + GoRouteData.$route( + path: 'eew-details-by-event-id/:eventId', + factory: $EewDetailsByEventIdRouteExtension._fromState, + ), + ], +); extension $HomeRouteExtension on HomeRoute { static HomeRoute _fromState(GoRouterState state) => const HomeRoute(); - String get location => GoRouteData.$location( - '/', - ); + String get location => GoRouteData.$location('/'); void go(BuildContext context) => context.go(location); @@ -183,9 +171,7 @@ extension $EarthquakeHistoryEarlyRouteExtension on EarthquakeHistoryEarlyRoute { static EarthquakeHistoryEarlyRoute _fromState(GoRouterState state) => const EarthquakeHistoryEarlyRoute(); - String get location => GoRouteData.$location( - '/earthquake-history-early', - ); + String get location => GoRouteData.$location('/earthquake-history-early'); void go(BuildContext context) => context.go(location); @@ -200,13 +186,11 @@ extension $EarthquakeHistoryEarlyRouteExtension on EarthquakeHistoryEarlyRoute { extension $EarthquakeHistoryEarlyDetailsRouteExtension on EarthquakeHistoryEarlyDetailsRoute { static EarthquakeHistoryEarlyDetailsRoute _fromState(GoRouterState state) => - EarthquakeHistoryEarlyDetailsRoute( - id: state.pathParameters['id']!, - ); + EarthquakeHistoryEarlyDetailsRoute(id: state.pathParameters['id']!); String get location => GoRouteData.$location( - '/earthquake-history-early/details/${Uri.encodeComponent(id)}', - ); + '/earthquake-history-early/details/${Uri.encodeComponent(id)}', + ); void go(BuildContext context) => context.go(location); @@ -220,13 +204,11 @@ extension $EarthquakeHistoryEarlyDetailsRouteExtension extension $EewDetailsByEventIdRouteExtension on EewDetailsByEventIdRoute { static EewDetailsByEventIdRoute _fromState(GoRouterState state) => - EewDetailsByEventIdRoute( - eventId: state.pathParameters['eventId']!, - ); + EewDetailsByEventIdRoute(eventId: state.pathParameters['eventId']!); String get location => GoRouteData.$location( - '/eew-details-by-event-id/${Uri.encodeComponent(eventId)}', - ); + '/eew-details-by-event-id/${Uri.encodeComponent(eventId)}', + ); void go(BuildContext context) => context.go(location); @@ -239,16 +221,14 @@ extension $EewDetailsByEventIdRouteExtension on EewDetailsByEventIdRoute { } RouteBase get $talkerRoute => GoRouteData.$route( - path: '/talker', - factory: $TalkerRouteExtension._fromState, - ); + path: '/talker', + factory: $TalkerRouteExtension._fromState, +); extension $TalkerRouteExtension on TalkerRoute { static TalkerRoute _fromState(GoRouterState state) => const TalkerRoute(); - String get location => GoRouteData.$location( - '/talker', - ); + String get location => GoRouteData.$location('/talker'); void go(BuildContext context) => context.go(location); @@ -261,105 +241,103 @@ extension $TalkerRouteExtension on TalkerRoute { } RouteBase get $settingsRoute => GoRouteData.$route( - path: '/settings', - factory: $SettingsRouteExtension._fromState, + path: '/settings', + factory: $SettingsRouteExtension._fromState, + routes: [ + GoRouteData.$route( + path: 'notification', + factory: $NotificationRouteExtension._fromState, routes: [ GoRouteData.$route( - path: 'notification', - factory: $NotificationRouteExtension._fromState, - routes: [ - GoRouteData.$route( - path: 'earthquake', - factory: $NotificationEarthquakeRouteExtension._fromState, - ), - GoRouteData.$route( - path: 'eew', - factory: $NotificationEewRouteExtension._fromState, - ), - ], + path: 'earthquake', + factory: $NotificationEarthquakeRouteExtension._fromState, ), GoRouteData.$route( - path: 'display', - factory: $DisplayRouteExtension._fromState, - routes: [ - GoRouteData.$route( - path: 'color-schema', - factory: $ColorSchemeConfigRouteExtension._fromState, - ), - ], - ), - GoRouteData.$route( - path: 'kyoshin-monitor-about', - factory: $KyoshinMonitorAboutRouteExtension._fromState, - routes: [ - GoRouteData.$route( - path: 'observation-network', - factory: $KyoshinMonitorAboutObservationNetworkRouteExtension - ._fromState, - ), - ], + path: 'eew', + factory: $NotificationEewRouteExtension._fromState, ), + ], + ), + GoRouteData.$route( + path: 'display', + factory: $DisplayRouteExtension._fromState, + routes: [ GoRouteData.$route( - path: 'term-of-service', - factory: $TermOfServiceRouteExtension._fromState, + path: 'color-schema', + factory: $ColorSchemeConfigRouteExtension._fromState, ), + ], + ), + GoRouteData.$route( + path: 'kyoshin-monitor-about', + factory: $KyoshinMonitorAboutRouteExtension._fromState, + routes: [ GoRouteData.$route( - path: 'privacy-policy', - factory: $PrivacyPolicyRouteExtension._fromState, + path: 'observation-network', + factory: + $KyoshinMonitorAboutObservationNetworkRouteExtension._fromState, ), + ], + ), + GoRouteData.$route( + path: 'term-of-service', + factory: $TermOfServiceRouteExtension._fromState, + ), + GoRouteData.$route( + path: 'privacy-policy', + factory: $PrivacyPolicyRouteExtension._fromState, + ), + GoRouteData.$route( + path: 'license', + factory: $LicenseRouteExtension._fromState, + ), + GoRouteData.$route( + path: 'earthquake-history', + factory: $EarthquakeHistoryConfigRouteExtension._fromState, + ), + GoRouteData.$route( + path: 'about-this-app', + factory: $AboutThisAppRouteExtension._fromState, + ), + GoRouteData.$route( + path: 'donation', + factory: $DonationRouteExtension._fromState, + routes: [ GoRouteData.$route( - path: 'license', - factory: $LicenseRouteExtension._fromState, + path: 'executed', + factory: $DonationExecutedRouteExtension._fromState, ), + ], + ), + GoRouteData.$route( + path: 'debugger', + factory: $DebuggerRouteExtension._fromState, + routes: [ GoRouteData.$route( - path: 'earthquake-history', - factory: $EarthquakeHistoryConfigRouteExtension._fromState, + path: 'api-endpoint-selector', + factory: $HttpApiEndpointSelectorRouteExtension._fromState, ), GoRouteData.$route( - path: 'about-this-app', - factory: $AboutThisAppRouteExtension._fromState, + path: 'websocket-api-endpoint-selector', + factory: $WebsocketEndpointSelectorRouteExtension._fromState, ), GoRouteData.$route( - path: 'donation', - factory: $DonationRouteExtension._fromState, - routes: [ - GoRouteData.$route( - path: 'executed', - factory: $DonationExecutedRouteExtension._fromState, - ), - ], + path: 'kyoshin-monitor', + factory: $DebugKyoshinMonitorRouteExtension._fromState, ), GoRouteData.$route( - path: 'debugger', - factory: $DebuggerRouteExtension._fromState, - routes: [ - GoRouteData.$route( - path: 'api-endpoint-selector', - factory: $HttpApiEndpointSelectorRouteExtension._fromState, - ), - GoRouteData.$route( - path: 'websocket-api-endpoint-selector', - factory: $WebsocketEndpointSelectorRouteExtension._fromState, - ), - GoRouteData.$route( - path: 'kyoshin-monitor', - factory: $DebugKyoshinMonitorRouteExtension._fromState, - ), - GoRouteData.$route( - path: 'playground', - factory: $PlaygroundRouteExtension._fromState, - ), - ], + path: 'playground', + factory: $PlaygroundRouteExtension._fromState, ), ], - ); + ), + ], +); extension $SettingsRouteExtension on SettingsRoute { static SettingsRoute _fromState(GoRouterState state) => const SettingsRoute(); - String get location => GoRouteData.$location( - '/settings', - ); + String get location => GoRouteData.$location('/settings'); void go(BuildContext context) => context.go(location); @@ -375,9 +353,7 @@ extension $NotificationRouteExtension on NotificationRoute { static NotificationRoute _fromState(GoRouterState state) => const NotificationRoute(); - String get location => GoRouteData.$location( - '/settings/notification', - ); + String get location => GoRouteData.$location('/settings/notification'); void go(BuildContext context) => context.go(location); @@ -393,9 +369,8 @@ extension $NotificationEarthquakeRouteExtension on NotificationEarthquakeRoute { static NotificationEarthquakeRoute _fromState(GoRouterState state) => const NotificationEarthquakeRoute(); - String get location => GoRouteData.$location( - '/settings/notification/earthquake', - ); + String get location => + GoRouteData.$location('/settings/notification/earthquake'); void go(BuildContext context) => context.go(location); @@ -411,9 +386,7 @@ extension $NotificationEewRouteExtension on NotificationEewRoute { static NotificationEewRoute _fromState(GoRouterState state) => const NotificationEewRoute(); - String get location => GoRouteData.$location( - '/settings/notification/eew', - ); + String get location => GoRouteData.$location('/settings/notification/eew'); void go(BuildContext context) => context.go(location); @@ -428,9 +401,7 @@ extension $NotificationEewRouteExtension on NotificationEewRoute { extension $DisplayRouteExtension on DisplayRoute { static DisplayRoute _fromState(GoRouterState state) => const DisplayRoute(); - String get location => GoRouteData.$location( - '/settings/display', - ); + String get location => GoRouteData.$location('/settings/display'); void go(BuildContext context) => context.go(location); @@ -446,9 +417,8 @@ extension $ColorSchemeConfigRouteExtension on ColorSchemeConfigRoute { static ColorSchemeConfigRoute _fromState(GoRouterState state) => const ColorSchemeConfigRoute(); - String get location => GoRouteData.$location( - '/settings/display/color-schema', - ); + String get location => + GoRouteData.$location('/settings/display/color-schema'); void go(BuildContext context) => context.go(location); @@ -464,9 +434,8 @@ extension $KyoshinMonitorAboutRouteExtension on KyoshinMonitorAboutRoute { static KyoshinMonitorAboutRoute _fromState(GoRouterState state) => const KyoshinMonitorAboutRoute(); - String get location => GoRouteData.$location( - '/settings/kyoshin-monitor-about', - ); + String get location => + GoRouteData.$location('/settings/kyoshin-monitor-about'); void go(BuildContext context) => context.go(location); @@ -481,12 +450,12 @@ extension $KyoshinMonitorAboutRouteExtension on KyoshinMonitorAboutRoute { extension $KyoshinMonitorAboutObservationNetworkRouteExtension on KyoshinMonitorAboutObservationNetworkRoute { static KyoshinMonitorAboutObservationNetworkRoute _fromState( - GoRouterState state) => - const KyoshinMonitorAboutObservationNetworkRoute(); + GoRouterState state, + ) => const KyoshinMonitorAboutObservationNetworkRoute(); String get location => GoRouteData.$location( - '/settings/kyoshin-monitor-about/observation-network', - ); + '/settings/kyoshin-monitor-about/observation-network', + ); void go(BuildContext context) => context.go(location); @@ -501,19 +470,23 @@ extension $KyoshinMonitorAboutObservationNetworkRouteExtension extension $TermOfServiceRouteExtension on TermOfServiceRoute { static TermOfServiceRoute _fromState(GoRouterState state) => TermOfServiceRoute( - showAcceptButton: _$convertMapValue('show-accept-button', - state.uri.queryParameters, _$boolConverter) ?? + showAcceptButton: + _$convertMapValue( + 'show-accept-button', + state.uri.queryParameters, + _$boolConverter, + ) ?? false, $extra: state.extra as void Function({bool isAccepted})?, ); String get location => GoRouteData.$location( - '/settings/term-of-service', - queryParams: { - if (showAcceptButton != false) - 'show-accept-button': showAcceptButton.toString(), - }, - ); + '/settings/term-of-service', + queryParams: { + if (showAcceptButton != false) + 'show-accept-button': showAcceptButton.toString(), + }, + ); void go(BuildContext context) => context.go(location, extra: $extra); @@ -530,19 +503,23 @@ extension $TermOfServiceRouteExtension on TermOfServiceRoute { extension $PrivacyPolicyRouteExtension on PrivacyPolicyRoute { static PrivacyPolicyRoute _fromState(GoRouterState state) => PrivacyPolicyRoute( - showAcceptButton: _$convertMapValue('show-accept-button', - state.uri.queryParameters, _$boolConverter) ?? + showAcceptButton: + _$convertMapValue( + 'show-accept-button', + state.uri.queryParameters, + _$boolConverter, + ) ?? false, $extra: state.extra as void Function({bool isAccepted})?, ); String get location => GoRouteData.$location( - '/settings/privacy-policy', - queryParams: { - if (showAcceptButton != false) - 'show-accept-button': showAcceptButton.toString(), - }, - ); + '/settings/privacy-policy', + queryParams: { + if (showAcceptButton != false) + 'show-accept-button': showAcceptButton.toString(), + }, + ); void go(BuildContext context) => context.go(location, extra: $extra); @@ -559,9 +536,7 @@ extension $PrivacyPolicyRouteExtension on PrivacyPolicyRoute { extension $LicenseRouteExtension on LicenseRoute { static LicenseRoute _fromState(GoRouterState state) => const LicenseRoute(); - String get location => GoRouteData.$location( - '/settings/license', - ); + String get location => GoRouteData.$location('/settings/license'); void go(BuildContext context) => context.go(location); @@ -578,9 +553,7 @@ extension $EarthquakeHistoryConfigRouteExtension static EarthquakeHistoryConfigRoute _fromState(GoRouterState state) => const EarthquakeHistoryConfigRoute(); - String get location => GoRouteData.$location( - '/settings/earthquake-history', - ); + String get location => GoRouteData.$location('/settings/earthquake-history'); void go(BuildContext context) => context.go(location); @@ -596,9 +569,7 @@ extension $AboutThisAppRouteExtension on AboutThisAppRoute { static AboutThisAppRoute _fromState(GoRouterState state) => const AboutThisAppRoute(); - String get location => GoRouteData.$location( - '/settings/about-this-app', - ); + String get location => GoRouteData.$location('/settings/about-this-app'); void go(BuildContext context) => context.go(location); @@ -613,9 +584,7 @@ extension $AboutThisAppRouteExtension on AboutThisAppRoute { extension $DonationRouteExtension on DonationRoute { static DonationRoute _fromState(GoRouterState state) => const DonationRoute(); - String get location => GoRouteData.$location( - '/settings/donation', - ); + String get location => GoRouteData.$location('/settings/donation'); void go(BuildContext context) => context.go(location); @@ -633,9 +602,7 @@ extension $DonationExecutedRouteExtension on DonationExecutedRoute { $extra: state.extra as (StoreProduct, CustomerInfo), ); - String get location => GoRouteData.$location( - '/settings/donation/executed', - ); + String get location => GoRouteData.$location('/settings/donation/executed'); void go(BuildContext context) => context.go(location, extra: $extra); @@ -652,9 +619,7 @@ extension $DonationExecutedRouteExtension on DonationExecutedRoute { extension $DebuggerRouteExtension on DebuggerRoute { static DebuggerRoute _fromState(GoRouterState state) => const DebuggerRoute(); - String get location => GoRouteData.$location( - '/settings/debugger', - ); + String get location => GoRouteData.$location('/settings/debugger'); void go(BuildContext context) => context.go(location); @@ -671,9 +636,8 @@ extension $HttpApiEndpointSelectorRouteExtension static HttpApiEndpointSelectorRoute _fromState(GoRouterState state) => const HttpApiEndpointSelectorRoute(); - String get location => GoRouteData.$location( - '/settings/debugger/api-endpoint-selector', - ); + String get location => + GoRouteData.$location('/settings/debugger/api-endpoint-selector'); void go(BuildContext context) => context.go(location); @@ -691,8 +655,8 @@ extension $WebsocketEndpointSelectorRouteExtension const WebsocketEndpointSelectorRoute(); String get location => GoRouteData.$location( - '/settings/debugger/websocket-api-endpoint-selector', - ); + '/settings/debugger/websocket-api-endpoint-selector', + ); void go(BuildContext context) => context.go(location); @@ -708,9 +672,8 @@ extension $DebugKyoshinMonitorRouteExtension on DebugKyoshinMonitorRoute { static DebugKyoshinMonitorRoute _fromState(GoRouterState state) => const DebugKyoshinMonitorRoute(); - String get location => GoRouteData.$location( - '/settings/debugger/kyoshin-monitor', - ); + String get location => + GoRouteData.$location('/settings/debugger/kyoshin-monitor'); void go(BuildContext context) => context.go(location); @@ -726,9 +689,7 @@ extension $PlaygroundRouteExtension on PlaygroundRoute { static PlaygroundRoute _fromState(GoRouterState state) => const PlaygroundRoute(); - String get location => GoRouteData.$location( - '/settings/debugger/playground', - ); + String get location => GoRouteData.$location('/settings/debugger/playground'); void go(BuildContext context) => context.go(location); diff --git a/app/lib/core/theme/build_theme.dart b/app/lib/core/theme/build_theme.dart index fa450829..3d004606 100644 --- a/app/lib/core/theme/build_theme.dart +++ b/app/lib/core/theme/build_theme.dart @@ -4,10 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -ThemeData buildTheme({ - ColorScheme? colorScheme, - CustomColors? customColors, -}) { +ThemeData buildTheme({ColorScheme? colorScheme, CustomColors? customColors}) { return ThemeData( colorScheme: colorScheme, extensions: [if (customColors != null) customColors], diff --git a/app/lib/core/theme/custom_colors.dart b/app/lib/core/theme/custom_colors.dart index 8b6162d7..33087c72 100644 --- a/app/lib/core/theme/custom_colors.dart +++ b/app/lib/core/theme/custom_colors.dart @@ -3,17 +3,13 @@ import 'package:flutter/material.dart'; @immutable class CustomColors extends ThemeExtension { - const CustomColors({ - required this.danger, - }); + const CustomColors({required this.danger}); final Color? danger; @override CustomColors copyWith({Color? danger}) { - return CustomColors( - danger: danger ?? this.danger, - ); + return CustomColors(danger: danger ?? this.danger); } @override @@ -21,9 +17,7 @@ class CustomColors extends ThemeExtension { if (other is! CustomColors) { return this; } - return CustomColors( - danger: Color.lerp(danger, other.danger, t), - ); + return CustomColors(danger: Color.lerp(danger, other.danger, t)); } CustomColors harmonized(ColorScheme dynamic) { diff --git a/app/lib/core/theme/platform_brightness.g.dart b/app/lib/core/theme/platform_brightness.g.dart index 87f7079d..4345ca77 100644 --- a/app/lib/core/theme/platform_brightness.g.dart +++ b/app/lib/core/theme/platform_brightness.g.dart @@ -15,14 +15,15 @@ String _$platformBrightnessHash() => @ProviderFor(PlatformBrightness) final platformBrightnessProvider = AutoDisposeNotifierProvider.internal( - PlatformBrightness.new, - name: r'platformBrightnessProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$platformBrightnessHash, - dependencies: null, - allTransitiveDependencies: null, -); + PlatformBrightness.new, + name: r'platformBrightnessProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$platformBrightnessHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$PlatformBrightness = AutoDisposeNotifier; // ignore_for_file: type=lint diff --git a/app/lib/core/theme/theme_provider.g.dart b/app/lib/core/theme/theme_provider.g.dart index eac10a90..9e26ab57 100644 --- a/app/lib/core/theme/theme_provider.g.dart +++ b/app/lib/core/theme/theme_provider.g.dart @@ -14,14 +14,15 @@ String _$themeModeNotifierHash() => r'fc896b63bda7ea9e58659851b10234f4074bab94'; @ProviderFor(ThemeModeNotifier) final themeModeNotifierProvider = NotifierProvider.internal( - ThemeModeNotifier.new, - name: r'themeModeNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$themeModeNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + ThemeModeNotifier.new, + name: r'themeModeNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$themeModeNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$ThemeModeNotifier = Notifier; String _$brightnessNotifierHash() => @@ -31,14 +32,15 @@ String _$brightnessNotifierHash() => @ProviderFor(BrightnessNotifier) final brightnessNotifierProvider = NotifierProvider.internal( - BrightnessNotifier.new, - name: r'brightnessNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$brightnessNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + BrightnessNotifier.new, + name: r'brightnessNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$brightnessNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$BrightnessNotifier = Notifier; // ignore_for_file: type=lint diff --git a/app/lib/core/util/env.dart b/app/lib/core/util/env.dart index 1de8f20e..898b2318 100644 --- a/app/lib/core/util/env.dart +++ b/app/lib/core/util/env.dart @@ -2,15 +2,14 @@ // ignore: avoid_classes_with_only_static_members class Env { - static Flavor flavor = - Flavor.values.byName(const String.fromEnvironment('FLAVOR')); + static Flavor flavor = Flavor.values.byName( + const String.fromEnvironment('FLAVOR'), + ); static const String restApiUrl = String.fromEnvironment('REST_API_URL'); static const String wsApiUrl = String.fromEnvironment('WS_API_URL'); - static const String apiAuthorization = - String.fromEnvironment('API_AUTHORIZATION'); + static const String apiAuthorization = String.fromEnvironment( + 'API_AUTHORIZATION', + ); } -enum Flavor { - dev, - prod, -} +enum Flavor { dev, prod } diff --git a/app/lib/core/util/fullscreen_loading_overlay.dart b/app/lib/core/util/fullscreen_loading_overlay.dart index 0cf4d619..16bad5ee 100644 --- a/app/lib/core/util/fullscreen_loading_overlay.dart +++ b/app/lib/core/util/fullscreen_loading_overlay.dart @@ -41,8 +41,6 @@ class FullScreenCircularProgressIndicator extends StatelessWidget { @override Widget build(BuildContext context) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); + return const Center(child: CircularProgressIndicator.adaptive()); } } diff --git a/app/lib/core/util/license/init_licenses.dart b/app/lib/core/util/license/init_licenses.dart index e0670794..06fd0be0 100644 --- a/app/lib/core/util/license/init_licenses.dart +++ b/app/lib/core/util/license/init_licenses.dart @@ -1,11 +1,10 @@ import 'package:flutter/foundation.dart'; Future initLicenses() async { - LicenseRegistry.addLicense( - () async* { - yield const LicenseEntryWithLineBreaks( - ['KyoshinEewViewerIngen'], - ''' + LicenseRegistry.addLicense(() async* { + yield const LicenseEntryWithLineBreaks( + ['KyoshinEewViewerIngen'], + ''' MIT License Copyright (c) 2019 ingen084 @@ -28,10 +27,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''', - ); - yield const LicenseEntryWithLineBreaks( - ['KyoshinMonitorLib'], - ''' + ); + yield const LicenseEntryWithLineBreaks( + ['KyoshinMonitorLib'], + ''' MIT License Copyright (c) 2020 ingen084 @@ -53,16 +52,15 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''', - ); - yield const LicenseEntryWithLineBreaks( - ['「国土数値情報(行政区域データ)」(国土交通省)(当該ページのURL)を加工して作成'], - ''' + ); + yield const LicenseEntryWithLineBreaks( + ['「国土数値情報(行政区域データ)」(国土交通省)(当該ページのURL)を加工して作成'], + ''' https://nlftp.mlit.go.jp/ksj/other/agreement.html に従います''', - ); - yield const LicenseEntryWithLineBreaks( - ['Natural Earth(世界地図)'], - '© 2009 - 2024. Natural Earth. All rights reserved.\nhttps://www.naturalearthdata.com/', - ); - }, - ); + ); + yield const LicenseEntryWithLineBreaks( + ['Natural Earth(世界地図)'], + '© 2009 - 2024. Natural Earth. All rights reserved.\nhttps://www.naturalearthdata.com/', + ); + }); } diff --git a/app/lib/feature/donation/data/donation_notifier.dart b/app/lib/feature/donation/data/donation_notifier.dart index 3bfb2509..b4d52f9f 100644 --- a/app/lib/feature/donation/data/donation_notifier.dart +++ b/app/lib/feature/donation/data/donation_notifier.dart @@ -6,18 +6,16 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'donation_notifier.g.dart'; Future initInAppPurchase() async { - await Purchases.setLogLevel( - kDebugMode ? LogLevel.debug : LogLevel.warn, - ); + await Purchases.setLogLevel(kDebugMode ? LogLevel.debug : LogLevel.warn); // Public App-specific API Keys final configuration = switch (defaultTargetPlatform) { TargetPlatform.android => PurchasesConfiguration( - 'goog_aEcAyBNviKgaKzmCwAOXSiXwHIb', - ), + 'goog_aEcAyBNviKgaKzmCwAOXSiXwHIb', + ), TargetPlatform.iOS || TargetPlatform.macOS => PurchasesConfiguration( - 'appl_BUymtTPkwhhVuihBlVOddLxOBaQ', - ), + 'appl_BUymtTPkwhhVuihBlVOddLxOBaQ', + ), _ => throw UnimplementedError(), }; @@ -26,9 +24,9 @@ Future initInAppPurchase() async { @Riverpod(keepAlive: true) Future> products(Ref ref) => Purchases.getProducts( - Products.values.map((e) => e.id).toList(), - productCategory: ProductCategory.nonSubscription, - ); + Products.values.map((e) => e.id).toList(), + productCategory: ProductCategory.nonSubscription, +); @riverpod Future purchase(Ref ref, StoreProduct product) => @@ -38,8 +36,7 @@ enum Products { coffee('0001'), enegyDrink('400'), meat('1000'), - eel('3000'), - ; + eel('3000'); const Products(this.id); final String id; diff --git a/app/lib/feature/donation/data/donation_notifier.g.dart b/app/lib/feature/donation/data/donation_notifier.g.dart index 4358b6fb..d0ad2388 100644 --- a/app/lib/feature/donation/data/donation_notifier.g.dart +++ b/app/lib/feature/donation/data/donation_notifier.g.dart @@ -57,21 +57,13 @@ class PurchaseFamily extends Family> { const PurchaseFamily(); /// See also [purchase]. - PurchaseProvider call( - StoreProduct product, - ) { - return PurchaseProvider( - product, - ); + PurchaseProvider call(StoreProduct product) { + return PurchaseProvider(product); } @override - PurchaseProvider getProviderOverride( - covariant PurchaseProvider provider, - ) { - return call( - provider.product, - ); + PurchaseProvider getProviderOverride(covariant PurchaseProvider provider) { + return call(provider.product); } static const Iterable? _dependencies = null; @@ -92,23 +84,19 @@ class PurchaseFamily extends Family> { /// See also [purchase]. class PurchaseProvider extends AutoDisposeFutureProvider { /// See also [purchase]. - PurchaseProvider( - StoreProduct product, - ) : this._internal( - (ref) => purchase( - ref as PurchaseRef, - product, - ), - from: purchaseProvider, - name: r'purchaseProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$purchaseHash, - dependencies: PurchaseFamily._dependencies, - allTransitiveDependencies: PurchaseFamily._allTransitiveDependencies, - product: product, - ); + PurchaseProvider(StoreProduct product) + : this._internal( + (ref) => purchase(ref as PurchaseRef, product), + from: purchaseProvider, + name: r'purchaseProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$purchaseHash, + dependencies: PurchaseFamily._dependencies, + allTransitiveDependencies: PurchaseFamily._allTransitiveDependencies, + product: product, + ); PurchaseProvider._internal( super._createNotifier, { @@ -167,11 +155,13 @@ mixin PurchaseRef on AutoDisposeFutureProviderRef { } class _PurchaseProviderElement - extends AutoDisposeFutureProviderElement with PurchaseRef { + extends AutoDisposeFutureProviderElement + with PurchaseRef { _PurchaseProviderElement(super.provider); @override StoreProduct get product => (origin as PurchaseProvider).product; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/donation/ui/donation_choice_modal.dart b/app/lib/feature/donation/ui/donation_choice_modal.dart index dee14d63..f6c1f4a2 100644 --- a/app/lib/feature/donation/ui/donation_choice_modal.dart +++ b/app/lib/feature/donation/ui/donation_choice_modal.dart @@ -6,31 +6,29 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:purchases_flutter/purchases_flutter.dart'; class DonationChoiceModal extends HookConsumerWidget { - const DonationChoiceModal._({ - required this.choices, - }); + const DonationChoiceModal._({required this.choices}); final List choices; static Future show( BuildContext context, List products, - ) => - showModalBottomSheet( - clipBehavior: Clip.antiAlias, - context: context, - builder: (context) => DonationChoiceModal._(choices: products), - ); + ) => showModalBottomSheet( + clipBehavior: Clip.antiAlias, + context: context, + builder: (context) => DonationChoiceModal._(choices: products), + ); @override Widget build(BuildContext context, WidgetRef ref) { final sortedChoices = useMemoized( - () => choices.sorted((a, b) => a.price.compareTo(b.price)).map((choice) { - final matchedProduct = Products.values.firstWhereOrNull( - (product) => product.id == choice.identifier, - ); - return (choice, matchedProduct); - }).whereType<(StoreProduct, Products)>(), + () => + choices.sorted((a, b) => a.price.compareTo(b.price)).map((choice) { + final matchedProduct = Products.values.firstWhereOrNull( + (product) => product.id == choice.identifier, + ); + return (choice, matchedProduct); + }).whereType<(StoreProduct, Products)>(), [choices], ); final theme = Theme.of(context); @@ -69,10 +67,7 @@ class DonationChoiceModal extends HookConsumerWidget { choice.priceString, style: theme.textTheme.titleSmall, ), - leading: Text( - emoji, - style: const TextStyle(fontSize: 24), - ), + leading: Text(emoji, style: const TextStyle(fontSize: 24)), onTap: () => Navigator.of(context).pop(choice), ); }(), @@ -109,9 +104,9 @@ extension ProductEx on Products { } String get productName => switch (this) { - Products.coffee => 'コーヒー', - Products.enegyDrink => 'エナジードリンクセット', - Products.meat => '美味しい牛肉', - Products.eel => 'うな重' - }; + Products.coffee => 'コーヒー', + Products.enegyDrink => 'エナジードリンクセット', + Products.meat => '美味しい牛肉', + Products.eel => 'うな重', + }; } diff --git a/app/lib/feature/donation/ui/donation_executed_screen.dart b/app/lib/feature/donation/ui/donation_executed_screen.dart index ae873831..3d16da92 100644 --- a/app/lib/feature/donation/ui/donation_executed_screen.dart +++ b/app/lib/feature/donation/ui/donation_executed_screen.dart @@ -15,10 +15,7 @@ import 'package:share_plus/share_plus.dart'; import 'package:url_launcher/url_launcher_string.dart'; class DonationExecutedScreen extends HookConsumerWidget { - const DonationExecutedScreen({ - required this.result, - super.key, - }); + const DonationExecutedScreen({required this.result, super.key}); final (StoreProduct, CustomerInfo) result; @@ -31,9 +28,7 @@ class DonationExecutedScreen extends HookConsumerWidget { final productEnum = Products.values.firstWhere( (e) => e.id == product.identifier, ); - final controller = useMemoized( - ScreenshotController.new, - ); + final controller = useMemoized(ScreenshotController.new); final body = Stack( children: [ SingleChildScrollView( @@ -63,10 +58,7 @@ class DonationExecutedScreen extends HookConsumerWidget { appBar: AppBar( backgroundColor: Colors.transparent, leading: IconButton( - icon: const Icon( - Icons.close, - color: Colors.white, - ), + icon: const Icon(Icons.close, color: Colors.white), onPressed: Navigator.of(context).pop, ), ), @@ -85,10 +77,10 @@ class DonationExecutedScreen extends HookConsumerWidget { ActionButton.text( context: context, text: 'アプリストアでレビューを書く', - onPressed: () async => - InAppReview.instance.openStoreListing( - appStoreId: '6447546703', - ), + onPressed: + () async => InAppReview.instance.openStoreListing( + appStoreId: '6447546703', + ), ), Row( children: [ @@ -99,10 +91,7 @@ class DonationExecutedScreen extends HookConsumerWidget { onPressed: () async { final image = await controller.capture(); await Share.shareXFiles([ - XFile.fromData( - image!, - mimeType: 'image/png', - ), + XFile.fromData(image!, mimeType: 'image/png'), ]); }, accentColor: Colors.grey.shade900, @@ -166,21 +155,18 @@ class _ScrollView extends StatelessWidget { children: [ const TextSpan( text: 'ご支援頂きありがとうございます!\n', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), const TextSpan( text: 'あなたのご支援のお陰で、より良いアプリを作ることができます。\n\n', ), const TextSpan( text: '皆様の声が励みになります!\n', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), const TextSpan( - text: 'Twitter(X)やメールで私へ連絡いただけると嬉しいです!' + text: + 'Twitter(X)やメールで私へ連絡いただけると嬉しいです!' 'もしくは、アプリストアへのレビューもお待ちしております\n\n' 'ご意見やご要望があれば、お気軽にお知らせください!\n\n' '- Ryotaro Onoue (Twitter: ', @@ -188,13 +174,13 @@ class _ScrollView extends StatelessWidget { for (final account in ['YumNumm', 'EQMonitorApp']) TextSpan( text: '@$account', - style: TextStyle( - color: Colors.blue.shade400, - ), - recognizer: TapGestureRecognizer() - ..onTap = () async => launchUrlString( - 'https://twitter.com/$account', - ), + style: TextStyle(color: Colors.blue.shade400), + recognizer: + TapGestureRecognizer() + ..onTap = + () async => launchUrlString( + 'https://twitter.com/$account', + ), ), ], ), @@ -260,19 +246,11 @@ class _Detail extends StatelessWidget { ), Text( product.priceString, - style: textTheme.titleMedium?.copyWith( - color: Colors.white, - ), + style: textTheme.titleMedium?.copyWith(color: Colors.white), ), Text( - "Tipped at ${DateFormat('yyyy/MM/dd HH:mm').format( - DateTime.parse( - customer.requestDate, - ).toLocal(), - )}", - style: textTheme.labelLarge?.copyWith( - color: Colors.white, - ), + "Tipped at ${DateFormat('yyyy/MM/dd HH:mm').format(DateTime.parse(customer.requestDate).toLocal())}", + style: textTheme.labelLarge?.copyWith(color: Colors.white), ), ], ), diff --git a/app/lib/feature/donation/ui/donation_screen.dart b/app/lib/feature/donation/ui/donation_screen.dart index 0a1bc389..3cec22b5 100644 --- a/app/lib/feature/donation/ui/donation_screen.dart +++ b/app/lib/feature/donation/ui/donation_screen.dart @@ -24,10 +24,7 @@ class DonationScreen extends StatelessWidget { appBar: AppBar( backgroundColor: Colors.transparent, leading: IconButton( - icon: const Icon( - Icons.close, - color: Colors.white, - ), + icon: const Icon(Icons.close, color: Colors.white), onPressed: () => Navigator.of(context).pop(), ), ), @@ -45,23 +42,18 @@ class _Body extends StatelessWidget { @override Widget build(BuildContext context) { const messageTextSpan = TextSpan( - style: TextStyle( - fontSize: 16, - color: Colors.white, - ), + style: TextStyle(fontSize: 16, color: Colors.white), children: [ + TextSpan(text: 'このアプリケーションは、広告・有料プランなどの収益化を行っていません。\n'), TextSpan( - text: 'このアプリケーションは、広告・有料プランなどの収益化を行っていません。\n', - ), - TextSpan( - text: '開発者は、このアプリケーションを開発・運用するために、' + text: + '開発者は、このアプリケーションを開発・運用するために、' '各種地震情報の入手に関わる費用や情報を配信するためのサーバ費などの費用を支払っています。\n', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), TextSpan( - text: 'もし、このアプリケーションを気に入っていただけた場合、' + text: + 'もし、このアプリケーションを気に入っていただけた場合、' '開発者へのチップをご検討いただけると幸いです。\n\n' 'チップは、開発者のモチベーション向上に繋がり、' 'アプリケーションの品質向上に繋がります。', @@ -82,9 +74,7 @@ class _Body extends StatelessWidget { height: 100, child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(800)), - child: Image( - image: AssetImage('assets/images/icon.png'), - ), + child: Image(image: AssetImage('assets/images/icon.png')), ), ), ), @@ -111,9 +101,7 @@ class _Body extends StatelessWidget { // 画面中部のメッセージ Padding( padding: EdgeInsets.all(16), - child: Text.rich( - messageTextSpan, - ), + child: Text.rich(messageTextSpan), ), Spacer(), ], @@ -156,85 +144,80 @@ class _ShowDonationButton extends HookConsumerWidget { Expanded( child: switch (state) { AsyncError() => ActionButton.text( - context: context, - text: '読み込みに失敗しました', - onPressed: () {}, - ), + context: context, + text: '読み込みに失敗しました', + onPressed: () {}, + ), AsyncData(:final value) => () { - final cheapest = - value.reduce((a, b) => a.price < b.price ? a : b); - return Column( - children: [ - ActionButton.text( - context: context, - text: 'チップを贈る', - onPressed: () async { - final item = await DonationChoiceModal.show( - context, - value, + final cheapest = value.reduce( + (a, b) => a.price < b.price ? a : b, + ); + return Column( + children: [ + ActionButton.text( + context: context, + text: 'チップを贈る', + onPressed: () async { + final item = await DonationChoiceModal.show( + context, + value, + ); + if (item != null && context.mounted) { + unawaited( + showDialog( + context: context, + barrierDismissible: false, + builder: + (context) => const Center( + child: CircularProgressIndicator.adaptive(), + ), + ), ); - if (item != null && context.mounted) { - unawaited( - showDialog( - context: context, - barrierDismissible: false, - builder: (context) => const Center( - child: CircularProgressIndicator.adaptive(), - ), - ), + try { + log('購入処理を開始します: ${item.identifier}'); + final purchaseResult = await ref.read( + purchaseProvider(item).future, ); - try { - log('購入処理を開始します: ${item.identifier}'); - final purchaseResult = - await ref.read(purchaseProvider(item).future); - log('購入処理が完了しました: ${item.identifier}'); + log('購入処理が完了しました: ${item.identifier}'); - if (context.mounted) { - Navigator.of(context).pop(); - // 完了画面へ遷移 - await DonationExecutedRoute( - $extra: (item, purchaseResult), - ).push(context); - } - } on PlatformException catch (e) { - final code = PurchasesErrorHelper.getErrorCode(e); - final message = switch (code) { - PurchasesErrorCode.purchaseCancelledError => - null, - _ => code.name, - }; - if (context.mounted && message != null) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - 'エラーが発生しました: $code', - ), - ), - ); - } - } finally { - if (context.mounted) { - Navigator.of(context).pop(); - } + if (context.mounted) { + Navigator.of(context).pop(); + // 完了画面へ遷移 + await DonationExecutedRoute( + $extra: (item, purchaseResult), + ).push(context); + } + } on PlatformException catch (e) { + final code = PurchasesErrorHelper.getErrorCode(e); + final message = switch (code) { + PurchasesErrorCode.purchaseCancelledError => null, + _ => code.name, + }; + if (context.mounted && message != null) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('エラーが発生しました: $code')), + ); + } + } finally { + if (context.mounted) { + Navigator.of(context).pop(); } } - }, - ), - Text( - 'ワンタイム ${cheapest.priceString}~', - style: const TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ], - ); - }(), + } + }, + ), + Text( + 'ワンタイム ${cheapest.priceString}~', + style: const TextStyle(color: Colors.white, fontSize: 12), + ), + ], + ); + }(), _ => ActionButton.text( - context: context, - text: '読み込み中...', - onPressed: () {}, - ) + context: context, + text: '読み込み中...', + onPressed: () {}, + ), }, ), ], diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart index dab4f542..8da160ee 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart @@ -20,10 +20,8 @@ import 'package:web_socket_client/web_socket_client.dart'; part 'earthquake_history_notifier.g.dart'; -typedef EarthquakeHistoryNotifierState = ( - List, - int totalCount -); +typedef EarthquakeHistoryNotifierState = + (List, int totalCount); @riverpod class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { @@ -44,34 +42,27 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { ); ref ..onDispose(refetchTimer.cancel) - // アプリがバックグラウンドからフォアグラウンドに戻った際にデータを再取得する - ..listen( - appLifecycleProvider, - (_, next) async { - if (next == AppLifecycleState.resumed) { - await _onResumed(); - } - }, - ) + ..listen(appLifecycleProvider, (_, next) async { + if (next == AppLifecycleState.resumed) { + await _onResumed(); + } + }) // WebSocketからのデータを適用する - ..listen( - websocketTableMessagesProvider, - (_, next) { - if (next case AsyncData(value: final value)) { - if (value is! RealtimePostgresChangesPayloadTable) { - return; - } - final _ = switch (value) { - RealtimePostgresInsertPayload(:final newData) => - _upsertEarthquakeV1s([newData]), - RealtimePostgresUpdatePayload(:final newData) => - _upsertEarthquakeV1s([newData]), - RealtimePostgresDeletePayload() => null, - }; + ..listen(websocketTableMessagesProvider, (_, next) { + if (next case AsyncData(value: final value)) { + if (value is! RealtimePostgresChangesPayloadTable) { + return; } - }, - ); + final _ = switch (value) { + RealtimePostgresInsertPayload(:final newData) => + _upsertEarthquakeV1s([newData]), + RealtimePostgresUpdatePayload(:final newData) => + _upsertEarthquakeV1s([newData]), + RealtimePostgresDeletePayload() => null, + }; + } + }); } return _fetchInitialData( @@ -100,10 +91,7 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { limit: limit, ); return ( - await _v1ToV1Extended( - data: result.items, - regions: regions, - ), + await _v1ToV1Extended(data: result.items, regions: regions), result.count, ); } @@ -113,21 +101,22 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { state = const AsyncLoading(); state = await AsyncValue.guard<(List, int totalCount)>( - () async { - // ensure earthquakeParameter has been initialized. - if (ref.read(jmaParameterProvider).hasError) { - ref.invalidate(jmaParameterProvider); - } - await ref.read(jmaParameterProvider.future); - final earthquakeParameter = - ref.watch(jmaParameterProvider).valueOrNull!.earthquake; - - return _fetchInitialData( - param: parameter, - regions: earthquakeParameter.regions, - limit: 50, - ); - }); + () async { + // ensure earthquakeParameter has been initialized. + if (ref.read(jmaParameterProvider).hasError) { + ref.invalidate(jmaParameterProvider); + } + await ref.read(jmaParameterProvider.future); + final earthquakeParameter = + ref.watch(jmaParameterProvider).valueOrNull!.earthquake; + + return _fetchInitialData( + param: parameter, + regions: earthquakeParameter.regions, + limit: 50, + ); + }, + ); } Future fetchNextData() async { @@ -147,35 +136,31 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { state = const AsyncLoading<(List, int totalCount)>() .copyWithPrevious(state); - state = await state.guardPlus( - () async { - final repository = ref.read(earthquakeHistoryRepositoryProvider); - final currentData = state.valueOrNull; - final result = await repository.fetchEarthquakeLists( - depthGte: parameter.depthGte, - depthLte: parameter.depthLte, - intensityGte: parameter.intensityGte, - intensityLte: parameter.intensityLte, - magnitudeGte: parameter.magnitudeGte, - magnitudeLte: parameter.magnitudeLte, - offset: currentData?.$1.length ?? 0, - limit: 50, - ); - final extendedResult = await _v1ToV1Extended( - data: result.items, - regions: jmaEarthquakeParameter.regions, - ); - return ( - [ - ...currentData?.$1 ?? [], - ...extendedResult, - ].sorted( - (a, b) => b.eventId.compareTo(a.eventId), - ), - result.count - ); - }, - ); + state = await state.guardPlus(() async { + final repository = ref.read(earthquakeHistoryRepositoryProvider); + final currentData = state.valueOrNull; + final result = await repository.fetchEarthquakeLists( + depthGte: parameter.depthGte, + depthLte: parameter.depthLte, + intensityGte: parameter.intensityGte, + intensityLte: parameter.intensityLte, + magnitudeGte: parameter.magnitudeGte, + magnitudeLte: parameter.magnitudeLte, + offset: currentData?.$1.length ?? 0, + limit: 50, + ); + final extendedResult = await _v1ToV1Extended( + data: result.items, + regions: jmaEarthquakeParameter.regions, + ); + return ( + [ + ...currentData?.$1 ?? [], + ...extendedResult, + ].sorted((a, b) => b.eventId.compareTo(a.eventId)), + result.count, + ); + }); } Future _onResumed() async { @@ -245,9 +230,7 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { } // event_idで降順ソート histories.sort((a, b) => b.eventId.compareTo(a.eventId)); - state = AsyncData( - (histories, currentData.$2), - ); + state = AsyncData((histories, currentData.$2)); } Future> _v1ToV1Extended({ @@ -258,16 +241,19 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { for (final e in data) EarthquakeV1Extended( earthquake: e, - maxIntensityRegionNames: e.maxIntensityRegionIds - ?.map( - (region) => regions - .firstWhereOrNull( - (paramRegion) => int.parse(paramRegion.code) == region, - ) - ?.name, - ) - .nonNulls - .toList(), + maxIntensityRegionNames: + e.maxIntensityRegionIds + ?.map( + (region) => + regions + .firstWhereOrNull( + (paramRegion) => + int.parse(paramRegion.code) == region, + ) + ?.name, + ) + .nonNulls + .toList(), ), ]; /* 別Isolateで処理させるならコッチ @@ -337,25 +323,25 @@ Future earthquakeV1Extended( return EarthquakeV1Extended( earthquake: data, - maxIntensityRegionNames: data.maxIntensityRegionIds - ?.map( - (region) => regions - .firstWhereOrNull( - (paramRegion) => int.parse(paramRegion.code) == region, - ) - ?.name, - ) - .nonNulls - .toList(), + maxIntensityRegionNames: + data.maxIntensityRegionIds + ?.map( + (region) => + regions + .firstWhereOrNull( + (paramRegion) => int.parse(paramRegion.code) == region, + ) + ?.name, + ) + .nonNulls + .toList(), ); } class EarthquakeParameterHasNotInitializedException implements Exception {} -extension EarthquakeHistoryState on ( - List, - int totalCount -) { +extension EarthquakeHistoryState + on (List, int totalCount) { bool get hasNext => $1.length < $2; } @@ -364,10 +350,12 @@ extension EarthquakeHistoryParameterMatch on EarthquakeHistoryParameter { RealtimePostgresChangesPayloadTable payload, ) { return switch (payload) { - RealtimePostgresInsertPayload() => - isEarthquakeV1Match(payload.newData), - RealtimePostgresUpdatePayload() => - isEarthquakeV1Match(payload.newData), + RealtimePostgresInsertPayload() => isEarthquakeV1Match( + payload.newData, + ), + RealtimePostgresUpdatePayload() => isEarthquakeV1Match( + payload.newData, + ), RealtimePostgresDeletePayload() => false, }; } diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart index 7bdf87af..6b3c9a36 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.g.dart @@ -43,21 +43,15 @@ class EarthquakeV1ExtendedFamily const EarthquakeV1ExtendedFamily(); /// See also [earthquakeV1Extended]. - EarthquakeV1ExtendedProvider call( - EarthquakeV1 data, - ) { - return EarthquakeV1ExtendedProvider( - data, - ); + EarthquakeV1ExtendedProvider call(EarthquakeV1 data) { + return EarthquakeV1ExtendedProvider(data); } @override EarthquakeV1ExtendedProvider getProviderOverride( covariant EarthquakeV1ExtendedProvider provider, ) { - return call( - provider.data, - ); + return call(provider.data); } static const Iterable? _dependencies = null; @@ -79,24 +73,20 @@ class EarthquakeV1ExtendedFamily class EarthquakeV1ExtendedProvider extends AutoDisposeFutureProvider { /// See also [earthquakeV1Extended]. - EarthquakeV1ExtendedProvider( - EarthquakeV1 data, - ) : this._internal( - (ref) => earthquakeV1Extended( - ref as EarthquakeV1ExtendedRef, - data, - ), - from: earthquakeV1ExtendedProvider, - name: r'earthquakeV1ExtendedProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeV1ExtendedHash, - dependencies: EarthquakeV1ExtendedFamily._dependencies, - allTransitiveDependencies: - EarthquakeV1ExtendedFamily._allTransitiveDependencies, - data: data, - ); + EarthquakeV1ExtendedProvider(EarthquakeV1 data) + : this._internal( + (ref) => earthquakeV1Extended(ref as EarthquakeV1ExtendedRef, data), + from: earthquakeV1ExtendedProvider, + name: r'earthquakeV1ExtendedProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeV1ExtendedHash, + dependencies: EarthquakeV1ExtendedFamily._dependencies, + allTransitiveDependencies: + EarthquakeV1ExtendedFamily._allTransitiveDependencies, + data: data, + ); EarthquakeV1ExtendedProvider._internal( super._createNotifier, { @@ -113,7 +103,7 @@ class EarthquakeV1ExtendedProvider @override Override overrideWith( FutureOr Function(EarthquakeV1ExtendedRef provider) - create, + create, ) { return ProviderOverride( origin: this, @@ -188,21 +178,15 @@ class EarthquakeHistoryNotifierFamily const EarthquakeHistoryNotifierFamily(); /// See also [EarthquakeHistoryNotifier]. - EarthquakeHistoryNotifierProvider call( - EarthquakeHistoryParameter parameter, - ) { - return EarthquakeHistoryNotifierProvider( - parameter, - ); + EarthquakeHistoryNotifierProvider call(EarthquakeHistoryParameter parameter) { + return EarthquakeHistoryNotifierProvider(parameter); } @override EarthquakeHistoryNotifierProvider getProviderOverride( covariant EarthquakeHistoryNotifierProvider provider, ) { - return call( - provider.parameter, - ); + return call(provider.parameter); } static const Iterable? _dependencies = null; @@ -222,24 +206,26 @@ class EarthquakeHistoryNotifierFamily /// See also [EarthquakeHistoryNotifier]. class EarthquakeHistoryNotifierProvider - extends AutoDisposeAsyncNotifierProviderImpl { + extends + AutoDisposeAsyncNotifierProviderImpl< + EarthquakeHistoryNotifier, + EarthquakeHistoryNotifierState + > { /// See also [EarthquakeHistoryNotifier]. - EarthquakeHistoryNotifierProvider( - EarthquakeHistoryParameter parameter, - ) : this._internal( - () => EarthquakeHistoryNotifier()..parameter = parameter, - from: earthquakeHistoryNotifierProvider, - name: r'earthquakeHistoryNotifierProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryNotifierHash, - dependencies: EarthquakeHistoryNotifierFamily._dependencies, - allTransitiveDependencies: - EarthquakeHistoryNotifierFamily._allTransitiveDependencies, - parameter: parameter, - ); + EarthquakeHistoryNotifierProvider(EarthquakeHistoryParameter parameter) + : this._internal( + () => EarthquakeHistoryNotifier()..parameter = parameter, + from: earthquakeHistoryNotifierProvider, + name: r'earthquakeHistoryNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryNotifierHash, + dependencies: EarthquakeHistoryNotifierFamily._dependencies, + allTransitiveDependencies: + EarthquakeHistoryNotifierFamily._allTransitiveDependencies, + parameter: parameter, + ); EarthquakeHistoryNotifierProvider._internal( super._createNotifier, { @@ -257,9 +243,7 @@ class EarthquakeHistoryNotifierProvider FutureOr runNotifierBuild( covariant EarthquakeHistoryNotifier notifier, ) { - return notifier.build( - parameter, - ); + return notifier.build(parameter); } @override @@ -279,8 +263,11 @@ class EarthquakeHistoryNotifierProvider } @override - AutoDisposeAsyncNotifierProviderElement createElement() { + AutoDisposeAsyncNotifierProviderElement< + EarthquakeHistoryNotifier, + EarthquakeHistoryNotifierState + > + createElement() { return _EarthquakeHistoryNotifierProviderElement(this); } @@ -308,13 +295,18 @@ mixin EarthquakeHistoryNotifierRef } class _EarthquakeHistoryNotifierProviderElement - extends AutoDisposeAsyncNotifierProviderElement with EarthquakeHistoryNotifierRef { + extends + AutoDisposeAsyncNotifierProviderElement< + EarthquakeHistoryNotifier, + EarthquakeHistoryNotifierState + > + with EarthquakeHistoryNotifierRef { _EarthquakeHistoryNotifierProviderElement(super.provider); @override EarthquakeHistoryParameter get parameter => (origin as EarthquakeHistoryNotifierProvider).parameter; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_repository.dart b/app/lib/feature/earthquake_history/data/earthquake_history_repository.dart index ae1c6237..da3ae3cb 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_repository.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_repository.dart @@ -7,12 +7,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_repository.g.dart'; @Riverpod(keepAlive: true) -EarthquakeHistoryRepository earthquakeHistoryRepository( - Ref ref, -) => - EarthquakeHistoryRepository( - api: ref.watch(eqApiProvider), - ); +EarthquakeHistoryRepository earthquakeHistoryRepository(Ref ref) => + EarthquakeHistoryRepository(api: ref.watch(eqApiProvider)); class EarthquakeHistoryRepository { EarthquakeHistoryRepository({required EqApi api}) : _api = api; @@ -39,9 +35,6 @@ class EarthquakeHistoryRepository { intensityLte: intensityLte?.type, intensityGte: intensityGte?.type, ); - return ( - count: result.response.count, - items: result.data, - ); + return (count: result.response.count, items: result.data); } } diff --git a/app/lib/feature/earthquake_history/data/earthquake_history_repository.g.dart b/app/lib/feature/earthquake_history/data/earthquake_history_repository.g.dart index d7cfd341..31a6666c 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_repository.g.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_repository.g.dart @@ -15,18 +15,19 @@ String _$earthquakeHistoryRepositoryHash() => @ProviderFor(earthquakeHistoryRepository) final earthquakeHistoryRepositoryProvider = Provider.internal( - earthquakeHistoryRepository, - name: r'earthquakeHistoryRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, -); + earthquakeHistoryRepository, + name: r'earthquakeHistoryRepositoryProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryRepositoryHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef EarthquakeHistoryRepositoryRef - = ProviderRef; +typedef EarthquakeHistoryRepositoryRef = + ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.dart b/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.dart index b5946d8c..b3c31606 100644 --- a/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.dart +++ b/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.dart @@ -22,27 +22,19 @@ extension EarthquakeHistoryParameterEx on EarthquakeHistoryParameter { EarthquakeHistoryParameter updateIntensity( JmaIntensity? min, JmaIntensity? max, - ) => - copyWith( - intensityGte: IntensityFilterChip.initialMin == min ? null : min, - intensityLte: IntensityFilterChip.initialMax == max ? null : max, - ); + ) => copyWith( + intensityGte: IntensityFilterChip.initialMin == min ? null : min, + intensityLte: IntensityFilterChip.initialMax == max ? null : max, + ); - EarthquakeHistoryParameter updateMagnitude( - double? min, - double? max, - ) => + EarthquakeHistoryParameter updateMagnitude(double? min, double? max) => copyWith( magnitudeGte: MagnitudeFilterChip.initialMin == min ? null : min, magnitudeLte: MagnitudeFilterChip.initialMax == max ? null : max, ); - EarthquakeHistoryParameter updateDepth( - double? min, - double? max, - ) => - copyWith( - depthGte: DepthFilterChip.initialMin == min ? null : min, - depthLte: DepthFilterChip.initialMax == max ? null : max, - ); + EarthquakeHistoryParameter updateDepth(double? min, double? max) => copyWith( + depthGte: DepthFilterChip.initialMin == min ? null : min, + depthLte: DepthFilterChip.initialMax == max ? null : max, + ); } diff --git a/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.freezed.dart b/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.freezed.dart index 2d734190..939326e4 100644 --- a/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.freezed.dart +++ b/app/lib/feature/earthquake_history/data/model/earthquake_history_parameter.freezed.dart @@ -12,7 +12,8 @@ part of 'earthquake_history_parameter.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$EarthquakeHistoryParameter { @@ -27,28 +28,35 @@ mixin _$EarthquakeHistoryParameter { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHistoryParameterCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHistoryParameterCopyWith<$Res> { - factory $EarthquakeHistoryParameterCopyWith(EarthquakeHistoryParameter value, - $Res Function(EarthquakeHistoryParameter) then) = - _$EarthquakeHistoryParameterCopyWithImpl<$Res, - EarthquakeHistoryParameter>; + factory $EarthquakeHistoryParameterCopyWith( + EarthquakeHistoryParameter value, + $Res Function(EarthquakeHistoryParameter) then, + ) = + _$EarthquakeHistoryParameterCopyWithImpl< + $Res, + EarthquakeHistoryParameter + >; @useResult - $Res call( - {double? magnitudeLte, - double? magnitudeGte, - double? depthLte, - double? depthGte, - JmaIntensity? intensityLte, - JmaIntensity? intensityGte}); + $Res call({ + double? magnitudeLte, + double? magnitudeGte, + double? depthLte, + double? depthGte, + JmaIntensity? intensityLte, + JmaIntensity? intensityGte, + }); } /// @nodoc -class _$EarthquakeHistoryParameterCopyWithImpl<$Res, - $Val extends EarthquakeHistoryParameter> +class _$EarthquakeHistoryParameterCopyWithImpl< + $Res, + $Val extends EarthquakeHistoryParameter +> implements $EarthquakeHistoryParameterCopyWith<$Res> { _$EarthquakeHistoryParameterCopyWithImpl(this._value, this._then); @@ -69,32 +77,41 @@ class _$EarthquakeHistoryParameterCopyWithImpl<$Res, Object? intensityLte = freezed, Object? intensityGte = freezed, }) { - return _then(_value.copyWith( - magnitudeLte: freezed == magnitudeLte - ? _value.magnitudeLte - : magnitudeLte // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeGte: freezed == magnitudeGte - ? _value.magnitudeGte - : magnitudeGte // ignore: cast_nullable_to_non_nullable - as double?, - depthLte: freezed == depthLte - ? _value.depthLte - : depthLte // ignore: cast_nullable_to_non_nullable - as double?, - depthGte: freezed == depthGte - ? _value.depthGte - : depthGte // ignore: cast_nullable_to_non_nullable - as double?, - intensityLte: freezed == intensityLte - ? _value.intensityLte - : intensityLte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - intensityGte: freezed == intensityGte - ? _value.intensityGte - : intensityGte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - ) as $Val); + return _then( + _value.copyWith( + magnitudeLte: + freezed == magnitudeLte + ? _value.magnitudeLte + : magnitudeLte // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeGte: + freezed == magnitudeGte + ? _value.magnitudeGte + : magnitudeGte // ignore: cast_nullable_to_non_nullable + as double?, + depthLte: + freezed == depthLte + ? _value.depthLte + : depthLte // ignore: cast_nullable_to_non_nullable + as double?, + depthGte: + freezed == depthGte + ? _value.depthGte + : depthGte // ignore: cast_nullable_to_non_nullable + as double?, + intensityLte: + freezed == intensityLte + ? _value.intensityLte + : intensityLte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + intensityGte: + freezed == intensityGte + ? _value.intensityGte + : intensityGte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + ) + as $Val, + ); } } @@ -102,29 +119,33 @@ class _$EarthquakeHistoryParameterCopyWithImpl<$Res, abstract class _$$EarthquakeHistoryParameterImplCopyWith<$Res> implements $EarthquakeHistoryParameterCopyWith<$Res> { factory _$$EarthquakeHistoryParameterImplCopyWith( - _$EarthquakeHistoryParameterImpl value, - $Res Function(_$EarthquakeHistoryParameterImpl) then) = - __$$EarthquakeHistoryParameterImplCopyWithImpl<$Res>; + _$EarthquakeHistoryParameterImpl value, + $Res Function(_$EarthquakeHistoryParameterImpl) then, + ) = __$$EarthquakeHistoryParameterImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {double? magnitudeLte, - double? magnitudeGte, - double? depthLte, - double? depthGte, - JmaIntensity? intensityLte, - JmaIntensity? intensityGte}); + $Res call({ + double? magnitudeLte, + double? magnitudeGte, + double? depthLte, + double? depthGte, + JmaIntensity? intensityLte, + JmaIntensity? intensityGte, + }); } /// @nodoc class __$$EarthquakeHistoryParameterImplCopyWithImpl<$Res> - extends _$EarthquakeHistoryParameterCopyWithImpl<$Res, - _$EarthquakeHistoryParameterImpl> + extends + _$EarthquakeHistoryParameterCopyWithImpl< + $Res, + _$EarthquakeHistoryParameterImpl + > implements _$$EarthquakeHistoryParameterImplCopyWith<$Res> { __$$EarthquakeHistoryParameterImplCopyWithImpl( - _$EarthquakeHistoryParameterImpl _value, - $Res Function(_$EarthquakeHistoryParameterImpl) _then) - : super(_value, _then); + _$EarthquakeHistoryParameterImpl _value, + $Res Function(_$EarthquakeHistoryParameterImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHistoryParameter /// with the given fields replaced by the non-null parameter values. @@ -138,45 +159,54 @@ class __$$EarthquakeHistoryParameterImplCopyWithImpl<$Res> Object? intensityLte = freezed, Object? intensityGte = freezed, }) { - return _then(_$EarthquakeHistoryParameterImpl( - magnitudeLte: freezed == magnitudeLte - ? _value.magnitudeLte - : magnitudeLte // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeGte: freezed == magnitudeGte - ? _value.magnitudeGte - : magnitudeGte // ignore: cast_nullable_to_non_nullable - as double?, - depthLte: freezed == depthLte - ? _value.depthLte - : depthLte // ignore: cast_nullable_to_non_nullable - as double?, - depthGte: freezed == depthGte - ? _value.depthGte - : depthGte // ignore: cast_nullable_to_non_nullable - as double?, - intensityLte: freezed == intensityLte - ? _value.intensityLte - : intensityLte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - intensityGte: freezed == intensityGte - ? _value.intensityGte - : intensityGte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - )); + return _then( + _$EarthquakeHistoryParameterImpl( + magnitudeLte: + freezed == magnitudeLte + ? _value.magnitudeLte + : magnitudeLte // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeGte: + freezed == magnitudeGte + ? _value.magnitudeGte + : magnitudeGte // ignore: cast_nullable_to_non_nullable + as double?, + depthLte: + freezed == depthLte + ? _value.depthLte + : depthLte // ignore: cast_nullable_to_non_nullable + as double?, + depthGte: + freezed == depthGte + ? _value.depthGte + : depthGte // ignore: cast_nullable_to_non_nullable + as double?, + intensityLte: + freezed == intensityLte + ? _value.intensityLte + : intensityLte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + intensityGte: + freezed == intensityGte + ? _value.intensityGte + : intensityGte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + ), + ); } } /// @nodoc class _$EarthquakeHistoryParameterImpl implements _EarthquakeHistoryParameter { - const _$EarthquakeHistoryParameterImpl( - {this.magnitudeLte, - this.magnitudeGte, - this.depthLte, - this.depthGte, - this.intensityLte, - this.intensityGte}); + const _$EarthquakeHistoryParameterImpl({ + this.magnitudeLte, + this.magnitudeGte, + this.depthLte, + this.depthGte, + this.intensityLte, + this.intensityGte, + }); @override final double? magnitudeLte; @@ -216,8 +246,15 @@ class _$EarthquakeHistoryParameterImpl implements _EarthquakeHistoryParameter { } @override - int get hashCode => Object.hash(runtimeType, magnitudeLte, magnitudeGte, - depthLte, depthGte, intensityLte, intensityGte); + int get hashCode => Object.hash( + runtimeType, + magnitudeLte, + magnitudeGte, + depthLte, + depthGte, + intensityLte, + intensityGte, + ); /// Create a copy of EarthquakeHistoryParameter /// with the given fields replaced by the non-null parameter values. @@ -225,19 +262,21 @@ class _$EarthquakeHistoryParameterImpl implements _EarthquakeHistoryParameter { @override @pragma('vm:prefer-inline') _$$EarthquakeHistoryParameterImplCopyWith<_$EarthquakeHistoryParameterImpl> - get copyWith => __$$EarthquakeHistoryParameterImplCopyWithImpl< - _$EarthquakeHistoryParameterImpl>(this, _$identity); + get copyWith => __$$EarthquakeHistoryParameterImplCopyWithImpl< + _$EarthquakeHistoryParameterImpl + >(this, _$identity); } abstract class _EarthquakeHistoryParameter implements EarthquakeHistoryParameter { - const factory _EarthquakeHistoryParameter( - {final double? magnitudeLte, - final double? magnitudeGte, - final double? depthLte, - final double? depthGte, - final JmaIntensity? intensityLte, - final JmaIntensity? intensityGte}) = _$EarthquakeHistoryParameterImpl; + const factory _EarthquakeHistoryParameter({ + final double? magnitudeLte, + final double? magnitudeGte, + final double? depthLte, + final double? depthGte, + final JmaIntensity? intensityLte, + final JmaIntensity? intensityGte, + }) = _$EarthquakeHistoryParameterImpl; @override double? get magnitudeLte; @@ -257,5 +296,5 @@ abstract class _EarthquakeHistoryParameter @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHistoryParameterImplCopyWith<_$EarthquakeHistoryParameterImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart index 8075c572..a3f718ae 100644 --- a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart +++ b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart @@ -48,20 +48,15 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { /// 噴火かどうか final isVolcano = item.isVolcano; - final hypoName = useMemoized( - () { - final volcanoName = item.volcanoName; - if (volcanoName != null) { - return volcanoName; - } - return codeTable.areaEpicenter.items - .firstWhereOrNull( - (e) => int.tryParse(e.code) == item.epicenterCode, - ) - ?.name; - }, - [item], - ); + final hypoName = useMemoized(() { + final volcanoName = item.volcanoName; + if (volcanoName != null) { + return volcanoName; + } + return codeTable.areaEpicenter.items + .firstWhereOrNull((e) => int.tryParse(e.code) == item.epicenterCode) + ?.name; + }, [item]); final hypoDetailName = useMemoized( () => codeTable.areaEpicenterDetail.items.firstWhereOrNull( (e) => int.tryParse(e.code) == item.epicenterDetailCode, @@ -75,22 +70,16 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { hypoName, hypoDetailName, maxIntensity, - maxIntensityRegionNames + maxIntensityRegionNames, )) { ( final String hypoName, final AreaEpicenterDetail_AreaEpicenterDetailItem hypoDetailName, _, - _ - ) => - '$hypoName(${hypoDetailName.name})', - ( - final String hypoName, - _, - _, _, ) => - hypoName, + '$hypoName(${hypoDetailName.name})', + (final String hypoName, _, _, _) => hypoName, (_, _, final JmaIntensity intensity, final List regionNames) when regionNames.isNotEmpty && regionNames.length >= 2 => '最大震度$intensityを${regionNames.first}などで観測', @@ -98,10 +87,11 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { when regionNames.isNotEmpty => '最大震度$intensityを${regionNames.first}で観測', (_, _, final JmaIntensity intensity, _) => '最大震度${intensity.type}を観測', - _ => '' + _ => '', }; final dateFormatter = DateFormat('yyyy/MM/dd HH:mm'); - final subTitle = switch ((item.originTime, item.arrivalTime)) { + final subTitle = + switch ((item.originTime, item.arrivalTime)) { (final DateTime originTime, _) => '${dateFormatter.format(originTime.toLocal())}頃発生 ', (_, final DateTime arrivalTime) => @@ -115,9 +105,10 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { _ => '', }; final intensityColorState = ref.watch(intensityColorProvider); - final intensityColor = maxIntensity != null - ? intensityColorState.fromJmaIntensity(maxIntensity).background - : null; + final intensityColor = + maxIntensity != null + ? intensityColorState.fromJmaIntensity(maxIntensity).background + : null; final maxLpgmIntensity = item.maxLpgmIntensity; // 5 -> 5.0, 5.123 -> 5.1 final magnitude = item.magnitude?.toStringAsFixed(1); @@ -161,19 +152,20 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { ...chips, ], ), - leading: isFarEarthquake - ? JmaIntensityIcon( - intensity: JmaIntensity.fiveLower, - type: IntensityIconType.filled, - customText: isVolcano ? '噴火\n情報' : '遠地\n地震', - size: intensityIconSize, - ) - : maxIntensity != null + leading: + isFarEarthquake + ? JmaIntensityIcon( + intensity: JmaIntensity.fiveLower, + type: IntensityIconType.filled, + customText: isVolcano ? '噴火\n情報' : '遠地\n地震', + size: intensityIconSize, + ) + : maxIntensity != null ? JmaIntensityIcon( - intensity: maxIntensity, - type: IntensityIconType.filled, - size: intensityIconSize, - ) + intensity: maxIntensity, + type: IntensityIconType.filled, + size: intensityIconSize, + ) : null, trailing: Text( trailingText, diff --git a/app/lib/feature/earthquake_history/ui/components/earthquake_history_not_found.dart b/app/lib/feature/earthquake_history/ui/components/earthquake_history_not_found.dart index ab546e14..6ffd1f26 100644 --- a/app/lib/feature/earthquake_history/ui/components/earthquake_history_not_found.dart +++ b/app/lib/feature/earthquake_history/ui/components/earthquake_history_not_found.dart @@ -3,9 +3,7 @@ import 'package:eqmonitor/feature/earthquake_history_early/ui/earthquake_history import 'package:flutter/material.dart'; class EarthquakeHistoryNotFound extends StatelessWidget { - const EarthquakeHistoryNotFound({ - super.key, - }); + const EarthquakeHistoryNotFound({super.key}); @override Widget build(BuildContext context) { @@ -15,10 +13,7 @@ class EarthquakeHistoryNotFound extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.search_off, - size: 48, - ), + const Icon(Icons.search_off, size: 48), const Text( '条件を満たす地震情報は見つかりませんでした', style: TextStyle(fontWeight: FontWeight.bold), @@ -31,8 +26,9 @@ class EarthquakeHistoryNotFound extends StatelessWidget { ), const SizedBox(height: 4), FilledButton( - onPressed: () async => - const EarthquakeHistoryEarlyRoute().push(context), + onPressed: + () async => + const EarthquakeHistoryEarlyRoute().push(context), child: const Text('震度データベース'), ), ], @@ -54,10 +50,7 @@ class EarthquakeHistoryAllFetched extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.search, - size: 48, - ), + const Icon(Icons.search, size: 48), const Text( '全件取得済みです', style: TextStyle(fontWeight: FontWeight.bold), @@ -70,8 +63,9 @@ class EarthquakeHistoryAllFetched extends StatelessWidget { ), const SizedBox(height: 4), FilledButton( - onPressed: () async => - const EarthquakeHistoryEarlyRoute().push(context), + onPressed: + () async => + const EarthquakeHistoryEarlyRoute().push(context), child: const Text('震度データベース'), ), ], diff --git a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart index 87ca4b7e..7baea31a 100644 --- a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart +++ b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart @@ -23,27 +23,21 @@ class EarthquakeHistoryScreen extends HookConsumerWidget { final parameter = useState(const EarthquakeHistoryParameter()); final state = ref.watch(earthquakeHistoryNotifierProvider(parameter.value)); - useEffect( - () { - unawaited( - WidgetsBinding.instance.endOfFrame.then( - (_) async { - if (parameter.value == const EarthquakeHistoryParameter() && - state.valueOrNull?.$1.length == 5) { - await ref - .read( - earthquakeHistoryNotifierProvider(parameter.value) - .notifier, - ) - .fetchNextData(); - } - }, - ), - ); - return null; - }, - [parameter.value], - ); + useEffect(() { + unawaited( + WidgetsBinding.instance.endOfFrame.then((_) async { + if (parameter.value == const EarthquakeHistoryParameter() && + state.valueOrNull?.$1.length == 5) { + await ref + .read( + earthquakeHistoryNotifierProvider(parameter.value).notifier, + ) + .fetchNextData(); + } + }), + ); + return null; + }, [parameter.value]); return Scaffold( appBar: AppBar( @@ -59,22 +53,31 @@ class EarthquakeHistoryScreen extends HookConsumerWidget { body: _SliverListBody( state: state, parameter: parameter.value, - onRefresh: () async => ref - .read(earthquakeHistoryNotifierProvider(parameter.value).notifier) - .refresh(), - onScrollEnd: () async => ref - .read(earthquakeHistoryNotifierProvider(parameter.value).notifier) - .fetchNextData(), + onRefresh: + () async => + ref + .read( + earthquakeHistoryNotifierProvider( + parameter.value, + ).notifier, + ) + .refresh(), + onScrollEnd: + () async => + ref + .read( + earthquakeHistoryNotifierProvider( + parameter.value, + ).notifier, + ) + .fetchNextData(), ), ); } } class _SearchParameter extends StatelessWidget { - const _SearchParameter({ - required this.parameter, - required this.onChanged, - }); + const _SearchParameter({required this.parameter, required this.onChanged}); final EarthquakeHistoryParameter parameter; final void Function(EarthquakeHistoryParameter) onChanged; @@ -86,39 +89,41 @@ class _SearchParameter extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(4), child: Row( - children: [ - IntensityFilterChip( - min: parameter.intensityGte, - max: parameter.intensityLte, - onChanged: (min, max) => onChanged( - parameter.updateIntensity(min, max), - ), - ), - MagnitudeFilterChip( - min: parameter.magnitudeGte, - max: parameter.magnitudeLte, - onChanged: (min, max) => onChanged( - parameter.updateMagnitude(min, max), - ), - ), - DepthFilterChip( - min: parameter.depthGte?.toInt(), - max: parameter.depthLte?.toInt(), - onChanged: (min, max) => onChanged( - parameter.updateDepth( - min?.toDouble(), - max?.toDouble(), - ), - ), - ), - ] - .map( - (e) => Padding( - padding: const EdgeInsets.symmetric(horizontal: 4), - child: e, - ), - ) - .toList(), + children: + [ + IntensityFilterChip( + min: parameter.intensityGte, + max: parameter.intensityLte, + onChanged: + (min, max) => + onChanged(parameter.updateIntensity(min, max)), + ), + MagnitudeFilterChip( + min: parameter.magnitudeGte, + max: parameter.magnitudeLte, + onChanged: + (min, max) => + onChanged(parameter.updateMagnitude(min, max)), + ), + DepthFilterChip( + min: parameter.depthGte?.toInt(), + max: parameter.depthLte?.toInt(), + onChanged: + (min, max) => onChanged( + parameter.updateDepth( + min?.toDouble(), + max?.toDouble(), + ), + ), + ), + ] + .map( + (e) => Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: e, + ), + ) + .toList(), ), ), ); @@ -141,29 +146,24 @@ class _SliverListBody extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final controller = useMemoized(() => PrimaryScrollController.of(context)); - useEffect( - () { - controller.addListener(() { - if (state.hasError || state.isRefreshing || !state.hasValue) { - return; - } - if (controller.position.pixels >= - controller.position.maxScrollExtent - 100) { - onScrollEnd?.call(); - } - }); - return null; - }, - [controller, state, onScrollEnd, onRefresh], - ); + useEffect(() { + controller.addListener(() { + if (state.hasError || state.isRefreshing || !state.hasValue) { + return; + } + if (controller.position.pixels >= + controller.position.maxScrollExtent - 100) { + onScrollEnd?.call(); + } + }); + return null; + }, [controller, state, onScrollEnd, onRefresh]); Widget listView({ required (List, int) data, Widget loading = const Padding( padding: EdgeInsets.all(48), - child: Center( - child: CircularProgressIndicator.adaptive(), - ), + child: Center(child: CircularProgressIndicator.adaptive()), ), }) { if (data.$1.isEmpty) { @@ -182,10 +182,7 @@ class _SliverListBody extends HookConsumerWidget { } if (state.hasError) { final error = state.error!; - return ErrorCard( - error: error, - onReload: onRefresh, - ); + return ErrorCard(error: error, onReload: onRefresh); } final hasNext = state.valueOrNull?.hasNext ?? false; if (hasNext) { @@ -197,9 +194,10 @@ class _SliverListBody extends HookConsumerWidget { final item = data.$1[index]; return EarthquakeHistoryListTile( item: item, - onTap: () async => EarthquakeHistoryDetailsRoute( - eventId: item.eventId, - ).push(context), + onTap: + () async => EarthquakeHistoryDetailsRoute( + eventId: item.eventId, + ).push(context), ); }, ), @@ -210,40 +208,38 @@ class _SliverListBody extends HookConsumerWidget { onRefresh: () async => onRefresh?.call(), child: switch (state) { AsyncError(:final error) => () { - if (error is EarthquakeParameterHasNotInitializedException) { - final parameterState = ref.watch(jmaParameterProvider); - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text('観測点情報が初期化されていません'), - if (parameterState.isLoading) - const CircularProgressIndicator.adaptive() - else - FilledButton( - child: const Text('観測点情報を再取得'), - onPressed: () async => - ref.invalidate(jmaParameterProvider), - ), - ], - ), - ); - } - final valueOrNull = state.valueOrNull; - if (valueOrNull != null) { - return listView(data: valueOrNull); - } - return ErrorCard( - error: error, - onReload: () async => ref.refresh( - earthquakeHistoryNotifierProvider(parameter), + if (error is EarthquakeParameterHasNotInitializedException) { + final parameterState = ref.watch(jmaParameterProvider); + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text('観測点情報が初期化されていません'), + if (parameterState.isLoading) + const CircularProgressIndicator.adaptive() + else + FilledButton( + child: const Text('観測点情報を再取得'), + onPressed: + () async => ref.invalidate(jmaParameterProvider), + ), + ], ), ); - }(), + } + final valueOrNull = state.valueOrNull; + if (valueOrNull != null) { + return listView(data: valueOrNull); + } + return ErrorCard( + error: error, + onReload: + () async => + ref.refresh(earthquakeHistoryNotifierProvider(parameter)), + ); + }(), AsyncData(:final value) => listView(data: value), - _ => const Center( - child: CircularProgressIndicator.adaptive(), - ), + _ => const Center(child: CircularProgressIndicator.adaptive()), }, ); } diff --git a/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.dart b/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.dart index dbf57d1d..6e4664c0 100644 --- a/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.dart +++ b/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.dart @@ -11,28 +11,28 @@ part 'earthquake_history_details_notifier.g.dart'; class EarthquakeHistoryDetailsNotifier extends _$EarthquakeHistoryDetailsNotifier { @override - Future build( - int eventId, - ) async { + Future build(int eventId) async { final api = ref.watch(eqApiProvider); - final response = - await api.v1.getEarthquakeDetail(eventId: eventId.toString()); + final response = await api.v1.getEarthquakeDetail( + eventId: eventId.toString(), + ); final data = response.data; final extended = await ref.read(earthquakeV1ExtendedProvider(data).future); ref.listen( - earthquakeHistoryNotifierProvider(const EarthquakeHistoryParameter()), - (_, next) { - if (next is AsyncData) { - final earthquakes = next.valueOrNull; - final target = earthquakes?.$1.firstWhereOrNull( - (earthquake) => earthquake.eventId == eventId, - ); - if (target?.intensityRegions != null) { - state = AsyncData(target!); + earthquakeHistoryNotifierProvider(const EarthquakeHistoryParameter()), + (_, next) { + if (next is AsyncData) { + final earthquakes = next.valueOrNull; + final target = earthquakes?.$1.firstWhereOrNull( + (earthquake) => earthquake.eventId == eventId, + ); + if (target?.intensityRegions != null) { + state = AsyncData(target!); + } } - } - }); + }, + ); return extended; } diff --git a/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.g.dart b/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.g.dart index 78e9ae3b..bcbe5f26 100644 --- a/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.g.dart +++ b/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.g.dart @@ -36,9 +36,7 @@ abstract class _$EarthquakeHistoryDetailsNotifier extends BuildlessAutoDisposeAsyncNotifier { late final int eventId; - FutureOr build( - int eventId, - ); + FutureOr build(int eventId); } /// See also [EarthquakeHistoryDetailsNotifier]. @@ -53,21 +51,15 @@ class EarthquakeHistoryDetailsNotifierFamily const EarthquakeHistoryDetailsNotifierFamily(); /// See also [EarthquakeHistoryDetailsNotifier]. - EarthquakeHistoryDetailsNotifierProvider call( - int eventId, - ) { - return EarthquakeHistoryDetailsNotifierProvider( - eventId, - ); + EarthquakeHistoryDetailsNotifierProvider call(int eventId) { + return EarthquakeHistoryDetailsNotifierProvider(eventId); } @override EarthquakeHistoryDetailsNotifierProvider getProviderOverride( covariant EarthquakeHistoryDetailsNotifierProvider provider, ) { - return call( - provider.eventId, - ); + return call(provider.eventId); } static const Iterable? _dependencies = null; @@ -87,24 +79,26 @@ class EarthquakeHistoryDetailsNotifierFamily /// See also [EarthquakeHistoryDetailsNotifier]. class EarthquakeHistoryDetailsNotifierProvider - extends AutoDisposeAsyncNotifierProviderImpl< - EarthquakeHistoryDetailsNotifier, EarthquakeV1Extended> { + extends + AutoDisposeAsyncNotifierProviderImpl< + EarthquakeHistoryDetailsNotifier, + EarthquakeV1Extended + > { /// See also [EarthquakeHistoryDetailsNotifier]. - EarthquakeHistoryDetailsNotifierProvider( - int eventId, - ) : this._internal( - () => EarthquakeHistoryDetailsNotifier()..eventId = eventId, - from: earthquakeHistoryDetailsNotifierProvider, - name: r'earthquakeHistoryDetailsNotifierProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryDetailsNotifierHash, - dependencies: EarthquakeHistoryDetailsNotifierFamily._dependencies, - allTransitiveDependencies: - EarthquakeHistoryDetailsNotifierFamily._allTransitiveDependencies, - eventId: eventId, - ); + EarthquakeHistoryDetailsNotifierProvider(int eventId) + : this._internal( + () => EarthquakeHistoryDetailsNotifier()..eventId = eventId, + from: earthquakeHistoryDetailsNotifierProvider, + name: r'earthquakeHistoryDetailsNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryDetailsNotifierHash, + dependencies: EarthquakeHistoryDetailsNotifierFamily._dependencies, + allTransitiveDependencies: + EarthquakeHistoryDetailsNotifierFamily._allTransitiveDependencies, + eventId: eventId, + ); EarthquakeHistoryDetailsNotifierProvider._internal( super._createNotifier, { @@ -122,9 +116,7 @@ class EarthquakeHistoryDetailsNotifierProvider FutureOr runNotifierBuild( covariant EarthquakeHistoryDetailsNotifier notifier, ) { - return notifier.build( - eventId, - ); + return notifier.build(eventId); } @override @@ -144,8 +136,11 @@ class EarthquakeHistoryDetailsNotifierProvider } @override - AutoDisposeAsyncNotifierProviderElement createElement() { + AutoDisposeAsyncNotifierProviderElement< + EarthquakeHistoryDetailsNotifier, + EarthquakeV1Extended + > + createElement() { return _EarthquakeHistoryDetailsNotifierProviderElement(this); } @@ -173,14 +168,18 @@ mixin EarthquakeHistoryDetailsNotifierRef } class _EarthquakeHistoryDetailsNotifierProviderElement - extends AutoDisposeAsyncNotifierProviderElement< - EarthquakeHistoryDetailsNotifier, - EarthquakeV1Extended> with EarthquakeHistoryDetailsNotifierRef { + extends + AutoDisposeAsyncNotifierProviderElement< + EarthquakeHistoryDetailsNotifier, + EarthquakeV1Extended + > + with EarthquakeHistoryDetailsNotifierRef { _EarthquakeHistoryDetailsNotifierProviderElement(super.provider); @override int get eventId => (origin as EarthquakeHistoryDetailsNotifierProvider).eventId; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_details/ui/component/earthquake_hypo_info_widget.dart b/app/lib/feature/earthquake_history_details/ui/component/earthquake_hypo_info_widget.dart index 843c59d6..8ab84468 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/earthquake_hypo_info_widget.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/earthquake_hypo_info_widget.dart @@ -16,10 +16,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class EarthquakeHypoInfoWidget extends HookConsumerWidget { - const EarthquakeHypoInfoWidget({ - required this.item, - super.key, - }); + const EarthquakeHypoInfoWidget({required this.item, super.key}); final EarthquakeV1Extended item; @@ -32,8 +29,9 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { final isVolcano = item.isVolcano; final maxIntensity = item.maxIntensity; final colorScheme = switch (maxIntensity) { - final JmaIntensity intensity => - intensityColorScheme.fromJmaIntensity(intensity), + final JmaIntensity intensity => intensityColorScheme.fromJmaIntensity( + intensity, + ), _ when isVolcano => intensityColorScheme.sixUpper, _ => null, }; @@ -52,73 +50,79 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { [item.epicenterDetailCode], ); - final maxIntensityWidget = maxIntensity != null - ? Column( - mainAxisSize: MainAxisSize.min, - children: [ - const Text('最大震度', style: TextStyle(fontWeight: FontWeight.bold)), - const SizedBox(height: 4), - JmaIntensityIcon( - type: IntensityIconType.filled, - size: 60, - intensity: maxIntensity, - ), - ], - ) - : null; + final maxIntensityWidget = + maxIntensity != null + ? Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + '最大震度', + style: TextStyle(fontWeight: FontWeight.bold), + ), + const SizedBox(height: 4), + JmaIntensityIcon( + type: IntensityIconType.filled, + size: 60, + intensity: maxIntensity, + ), + ], + ) + : null; // 「分頃(日本時間)」の後から「火山で大規模な噴火が発生しました」 の間の文字列 final volcanoName = item.volcanoName; - final volcanoWidget = isVolcano - ? Column( - mainAxisSize: MainAxisSize.min, - children: [ - Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: TextBaseline.alphabetic, - children: [ - Flexible( - child: Text( - '火山の大規模な噴火', - style: textTheme.titleMedium!.copyWith( - color: textTheme.titleMedium!.color! - .withValues(alpha: 0.8), + final volcanoWidget = + isVolcano + ? Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Flexible( + child: Text( + '火山の大規模な噴火', + style: textTheme.titleMedium!.copyWith( + color: textTheme.titleMedium!.color!.withValues( + alpha: 0.8, + ), + ), ), ), - ), - const SizedBox(width: 4), - Flexible( - child: Text( - volcanoName ?? '不明', - style: textTheme.headlineMedium!.copyWith( - fontWeight: FontWeight.bold, + const SizedBox(width: 4), + Flexible( + child: Text( + volcanoName ?? '不明', + style: textTheme.headlineMedium!.copyWith( + fontWeight: FontWeight.bold, + ), ), ), - ), - ], - ), - Flexible( - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: hypoName?.name ?? '不明', - style: textTheme.titleMedium, - ), - if (hypoDetailName != null) ...[ - const TextSpan(text: ' '), + ], + ), + Flexible( + child: Text.rich( + TextSpan( + children: [ TextSpan( - text: '(${hypoDetailName.name})', - style: textTheme.titleSmall, + text: hypoName?.name ?? '不明', + style: textTheme.titleMedium, ), + if (hypoDetailName != null) ...[ + const TextSpan(text: ' '), + TextSpan( + text: '(${hypoDetailName.name})', + style: textTheme.titleSmall, + ), + ], ], - ], + ), ), ), - ), - ], - ) - : null; + ], + ) + : null; // 「MaxInt, 震源地, 規模」 final hypoWidget = Row( textBaseline: TextBaseline.ideographic, @@ -162,35 +166,23 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { final creationDateFromEventId = EventId(item.eventId).toCreationDate(); // 地震発生時刻 - final timeText = - switch ((item.originTime, item.arrivalTime, creationDateFromEventId)) { + final timeText = switch (( + item.originTime, + item.arrivalTime, + creationDateFromEventId, + )) { (final DateTime originTime, _, _) when isVolcano => - "噴火時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format( - originTime.toLocal(), - )}", + "噴火時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format(originTime.toLocal())}", (final DateTime originTime, _, _) => - "発生時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format( - originTime.toLocal(), - )}", + "発生時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format(originTime.toLocal())}", (_, final DateTime arrivalTime, _) => - "検知時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format( - arrivalTime.toLocal(), - )}", + "検知時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format(arrivalTime.toLocal())}", (_, _, final DateTime creationDateFromEventId) => - "時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format( - creationDateFromEventId, - )}", + "時刻: ${DateFormat('yyyy/MM/dd HH:mm頃').format(creationDateFromEventId)}", _ => null, }; - final timeWidget = timeText != null - ? Wrap( - children: [ - Text( - timeText, - ), - ], - ) - : null; + final timeWidget = + timeText != null ? Wrap(children: [Text(timeText)]) : null; // 「M 8.0 / 深さ100km」 final magnitudeWidget = Row( @@ -207,10 +199,7 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { ), Flexible( child: Text( - switch (( - item.magnitudeCondition, - item.magnitude, - )) { + switch ((item.magnitudeCondition, item.magnitude)) { (final String cond, _) => cond.toHalfWidth, (_, final double value) => value.toStringAsFixed(1), // vxse53がある場合 @@ -221,9 +210,9 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { ? textTheme.headlineLarge : textTheme.displaySmall)! .copyWith( - fontWeight: FontWeight.bold, - fontFamily: FontFamily.notoSansJP, - ), + fontWeight: FontWeight.bold, + fontFamily: FontFamily.notoSansJP, + ), ), ), ], @@ -272,8 +261,8 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { // M・深さ ともに不明の場合 final isMagnitudeAndDepthUnknown = (item.magnitudeCondition?.toHalfWidth == 'M不明' || - item.magnitude == null) && - item.depth == null; + item.magnitude == null) && + item.depth == null; final magnitudeDepthUnknownWidget = Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.baseline, @@ -351,9 +340,7 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { final card = Card( margin: const EdgeInsets.symmetric( horizontal: 8, - ).add( - const EdgeInsets.only(bottom: 4), - ), + ).add(const EdgeInsets.only(bottom: 4)), elevation: 0, shadowColor: Colors.transparent, @@ -365,13 +352,11 @@ class EarthquakeHypoInfoWidget extends HookConsumerWidget { width: 0, ), ), - color: (colorScheme?.background ?? Colors.transparent) - .withValues(alpha: 0.3), + color: (colorScheme?.background ?? Colors.transparent).withValues( + alpha: 0.3, + ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Column( children: [ Row( diff --git a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart index 49137f2c..cef4c4a1 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart @@ -23,17 +23,11 @@ import 'package:jma_parameter_api_client/jma_parameter_api_client.dart'; import 'package:maplibre_gl/maplibre_gl.dart' as map_libre; import 'package:maplibre_gl/maplibre_gl.dart'; -typedef _RegionColorItem = ({ - TextColorModel color, - List codes, - JmaIntensity intensity, -}); - -typedef _RegionLpgmColorItem = ({ - TextColorModel color, - List codes, - JmaLgIntensity intensity, -}); +typedef _RegionColorItem = + ({TextColorModel color, List codes, JmaIntensity intensity}); + +typedef _RegionLpgmColorItem = + ({TextColorModel color, List codes, JmaLgIntensity intensity}); class EarthquakeMapWidget extends HookConsumerWidget { const EarthquakeMapWidget({ @@ -61,8 +55,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { MapLibreMapController controller, String name, Uint8List buffer, - ) => - controller.addImage(name, buffer); + ) => controller.addImage(name, buffer); @override Widget build(BuildContext context, WidgetRef ref) { @@ -75,19 +68,14 @@ class EarthquakeMapWidget extends HookConsumerWidget { if (earthquakeParams == null || jmaMap == null) { // どれが条件を満たしていないのか表示 return const Scaffold( - body: Center( - child: CircularProgressIndicator.adaptive(), - ), + body: Center(child: CircularProgressIndicator.adaptive()), ); } // ignore: discarded_futures - final itemCalculateFutureing = useMemoized( - () async { - return _compute(colorModel, item, earthquakeParams); - }, - [colorModel, item, earthquakeParams], - ); + final itemCalculateFutureing = useMemoized(() async { + return _compute(colorModel, item, earthquakeParams); + }, [colorModel, item, earthquakeParams]); final itemCalculateFuture = useFuture(itemCalculateFutureing); final result = itemCalculateFuture.data; if (itemCalculateFuture.hasError) { @@ -99,9 +87,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { } if (result == null) { return const Scaffold( - body: Center( - child: CircularProgressIndicator.adaptive(), - ), + body: Center(child: CircularProgressIndicator.adaptive()), ); } final ( @@ -109,112 +95,84 @@ class EarthquakeMapWidget extends HookConsumerWidget { citiesItem, stationsItem, regionsLpgmItem, - stationsLpgmItem + stationsLpgmItem, ) = result; - final bbox = useMemoized( - () { - final maxInt = item.maxIntensity; - if (maxInt == null || regionsItem == null) { - return null; - } + final bbox = useMemoized(() { + final maxInt = item.maxIntensity; + if (maxInt == null || regionsItem == null) { + return null; + } - // 最大震度5弱以上の場合、最大震度4以上の地域を表示する - final codes = regionsItem.map((e) => e.codes).flattened.toList(); - final bboxs = codes - .map( - (e) => jmaMap[JmaMapType.areaForecastLocalE]! - .firstWhereOrNull((region) => region.property.code == e) - ?.bounds, - ) - .nonNulls - .toList(); - var bbox = bboxs.marge(); - // 震源地を含める - final (latitude, longitude) = (item.latitude, item.longitude); - if (latitude != null && longitude != null) { - bbox = bbox.add( - jma_map.LatLng(lat: latitude, lng: longitude), - ); - } - return bbox; - }, - [regionsItem], - ); + // 最大震度5弱以上の場合、最大震度4以上の地域を表示する + final codes = regionsItem.map((e) => e.codes).flattened.toList(); + final bboxs = + codes + .map( + (e) => + jmaMap[JmaMapType.areaForecastLocalE]! + .firstWhereOrNull((region) => region.property.code == e) + ?.bounds, + ) + .nonNulls + .toList(); + var bbox = bboxs.marge(); + // 震源地を含める + final (latitude, longitude) = (item.latitude, item.longitude); + if (latitude != null && longitude != null) { + bbox = bbox.add(jma_map.LatLng(lat: latitude, lng: longitude)); + } + return bbox; + }, [regionsItem]); final mapController = useState(null); - final cameraUpdate = useMemoized( - () { - if (bbox == null) { - final (latitude, longitude) = (item.latitude, item.longitude); - if (latitude != null && longitude != null) { - return CameraUpdate.newLatLngZoom( - map_libre.LatLng(latitude, longitude), - 2, - ); - } else { - return CameraUpdate.newLatLngZoom( - const map_libre.LatLng(35, 139), - 6, - ); - } + final cameraUpdate = useMemoized(() { + if (bbox == null) { + final (latitude, longitude) = (item.latitude, item.longitude); + if (latitude != null && longitude != null) { + return CameraUpdate.newLatLngZoom( + map_libre.LatLng(latitude, longitude), + 2, + ); + } else { + return CameraUpdate.newLatLngZoom(const map_libre.LatLng(35, 139), 6); } - return CameraUpdate.newLatLngBounds( - map_libre.LatLngBounds( - southwest: map_libre.LatLng( - bbox.southWest.lat, - bbox.southWest.lng, - ), - northeast: map_libre.LatLng( - bbox.northEast.lat, - bbox.northEast.lng, - ), - ), - bottom: 10, - left: 10, - right: 10, - top: 10, - ); - }, - [bbox, item], - ); + } + return CameraUpdate.newLatLngBounds( + map_libre.LatLngBounds( + southwest: map_libre.LatLng(bbox.southWest.lat, bbox.southWest.lng), + northeast: map_libre.LatLng(bbox.northEast.lat, bbox.northEast.lng), + ), + bottom: 10, + left: 10, + right: 10, + top: 10, + ); + }, [bbox, item]); // * Display mode related List<_Action> getActions(EarthquakeHistoryDetailConfig config) => [ - _HypocenterAction( - earthquake: item, + _HypocenterAction(earthquake: item), + if (config.showingLpgmIntensity) ...[ + if (config.intensityFillMode != IntensityFillMode.none) + _FillRegionLpgmIntensityAction(regionsItem: regionsLpgmItem ?? []), + if (config.showIntensityIcon) + _StationIntensityLpgmAction( + stations: stationsLpgmItem ?? {}, + colorModel: colorModel, ), - if (config.showingLpgmIntensity) ...[ - if (config.intensityFillMode != IntensityFillMode.none) - _FillRegionLpgmIntensityAction( - regionsItem: regionsLpgmItem ?? [], - ), - if (config.showIntensityIcon) - _StationIntensityLpgmAction( - stations: stationsLpgmItem ?? {}, - colorModel: colorModel, - ), - ] else ...[ - if (config.intensityFillMode == IntensityFillMode.fillCity) - if (citiesItem != null) - _FillCityAction( - citiesItem: citiesItem, - ) - else - _FillRegionAction( - regionsItem: regionsItem ?? [], - ), - if (config.intensityFillMode == IntensityFillMode.fillRegion) - _FillRegionAction( - regionsItem: regionsItem ?? [], - ), - if (config.showIntensityIcon) - _StationAction( - stations: stationsItem ?? {}, - colorModel: colorModel, - ), - ], - ]; + ] else ...[ + if (config.intensityFillMode == IntensityFillMode.fillCity) + if (citiesItem != null) + _FillCityAction(citiesItem: citiesItem) + else + _FillRegionAction(regionsItem: regionsItem ?? []), + if (config.intensityFillMode == IntensityFillMode.fillRegion) + _FillRegionAction(regionsItem: regionsItem ?? []), + if (config.showIntensityIcon) + _StationAction(stations: stationsItem ?? {}, colorModel: colorModel), + ], + ]; final currentLocationService = useMemoized(_CurrentLocationIconService.new); final config = ref.watch( earthquakeHistoryConfigProvider.select((value) => value.detail), @@ -229,11 +187,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { } Future initActions(List<_Action> actions) async { - await actions - .map>( - (e) => e.init(mapController.value!), - ) - .wait; + await actions.map>((e) => e.init(mapController.value!)).wait; await currentLocationService.init(mapController.value!); } @@ -268,50 +222,38 @@ class EarthquakeMapWidget extends HookConsumerWidget { ref.listen( earthquakeHistoryConfigProvider.select((v) => v.detail), - (_, next) async => onDisplayModeChanged( - controller: mapController.value!, - config: next, - ), + (_, next) async => + onDisplayModeChanged(controller: mapController.value!, config: next), ); - useEffect( - () { - unawaited( - WidgetsBinding.instance.endOfFrame.then( - (_) async { - registerNavigateToHome(() async { - final controller = mapController.value; - if (controller == null) { - return; - } - await controller.animateCamera( - cameraUpdate, - ); - }); - final controller = mapController.value; - if (controller == null) { - return; - } - await onDisplayModeChanged( - controller: mapController.value!, - config: config, - ); - }, - ), - ); - return null; - }, - [item], - ); + useEffect(() { + unawaited( + WidgetsBinding.instance.endOfFrame.then((_) async { + registerNavigateToHome(() async { + final controller = mapController.value; + if (controller == null) { + return; + } + await controller.animateCamera(cameraUpdate); + }); + final controller = mapController.value; + if (controller == null) { + return; + } + await onDisplayModeChanged( + controller: mapController.value!, + config: config, + ); + }), + ); + return null; + }, [item]); final maxZoomLevel = useState(6); return RepaintBoundary( child: MapLibreMap( initialCameraPosition: CameraPosition( - target: map_libre.LatLng( - item.latitude ?? 35, - item.longitude ?? 139, - ), + target: map_libre.LatLng(item.latitude ?? 35, item.longitude ?? 139), zoom: 7, ), minMaxZoomPreference: MinMaxZoomPreference(0, maxZoomLevel.value), @@ -339,151 +281,140 @@ class EarthquakeMapWidget extends HookConsumerWidget { } Future< - ( - List< - ({ - List codes, - TextColorModel color, - JmaIntensity intensity - })>?, + ( + List< + ({List codes, TextColorModel color, JmaIntensity intensity}) + >?, + List< + ({List codes, TextColorModel color, JmaIntensity intensity}) + >?, + Map< + JmaIntensity?, List< - ({ - List codes, - TextColorModel color, - JmaIntensity intensity - })>?, - Map< - JmaIntensity?, - List< - ({ - ObservedRegionIntensity item, - EarthquakeParameterStationItem? param - })>>?, + ({ + ObservedRegionIntensity item, + EarthquakeParameterStationItem? param, + }) + > + >?, + List< + ({List codes, TextColorModel color, JmaLgIntensity intensity}) + >?, + Map< + JmaLgIntensity?, List< - ({ - List codes, - TextColorModel color, - JmaLgIntensity intensity - })>?, - Map< - JmaLgIntensity?, - List< - ({ - ObservedRegionLpgmIntensity item, - EarthquakeParameterStationItem? param - })>>? - )> _compute( + ({ + ObservedRegionLpgmIntensity item, + EarthquakeParameterStationItem? param, + }) + > + >?, + ) + > + _compute( IntensityColorModel colorModel, EarthquakeV1Extended earthquake, EarthquakeParameter earthquakeParams, ) async { - return compute( - (arg) { - final earthquake = arg.$1; - final earthquakeParams = arg.$2; - final colorModel = arg.$3; - final regionsItem = earthquake.intensityRegions - ?.groupListsBy((e) => e.intensity) - .entries - .where((e) => e.key != null) - .map( - (e) => ( - color: colorModel.fromJmaIntensity(e.key!), - codes: e.value.map((e) => e.code.padLeft(3, '0')).toList(), - intensity: e.key!, - ), - ) - .toList(); - final citiesItem = earthquake.intensityCities - ?.groupListsBy((e) => e.intensity) - .entries - .where((e) => e.key != null) - .map( - (e) => ( - color: colorModel.fromJmaIntensity(e.key!), - codes: e.value.map((e) => e.code).toList(), - intensity: e.key!, - ), - ) - .toList(); - - final stationsItem = () { - final stations = earthquake.intensityStations; - if (stations == null) { - return null; - } - final allStations = earthquakeParams.regions + return compute((arg) { + final earthquake = arg.$1; + final earthquakeParams = arg.$2; + final colorModel = arg.$3; + final regionsItem = + earthquake.intensityRegions + ?.groupListsBy((e) => e.intensity) + .entries + .where((e) => e.key != null) .map( - (region) => region.cities.map( - (city) => city.stations, + (e) => ( + color: colorModel.fromJmaIntensity(e.key!), + codes: e.value.map((e) => e.code.padLeft(3, '0')).toList(), + intensity: e.key!, ), ) - .flattened - .flattened; - final stationsParamMerged = stations.map( - (e) => ( - item: e, - param: allStations.firstWhereOrNull( - (element) => element.code == e.code, - ), + .toList(); + final citiesItem = + earthquake.intensityCities + ?.groupListsBy((e) => e.intensity) + .entries + .where((e) => e.key != null) + .map( + (e) => ( + color: colorModel.fromJmaIntensity(e.key!), + codes: e.value.map((e) => e.code).toList(), + intensity: e.key!, + ), + ) + .toList(); + + final stationsItem = () { + final stations = earthquake.intensityStations; + if (stations == null) { + return null; + } + final allStations = + earthquakeParams.regions + .map((region) => region.cities.map((city) => city.stations)) + .flattened + .flattened; + final stationsParamMerged = stations.map( + (e) => ( + item: e, + param: allStations.firstWhereOrNull( + (element) => element.code == e.code, ), - ); - final grouped = - stationsParamMerged.groupListsBy((e) => e.item.intensity); - return grouped; - }(); - - final regionsLpgmItem = earthquake.lpgmIntensityRegions - ?.groupListsBy((e) => e.lpgmIntensity) - .entries - .where((e) => e.key != null) - .map( - (e) => ( - color: colorModel.fromJmaLgIntensity(e.key!), - codes: e.value.map((e) => e.code.padLeft(3, '0')).toList(), - intensity: e.key!, - ), - ) - .toList(); - final stationsLpgmItem = () { - final stations = earthquake.lpgmIntenstiyStations; - if (stations == null) { - return null; - } - final allStations = earthquakeParams.regions + ), + ); + final grouped = stationsParamMerged.groupListsBy( + (e) => e.item.intensity, + ); + return grouped; + }(); + + final regionsLpgmItem = + earthquake.lpgmIntensityRegions + ?.groupListsBy((e) => e.lpgmIntensity) + .entries + .where((e) => e.key != null) .map( - (region) => region.cities.map( - (city) => city.stations, + (e) => ( + color: colorModel.fromJmaLgIntensity(e.key!), + codes: e.value.map((e) => e.code.padLeft(3, '0')).toList(), + intensity: e.key!, ), ) - .flattened - .flattened; - final stationsParamMerged = stations.map( - (e) => ( - item: e, - param: allStations.firstWhereOrNull( - (element) => element.code == e.code, - ), + .toList(); + final stationsLpgmItem = () { + final stations = earthquake.lpgmIntenstiyStations; + if (stations == null) { + return null; + } + final allStations = + earthquakeParams.regions + .map((region) => region.cities.map((city) => city.stations)) + .flattened + .flattened; + final stationsParamMerged = stations.map( + (e) => ( + item: e, + param: allStations.firstWhereOrNull( + (element) => element.code == e.code, ), - ); - final grouped = - stationsParamMerged.groupListsBy((e) => e.item.lpgmIntensity); - return grouped; - }(); - return ( - regionsItem, - citiesItem, - stationsItem, - regionsLpgmItem, - stationsLpgmItem, + ), ); - }, - ( - earthquake, - earthquakeParams, - colorModel, - ), - ); + final grouped = stationsParamMerged.groupListsBy( + (e) => e.item.lpgmIntensity, + ); + return grouped; + }(); + return ( + regionsItem, + citiesItem, + stationsItem, + regionsLpgmItem, + stationsLpgmItem, + ); + }, (earthquake, earthquakeParams, colorModel)); } } @@ -493,9 +424,7 @@ sealed class _Action { } class _FillRegionAction extends _Action { - _FillRegionAction({ - required this.regionsItem, - }); + _FillRegionAction({required this.regionsItem}); final List<_RegionColorItem> regionsItem; @@ -521,10 +450,7 @@ class _FillRegionAction extends _Action { filter: [ 'in', ['get', 'code'], - [ - 'literal', - item.codes, - ], + ['literal', item.codes], ], ), controller.addLayer( @@ -540,10 +466,7 @@ class _FillRegionAction extends _Action { filter: [ 'in', ['get', 'regioncode'], - [ - 'literal', - item.codes, - ], + ['literal', item.codes], ], ), ], @@ -551,22 +474,17 @@ class _FillRegionAction extends _Action { } @override - Future dispose(map_libre.MapLibreMapController controller) => [ + Future dispose(map_libre.MapLibreMapController controller) => + [ for (final item in regionsItem) ...[ - controller.removeLayer( - getLineLayerName(item.intensity), - ), - controller.removeLayer( - getFillLayerName(item.intensity), - ), + controller.removeLayer(getLineLayerName(item.intensity)), + controller.removeLayer(getFillLayerName(item.intensity)), ], ].wait; } class _FillCityAction extends _Action { - _FillCityAction({ - required this.citiesItem, - }); + _FillCityAction({required this.citiesItem}); final List<_RegionColorItem> citiesItem; @@ -577,18 +495,13 @@ class _FillCityAction extends _Action { await controller.addLayer( 'eqmonitor_map', getFillLayerName(item.intensity), - FillLayerProperties( - fillColor: item.color.background.toHexStringRGB(), - ), + FillLayerProperties(fillColor: item.color.background.toHexStringRGB()), belowLayerId: BaseLayer.areaForecastLocalEewLine.name, sourceLayer: name, filter: [ 'in', ['get', 'regioncode'], - [ - 'literal', - item.codes, - ], + ['literal', item.codes], ], ); await controller.addLayer( @@ -604,25 +517,19 @@ class _FillCityAction extends _Action { filter: [ 'in', ['get', 'regioncode'], - [ - 'literal', - item.codes, - ], + ['literal', item.codes], ], ); } } @override - Future dispose(map_libre.MapLibreMapController controller) => [ + Future dispose(map_libre.MapLibreMapController controller) => + [ for (final item in citiesItem.groupListsBy((e) => e.intensity).entries) ...[ - controller.removeLayer( - getLineLayerName(item.key), - ), - controller.removeLayer( - getFillLayerName(item.key), - ), + controller.removeLayer(getLineLayerName(item.key)), + controller.removeLayer(getFillLayerName(item.key)), ], ].wait; @@ -635,61 +542,55 @@ class _FillCityAction extends _Action { } class _StationAction extends _Action { - _StationAction({ - required this.stations, - required this.colorModel, - }); + _StationAction({required this.stations, required this.colorModel}); final Map< - JmaIntensity?, - List< - ({ - ObservedRegionIntensity item, - EarthquakeParameterStationItem? param - })>> stations; + JmaIntensity?, + List< + ({ObservedRegionIntensity item, EarthquakeParameterStationItem? param}) + > + > + stations; final IntensityColorModel colorModel; @override - Future init( - map_libre.MapLibreMapController controller, - ) async { + Future init(map_libre.MapLibreMapController controller) async { await dispose(controller); await controller.setSymbolIconAllowOverlap(true); await controller.setSymbolIconIgnorePlacement(true); - await controller.addGeoJsonSource( - 'station-intensity', - { - 'type': 'FeatureCollection', - 'features': stations.entries - .map((e) { - final color = e.key == null - ? const TextColorModel( - background: Color(0x00000000), - foreground: Color(0x00000000), - ) - : colorModel.fromJmaIntensity(e.key!); - return e.value.map( - (point) => { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [ - point.param?.longitude ?? 0, - point.param?.latitude ?? 0, - ], + await controller.addGeoJsonSource('station-intensity', { + 'type': 'FeatureCollection', + 'features': + stations.entries + .map((e) { + final color = + e.key == null + ? const TextColorModel( + background: Color(0x00000000), + foreground: Color(0x00000000), + ) + : colorModel.fromJmaIntensity(e.key!); + return e.value.map( + (point) => { + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [ + point.param?.longitude ?? 0, + point.param?.latitude ?? 0, + ], + }, + 'properties': { + 'color': color.background.toHexStringRGB(), + 'intensity': e.key?.type, + 'name': point.param?.name, + }, }, - 'properties': { - 'color': color.background.toHexStringRGB(), - 'intensity': e.key?.type, - 'name': point.param?.name, - }, - }, - ); - }) - .flattened - .toList(), - }, - ); + ); + }) + .flattened + .toList(), + }); for (final intensity in JmaIntensity.values) { await controller.addLayer( 'station-intensity', @@ -715,11 +616,7 @@ class _StationAction extends _Action { textAllowOverlap: true, iconAllowOverlap: true, ), - filter: [ - '==', - 'intensity', - intensity.type, - ], + filter: ['==', 'intensity', intensity.type], sourceLayer: 'station-intensity', minzoom: 7, ); @@ -742,11 +639,7 @@ class _StationAction extends _Action { iconAllowOverlap: true, ), maxzoom: 7, - filter: [ - '==', - 'intensity', - intensity.type, - ], + filter: ['==', 'intensity', intensity.type], sourceLayer: 'station-intensity', belowLayerId: 'hypocenter', ); @@ -788,9 +681,7 @@ class _StationAction extends _Action { } class _HypocenterAction extends _Action { - _HypocenterAction({ - required this.earthquake, - }); + _HypocenterAction({required this.earthquake}); final EarthquakeV1Extended earthquake; @@ -811,11 +702,12 @@ class _HypocenterAction extends _Action { 'coordinates': [longitude, latitude], }, 'properties': { - 'magnitude': earthquake.magnitude?.toString() ?? + 'magnitude': + earthquake.magnitude?.toString() ?? earthquake.magnitudeCondition ?? '調査中', }, - } + }, ], }); await controller.addSymbolLayer( @@ -855,9 +747,7 @@ class _HypocenterAction extends _Action { } class _FillRegionLpgmIntensityAction extends _Action { - _FillRegionLpgmIntensityAction({ - required this.regionsItem, - }); + _FillRegionLpgmIntensityAction({required this.regionsItem}); final List<_RegionLpgmColorItem> regionsItem; @@ -883,10 +773,7 @@ class _FillRegionLpgmIntensityAction extends _Action { filter: [ 'in', ['get', 'code'], - [ - 'literal', - item.codes, - ], + ['literal', item.codes], ], ), controller.addLayer( @@ -902,10 +789,7 @@ class _FillRegionLpgmIntensityAction extends _Action { filter: [ 'in', ['get', 'regioncode'], - [ - 'literal', - item.codes, - ], + ['literal', item.codes], ], ), ], @@ -913,14 +797,11 @@ class _FillRegionLpgmIntensityAction extends _Action { } @override - Future dispose(map_libre.MapLibreMapController controller) => [ + Future dispose(map_libre.MapLibreMapController controller) => + [ for (final item in regionsItem) ...[ - controller.removeLayer( - getLineLayerName(item.intensity), - ), - controller.removeLayer( - getFillLayerName(item.intensity), - ), + controller.removeLayer(getLineLayerName(item.intensity)), + controller.removeLayer(getFillLayerName(item.intensity)), ], ].wait; } @@ -932,12 +813,15 @@ class _StationIntensityLpgmAction extends _Action { }); final Map< - JmaLgIntensity?, - List< - ({ - ObservedRegionLpgmIntensity item, - EarthquakeParameterStationItem? param - })>> stations; + JmaLgIntensity?, + List< + ({ + ObservedRegionLpgmIntensity item, + EarthquakeParameterStationItem? param, + }) + > + > + stations; final IntensityColorModel colorModel; static const sourceName = 'station-lpgm-intensity'; @@ -948,41 +832,37 @@ class _StationIntensityLpgmAction extends _Action { static const symbolLayerName = 'station-lpgm-intensity-symbol'; @override - Future init( - map_libre.MapLibreMapController controller, - ) async { + Future init(map_libre.MapLibreMapController controller) async { await dispose(controller); await controller.setSymbolIconAllowOverlap(true); await controller.setSymbolIconIgnorePlacement(true); - await controller.addGeoJsonSource( - sourceName, - { - 'type': 'FeatureCollection', - 'features': stations.entries - .map((e) { - final color = colorModel.fromJmaLgIntensity(e.key!); - return e.value.map( - (point) => { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [ - point.param?.longitude ?? 0, - point.param?.latitude ?? 0, - ], - }, - 'properties': { - 'color': color.background.toHexStringRGB(), - 'lgIntensity': e.key?.type, - 'name': point.param?.name, + await controller.addGeoJsonSource(sourceName, { + 'type': 'FeatureCollection', + 'features': + stations.entries + .map((e) { + final color = colorModel.fromJmaLgIntensity(e.key!); + return e.value.map( + (point) => { + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [ + point.param?.longitude ?? 0, + point.param?.latitude ?? 0, + ], + }, + 'properties': { + 'color': color.background.toHexStringRGB(), + 'lgIntensity': e.key?.type, + 'name': point.param?.name, + }, }, - }, - ); - }) - .flattened - .toList(), - }, - ); + ); + }) + .flattened + .toList(), + }); for (final intensity in JmaLgIntensity.values) { await controller.addLayer( sourceName, @@ -1008,11 +888,7 @@ class _StationIntensityLpgmAction extends _Action { textAllowOverlap: true, iconAllowOverlap: true, ), - filter: [ - '==', - 'lgIntensity', - intensity.type, - ], + filter: ['==', 'lgIntensity', intensity.type], sourceLayer: sourceName, minzoom: 7, ); @@ -1036,11 +912,7 @@ class _StationIntensityLpgmAction extends _Action { iconAllowOverlap: true, ), maxzoom: 7, - filter: [ - '==', - 'lgIntensity', - intensity.type, - ], + filter: ['==', 'lgIntensity', intensity.type], sourceLayer: sourceName, ); } @@ -1081,13 +953,10 @@ class _StationIntensityLpgmAction extends _Action { class _CurrentLocationIconService extends _Action { @override Future init(map_libre.MapLibreMapController controller) async { - await controller.addGeoJsonSource( - layerId, - { - 'type': 'FeatureCollection', - 'features': [], - }, - ); + await controller.addGeoJsonSource(layerId, { + 'type': 'FeatureCollection', + 'features': [], + }); await controller.addSymbolLayer( layerId, @@ -1119,24 +988,18 @@ class _CurrentLocationIconService extends _Action { map_libre.MapLibreMapController controller, (double lat, double lng) position, ) async { - await controller.setGeoJsonSource( - layerId, - { - 'type': 'FeatureCollection', - 'features': [ - { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [ - position.$2, - position.$1, - ], - }, + await controller.setGeoJsonSource(layerId, { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [position.$2, position.$1], }, - ], - }, - ); + }, + ], + }); } static String get layerId => 'current-location'; diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart index c0de5f4f..3abf52cc 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart @@ -14,112 +14,109 @@ import 'package:sheet/route.dart'; part 'prefecture_intensity.g.dart'; -typedef _Arg = ({ - List? cities, - List prefectures, - List? stations, -}); +typedef _Arg = + ({ + List? cities, + List prefectures, + List? stations, + }); @riverpod Future>> _calculator( Ref ref, _Arg arg, -) => - compute<_Arg, Map>>( - ( - arg, - ) { - final cities = arg.cities; - final prefectures = arg.prefectures; - final stations = arg.stations; +) => compute<_Arg, Map>>((arg) { + final cities = arg.cities; + final prefectures = arg.prefectures; + final stations = arg.stations; - final Map> result; - if (stations != null && cities != null) { - final stationsGroupedByIntensity = stations - .where((e) => e.intensity != null) - .groupListsBy((e) => e.intensity!); - result = stationsGroupedByIntensity.map((intensity, stations) { - final stationsGroupedByCity = - stations.groupListsBy((e) => '${e.code.substring(0, 5)}00'); - // マージ - final mergedCity = stationsGroupedByCity.entries - .map((e) { - final cityCode = e.key; - final cityStations = e.value; - final city = - cities.firstWhereOrNull((e) => e.code == cityCode); - if (city == null) { - return null; - } - return _CityIntensity( - code: city.code, - name: city.name, - intensity: intensity, - stations: cityStations, - ); - }) - .whereType<_CityIntensity>() - .toList(); + final Map> result; + if (stations != null && cities != null) { + final stationsGroupedByIntensity = stations + .where((e) => e.intensity != null) + .groupListsBy((e) => e.intensity!); + result = stationsGroupedByIntensity.map((intensity, stations) { + final stationsGroupedByCity = stations.groupListsBy( + (e) => '${e.code.substring(0, 5)}00', + ); + // マージ + final mergedCity = + stationsGroupedByCity.entries + .map((e) { + final cityCode = e.key; + final cityStations = e.value; + final city = cities.firstWhereOrNull((e) => e.code == cityCode); + if (city == null) { + return null; + } + return _CityIntensity( + code: city.code, + name: city.name, + intensity: intensity, + stations: cityStations, + ); + }) + .whereType<_CityIntensity>() + .toList(); - // 都道府県ごとにまとめる - final citiesGroupedByPrefecture = - mergedCity.groupListsBy((e) => e.code.substring(0, 2)); - // マージ - final mergedPrefecture = citiesGroupedByPrefecture.entries - .map((e) { - final prefectureCode = e.key; - final prefectureCities = e.value; - final prefecture = prefectures - .firstWhereOrNull((e) => e.code == prefectureCode); - if (prefecture == null) { - return null; - } - return _MergedRegionIntensity( - code: prefecture.code, - name: prefecture.name, + // 都道府県ごとにまとめる + final citiesGroupedByPrefecture = mergedCity.groupListsBy( + (e) => e.code.substring(0, 2), + ); + // マージ + final mergedPrefecture = + citiesGroupedByPrefecture.entries + .map((e) { + final prefectureCode = e.key; + final prefectureCities = e.value; + final prefecture = prefectures.firstWhereOrNull( + (e) => e.code == prefectureCode, + ); + if (prefecture == null) { + return null; + } + return _MergedRegionIntensity( + code: prefecture.code, + name: prefecture.name, + intensity: intensity, + cities: prefectureCities, + ); + }) + .whereType<_MergedRegionIntensity>() + .toList(); + return MapEntry(intensity, mergedPrefecture); + }); + } else { + result = prefectures + .where((e) => e.intensity != null) + .groupListsBy((e) => e.intensity!) + .map( + (intensity, prefectures) => MapEntry( + intensity, + prefectures + .map( + (e) => _MergedRegionIntensity( + code: e.code, + name: e.name, intensity: intensity, - cities: prefectureCities, - ); - }) - .whereType<_MergedRegionIntensity>() - .toList(); - return MapEntry(intensity, mergedPrefecture); - }); - } else { - result = prefectures - .where((e) => e.intensity != null) - .groupListsBy((e) => e.intensity!) - .map( - (intensity, prefectures) => MapEntry( - intensity, - prefectures - .map( - (e) => _MergedRegionIntensity( - code: e.code, - name: e.name, - intensity: intensity, - cities: null, - ), - ) - .toList(), - ), - ); - } - final reorderedResult = result.entries - .sorted((a, b) => a.key.index.compareTo(b.key.index)) - .toList() - .reversed - .toList(); - return Map.fromEntries(reorderedResult); - }, - arg, - ); + cities: null, + ), + ) + .toList(), + ), + ); + } + final reorderedResult = + result.entries + .sorted((a, b) => a.key.index.compareTo(b.key.index)) + .toList() + .reversed + .toList(); + return Map.fromEntries(reorderedResult); +}, arg); class PrefectureIntensityWidget extends HookConsumerWidget { - const PrefectureIntensityWidget({ - required this.item, - super.key, - }); + const PrefectureIntensityWidget({required this.item, super.key}); final EarthquakeV1 item; @@ -132,77 +129,66 @@ class PrefectureIntensityWidget extends HookConsumerWidget { } final mergedPrefecturesFuture = ref.watch( - _calculatorProvider( - ( - prefectures: item.intensityPrefectures!, - cities: item.intensityCities, - stations: item.intensityStations, - ), - ), + _calculatorProvider(( + prefectures: item.intensityPrefectures!, + cities: item.intensityCities, + stations: item.intensityStations, + )), ); return switch (mergedPrefecturesFuture) { AsyncLoading() => const Center( - child: Padding( - padding: EdgeInsets.all(8), - child: CircularProgressIndicator.adaptive(), - ), + child: Padding( + padding: EdgeInsets.all(8), + child: CircularProgressIndicator.adaptive(), ), + ), AsyncData(:final value) => BorderedContainer( - elevation: 1, - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Column( - children: [ - const SheetHeader( - title: '各地の震度', - ), - // 震度一覧 - for (final kv in value.entries) - () { - final intensity = kv.key; - final prefectures = kv.value; - final hasCities = prefectures.any( - (prefecture) => - prefecture.cities - ?.any((city) => city.stations.isNotEmpty) ?? - false, - ); - final title = switch (intensity) { - JmaIntensity.fiveUpperNoInput => '震度5弱以上未入電', - _ => '震度$intensity' - }; - return ListTile( - titleAlignment: ListTileTitleAlignment.titleHeight, - leading: JmaIntensityIcon( - intensity: intensity, - type: IntensityIconType.filled, - ), - title: Text( - title, - style: textTheme.titleMedium, - ), - subtitle: Text( - prefectures.map((e) => e.name).join(', '), - style: const TextStyle( - fontFamily: FontFamily.notoSansJP, - ), - ), - onTap: hasCities - ? () async => _PrefectureModalBottomSheet.show( - context: context, - intensity: kv.key, - prefectures: kv.value, - ) - : null, - trailing: - hasCities ? const Icon(Icons.chevron_right) : null, - ); - }(), - ], - ), + elevation: 1, + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: Column( + children: [ + const SheetHeader(title: '各地の震度'), + // 震度一覧 + for (final kv in value.entries) + () { + final intensity = kv.key; + final prefectures = kv.value; + final hasCities = prefectures.any( + (prefecture) => + prefecture.cities?.any( + (city) => city.stations.isNotEmpty, + ) ?? + false, + ); + final title = switch (intensity) { + JmaIntensity.fiveUpperNoInput => '震度5弱以上未入電', + _ => '震度$intensity', + }; + return ListTile( + titleAlignment: ListTileTitleAlignment.titleHeight, + leading: JmaIntensityIcon( + intensity: intensity, + type: IntensityIconType.filled, + ), + title: Text(title, style: textTheme.titleMedium), + subtitle: Text( + prefectures.map((e) => e.name).join(', '), + style: const TextStyle(fontFamily: FontFamily.notoSansJP), + ), + onTap: + hasCities + ? () async => _PrefectureModalBottomSheet.show( + context: context, + intensity: kv.key, + prefectures: kv.value, + ) + : null, + trailing: hasCities ? const Icon(Icons.chevron_right) : null, + ); + }(), + ], ), + ), _ => const SizedBox.shrink(), }; } @@ -218,17 +204,16 @@ class _PrefectureModalBottomSheet extends StatelessWidget { required BuildContext context, required JmaIntensity intensity, required List<_MergedRegionIntensity> prefectures, - }) => - Navigator.of(context).push( - SheetRoute( - builder: (context) { - return _PrefectureModalBottomSheet( - intensity: intensity, - prefectures: prefectures, - ); - }, - ), - ); + }) => Navigator.of(context).push( + SheetRoute( + builder: (context) { + return _PrefectureModalBottomSheet( + intensity: intensity, + prefectures: prefectures, + ); + }, + ), + ); final JmaIntensity intensity; final List<_MergedRegionIntensity> prefectures; @@ -236,11 +221,7 @@ class _PrefectureModalBottomSheet extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - '震度$intensityの地域', - ), - ), + appBar: AppBar(title: Text('震度$intensityの地域')), body: ListView( children: [ for (final prefecture in prefectures) @@ -252,9 +233,7 @@ class _PrefectureModalBottomSheet extends StatelessWidget { } class _PrefectureListTile extends HookWidget { - const _PrefectureListTile({ - required this.prefecture, - }); + const _PrefectureListTile({required this.prefecture}); final _MergedRegionIntensity prefecture; @@ -264,9 +243,7 @@ class _PrefectureListTile extends HookWidget { final shrinked = ListTile( title: Text( prefecture.name, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + style: const TextStyle(fontWeight: FontWeight.bold), ), trailing: const Icon(Icons.expand_more), onTap: () => isExpanded.value = true, @@ -274,9 +251,7 @@ class _PrefectureListTile extends HookWidget { final expanded = ListTile( title: Text( prefecture.name, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + style: const TextStyle(fontWeight: FontWeight.bold), ), subtitle: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -287,16 +262,12 @@ class _PrefectureListTile extends HookWidget { children: [ TextSpan( text: '${city.name}: ', - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + style: const TextStyle(fontWeight: FontWeight.bold), ), for (final station in city.stations) TextSpan( text: '${station.name} ', - style: const TextStyle( - color: Colors.grey, - ), + style: const TextStyle(color: Colors.grey), ), ], ), @@ -309,9 +280,10 @@ class _PrefectureListTile extends HookWidget { return AnimatedCrossFade( firstChild: shrinked, secondChild: expanded, - crossFadeState: isExpanded.value - ? CrossFadeState.showSecond - : CrossFadeState.showFirst, + crossFadeState: + isExpanded.value + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, duration: const Duration(milliseconds: 300), ); } diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.g.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.g.dart index 77677a32..50e620bd 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.g.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.g.dart @@ -36,8 +36,9 @@ class _SystemHash { const _calculatorProvider = _CalculatorFamily(); /// See also [_calculator]. -class _CalculatorFamily extends Family< - AsyncValue>>> { +class _CalculatorFamily + extends + Family>>> { /// See also [_calculator]. const _CalculatorFamily(); @@ -46,21 +47,18 @@ class _CalculatorFamily extends Family< ({ List? cities, List prefectures, - List? stations - }) arg, + List? stations, + }) + arg, ) { - return _CalculatorProvider( - arg, - ); + return _CalculatorProvider(arg); } @override _CalculatorProvider getProviderOverride( covariant _CalculatorProvider provider, ) { - return call( - provider.arg, - ); + return call(provider.arg); } static const Iterable? _dependencies = null; @@ -79,31 +77,31 @@ class _CalculatorFamily extends Family< } /// See also [_calculator]. -class _CalculatorProvider extends AutoDisposeFutureProvider< - Map>> { +class _CalculatorProvider + extends + AutoDisposeFutureProvider< + Map> + > { /// See also [_calculator]. _CalculatorProvider( ({ List? cities, List prefectures, - List? stations - }) arg, + List? stations, + }) + arg, ) : this._internal( - (ref) => _calculator( - ref as _CalculatorRef, - arg, - ), - from: _calculatorProvider, - name: r'_calculatorProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$calculatorHash, - dependencies: _CalculatorFamily._dependencies, - allTransitiveDependencies: - _CalculatorFamily._allTransitiveDependencies, - arg: arg, - ); + (ref) => _calculator(ref as _CalculatorRef, arg), + from: _calculatorProvider, + name: r'_calculatorProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$calculatorHash, + dependencies: _CalculatorFamily._dependencies, + allTransitiveDependencies: _CalculatorFamily._allTransitiveDependencies, + arg: arg, + ); _CalculatorProvider._internal( super._createNotifier, { @@ -118,14 +116,16 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< final ({ List? cities, List prefectures, - List? stations - }) arg; + List? stations, + }) + arg; @override Override overrideWith( FutureOr>> Function( - _CalculatorRef provider) - create, + _CalculatorRef provider, + ) + create, ) { return ProviderOverride( origin: this, @@ -143,7 +143,9 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< @override AutoDisposeFutureProviderElement< - Map>> createElement() { + Map> + > + createElement() { return _CalculatorProviderElement(this); } @@ -163,26 +165,36 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -mixin _CalculatorRef on AutoDisposeFutureProviderRef< - Map>> { +mixin _CalculatorRef + on + AutoDisposeFutureProviderRef< + Map> + > { /// The parameter `arg` of this provider. ({ List? cities, List prefectures, - List? stations - }) get arg; + List? stations, + }) + get arg; } -class _CalculatorProviderElement extends AutoDisposeFutureProviderElement< - Map>> with _CalculatorRef { +class _CalculatorProviderElement + extends + AutoDisposeFutureProviderElement< + Map> + > + with _CalculatorRef { _CalculatorProviderElement(super.provider); @override ({ List? cities, List prefectures, - List? stations - }) get arg => (origin as _CalculatorProvider).arg; + List? stations, + }) + get arg => (origin as _CalculatorProvider).arg; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart index 56b80182..6619c0e4 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart @@ -15,68 +15,56 @@ import 'package:sheet/route.dart'; part 'prefecture_lpgm_intensity.g.dart'; -typedef _Arg = ({ - List? prefectures, - List? stations, -}); +typedef _Arg = + ({ + List? prefectures, + List? stations, + }); @riverpod Future>> _lpgmCalculator( Ref ref, _Arg arg, ) => - compute<_Arg, Map>>( - ( - arg, - ) { - final prefectures = arg.prefectures; - final stations = arg.stations; - if (prefectures == null || stations == null) { - return {}; - } - // 最大長周期地震動階級でグルーピング - final prefecturesGroupedByLpgmIntensity = prefectures - .where((pref) => pref.lpgmIntensity != null) - .groupListsBy( - (pref) => pref.lpgmIntensity!, - ); - // それぞれの階級ごとに、都道府県を舐める - final result = >{}; - for (final entry in prefecturesGroupedByLpgmIntensity.entries) { - final intensity = entry.key; - final prefectures = entry.value; - for (final pref in prefectures) { - // 観測点が所属していて、階級が同じものを取得 - // idの上2桁が都道府県コード - final stationsInPrefAndIntensitySame = stations.where( - (sta) => - sta.code.startsWith(pref.code.substring(0, 2)) && - sta.lpgmIntensity == intensity, - ); - result.putIfAbsent( - intensity, - () => [], - ); - result[intensity]!.add( - _MergedPrefectureIntensity( - code: pref.code, - name: pref.name, - intensity: intensity, - stations: stationsInPrefAndIntensitySame.toList(), - ), - ); - } + compute<_Arg, Map>>((arg) { + final prefectures = arg.prefectures; + final stations = arg.stations; + if (prefectures == null || stations == null) { + return {}; + } + // 最大長周期地震動階級でグルーピング + final prefecturesGroupedByLpgmIntensity = prefectures + .where((pref) => pref.lpgmIntensity != null) + .groupListsBy((pref) => pref.lpgmIntensity!); + // それぞれの階級ごとに、都道府県を舐める + final result = >{}; + for (final entry in prefecturesGroupedByLpgmIntensity.entries) { + final intensity = entry.key; + final prefectures = entry.value; + for (final pref in prefectures) { + // 観測点が所属していて、階級が同じものを取得 + // idの上2桁が都道府県コード + final stationsInPrefAndIntensitySame = stations.where( + (sta) => + sta.code.startsWith(pref.code.substring(0, 2)) && + sta.lpgmIntensity == intensity, + ); + result.putIfAbsent(intensity, () => []); + result[intensity]!.add( + _MergedPrefectureIntensity( + code: pref.code, + name: pref.name, + intensity: intensity, + stations: stationsInPrefAndIntensitySame.toList(), + ), + ); } - return result; - }, - arg, - ); + } + return result; + }, arg); class PrefectureLpgmIntensityWidget extends HookConsumerWidget { - const PrefectureLpgmIntensityWidget({ - required this.item, - super.key, - }); + const PrefectureLpgmIntensityWidget({required this.item, super.key}); final EarthquakeV1 item; @@ -86,67 +74,60 @@ class PrefectureLpgmIntensityWidget extends HookConsumerWidget { final textTheme = theme.textTheme; final mergedPrefecturesFuture = ref.watch( - _LpgmCalculatorProvider( - ( - prefectures: item.lpgmIntensityPrefectures, - stations: item.lpgmIntenstiyStations, - ), - ), + _LpgmCalculatorProvider(( + prefectures: item.lpgmIntensityPrefectures, + stations: item.lpgmIntenstiyStations, + )), ); return switch (mergedPrefecturesFuture) { AsyncLoading() => const Center( - child: Padding( - padding: EdgeInsets.all(8), - child: CircularProgressIndicator.adaptive(), - ), + child: Padding( + padding: EdgeInsets.all(8), + child: CircularProgressIndicator.adaptive(), ), + ), AsyncData(:final value) when value.isEmpty => const SizedBox.shrink(), AsyncData(:final value) => BorderedContainer( - elevation: 1, - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Column( - children: [ - const SheetHeader( - title: '各地の長周期地震動観測状況', - ), - // 長周期地震動階級の種別 - for (final kv in value.toList.sorted( - (a, b) => a.key < b.key ? 1 : -1, - )) - () { - final hasStations = - kv.value.any((e) => e.stations.isNotEmpty); - return ListTile( - titleAlignment: ListTileTitleAlignment.titleHeight, - leading: JmaLgIntensityIcon( - intensity: kv.key, - type: IntensityIconType.filled, - ), - title: Text( - '長周期地震動階級${kv.key.type}', - style: textTheme.titleMedium, - ), - subtitle: Text( - kv.value.map((e) => e.name).join(', ').toHalfWidth, - ), - onTap: hasStations - ? () async => _PrefectureModalBottomSheet.show( - context: context, - intensity: kv.key, - prefectures: kv.value, - ) - : null, - trailing: - hasStations ? const Icon(Icons.chevron_right) : null, - ); - }(), - ], - ), + elevation: 1, + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: Column( + children: [ + const SheetHeader(title: '各地の長周期地震動観測状況'), + // 長周期地震動階級の種別 + for (final kv in value.toList.sorted( + (a, b) => a.key < b.key ? 1 : -1, + )) + () { + final hasStations = kv.value.any((e) => e.stations.isNotEmpty); + return ListTile( + titleAlignment: ListTileTitleAlignment.titleHeight, + leading: JmaLgIntensityIcon( + intensity: kv.key, + type: IntensityIconType.filled, + ), + title: Text( + '長周期地震動階級${kv.key.type}', + style: textTheme.titleMedium, + ), + subtitle: Text( + kv.value.map((e) => e.name).join(', ').toHalfWidth, + ), + onTap: + hasStations + ? () async => _PrefectureModalBottomSheet.show( + context: context, + intensity: kv.key, + prefectures: kv.value, + ) + : null, + trailing: + hasStations ? const Icon(Icons.chevron_right) : null, + ); + }(), + ], ), + ), _ => const SizedBox.shrink(), }; } @@ -162,17 +143,16 @@ class _PrefectureModalBottomSheet extends StatelessWidget { required BuildContext context, required JmaLgIntensity intensity, required List<_MergedPrefectureIntensity> prefectures, - }) => - Navigator.of(context).push( - SheetRoute( - builder: (context) { - return _PrefectureModalBottomSheet( - intensity: intensity, - prefectures: prefectures, - ); - }, - ), - ); + }) => Navigator.of(context).push( + SheetRoute( + builder: (context) { + return _PrefectureModalBottomSheet( + intensity: intensity, + prefectures: prefectures, + ); + }, + ), + ); final JmaLgIntensity intensity; final List<_MergedPrefectureIntensity> prefectures; @@ -180,11 +160,7 @@ class _PrefectureModalBottomSheet extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: Text( - '長周期地震動階級$intensityの観測点', - ), - ), + appBar: AppBar(title: Text('長周期地震動階級$intensityの観測点')), body: ListView( children: [ for (final prefecture in prefectures) @@ -196,9 +172,7 @@ class _PrefectureModalBottomSheet extends StatelessWidget { } class _PrefectureListTile extends HookWidget { - const _PrefectureListTile({ - required this.prefecture, - }); + const _PrefectureListTile({required this.prefecture}); final _MergedPrefectureIntensity prefecture; @@ -208,9 +182,7 @@ class _PrefectureListTile extends HookWidget { final shrinked = ListTile( title: Text( prefecture.name, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + style: const TextStyle(fontWeight: FontWeight.bold), ), trailing: const Icon(Icons.expand_more), onTap: () => isExpanded.value = true, @@ -218,26 +190,19 @@ class _PrefectureListTile extends HookWidget { final expanded = ListTile( title: Text( prefecture.name, - style: const TextStyle( - fontWeight: FontWeight.bold, - ), - ), - subtitle: Text( - prefecture.stations - .map( - (e) => e.name, - ) - .join(', '), + style: const TextStyle(fontWeight: FontWeight.bold), ), + subtitle: Text(prefecture.stations.map((e) => e.name).join(', ')), onTap: () => isExpanded.value = false, trailing: const Icon(Icons.expand_less), ); return AnimatedCrossFade( firstChild: shrinked, secondChild: expanded, - crossFadeState: isExpanded.value - ? CrossFadeState.showSecond - : CrossFadeState.showFirst, + crossFadeState: + isExpanded.value + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, duration: const Duration(milliseconds: 300), ); } diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.g.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.g.dart index dcd9b52c..aded8232 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.g.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.g.dart @@ -36,8 +36,11 @@ class _SystemHash { const _lpgmCalculatorProvider = _LpgmCalculatorFamily(); /// See also [_lpgmCalculator]. -class _LpgmCalculatorFamily extends Family< - AsyncValue>>> { +class _LpgmCalculatorFamily + extends + Family< + AsyncValue>> + > { /// See also [_lpgmCalculator]. const _LpgmCalculatorFamily(); @@ -45,21 +48,18 @@ class _LpgmCalculatorFamily extends Family< _LpgmCalculatorProvider call( ({ List? prefectures, - List? stations - }) arg, + List? stations, + }) + arg, ) { - return _LpgmCalculatorProvider( - arg, - ); + return _LpgmCalculatorProvider(arg); } @override _LpgmCalculatorProvider getProviderOverride( covariant _LpgmCalculatorProvider provider, ) { - return call( - provider.arg, - ); + return call(provider.arg); } static const Iterable? _dependencies = null; @@ -78,30 +78,31 @@ class _LpgmCalculatorFamily extends Family< } /// See also [_lpgmCalculator]. -class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< - Map>> { +class _LpgmCalculatorProvider + extends + AutoDisposeFutureProvider< + Map> + > { /// See also [_lpgmCalculator]. _LpgmCalculatorProvider( ({ List? prefectures, - List? stations - }) arg, + List? stations, + }) + arg, ) : this._internal( - (ref) => _lpgmCalculator( - ref as _LpgmCalculatorRef, - arg, - ), - from: _lpgmCalculatorProvider, - name: r'_lpgmCalculatorProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$lpgmCalculatorHash, - dependencies: _LpgmCalculatorFamily._dependencies, - allTransitiveDependencies: - _LpgmCalculatorFamily._allTransitiveDependencies, - arg: arg, - ); + (ref) => _lpgmCalculator(ref as _LpgmCalculatorRef, arg), + from: _lpgmCalculatorProvider, + name: r'_lpgmCalculatorProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$lpgmCalculatorHash, + dependencies: _LpgmCalculatorFamily._dependencies, + allTransitiveDependencies: + _LpgmCalculatorFamily._allTransitiveDependencies, + arg: arg, + ); _LpgmCalculatorProvider._internal( super._createNotifier, { @@ -115,14 +116,16 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< final ({ List? prefectures, - List? stations - }) arg; + List? stations, + }) + arg; @override Override overrideWith( FutureOr>> Function( - _LpgmCalculatorRef provider) - create, + _LpgmCalculatorRef provider, + ) + create, ) { return ProviderOverride( origin: this, @@ -140,7 +143,9 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< @override AutoDisposeFutureProviderElement< - Map>> createElement() { + Map> + > + createElement() { return _LpgmCalculatorProviderElement(this); } @@ -160,25 +165,34 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -mixin _LpgmCalculatorRef on AutoDisposeFutureProviderRef< - Map>> { +mixin _LpgmCalculatorRef + on + AutoDisposeFutureProviderRef< + Map> + > { /// The parameter `arg` of this provider. ({ List? prefectures, - List? stations - }) get arg; + List? stations, + }) + get arg; } -class _LpgmCalculatorProviderElement extends AutoDisposeFutureProviderElement< - Map>> +class _LpgmCalculatorProviderElement + extends + AutoDisposeFutureProviderElement< + Map> + > with _LpgmCalculatorRef { _LpgmCalculatorProviderElement(super.provider); @override ({ List? prefectures, - List? stations - }) get arg => (origin as _LpgmCalculatorProvider).arg; + List? stations, + }) + get arg => (origin as _LpgmCalculatorProvider).arg; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_details/ui/screen/earthquake_history_details.dart b/app/lib/feature/earthquake_history_details/ui/screen/earthquake_history_details.dart index b105fb6a..fe05fdc9 100644 --- a/app/lib/feature/earthquake_history_details/ui/screen/earthquake_history_details.dart +++ b/app/lib/feature/earthquake_history_details/ui/screen/earthquake_history_details.dart @@ -24,10 +24,7 @@ import 'package:sheet/sheet.dart'; import 'package:url_launcher/url_launcher.dart'; class EarthquakeHistoryDetailsPage extends HookConsumerWidget { - const EarthquakeHistoryDetailsPage({ - required this.eventId, - super.key, - }); + const EarthquakeHistoryDetailsPage({required this.eventId, super.key}); final int eventId; @@ -43,37 +40,37 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { appBar: AppBar(), body: switch (detailsState) { AsyncError(:final error) when !detailsState.isLoading => ErrorCard( - error: error, - onReload: () async => ref.refresh( - earthquakeHistoryDetailsNotifierProvider(eventId), - ), - ), + error: error, + onReload: + () async => ref.refresh( + earthquakeHistoryDetailsNotifierProvider(eventId), + ), + ), AsyncLoading() || _ when detailsState.isLoading => Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const CircularProgressIndicator.adaptive(), - const SizedBox(height: 8), - Text( - '各地の震度データを取得中...', - style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.bold, - ), - ), - ], - ), - ), - _ => const Center( - child: CircularProgressIndicator.adaptive(), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const CircularProgressIndicator.adaptive(), + const SizedBox(height: 8), + Text( + '各地の震度データを取得中...', + style: Theme.of( + context, + ).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.bold), + ), + ], ), + ), + _ => const Center(child: CircularProgressIndicator.adaptive()), }, ); } final maxIntensity = details.maxIntensity; final maxLgIntensity = details.maxLpgmIntensity; - final config = ref - .watch(earthquakeHistoryConfigProvider.select((value) => value.detail)); + final config = ref.watch( + earthquakeHistoryConfigProvider.select((value) => value.detail), + ); final sheetController = SheetController(); final navigateToHomeFunction = useState(null); @@ -93,9 +90,7 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { child: AnimatedSwitcher( duration: const Duration(milliseconds: 250), child: BorderedContainer( - key: ValueKey( - (config, maxIntensity, maxLgIntensity), - ), + key: ValueKey((config, maxIntensity, maxLgIntensity)), margin: const EdgeInsets.all(4), padding: const EdgeInsets.all(4), borderRadius: BorderRadius.circular((25 / 5) + 5), @@ -120,9 +115,7 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { else for (final intensity in [ ...JmaIntensity.values, - ].where( - (e) => e <= maxIntensity, - )) + ].where((e) => e <= maxIntensity)) JmaIntensityIcon( type: IntensityIconType.filled, intensity: intensity, @@ -147,12 +140,12 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { FloatingActionButton.small( heroTag: 'earthquake_history_details_layer_fab', tooltip: '地図の表示レイヤーを切り替える', - onPressed: () async => - showEarthquakeHistoryDetailConfigDialog( - context, - showCitySelector: details.intensityCities != null, - hasLpgmIntensity: details.maxLpgmIntensity != null, - ), + onPressed: + () async => showEarthquakeHistoryDetailConfigDialog( + context, + showCitySelector: details.intensityCities != null, + hasLpgmIntensity: details.maxLpgmIntensity != null, + ), elevation: 4, child: const Icon(Icons.layers), ), @@ -172,10 +165,7 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { ], ), // Sheet - _Sheet( - sheetController: sheetController, - item: details, - ), + _Sheet(sheetController: sheetController, item: details), if (Navigator.canPop(context)) // 戻るボタン SafeArea( @@ -202,10 +192,7 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { } class _Sheet extends StatelessWidget { - const _Sheet({ - required this.sheetController, - required this.item, - }); + const _Sheet({required this.sheetController, required this.item}); final SheetController sheetController; final EarthquakeV1Extended item; @@ -221,9 +208,7 @@ class _Sheet extends StatelessWidget { const Divider(), PrefectureIntensityWidget(item: item.v1), if (item.lpgmIntensityPrefectures != null) - PrefectureLpgmIntensityWidget( - item: item, - ), + PrefectureLpgmIntensityWidget(item: item), _EarthquakeCommentWidget(item: item), ], ), @@ -260,9 +245,7 @@ class _EarthquakeCommentWidget extends StatelessWidget { if (uri == null) { return; } - await launchUrl( - uri, - ); + await launchUrl(uri); }, ), ); @@ -272,10 +255,7 @@ class _EarthquakeCommentWidget extends StatelessWidget { } class EarthquakeHypoInfoWidget extends StatelessWidget { - const EarthquakeHypoInfoWidget({ - required this.item, - super.key, - }); + const EarthquakeHypoInfoWidget({required this.item, super.key}); final EarthquakeV1Extended item; @@ -290,9 +270,10 @@ class EarthquakeHypoInfoWidget extends StatelessWidget { child: Padding( padding: const EdgeInsets.only(top: 8), child: FilledButton.icon( - onPressed: () async => EewDetailsByEventIdRoute( - eventId: item.v1.eventId.toString(), - ).push(context), + onPressed: + () async => EewDetailsByEventIdRoute( + eventId: item.v1.eventId.toString(), + ).push(context), icon: const Icon(Icons.notifications_active), label: const Text('緊急地震速報の履歴を表示'), style: FilledButton.styleFrom( diff --git a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.dart index 7740e803..e17167d3 100644 --- a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.dart +++ b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.dart @@ -6,12 +6,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_early_details_notifier.g.dart'; @riverpod -Future earthquakeHistoryEarlyEvent( - Ref ref, - String id, -) => +Future earthquakeHistoryEarlyEvent(Ref ref, String id) => ref .watch(earthquakeHistoryEarlyRepositoryProvider) - .fetchEarthquakeEarlyEvent( - id: id, - ); + .fetchEarthquakeEarlyEvent(id: id); diff --git a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.g.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.g.dart index 75159d3d..57daa8ba 100644 --- a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.g.dart +++ b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_details_notifier.g.dart @@ -43,21 +43,15 @@ class EarthquakeHistoryEarlyEventFamily const EarthquakeHistoryEarlyEventFamily(); /// See also [earthquakeHistoryEarlyEvent]. - EarthquakeHistoryEarlyEventProvider call( - String id, - ) { - return EarthquakeHistoryEarlyEventProvider( - id, - ); + EarthquakeHistoryEarlyEventProvider call(String id) { + return EarthquakeHistoryEarlyEventProvider(id); } @override EarthquakeHistoryEarlyEventProvider getProviderOverride( covariant EarthquakeHistoryEarlyEventProvider provider, ) { - return call( - provider.id, - ); + return call(provider.id); } static const Iterable? _dependencies = null; @@ -79,24 +73,23 @@ class EarthquakeHistoryEarlyEventFamily class EarthquakeHistoryEarlyEventProvider extends AutoDisposeFutureProvider { /// See also [earthquakeHistoryEarlyEvent]. - EarthquakeHistoryEarlyEventProvider( - String id, - ) : this._internal( - (ref) => earthquakeHistoryEarlyEvent( - ref as EarthquakeHistoryEarlyEventRef, - id, - ), - from: earthquakeHistoryEarlyEventProvider, - name: r'earthquakeHistoryEarlyEventProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryEarlyEventHash, - dependencies: EarthquakeHistoryEarlyEventFamily._dependencies, - allTransitiveDependencies: - EarthquakeHistoryEarlyEventFamily._allTransitiveDependencies, - id: id, - ); + EarthquakeHistoryEarlyEventProvider(String id) + : this._internal( + (ref) => earthquakeHistoryEarlyEvent( + ref as EarthquakeHistoryEarlyEventRef, + id, + ), + from: earthquakeHistoryEarlyEventProvider, + name: r'earthquakeHistoryEarlyEventProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryEarlyEventHash, + dependencies: EarthquakeHistoryEarlyEventFamily._dependencies, + allTransitiveDependencies: + EarthquakeHistoryEarlyEventFamily._allTransitiveDependencies, + id: id, + ); EarthquakeHistoryEarlyEventProvider._internal( super._createNotifier, { @@ -113,8 +106,9 @@ class EarthquakeHistoryEarlyEventProvider @override Override overrideWith( FutureOr Function( - EarthquakeHistoryEarlyEventRef provider) - create, + EarthquakeHistoryEarlyEventRef provider, + ) + create, ) { return ProviderOverride( origin: this, @@ -165,5 +159,6 @@ class _EarthquakeHistoryEarlyEventProviderElement @override String get id => (origin as EarthquakeHistoryEarlyEventProvider).id; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.dart index 5aad4dbe..7bd6818a 100644 --- a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.dart +++ b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.dart @@ -6,10 +6,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_early_notifier.g.dart'; -typedef EarthquakeHistoryEarlyNotifierState = ( - List, - int totalCount -); +typedef EarthquakeHistoryEarlyNotifierState = + (List, int totalCount); extension EarthquakeHistoryEarlyNotifierStateEx on EarthquakeHistoryEarlyNotifierState { @@ -21,8 +19,7 @@ class EarthquakeHistoryEarlyNotifier extends _$EarthquakeHistoryEarlyNotifier { @override Future build( EarthquakeHistoryEarlyParameter parameter, - ) => - _fetchInitialData(parameter: parameter); + ) => _fetchInitialData(parameter: parameter); Future _fetchInitialData({ required EarthquakeHistoryEarlyParameter parameter, @@ -41,10 +38,7 @@ class EarthquakeHistoryEarlyNotifier extends _$EarthquakeHistoryEarlyNotifier { ascending: parameter.ascending, ); - return ( - response.items, - response.count, - ); + return (response.items, response.count); } Future fetchNextData() async { @@ -58,31 +52,26 @@ class EarthquakeHistoryEarlyNotifier extends _$EarthquakeHistoryEarlyNotifier { } state = const AsyncLoading<(List, int totalCount)>() .copyWithPrevious(state); - state = await state.guardPlus( - () async { - final repository = ref.read(earthquakeHistoryEarlyRepositoryProvider); - final currentData = state.valueOrNull; - final result = await repository.fetchEarthquakeEarlyLists( - depthGte: parameter.depthGte, - depthLte: parameter.depthLte, - intensityGte: parameter.intensityGte, - intensityLte: parameter.intensityLte, - magnitudeGte: parameter.magnitudeGte, - magnitudeLte: parameter.magnitudeLte, - originTimeLte: parameter.originTimeLte, - originTimeGte: parameter.originTimeGte, - offset: currentData?.$1.length ?? 0, - sort: parameter.sort, - ascending: parameter.ascending, - ); - return ( - [ - ...currentData?.$1 ?? [], - ...result.items, - ], - result.count, - ); - }, - ); + state = await state.guardPlus(() async { + final repository = ref.read(earthquakeHistoryEarlyRepositoryProvider); + final currentData = state.valueOrNull; + final result = await repository.fetchEarthquakeEarlyLists( + depthGte: parameter.depthGte, + depthLte: parameter.depthLte, + intensityGte: parameter.intensityGte, + intensityLte: parameter.intensityLte, + magnitudeGte: parameter.magnitudeGte, + magnitudeLte: parameter.magnitudeLte, + originTimeLte: parameter.originTimeLte, + originTimeGte: parameter.originTimeGte, + offset: currentData?.$1.length ?? 0, + sort: parameter.sort, + ascending: parameter.ascending, + ); + return ( + [...currentData?.$1 ?? [], ...result.items], + result.count, + ); + }); } } diff --git a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.g.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.g.dart index 5392f919..15af8070 100644 --- a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.g.dart +++ b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.g.dart @@ -33,8 +33,8 @@ class _SystemHash { } abstract class _$EarthquakeHistoryEarlyNotifier - extends BuildlessAutoDisposeAsyncNotifier< - EarthquakeHistoryEarlyNotifierState> { + extends + BuildlessAutoDisposeAsyncNotifier { late final EarthquakeHistoryEarlyParameter parameter; FutureOr build( @@ -57,18 +57,14 @@ class EarthquakeHistoryEarlyNotifierFamily EarthquakeHistoryEarlyNotifierProvider call( EarthquakeHistoryEarlyParameter parameter, ) { - return EarthquakeHistoryEarlyNotifierProvider( - parameter, - ); + return EarthquakeHistoryEarlyNotifierProvider(parameter); } @override EarthquakeHistoryEarlyNotifierProvider getProviderOverride( covariant EarthquakeHistoryEarlyNotifierProvider provider, ) { - return call( - provider.parameter, - ); + return call(provider.parameter); } static const Iterable? _dependencies = null; @@ -88,24 +84,27 @@ class EarthquakeHistoryEarlyNotifierFamily /// See also [EarthquakeHistoryEarlyNotifier]. class EarthquakeHistoryEarlyNotifierProvider - extends AutoDisposeAsyncNotifierProviderImpl { + extends + AutoDisposeAsyncNotifierProviderImpl< + EarthquakeHistoryEarlyNotifier, + EarthquakeHistoryEarlyNotifierState + > { /// See also [EarthquakeHistoryEarlyNotifier]. EarthquakeHistoryEarlyNotifierProvider( EarthquakeHistoryEarlyParameter parameter, ) : this._internal( - () => EarthquakeHistoryEarlyNotifier()..parameter = parameter, - from: earthquakeHistoryEarlyNotifierProvider, - name: r'earthquakeHistoryEarlyNotifierProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryEarlyNotifierHash, - dependencies: EarthquakeHistoryEarlyNotifierFamily._dependencies, - allTransitiveDependencies: - EarthquakeHistoryEarlyNotifierFamily._allTransitiveDependencies, - parameter: parameter, - ); + () => EarthquakeHistoryEarlyNotifier()..parameter = parameter, + from: earthquakeHistoryEarlyNotifierProvider, + name: r'earthquakeHistoryEarlyNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryEarlyNotifierHash, + dependencies: EarthquakeHistoryEarlyNotifierFamily._dependencies, + allTransitiveDependencies: + EarthquakeHistoryEarlyNotifierFamily._allTransitiveDependencies, + parameter: parameter, + ); EarthquakeHistoryEarlyNotifierProvider._internal( super._createNotifier, { @@ -123,9 +122,7 @@ class EarthquakeHistoryEarlyNotifierProvider FutureOr runNotifierBuild( covariant EarthquakeHistoryEarlyNotifier notifier, ) { - return notifier.build( - parameter, - ); + return notifier.build(parameter); } @override @@ -145,8 +142,11 @@ class EarthquakeHistoryEarlyNotifierProvider } @override - AutoDisposeAsyncNotifierProviderElement createElement() { + AutoDisposeAsyncNotifierProviderElement< + EarthquakeHistoryEarlyNotifier, + EarthquakeHistoryEarlyNotifierState + > + createElement() { return _EarthquakeHistoryEarlyNotifierProviderElement(this); } @@ -167,15 +167,21 @@ class EarthquakeHistoryEarlyNotifierProvider @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -mixin EarthquakeHistoryEarlyNotifierRef on AutoDisposeAsyncNotifierProviderRef< - EarthquakeHistoryEarlyNotifierState> { +mixin EarthquakeHistoryEarlyNotifierRef + on + AutoDisposeAsyncNotifierProviderRef< + EarthquakeHistoryEarlyNotifierState + > { /// The parameter `parameter` of this provider. EarthquakeHistoryEarlyParameter get parameter; } class _EarthquakeHistoryEarlyNotifierProviderElement - extends AutoDisposeAsyncNotifierProviderElement< - EarthquakeHistoryEarlyNotifier, EarthquakeHistoryEarlyNotifierState> + extends + AutoDisposeAsyncNotifierProviderElement< + EarthquakeHistoryEarlyNotifier, + EarthquakeHistoryEarlyNotifierState + > with EarthquakeHistoryEarlyNotifierRef { _EarthquakeHistoryEarlyNotifierProviderElement(super.provider); @@ -183,5 +189,6 @@ class _EarthquakeHistoryEarlyNotifierProviderElement EarthquakeHistoryEarlyParameter get parameter => (origin as EarthquakeHistoryEarlyNotifierProvider).parameter; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.dart index c1034d00..34d84e2d 100644 --- a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.dart +++ b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.dart @@ -7,17 +7,11 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_early_repository.g.dart'; @Riverpod(keepAlive: true) -EarthquakeHistoryEarlyRepository earthquakeHistoryEarlyRepository( - Ref ref, -) => - EarthquakeHistoryEarlyRepository( - api: ref.watch(eqApiProvider), - ); +EarthquakeHistoryEarlyRepository earthquakeHistoryEarlyRepository(Ref ref) => + EarthquakeHistoryEarlyRepository(api: ref.watch(eqApiProvider)); class EarthquakeHistoryEarlyRepository { - EarthquakeHistoryEarlyRepository({ - required EqApi api, - }) : _api = api; + EarthquakeHistoryEarlyRepository({required EqApi api}) : _api = api; final EqApi _api; @@ -50,10 +44,7 @@ class EarthquakeHistoryEarlyRepository { ascending: ascending, ); - return ( - count: response.response.count, - items: response.data, - ); + return (count: response.response.count, items: response.data); } Future fetchEarthquakeEarlyEvent({ diff --git a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.g.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.g.dart index c4c67b23..531e2715 100644 --- a/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.g.dart +++ b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_repository.g.dart @@ -15,18 +15,19 @@ String _$earthquakeHistoryEarlyRepositoryHash() => @ProviderFor(earthquakeHistoryEarlyRepository) final earthquakeHistoryEarlyRepositoryProvider = Provider.internal( - earthquakeHistoryEarlyRepository, - name: r'earthquakeHistoryEarlyRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeHistoryEarlyRepositoryHash, - dependencies: null, - allTransitiveDependencies: null, -); + earthquakeHistoryEarlyRepository, + name: r'earthquakeHistoryEarlyRepositoryProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeHistoryEarlyRepositoryHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef EarthquakeHistoryEarlyRepositoryRef - = ProviderRef; +typedef EarthquakeHistoryEarlyRepositoryRef = + ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.dart b/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.dart index 25175788..c1eb7905 100644 --- a/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.dart +++ b/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.dart @@ -28,45 +28,21 @@ extension EarthquakeHistoryEarlyParameterEx on EarthquakeHistoryEarlyParameter { EarthquakeHistoryEarlyParameter updateIntensity( JmaIntensity? min, JmaIntensity? max, - ) => - copyWith( - intensityGte: min, - intensityLte: max, - ); + ) => copyWith(intensityGte: min, intensityLte: max); - EarthquakeHistoryEarlyParameter updateMagnitude( - double? min, - double? max, - ) => - copyWith( - magnitudeGte: min, - magnitudeLte: max, - ); + EarthquakeHistoryEarlyParameter updateMagnitude(double? min, double? max) => + copyWith(magnitudeGte: min, magnitudeLte: max); - EarthquakeHistoryEarlyParameter updateDepth( - double? min, - double? max, - ) => - copyWith( - depthGte: min, - depthLte: max, - ); + EarthquakeHistoryEarlyParameter updateDepth(double? min, double? max) => + copyWith(depthGte: min, depthLte: max); EarthquakeHistoryEarlyParameter updateOriginTime( DateTime? min, DateTime? max, - ) => - copyWith( - originTimeGte: min, - originTimeLte: max, - ); + ) => copyWith(originTimeGte: min, originTimeLte: max); EarthquakeHistoryEarlyParameter updateSort({ required EarthquakeEarlySortType type, required bool ascending, - }) => - copyWith( - sort: type, - ascending: ascending, - ); + }) => copyWith(sort: type, ascending: ascending); } diff --git a/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.freezed.dart b/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.freezed.dart index 83af9c7b..4f47f169 100644 --- a/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.freezed.dart +++ b/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.freezed.dart @@ -12,10 +12,12 @@ part of 'earthquake_history_early_parameter.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EarthquakeHistoryEarlyParameter _$EarthquakeHistoryEarlyParameterFromJson( - Map json) { + Map json, +) { return _EarthquakeHistoryEarlyParameter.fromJson(json); } @@ -39,33 +41,39 @@ mixin _$EarthquakeHistoryEarlyParameter { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHistoryEarlyParameterCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHistoryEarlyParameterCopyWith<$Res> { factory $EarthquakeHistoryEarlyParameterCopyWith( - EarthquakeHistoryEarlyParameter value, - $Res Function(EarthquakeHistoryEarlyParameter) then) = - _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, - EarthquakeHistoryEarlyParameter>; + EarthquakeHistoryEarlyParameter value, + $Res Function(EarthquakeHistoryEarlyParameter) then, + ) = + _$EarthquakeHistoryEarlyParameterCopyWithImpl< + $Res, + EarthquakeHistoryEarlyParameter + >; @useResult - $Res call( - {EarthquakeEarlySortType sort, - bool ascending, - double? magnitudeLte, - double? magnitudeGte, - double? depthLte, - double? depthGte, - JmaIntensity? intensityLte, - JmaIntensity? intensityGte, - DateTime? originTimeLte, - DateTime? originTimeGte}); + $Res call({ + EarthquakeEarlySortType sort, + bool ascending, + double? magnitudeLte, + double? magnitudeGte, + double? depthLte, + double? depthGte, + JmaIntensity? intensityLte, + JmaIntensity? intensityGte, + DateTime? originTimeLte, + DateTime? originTimeGte, + }); } /// @nodoc -class _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, - $Val extends EarthquakeHistoryEarlyParameter> +class _$EarthquakeHistoryEarlyParameterCopyWithImpl< + $Res, + $Val extends EarthquakeHistoryEarlyParameter +> implements $EarthquakeHistoryEarlyParameterCopyWith<$Res> { _$EarthquakeHistoryEarlyParameterCopyWithImpl(this._value, this._then); @@ -90,48 +98,61 @@ class _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, Object? originTimeLte = freezed, Object? originTimeGte = freezed, }) { - return _then(_value.copyWith( - sort: null == sort - ? _value.sort - : sort // ignore: cast_nullable_to_non_nullable - as EarthquakeEarlySortType, - ascending: null == ascending - ? _value.ascending - : ascending // ignore: cast_nullable_to_non_nullable - as bool, - magnitudeLte: freezed == magnitudeLte - ? _value.magnitudeLte - : magnitudeLte // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeGte: freezed == magnitudeGte - ? _value.magnitudeGte - : magnitudeGte // ignore: cast_nullable_to_non_nullable - as double?, - depthLte: freezed == depthLte - ? _value.depthLte - : depthLte // ignore: cast_nullable_to_non_nullable - as double?, - depthGte: freezed == depthGte - ? _value.depthGte - : depthGte // ignore: cast_nullable_to_non_nullable - as double?, - intensityLte: freezed == intensityLte - ? _value.intensityLte - : intensityLte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - intensityGte: freezed == intensityGte - ? _value.intensityGte - : intensityGte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - originTimeLte: freezed == originTimeLte - ? _value.originTimeLte - : originTimeLte // ignore: cast_nullable_to_non_nullable - as DateTime?, - originTimeGte: freezed == originTimeGte - ? _value.originTimeGte - : originTimeGte // ignore: cast_nullable_to_non_nullable - as DateTime?, - ) as $Val); + return _then( + _value.copyWith( + sort: + null == sort + ? _value.sort + : sort // ignore: cast_nullable_to_non_nullable + as EarthquakeEarlySortType, + ascending: + null == ascending + ? _value.ascending + : ascending // ignore: cast_nullable_to_non_nullable + as bool, + magnitudeLte: + freezed == magnitudeLte + ? _value.magnitudeLte + : magnitudeLte // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeGte: + freezed == magnitudeGte + ? _value.magnitudeGte + : magnitudeGte // ignore: cast_nullable_to_non_nullable + as double?, + depthLte: + freezed == depthLte + ? _value.depthLte + : depthLte // ignore: cast_nullable_to_non_nullable + as double?, + depthGte: + freezed == depthGte + ? _value.depthGte + : depthGte // ignore: cast_nullable_to_non_nullable + as double?, + intensityLte: + freezed == intensityLte + ? _value.intensityLte + : intensityLte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + intensityGte: + freezed == intensityGte + ? _value.intensityGte + : intensityGte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + originTimeLte: + freezed == originTimeLte + ? _value.originTimeLte + : originTimeLte // ignore: cast_nullable_to_non_nullable + as DateTime?, + originTimeGte: + freezed == originTimeGte + ? _value.originTimeGte + : originTimeGte // ignore: cast_nullable_to_non_nullable + as DateTime?, + ) + as $Val, + ); } } @@ -139,33 +160,37 @@ class _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, abstract class _$$EarthquakeHistoryEarlyParameterImplCopyWith<$Res> implements $EarthquakeHistoryEarlyParameterCopyWith<$Res> { factory _$$EarthquakeHistoryEarlyParameterImplCopyWith( - _$EarthquakeHistoryEarlyParameterImpl value, - $Res Function(_$EarthquakeHistoryEarlyParameterImpl) then) = - __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res>; + _$EarthquakeHistoryEarlyParameterImpl value, + $Res Function(_$EarthquakeHistoryEarlyParameterImpl) then, + ) = __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {EarthquakeEarlySortType sort, - bool ascending, - double? magnitudeLte, - double? magnitudeGte, - double? depthLte, - double? depthGte, - JmaIntensity? intensityLte, - JmaIntensity? intensityGte, - DateTime? originTimeLte, - DateTime? originTimeGte}); + $Res call({ + EarthquakeEarlySortType sort, + bool ascending, + double? magnitudeLte, + double? magnitudeGte, + double? depthLte, + double? depthGte, + JmaIntensity? intensityLte, + JmaIntensity? intensityGte, + DateTime? originTimeLte, + DateTime? originTimeGte, + }); } /// @nodoc class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> - extends _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, - _$EarthquakeHistoryEarlyParameterImpl> + extends + _$EarthquakeHistoryEarlyParameterCopyWithImpl< + $Res, + _$EarthquakeHistoryEarlyParameterImpl + > implements _$$EarthquakeHistoryEarlyParameterImplCopyWith<$Res> { __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl( - _$EarthquakeHistoryEarlyParameterImpl _value, - $Res Function(_$EarthquakeHistoryEarlyParameterImpl) _then) - : super(_value, _then); + _$EarthquakeHistoryEarlyParameterImpl _value, + $Res Function(_$EarthquakeHistoryEarlyParameterImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHistoryEarlyParameter /// with the given fields replaced by the non-null parameter values. @@ -183,48 +208,60 @@ class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> Object? originTimeLte = freezed, Object? originTimeGte = freezed, }) { - return _then(_$EarthquakeHistoryEarlyParameterImpl( - sort: null == sort - ? _value.sort - : sort // ignore: cast_nullable_to_non_nullable - as EarthquakeEarlySortType, - ascending: null == ascending - ? _value.ascending - : ascending // ignore: cast_nullable_to_non_nullable - as bool, - magnitudeLte: freezed == magnitudeLte - ? _value.magnitudeLte - : magnitudeLte // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeGte: freezed == magnitudeGte - ? _value.magnitudeGte - : magnitudeGte // ignore: cast_nullable_to_non_nullable - as double?, - depthLte: freezed == depthLte - ? _value.depthLte - : depthLte // ignore: cast_nullable_to_non_nullable - as double?, - depthGte: freezed == depthGte - ? _value.depthGte - : depthGte // ignore: cast_nullable_to_non_nullable - as double?, - intensityLte: freezed == intensityLte - ? _value.intensityLte - : intensityLte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - intensityGte: freezed == intensityGte - ? _value.intensityGte - : intensityGte // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - originTimeLte: freezed == originTimeLte - ? _value.originTimeLte - : originTimeLte // ignore: cast_nullable_to_non_nullable - as DateTime?, - originTimeGte: freezed == originTimeGte - ? _value.originTimeGte - : originTimeGte // ignore: cast_nullable_to_non_nullable - as DateTime?, - )); + return _then( + _$EarthquakeHistoryEarlyParameterImpl( + sort: + null == sort + ? _value.sort + : sort // ignore: cast_nullable_to_non_nullable + as EarthquakeEarlySortType, + ascending: + null == ascending + ? _value.ascending + : ascending // ignore: cast_nullable_to_non_nullable + as bool, + magnitudeLte: + freezed == magnitudeLte + ? _value.magnitudeLte + : magnitudeLte // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeGte: + freezed == magnitudeGte + ? _value.magnitudeGte + : magnitudeGte // ignore: cast_nullable_to_non_nullable + as double?, + depthLte: + freezed == depthLte + ? _value.depthLte + : depthLte // ignore: cast_nullable_to_non_nullable + as double?, + depthGte: + freezed == depthGte + ? _value.depthGte + : depthGte // ignore: cast_nullable_to_non_nullable + as double?, + intensityLte: + freezed == intensityLte + ? _value.intensityLte + : intensityLte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + intensityGte: + freezed == intensityGte + ? _value.intensityGte + : intensityGte // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + originTimeLte: + freezed == originTimeLte + ? _value.originTimeLte + : originTimeLte // ignore: cast_nullable_to_non_nullable + as DateTime?, + originTimeGte: + freezed == originTimeGte + ? _value.originTimeGte + : originTimeGte // ignore: cast_nullable_to_non_nullable + as DateTime?, + ), + ); } } @@ -232,21 +269,22 @@ class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeHistoryEarlyParameterImpl implements _EarthquakeHistoryEarlyParameter { - const _$EarthquakeHistoryEarlyParameterImpl( - {required this.sort, - required this.ascending, - this.magnitudeLte, - this.magnitudeGte, - this.depthLte, - this.depthGte, - this.intensityLte, - this.intensityGte, - this.originTimeLte, - this.originTimeGte}); + const _$EarthquakeHistoryEarlyParameterImpl({ + required this.sort, + required this.ascending, + this.magnitudeLte, + this.magnitudeGte, + this.depthLte, + this.depthGte, + this.intensityLte, + this.intensityGte, + this.originTimeLte, + this.originTimeGte, + }); factory _$EarthquakeHistoryEarlyParameterImpl.fromJson( - Map json) => - _$$EarthquakeHistoryEarlyParameterImplFromJson(json); + Map json, + ) => _$$EarthquakeHistoryEarlyParameterImplFromJson(json); @override final EarthquakeEarlySortType sort; @@ -303,17 +341,18 @@ class _$EarthquakeHistoryEarlyParameterImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - sort, - ascending, - magnitudeLte, - magnitudeGte, - depthLte, - depthGte, - intensityLte, - intensityGte, - originTimeLte, - originTimeGte); + runtimeType, + sort, + ascending, + magnitudeLte, + magnitudeGte, + depthLte, + depthGte, + intensityLte, + intensityGte, + originTimeLte, + originTimeGte, + ); /// Create a copy of EarthquakeHistoryEarlyParameter /// with the given fields replaced by the non-null parameter values. @@ -321,31 +360,32 @@ class _$EarthquakeHistoryEarlyParameterImpl @override @pragma('vm:prefer-inline') _$$EarthquakeHistoryEarlyParameterImplCopyWith< - _$EarthquakeHistoryEarlyParameterImpl> - get copyWith => __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl< - _$EarthquakeHistoryEarlyParameterImpl>(this, _$identity); + _$EarthquakeHistoryEarlyParameterImpl + > + get copyWith => __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl< + _$EarthquakeHistoryEarlyParameterImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeHistoryEarlyParameterImplToJson( - this, - ); + return _$$EarthquakeHistoryEarlyParameterImplToJson(this); } } abstract class _EarthquakeHistoryEarlyParameter implements EarthquakeHistoryEarlyParameter { - const factory _EarthquakeHistoryEarlyParameter( - {required final EarthquakeEarlySortType sort, - required final bool ascending, - final double? magnitudeLte, - final double? magnitudeGte, - final double? depthLte, - final double? depthGte, - final JmaIntensity? intensityLte, - final JmaIntensity? intensityGte, - final DateTime? originTimeLte, - final DateTime? originTimeGte}) = _$EarthquakeHistoryEarlyParameterImpl; + const factory _EarthquakeHistoryEarlyParameter({ + required final EarthquakeEarlySortType sort, + required final bool ascending, + final double? magnitudeLte, + final double? magnitudeGte, + final double? depthLte, + final double? depthGte, + final JmaIntensity? intensityLte, + final JmaIntensity? intensityGte, + final DateTime? originTimeLte, + final DateTime? originTimeGte, + }) = _$EarthquakeHistoryEarlyParameterImpl; factory _EarthquakeHistoryEarlyParameter.fromJson(Map json) = _$EarthquakeHistoryEarlyParameterImpl.fromJson; @@ -376,6 +416,7 @@ abstract class _EarthquakeHistoryEarlyParameter @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHistoryEarlyParameterImplCopyWith< - _$EarthquakeHistoryEarlyParameterImpl> - get copyWith => throw _privateConstructorUsedError; + _$EarthquakeHistoryEarlyParameterImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.g.dart b/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.g.dart index 295917ed..6550919b 100644 --- a/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.g.dart +++ b/app/lib/feature/earthquake_history_early/data/model/earthquake_history_early_parameter.g.dart @@ -9,60 +9,73 @@ part of 'earthquake_history_early_parameter.dart'; // ************************************************************************** _$EarthquakeHistoryEarlyParameterImpl - _$$EarthquakeHistoryEarlyParameterImplFromJson(Map json) => - $checkedCreate( - r'_$EarthquakeHistoryEarlyParameterImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeHistoryEarlyParameterImpl( - sort: $checkedConvert('sort', - (v) => $enumDecode(_$EarthquakeEarlySortTypeEnumMap, v)), - ascending: $checkedConvert('ascending', (v) => v as bool), - magnitudeLte: $checkedConvert( - 'magnitude_lte', (v) => (v as num?)?.toDouble()), - magnitudeGte: $checkedConvert( - 'magnitude_gte', (v) => (v as num?)?.toDouble()), - depthLte: - $checkedConvert('depth_lte', (v) => (v as num?)?.toDouble()), - depthGte: - $checkedConvert('depth_gte', (v) => (v as num?)?.toDouble()), - intensityLte: $checkedConvert('intensity_lte', - (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v)), - intensityGte: $checkedConvert('intensity_gte', - (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v)), - originTimeLte: $checkedConvert('origin_time_lte', - (v) => v == null ? null : DateTime.parse(v as String)), - originTimeGte: $checkedConvert('origin_time_gte', - (v) => v == null ? null : DateTime.parse(v as String)), - ); - return val; - }, - fieldKeyMap: const { - 'magnitudeLte': 'magnitude_lte', - 'magnitudeGte': 'magnitude_gte', - 'depthLte': 'depth_lte', - 'depthGte': 'depth_gte', - 'intensityLte': 'intensity_lte', - 'intensityGte': 'intensity_gte', - 'originTimeLte': 'origin_time_lte', - 'originTimeGte': 'origin_time_gte' - }, - ); +_$$EarthquakeHistoryEarlyParameterImplFromJson( + Map json, +) => $checkedCreate( + r'_$EarthquakeHistoryEarlyParameterImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeHistoryEarlyParameterImpl( + sort: $checkedConvert( + 'sort', + (v) => $enumDecode(_$EarthquakeEarlySortTypeEnumMap, v), + ), + ascending: $checkedConvert('ascending', (v) => v as bool), + magnitudeLte: $checkedConvert( + 'magnitude_lte', + (v) => (v as num?)?.toDouble(), + ), + magnitudeGte: $checkedConvert( + 'magnitude_gte', + (v) => (v as num?)?.toDouble(), + ), + depthLte: $checkedConvert('depth_lte', (v) => (v as num?)?.toDouble()), + depthGte: $checkedConvert('depth_gte', (v) => (v as num?)?.toDouble()), + intensityLte: $checkedConvert( + 'intensity_lte', + (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v), + ), + intensityGte: $checkedConvert( + 'intensity_gte', + (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v), + ), + originTimeLte: $checkedConvert( + 'origin_time_lte', + (v) => v == null ? null : DateTime.parse(v as String), + ), + originTimeGte: $checkedConvert( + 'origin_time_gte', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; + }, + fieldKeyMap: const { + 'magnitudeLte': 'magnitude_lte', + 'magnitudeGte': 'magnitude_gte', + 'depthLte': 'depth_lte', + 'depthGte': 'depth_gte', + 'intensityLte': 'intensity_lte', + 'intensityGte': 'intensity_gte', + 'originTimeLte': 'origin_time_lte', + 'originTimeGte': 'origin_time_gte', + }, +); Map _$$EarthquakeHistoryEarlyParameterImplToJson( - _$EarthquakeHistoryEarlyParameterImpl instance) => - { - 'sort': _$EarthquakeEarlySortTypeEnumMap[instance.sort]!, - 'ascending': instance.ascending, - 'magnitude_lte': instance.magnitudeLte, - 'magnitude_gte': instance.magnitudeGte, - 'depth_lte': instance.depthLte, - 'depth_gte': instance.depthGte, - 'intensity_lte': _$JmaIntensityEnumMap[instance.intensityLte], - 'intensity_gte': _$JmaIntensityEnumMap[instance.intensityGte], - 'origin_time_lte': instance.originTimeLte?.toIso8601String(), - 'origin_time_gte': instance.originTimeGte?.toIso8601String(), - }; + _$EarthquakeHistoryEarlyParameterImpl instance, +) => { + 'sort': _$EarthquakeEarlySortTypeEnumMap[instance.sort]!, + 'ascending': instance.ascending, + 'magnitude_lte': instance.magnitudeLte, + 'magnitude_gte': instance.magnitudeGte, + 'depth_lte': instance.depthLte, + 'depth_gte': instance.depthGte, + 'intensity_lte': _$JmaIntensityEnumMap[instance.intensityLte], + 'intensity_gte': _$JmaIntensityEnumMap[instance.intensityGte], + 'origin_time_lte': instance.originTimeLte?.toIso8601String(), + 'origin_time_gte': instance.originTimeGte?.toIso8601String(), +}; const _$EarthquakeEarlySortTypeEnumMap = { EarthquakeEarlySortType.origin_time: 'origin_time', diff --git a/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart b/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart index b075e2de..1090d6b8 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart @@ -19,7 +19,8 @@ class EarthquakeHistoryEarlySortChip extends StatelessWidget { EarthquakeEarlySortType type, // ignore: avoid_positional_boolean_parameters bool ascending, - )? onChanged; + )? + onChanged; final EarthquakeEarlySortType type; final bool ascending; @@ -46,13 +47,14 @@ class EarthquakeHistoryEarlySortChip extends StatelessWidget { onPressed: () async { final result = await showModalBottomSheet<(EarthquakeEarlySortType, bool)?>( - clipBehavior: Clip.antiAlias, - context: context, - builder: (context) => _SortModal( - currentSortType: type, - currentAscending: ascending, - ), - ); + clipBehavior: Clip.antiAlias, + context: context, + builder: + (context) => _SortModal( + currentSortType: type, + currentAscending: ascending, + ), + ); if (result != null) { onChanged?.call(result.$1, result.$2); } @@ -63,11 +65,11 @@ class EarthquakeHistoryEarlySortChip extends StatelessWidget { extension _EarthquakeEarlySortTypeEx on EarthquakeEarlySortType { String get label => switch (this) { - EarthquakeEarlySortType.depth => '深さ', - EarthquakeEarlySortType.magnitude => 'マグニチュード', - EarthquakeEarlySortType.origin_time => '発生時刻', - EarthquakeEarlySortType.max_intensity => '最大観測震度', - }; + EarthquakeEarlySortType.depth => '深さ', + EarthquakeEarlySortType.magnitude => 'マグニチュード', + EarthquakeEarlySortType.origin_time => '発生時刻', + EarthquakeEarlySortType.max_intensity => '最大観測震度', + }; } class _SortModal extends HookConsumerWidget { @@ -125,18 +127,16 @@ class _SortModal extends HookConsumerWidget { ), SwitchListTile.adaptive( title: const Text('昇順・降順'), - subtitle: Text( - switch ((type.value, ascending.value)) { - (EarthquakeEarlySortType.depth, false) => '震源の深い順', - (EarthquakeEarlySortType.depth, true) => '震源の浅い順', - (EarthquakeEarlySortType.magnitude, false) => 'マグニチュードの大きい順', - (EarthquakeEarlySortType.magnitude, true) => 'マグニチュードの小さい順', - (EarthquakeEarlySortType.origin_time, false) => '地震発生時刻の新しい順', - (EarthquakeEarlySortType.origin_time, true) => '地震発生時刻の古い順', - (EarthquakeEarlySortType.max_intensity, false) => '最大観測震度の大きい順', - (EarthquakeEarlySortType.max_intensity, true) => '最大観測震度の小さい順', - }, - ), + subtitle: Text(switch ((type.value, ascending.value)) { + (EarthquakeEarlySortType.depth, false) => '震源の深い順', + (EarthquakeEarlySortType.depth, true) => '震源の浅い順', + (EarthquakeEarlySortType.magnitude, false) => 'マグニチュードの大きい順', + (EarthquakeEarlySortType.magnitude, true) => 'マグニチュードの小さい順', + (EarthquakeEarlySortType.origin_time, false) => '地震発生時刻の新しい順', + (EarthquakeEarlySortType.origin_time, true) => '地震発生時刻の古い順', + (EarthquakeEarlySortType.max_intensity, false) => '最大観測震度の大きい順', + (EarthquakeEarlySortType.max_intensity, true) => '最大観測震度の小さい順', + }), value: ascending.value, onChanged: (v) => ascending.value = v, ), @@ -149,9 +149,10 @@ class _SortModal extends HookConsumerWidget { child: const Text('キャンセル'), ), TextButton( - onPressed: () => Navigator.of(context).pop( - (type.value, ascending.value), - ), + onPressed: + () => Navigator.of( + context, + ).pop((type.value, ascending.value)), child: const Text('完了'), ), ], @@ -164,10 +165,7 @@ class _SortModal extends HookConsumerWidget { } class _SegmentedControl extends StatelessWidget { - const _SegmentedControl({ - required this.type, - this.onChanged, - }); + const _SegmentedControl({required this.type, this.onChanged}); final EarthquakeEarlySortType type; final void Function(EarthquakeEarlySortType)? onChanged; @@ -180,9 +178,7 @@ class _SegmentedControl extends StatelessWidget { for (final e in EarthquakeEarlySortType.values) e: Padding( padding: const EdgeInsets.symmetric(horizontal: 2), - child: FittedBox( - child: Text(e.label), - ), + child: FittedBox(child: Text(e.label)), ), }, groupValue: type, @@ -198,10 +194,7 @@ class _SegmentedControl extends StatelessWidget { onSelectionChanged: (v) => onChanged?.call(v.first), segments: [ for (final e in EarthquakeEarlySortType.values) - ButtonSegment( - value: e, - label: Text(e.label), - ), + ButtonSegment(value: e, label: Text(e.label)), ], ); } diff --git a/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_hypo_info_widget.dart b/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_hypo_info_widget.dart index abc71ee1..33da2392 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_hypo_info_widget.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_hypo_info_widget.dart @@ -9,10 +9,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class EarthquakeEarlyHypoInfoWidget extends HookConsumerWidget { - const EarthquakeEarlyHypoInfoWidget({ - required this.item, - super.key, - }); + const EarthquakeEarlyHypoInfoWidget({required this.item, super.key}); final EarthquakeEarlyEvent item; @@ -24,70 +21,76 @@ class EarthquakeEarlyHypoInfoWidget extends HookConsumerWidget { final maxIntensity = item.maxIntensity; final colorScheme = switch (maxIntensity) { - final JmaForecastIntensity intensity => - intensityColorScheme.fromJmaForecastIntensity(intensity), + final JmaForecastIntensity intensity => intensityColorScheme + .fromJmaForecastIntensity(intensity), _ => null, }; - final maxIntensityWidget = maxIntensity != null - ? Column( - mainAxisSize: MainAxisSize.min, - children: [ - const Text('最大震度', style: TextStyle(fontWeight: FontWeight.bold)), - const SizedBox(height: 4), - JmaForecastIntensityIcon( - type: IntensityIconType.filled, - size: 60, - intensity: maxIntensity, - showSuffix: !item.maxIntensityIsEarly, - ), - ], - ) - : null; + final maxIntensityWidget = + maxIntensity != null + ? Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + '最大震度', + style: TextStyle(fontWeight: FontWeight.bold), + ), + const SizedBox(height: 4), + JmaForecastIntensityIcon( + type: IntensityIconType.filled, + size: 60, + intensity: maxIntensity, + showSuffix: !item.maxIntensityIsEarly, + ), + ], + ) + : null; // 「MaxInt, 震源地, 規模」 - final hypoWidget = item.name == '詳細不明' - ? null - : Row( - textBaseline: TextBaseline.ideographic, - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.baseline, - children: [ - Text( - '震源地', - style: textTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.bold, - color: textTheme.bodyMedium!.color!.withValues(alpha: 0.8), + final hypoWidget = + item.name == '詳細不明' + ? null + : Row( + textBaseline: TextBaseline.ideographic, + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.baseline, + children: [ + Text( + '震源地', + style: textTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.bold, + color: textTheme.bodyMedium!.color!.withValues(alpha: 0.8), + ), ), - ), - const SizedBox(width: 4), - Flexible( - child: Text.rich( - TextSpan( - children: [ - TextSpan( - text: item.name, - style: textTheme.headlineMedium?.copyWith( - fontWeight: FontWeight.bold, + const SizedBox(width: 4), + Flexible( + child: Text.rich( + TextSpan( + children: [ + TextSpan( + text: item.name, + style: textTheme.headlineMedium?.copyWith( + fontWeight: FontWeight.bold, + ), ), - ), - ], + ], + ), ), ), - ), - ], - ); + ], + ); // 地震発生時刻 final originTime = item.originTime.toLocal(); final timeText = switch (item.originTimePrecision) { - OriginTimePrecision.millisecond || - OriginTimePrecision.second => + OriginTimePrecision.millisecond || OriginTimePrecision.second => DateFormat('yyyy/MM/dd HH:mm:ss ').format(originTime), - OriginTimePrecision.minute => - DateFormat('yyyy/MM/dd HH:mm ').format(originTime), - OriginTimePrecision.hour => - DateFormat('yyyy/MM/dd HH ').format(originTime), + OriginTimePrecision.minute => DateFormat( + 'yyyy/MM/dd HH:mm ', + ).format(originTime), + OriginTimePrecision.hour => DateFormat( + 'yyyy/MM/dd HH ', + ).format(originTime), OriginTimePrecision.day => DateFormat('yyyy/MM/dd ').format(originTime), OriginTimePrecision.month => DateFormat('yyyy/MM ').format(originTime), }; @@ -227,9 +230,7 @@ class EarthquakeEarlyHypoInfoWidget extends HookConsumerWidget { final card = Card( margin: const EdgeInsets.symmetric( horizontal: 8, - ).add( - const EdgeInsets.only(bottom: 4), - ), + ).add(const EdgeInsets.only(bottom: 4)), elevation: 0, shadowColor: Colors.transparent, @@ -241,13 +242,11 @@ class EarthquakeEarlyHypoInfoWidget extends HookConsumerWidget { width: 0, ), ), - color: (colorScheme?.background ?? Colors.transparent) - .withValues(alpha: 0.3), + color: (colorScheme?.background ?? Colors.transparent).withValues( + alpha: 0.3, + ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Column( children: [ Row( diff --git a/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_list_tile.dart b/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_list_tile.dart index da0675ec..d04613d0 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_list_tile.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_list_tile.dart @@ -27,34 +27,27 @@ class EarthquakeHistoryEarlyListTile extends HookConsumerWidget { final hypoName = item.name; final maxIntensity = item.maxIntensity; - final title = switch (( - hypoName, - maxIntensity, - )) { - ( - final String hypoName, - final JmaForecastIntensity _, - ) => - hypoName, - ( - final String hypoName, - _, - ) => - hypoName, + final title = switch ((hypoName, maxIntensity)) { + (final String hypoName, final JmaForecastIntensity _) => hypoName, + (final String hypoName, _) => hypoName, }; final originTime = item.originTime.toLocal(); - final subTitle = switch (item.originTimePrecision) { - OriginTimePrecision.millisecond || - OriginTimePrecision.second => + final subTitle = + switch (item.originTimePrecision) { + OriginTimePrecision.millisecond || OriginTimePrecision.second => DateFormat('yyyy/MM/dd HH:mm:ss ').format(originTime), - OriginTimePrecision.minute => - DateFormat('yyyy/MM/dd HH:mm ').format(originTime), - OriginTimePrecision.hour => - DateFormat('yyyy/MM/dd HH ').format(originTime), - OriginTimePrecision.day => - DateFormat('yyyy/MM/dd ').format(originTime), - OriginTimePrecision.month => - DateFormat('yyyy/MM ').format(originTime), + OriginTimePrecision.minute => DateFormat( + 'yyyy/MM/dd HH:mm ', + ).format(originTime), + OriginTimePrecision.hour => DateFormat( + 'yyyy/MM/dd HH ', + ).format(originTime), + OriginTimePrecision.day => DateFormat( + 'yyyy/MM/dd ', + ).format(originTime), + OriginTimePrecision.month => DateFormat( + 'yyyy/MM ', + ).format(originTime), } + switch (item.depth) { (final int depth) when depth == 0 => '深さ ごく浅い', @@ -63,9 +56,12 @@ class EarthquakeHistoryEarlyListTile extends HookConsumerWidget { _ => '', }; final intensityColorState = ref.watch(intensityColorProvider); - final intensityColor = maxIntensity != null - ? intensityColorState.fromJmaForecastIntensity(maxIntensity).background - : null; + final intensityColor = + maxIntensity != null + ? intensityColorState + .fromJmaForecastIntensity(maxIntensity) + .background + : null; // 5 -> 5.0, 5.123 -> 5.1 final magnitude = item.magnitude?.toStringAsFixed(1); final trailingText = switch (null) { @@ -87,19 +83,18 @@ class EarthquakeHistoryEarlyListTile extends HookConsumerWidget { children: [ Text( subTitle, - style: TextStyle( - fontFamily: GoogleFonts.notoSansJp().fontFamily, - ), + style: TextStyle(fontFamily: GoogleFonts.notoSansJp().fontFamily), ), ], ), - leading: maxIntensity != null - ? JmaForecastIntensityIcon( - intensity: maxIntensity, - type: IntensityIconType.filled, - showSuffix: !item.maxIntensityIsEarly, - ) - : null, + leading: + maxIntensity != null + ? JmaForecastIntensityIcon( + intensity: maxIntensity, + type: IntensityIconType.filled, + showSuffix: !item.maxIntensityIsEarly, + ) + : null, trailing: Text( trailingText, style: theme.textTheme.labelLarge!.copyWith( diff --git a/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_not_found.dart b/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_not_found.dart index f55ac058..54a11072 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_not_found.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/earthquake_history_early_not_found.dart @@ -1,9 +1,7 @@ import 'package:flutter/material.dart'; class EarthquakeHistoryEarlyNotFound extends StatelessWidget { - const EarthquakeHistoryEarlyNotFound({ - super.key, - }); + const EarthquakeHistoryEarlyNotFound({super.key}); @override Widget build(BuildContext context) { @@ -13,10 +11,7 @@ class EarthquakeHistoryEarlyNotFound extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon( - Icons.search_off, - size: 48, - ), + Icon(Icons.search_off, size: 48), Text( '条件を満たす地震情報は見つかりませんでした。', style: TextStyle(fontWeight: FontWeight.bold), @@ -41,10 +36,7 @@ class EarthquakeHistoryEarlyAllFetched extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon( - Icons.search, - size: 48, - ), + Icon(Icons.search, size: 48), Text( '全件取得済みです', style: TextStyle(fontWeight: FontWeight.bold), diff --git a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_details_screen.dart b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_details_screen.dart index b03dfd12..6059efb7 100644 --- a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_details_screen.dart +++ b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_details_screen.dart @@ -14,25 +14,18 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:sheet/sheet.dart'; class EarthquakeHistoryEarlyDetailsRoute extends GoRouteData { - const EarthquakeHistoryEarlyDetailsRoute({ - required this.id, - }); + const EarthquakeHistoryEarlyDetailsRoute({required this.id}); final String id; @override Widget build(BuildContext context, GoRouterState state) { - return EarthquakeHistoryEarlyDetailsScreen( - id: id, - ); + return EarthquakeHistoryEarlyDetailsScreen(id: id); } } class EarthquakeHistoryEarlyDetailsScreen extends HookConsumerWidget { - const EarthquakeHistoryEarlyDetailsScreen({ - required this.id, - super.key, - }); + const EarthquakeHistoryEarlyDetailsScreen({required this.id, super.key}); final String id; @@ -46,125 +39,117 @@ class EarthquakeHistoryEarlyDetailsScreen extends HookConsumerWidget { final state = ref.watch(earthquakeHistoryEarlyEventProvider(id)); return switch (state) { AsyncError(:final error) => Scaffold( - appBar: AppBar(), - body: ErrorCard( - error: error, - onReload: () async => - ref.refresh(earthquakeHistoryEarlyEventProvider(id)), - ), + appBar: AppBar(), + body: ErrorCard( + error: error, + onReload: + () async => ref.refresh(earthquakeHistoryEarlyEventProvider(id)), ), + ), AsyncData(:final value) => Scaffold( - body: Stack( - children: [ - IgnorePointer( - child: SafeArea( - child: Align( - alignment: Alignment.topRight, - child: Padding( - padding: const EdgeInsets.all(8), - child: AnimatedSwitcher( - duration: const Duration(milliseconds: 250), - child: BorderedContainer( - margin: const EdgeInsets.all(4), - padding: const EdgeInsets.all(4), - borderRadius: BorderRadius.circular((25 / 5) + 5), - child: Wrap( - spacing: 8, - runSpacing: 8, - children: [ - for (final intensity in [ - ...JmaForecastIntensity.values, - ].where( - (e) => e <= value.maxIntensity!, - )) - JmaForecastIntensityIcon( - type: IntensityIconType.filled, - intensity: intensity, - size: 25, - ), - ], - ), + body: Stack( + children: [ + IgnorePointer( + child: SafeArea( + child: Align( + alignment: Alignment.topRight, + child: Padding( + padding: const EdgeInsets.all(8), + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 250), + child: BorderedContainer( + margin: const EdgeInsets.all(4), + padding: const EdgeInsets.all(4), + borderRadius: BorderRadius.circular((25 / 5) + 5), + child: Wrap( + spacing: 8, + runSpacing: 8, + children: [ + for (final intensity in [ + ...JmaForecastIntensity.values, + ].where((e) => e <= value.maxIntensity!)) + JmaForecastIntensityIcon( + type: IntensityIconType.filled, + intensity: intensity, + size: 25, + ), + ], ), ), ), ), ), ), - SheetFloatingActionButtons( - hasAppBar: false, - controller: sheetController, - fab: [ - Column( - children: [ - FloatingActionButton.small( - heroTag: 'earthquake_history_details_fab', - tooltip: '表示領域を地図に合わせる', - onPressed: () { - if (navigateToHomeFunction.value != null) { - navigateToHomeFunction.value!.call(); - } - }, - elevation: 4, - child: const Icon(Icons.home), - ), - ], - ), - ], - ), - // Sheet - _Sheet( - sheetController: sheetController, - item: value, - ), - if (Navigator.canPop(context)) - // 戻るボタン - SafeArea( - child: IconButton.filledTonal( - style: ButtonStyle( - shape: WidgetStatePropertyAll( - RoundedRectangleBorder( - side: BorderSide( - color: colorScheme.primary.withValues(alpha: 0.2), - ), - borderRadius: BorderRadius.circular(128), + ), + SheetFloatingActionButtons( + hasAppBar: false, + controller: sheetController, + fab: [ + Column( + children: [ + FloatingActionButton.small( + heroTag: 'earthquake_history_details_fab', + tooltip: '表示領域を地図に合わせる', + onPressed: () { + if (navigateToHomeFunction.value != null) { + navigateToHomeFunction.value!.call(); + } + }, + elevation: 4, + child: const Icon(Icons.home), + ), + ], + ), + ], + ), + // Sheet + _Sheet(sheetController: sheetController, item: value), + if (Navigator.canPop(context)) + // 戻るボタン + SafeArea( + child: IconButton.filledTonal( + style: ButtonStyle( + shape: WidgetStatePropertyAll( + RoundedRectangleBorder( + side: BorderSide( + color: colorScheme.primary.withValues(alpha: 0.2), ), + borderRadius: BorderRadius.circular(128), ), ), - icon: const Icon(Icons.arrow_back), - onPressed: () => context.pop(), - color: colorScheme.primary, ), + icon: const Icon(Icons.arrow_back), + onPressed: () => context.pop(), + color: colorScheme.primary, ), - ], - ), + ), + ], ), + ), _ => Scaffold( - appBar: AppBar(), - body: Center( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const CircularProgressIndicator.adaptive(), - const SizedBox(height: 8), - Text( - '各地の震度データを取得中...', - style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.bold, - ), - ), - ], - ), + appBar: AppBar(), + body: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const CircularProgressIndicator.adaptive(), + const SizedBox(height: 8), + Text( + '各地の震度データを取得中...', + style: Theme.of( + context, + ).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.bold), + ), + ], ), ), + ), }; } } class _Sheet extends StatelessWidget { - const _Sheet({ - required this.sheetController, - required this.item, - }); + const _Sheet({required this.sheetController, required this.item}); final SheetController sheetController; final EarthquakeEarlyEvent item; @@ -175,9 +160,7 @@ class _Sheet extends StatelessWidget { bottom: false, child: BasicModalSheet( hasAppBar: false, - children: [ - EarthquakeEarlyHypoInfoWidget(item: item), - ], + children: [EarthquakeEarlyHypoInfoWidget(item: item)], ), ); } diff --git a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart index 7a36ad00..2308f017 100644 --- a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart +++ b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart @@ -58,35 +58,38 @@ class EarthquakeHistoryEarlyScreen extends HookConsumerWidget { actions: [ IconButton( icon: const Icon(Icons.info), - onPressed: () async => - _EarthquakeHistoryEarlyInformationModal.show(context), + onPressed: + () async => + _EarthquakeHistoryEarlyInformationModal.show(context), ), ], ), body: _SliverListBody( parameter: parameter.value, state: state, - onRefresh: () async => ref.refresh( - earthquakeHistoryEarlyNotifierProvider(parameter.value).notifier, - ), - onScrollEnd: () async => ref - .read( + onRefresh: + () async => ref.refresh( earthquakeHistoryEarlyNotifierProvider(parameter.value).notifier, - ) - .fetchNextData(), + ), + onScrollEnd: + () async => + ref + .read( + earthquakeHistoryEarlyNotifierProvider( + parameter.value, + ).notifier, + ) + .fetchNextData(), shouldShowLatestEarthquakeMessage: parameter.value.sort == EarthquakeEarlySortType.origin_time && - !parameter.value.ascending, + !parameter.value.ascending, ), ); } } class _SearchParameter extends StatelessWidget { - const _SearchParameter({ - required this.parameter, - required this.onChanged, - }); + const _SearchParameter({required this.parameter, required this.onChanged}); final EarthquakeHistoryEarlyParameter parameter; final void Function(EarthquakeHistoryEarlyParameter) onChanged; @@ -99,57 +102,60 @@ class _SearchParameter extends StatelessWidget { padding: const EdgeInsets.all(4), child: IntrinsicHeight( child: Row( - children: [ - EarthquakeHistoryEarlySortChip( - type: parameter.sort, - ascending: parameter.ascending, - onChanged: (type, ascending) => onChanged( - parameter.updateSort( - type: type, - ascending: ascending, - ), - ), - ), - const VerticalDivider(), - IntensityFilterChip( - min: parameter.intensityGte, - max: parameter.intensityLte, - onChanged: (min, max) => onChanged( - parameter.updateIntensity(min, max), - ), - ), - MagnitudeFilterChip( - min: parameter.magnitudeGte, - max: parameter.magnitudeLte, - onChanged: (min, max) => onChanged( - parameter.updateMagnitude(min, max), - ), - ), - DepthFilterChip( - min: parameter.depthGte?.toInt(), - max: parameter.depthLte?.toInt(), - onChanged: (min, max) => onChanged( - parameter.updateDepth( - min?.toDouble(), - max?.toDouble(), - ), - ), - ), - DateRangeFilterChip( - min: parameter.originTimeGte, - max: parameter.originTimeLte, - onChanged: (min, max) => onChanged( - parameter.updateOriginTime(min, max), - ), - ), - ] - .map( - (e) => Padding( - padding: const EdgeInsets.symmetric(horizontal: 4), - child: e, - ), - ) - .toList(), + children: + [ + EarthquakeHistoryEarlySortChip( + type: parameter.sort, + ascending: parameter.ascending, + onChanged: + (type, ascending) => onChanged( + parameter.updateSort( + type: type, + ascending: ascending, + ), + ), + ), + const VerticalDivider(), + IntensityFilterChip( + min: parameter.intensityGte, + max: parameter.intensityLte, + onChanged: + (min, max) => + onChanged(parameter.updateIntensity(min, max)), + ), + MagnitudeFilterChip( + min: parameter.magnitudeGte, + max: parameter.magnitudeLte, + onChanged: + (min, max) => + onChanged(parameter.updateMagnitude(min, max)), + ), + DepthFilterChip( + min: parameter.depthGte?.toInt(), + max: parameter.depthLte?.toInt(), + onChanged: + (min, max) => onChanged( + parameter.updateDepth( + min?.toDouble(), + max?.toDouble(), + ), + ), + ), + DateRangeFilterChip( + min: parameter.originTimeGte, + max: parameter.originTimeLte, + onChanged: + (min, max) => + onChanged(parameter.updateOriginTime(min, max)), + ), + ] + .map( + (e) => Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: e, + ), + ) + .toList(), ), ), ), @@ -177,21 +183,18 @@ class _SliverListBody extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final controller = useMemoized(() => PrimaryScrollController.of(context)); - useEffect( - () { - controller.addListener(() { - if (state.hasError || state.isRefreshing || !state.hasValue) { - return; - } - if (controller.position.pixels >= - controller.position.maxScrollExtent - 100) { - onScrollEnd?.call(); - } - }); - return null; - }, - [controller, state, onScrollEnd, onRefresh], - ); + useEffect(() { + controller.addListener(() { + if (state.hasError || state.isRefreshing || !state.hasValue) { + return; + } + if (controller.position.pixels >= + controller.position.maxScrollExtent - 100) { + onScrollEnd?.call(); + } + }); + return null; + }, [controller, state, onScrollEnd, onRefresh]); final theme = Theme.of(context); final colorSchema = theme.colorScheme; @@ -199,9 +202,7 @@ class _SliverListBody extends HookConsumerWidget { required (List, int) data, Widget loading = const Padding( padding: EdgeInsets.all(48), - child: Center( - child: CircularProgressIndicator.adaptive(), - ), + child: Center(child: CircularProgressIndicator.adaptive()), ), }) { if (data.$1.isEmpty) { @@ -220,10 +221,7 @@ class _SliverListBody extends HookConsumerWidget { } if (state.hasError) { final error = state.error!; - return ErrorCard( - error: error, - onReload: onRefresh, - ); + return ErrorCard(error: error, onReload: onRefresh); } final hasNext = state.valueOrNull?.hasNext ?? false; if (hasNext) { @@ -235,9 +233,10 @@ class _SliverListBody extends HookConsumerWidget { final item = data.$1[index]; return EarthquakeHistoryEarlyListTile( item: item, - onTap: () async => EarthquakeHistoryEarlyDetailsRoute( - id: item.id, - ).push(context), + onTap: + () async => EarthquakeHistoryEarlyDetailsRoute( + id: item.id, + ).push(context), ); }, ), @@ -249,70 +248,65 @@ class _SliverListBody extends HookConsumerWidget { onRefresh: () async => onRefresh?.call(), child: switch (state) { AsyncError(:final error) => () { - final valueOrNull = state.valueOrNull; - if (valueOrNull != null) { - return listView(data: valueOrNull); - } - return ErrorCard( - error: error, - onReload: () async => ref.refresh( - earthquakeHistoryEarlyNotifierProvider(parameter), - ), - ); - }(), + final valueOrNull = state.valueOrNull; + if (valueOrNull != null) { + return listView(data: valueOrNull); + } + return ErrorCard( + error: error, + onReload: + () async => ref.refresh( + earthquakeHistoryEarlyNotifierProvider(parameter), + ), + ); + }(), AsyncData(:final value) => Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - if (shouldShowLatestEarthquakeMessage) - Card( - color: colorSchema.secondaryContainer, - child: Padding( - padding: const EdgeInsets.all(8), - child: Text.rich( - TextSpan( - children: [ - const TextSpan(text: '最新の地震情報を見るためには'), - TextSpan( - text: '地震履歴', - style: const TextStyle(fontWeight: FontWeight.bold), - recognizer: TapGestureRecognizer() - ..onTap = () async => - const EarthquakeHistoryRoute().push( - context, - ), - ), - const TextSpan(text: 'を使ってください'), - ], - ), - style: TextStyle( - color: colorSchema.onSecondaryContainer, - ), + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + if (shouldShowLatestEarthquakeMessage) + Card( + color: colorSchema.secondaryContainer, + child: Padding( + padding: const EdgeInsets.all(8), + child: Text.rich( + TextSpan( + children: [ + const TextSpan(text: '最新の地震情報を見るためには'), + TextSpan( + text: '地震履歴', + style: const TextStyle(fontWeight: FontWeight.bold), + recognizer: + TapGestureRecognizer() + ..onTap = + () async => const EarthquakeHistoryRoute() + .push(context), + ), + const TextSpan(text: 'を使ってください'), + ], ), - ), - ), - Padding( - padding: const EdgeInsets.all(4), - child: Text.rich( - TextSpan( - children: [ - const TextSpan(text: '全'), - TextSpan( - text: NumberFormat('#,###').format(value.$2), - style: const TextStyle(fontWeight: FontWeight.bold), - ), - const TextSpan(text: '件の地震情報が見つかりました'), - ], + style: TextStyle(color: colorSchema.onSecondaryContainer), ), ), ), - Expanded( - child: listView(data: value), + Padding( + padding: const EdgeInsets.all(4), + child: Text.rich( + TextSpan( + children: [ + const TextSpan(text: '全'), + TextSpan( + text: NumberFormat('#,###').format(value.$2), + style: const TextStyle(fontWeight: FontWeight.bold), + ), + const TextSpan(text: '件の地震情報が見つかりました'), + ], + ), ), - ], - ), - _ => const Center( - child: CircularProgressIndicator.adaptive(), - ), + ), + Expanded(child: listView(data: value)), + ], + ), + _ => const Center(child: CircularProgressIndicator.adaptive()), }, ); } @@ -322,9 +316,9 @@ class _EarthquakeHistoryEarlyInformationModal extends StatelessWidget { const _EarthquakeHistoryEarlyInformationModal(); static Future show(BuildContext context) async => showModalBottomSheet( - context: context, - builder: (_) => const _EarthquakeHistoryEarlyInformationModal(), - ); + context: context, + builder: (_) => const _EarthquakeHistoryEarlyInformationModal(), + ); @override Widget build(BuildContext context) { diff --git a/app/lib/feature/eew/data/eew_alive_telegram.dart b/app/lib/feature/eew/data/eew_alive_telegram.dart index d6e68d9a..a76f0f05 100644 --- a/app/lib/feature/eew/data/eew_alive_telegram.dart +++ b/app/lib/feature/eew/data/eew_alive_telegram.dart @@ -9,9 +9,7 @@ part 'eew_alive_telegram.g.dart'; /// イベント終了していないEEWのうち、精度が低いものを除外したもの @Riverpod(keepAlive: true, dependencies: [EewAliveTelegram]) -List eewAliveNormalTelegram( - Ref ref, -) { +List eewAliveNormalTelegram(Ref ref) { final state = ref.watch(eewAliveTelegramProvider) ?? []; return state.where((e) { if (e.isPlum ?? false || e.isLevelEew || e.isIpfOnePoint) { @@ -41,10 +39,7 @@ class EewAliveTelegram extends _$EewAliveTelegram { } @override - bool updateShouldNotify( - List? previous, - List? next, - ) { + bool updateShouldNotify(List? previous, List? next) { return !const ListEquality().equals(previous, next); } } @@ -54,10 +49,7 @@ EewAliveChecker eewAliveChecker(Ref ref) => EewAliveChecker(); class EewAliveChecker { /// イベント終了の判定 - bool checkMarkAsEventEnded({ - required EewV1 eew, - required DateTime now, - }) { + bool checkMarkAsEventEnded({required EewV1 eew, required DateTime now}) { // 発生時刻から1時間以上経過している場合、イベント終了と判定する(早期return) final reportTime = eew.reportTime.toUtc(); if (now.toUtc().difference(reportTime).inHours > 1) { diff --git a/app/lib/feature/eew/data/eew_alive_telegram.g.dart b/app/lib/feature/eew/data/eew_alive_telegram.g.dart index 651b3f1e..7ac13545 100644 --- a/app/lib/feature/eew/data/eew_alive_telegram.g.dart +++ b/app/lib/feature/eew/data/eew_alive_telegram.g.dart @@ -18,13 +18,14 @@ String _$eewAliveNormalTelegramHash() => final eewAliveNormalTelegramProvider = Provider>.internal( eewAliveNormalTelegram, name: r'eewAliveNormalTelegramProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewAliveNormalTelegramHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewAliveNormalTelegramHash, dependencies: [eewAliveTelegramProvider], allTransitiveDependencies: { eewAliveTelegramProvider, - ...?eewAliveTelegramProvider.allTransitiveDependencies + ...?eewAliveTelegramProvider.allTransitiveDependencies, }, ); @@ -38,9 +39,10 @@ String _$eewAliveCheckerHash() => r'21c8182cab2a3bb009efd938202257d2580030c9'; final eewAliveCheckerProvider = Provider.internal( eewAliveChecker, name: r'eewAliveCheckerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewAliveCheckerHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewAliveCheckerHash, dependencies: const [], allTransitiveDependencies: const {}, ); @@ -56,19 +58,23 @@ String _$eewAliveTelegramHash() => r'0e6433459f8e9d3a6a4b414224e0a0d9abb1e5a2'; @ProviderFor(EewAliveTelegram) final eewAliveTelegramProvider = NotifierProvider?>.internal( - EewAliveTelegram.new, - name: r'eewAliveTelegramProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewAliveTelegramHash, - dependencies: [timeTickerProvider, eewAliveCheckerProvider], - allTransitiveDependencies: { - timeTickerProvider, - ...?timeTickerProvider.allTransitiveDependencies, - eewAliveCheckerProvider, - ...?eewAliveCheckerProvider.allTransitiveDependencies - }, -); + EewAliveTelegram.new, + name: r'eewAliveTelegramProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewAliveTelegramHash, + dependencies: [ + timeTickerProvider, + eewAliveCheckerProvider, + ], + allTransitiveDependencies: { + timeTickerProvider, + ...?timeTickerProvider.allTransitiveDependencies, + eewAliveCheckerProvider, + ...?eewAliveCheckerProvider.allTransitiveDependencies, + }, + ); typedef _$EewAliveTelegram = Notifier?>; // ignore_for_file: type=lint diff --git a/app/lib/feature/eew/data/eew_by_event_id.dart b/app/lib/feature/eew/data/eew_by_event_id.dart index 5c9068a7..dab7ddb1 100644 --- a/app/lib/feature/eew/data/eew_by_event_id.dart +++ b/app/lib/feature/eew/data/eew_by_event_id.dart @@ -12,9 +12,7 @@ class EewsByEventId extends _$EewsByEventId { @override Future> build(String eventId) async { final client = ref.watch(eqApiProvider); - final response = await client.v1.getEewByEventId( - eventId: eventId, - ); + final response = await client.v1.getEewByEventId(eventId: eventId); // Start Listening Eew // to update the list diff --git a/app/lib/feature/eew/data/eew_by_event_id.g.dart b/app/lib/feature/eew/data/eew_by_event_id.g.dart index e9db5714..c6156e11 100644 --- a/app/lib/feature/eew/data/eew_by_event_id.g.dart +++ b/app/lib/feature/eew/data/eew_by_event_id.g.dart @@ -35,9 +35,7 @@ abstract class _$EewsByEventId extends BuildlessAutoDisposeAsyncNotifier> { late final String eventId; - FutureOr> build( - String eventId, - ); + FutureOr> build(String eventId); } /// See also [EewsByEventId]. @@ -50,21 +48,15 @@ class EewsByEventIdFamily extends Family>> { const EewsByEventIdFamily(); /// See also [EewsByEventId]. - EewsByEventIdProvider call( - String eventId, - ) { - return EewsByEventIdProvider( - eventId, - ); + EewsByEventIdProvider call(String eventId) { + return EewsByEventIdProvider(eventId); } @override EewsByEventIdProvider getProviderOverride( covariant EewsByEventIdProvider provider, ) { - return call( - provider.eventId, - ); + return call(provider.eventId); } static const Iterable? _dependencies = null; @@ -86,21 +78,20 @@ class EewsByEventIdFamily extends Family>> { class EewsByEventIdProvider extends AutoDisposeAsyncNotifierProviderImpl> { /// See also [EewsByEventId]. - EewsByEventIdProvider( - String eventId, - ) : this._internal( - () => EewsByEventId()..eventId = eventId, - from: eewsByEventIdProvider, - name: r'eewsByEventIdProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewsByEventIdHash, - dependencies: EewsByEventIdFamily._dependencies, - allTransitiveDependencies: - EewsByEventIdFamily._allTransitiveDependencies, - eventId: eventId, - ); + EewsByEventIdProvider(String eventId) + : this._internal( + () => EewsByEventId()..eventId = eventId, + from: eewsByEventIdProvider, + name: r'eewsByEventIdProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewsByEventIdHash, + dependencies: EewsByEventIdFamily._dependencies, + allTransitiveDependencies: + EewsByEventIdFamily._allTransitiveDependencies, + eventId: eventId, + ); EewsByEventIdProvider._internal( super._createNotifier, { @@ -115,12 +106,8 @@ class EewsByEventIdProvider final String eventId; @override - FutureOr> runNotifierBuild( - covariant EewsByEventId notifier, - ) { - return notifier.build( - eventId, - ); + FutureOr> runNotifierBuild(covariant EewsByEventId notifier) { + return notifier.build(eventId); } @override @@ -141,7 +128,7 @@ class EewsByEventIdProvider @override AutoDisposeAsyncNotifierProviderElement> - createElement() { + createElement() { return _EewsByEventIdProviderElement(this); } @@ -174,5 +161,6 @@ class _EewsByEventIdProviderElement @override String get eventId => (origin as EewsByEventIdProvider).eventId; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/eew/data/eew_telegram.dart b/app/lib/feature/eew/data/eew_telegram.dart index f5d0ced7..8d76a581 100644 --- a/app/lib/feature/eew/data/eew_telegram.dart +++ b/app/lib/feature/eew/data/eew_telegram.dart @@ -22,15 +22,12 @@ class Eew extends _$Eew { // WebSocketのListen開始 ref - ..listen( - websocketTableMessagesProvider, - (_, next) { - final valueOrNull = next.valueOrNull; - if (valueOrNull is RealtimePostgresInsertPayload) { - _upsert(valueOrNull.newData); - } - }, - ) + ..listen(websocketTableMessagesProvider, (_, next) { + final valueOrNull = next.valueOrNull; + if (valueOrNull is RealtimePostgresInsertPayload) { + _upsert(valueOrNull.newData); + } + }) ..listen(appLifecycleProvider, (_, next) { if (next == AppLifecycleState.resumed) { log('AppLifecycleState.resumed: Refetch EEW'); diff --git a/app/lib/feature/eew/ui/components/eew_table.dart b/app/lib/feature/eew/ui/components/eew_table.dart index 765f20e8..55687329 100644 --- a/app/lib/feature/eew/ui/components/eew_table.dart +++ b/app/lib/feature/eew/ui/components/eew_table.dart @@ -3,10 +3,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class EewTable extends StatelessWidget { - const EewTable({ - required this.eews, - super.key, - }); + const EewTable({required this.eews, super.key}); final List eews; @@ -27,47 +24,46 @@ class EewTable extends StatelessWidget { borderRadius: BorderRadius.circular(8), outside: BorderSide(color: colorScheme.surface), ), - columns: _EewTableColumn.values - .map( - (e) => DataColumn( - label: Row( - children: [ - Text(e.name), - if (e.tooltip != null) ...[ - const SizedBox(width: 4), - Tooltip( - message: e.tooltip, - triggerMode: TooltipTriggerMode.tap, - child: const Icon(Icons.info_outline), - ), - ], - ], - ), - numeric: e.isNumeric, - headingRowAlignment: MainAxisAlignment.center, - ), - ) - .toList(), - rows: eews - .map( - (eew) => DataRow( - color: WidgetStateProperty.all( - eew.isWarning ?? false - ? colorScheme.errorContainer.withValues(alpha: 0.7) - : colorScheme.surfaceContainer, - ), - cells: _EewTableColumn.values - .map( - (c) => DataCell( - Text( - c.value(eew).value, - ), - ), - ) - .toList(), - ), - ) - .toList(), + columns: + _EewTableColumn.values + .map( + (e) => DataColumn( + label: Row( + children: [ + Text(e.name), + if (e.tooltip != null) ...[ + const SizedBox(width: 4), + Tooltip( + message: e.tooltip, + triggerMode: TooltipTriggerMode.tap, + child: const Icon(Icons.info_outline), + ), + ], + ], + ), + numeric: e.isNumeric, + headingRowAlignment: MainAxisAlignment.center, + ), + ) + .toList(), + rows: + eews + .map( + (eew) => DataRow( + color: WidgetStateProperty.all( + eew.isWarning ?? false + ? colorScheme.errorContainer.withValues( + alpha: 0.7, + ) + : colorScheme.surfaceContainer, + ), + cells: + _EewTableColumn.values + .map((c) => DataCell(Text(c.value(eew).value))) + .toList(), + ), + ) + .toList(), ), ), ), @@ -91,8 +87,7 @@ enum _EewTableColumn { magnitude(name: 'M', isNumeric: true), maxIntensity(name: '予想最大震度', isNumeric: true), maxLongPeriodIntensity(name: '予想最大長周期\n地震動階級', isNumeric: true), - accuracy(name: '精度', isNumeric: false), - ; + accuracy(name: '精度', isNumeric: false); const _EewTableColumn({ required this.name, @@ -107,81 +102,81 @@ enum _EewTableColumn { extension _EewTableColumnEx on _EewTableColumn { _EewTableColumnValue value(EewV1 eew) => switch (this) { - _EewTableColumn.serialNo => _EewTableColumnValue( - value: eew.serialNo?.toString() ?? '', - isNumeric: true, - ), - _EewTableColumn.originTime => _EewTableColumnValue( - value: eew.originTime != null - ? DateFormat('yyyy/MM/dd HH:mm:ss').format( - eew.originTime!.toLocal(), - ) - : '', - isNumeric: false, - ), - _EewTableColumn.elapsedTime => _EewTableColumnValue( - value: eew.arrivalTime != null - ? '+${eew.reportTime.difference(eew.arrivalTime!).inSeconds}秒' - : '', - isNumeric: false, - ), - _EewTableColumn.epicenterName => _EewTableColumnValue( - value: eew.hypoName ?? '', - isNumeric: false, - ), - _EewTableColumn.epicenterLatitude => _EewTableColumnValue( - value: eew.latitude?.toString() ?? '', - isNumeric: true, - ), - _EewTableColumn.epicenterLongitude => _EewTableColumnValue( - value: eew.longitude?.toString() ?? '', - isNumeric: true, - ), - _EewTableColumn.magnitude => _EewTableColumnValue( - value: eew.magnitude != null ? 'M${eew.magnitude}' : '', - isNumeric: true, - ), - _EewTableColumn.maxIntensity => _EewTableColumnValue( - value: eew.forecastMaxIntensity != null - ? '震度 ${eew.forecastMaxIntensity!.type.replaceAll('-', '弱').replaceAll('+', '強')}' - '${eew.forecastMaxIntensityIsOver ?? false ? '以上' : ''}' - : '', - isNumeric: false, - ), - _EewTableColumn.epicenterDepth => _EewTableColumnValue( - value: eew.depth != null ? '${eew.depth}km' : '', - isNumeric: true, - ), - _EewTableColumn.maxLongPeriodIntensity => _EewTableColumnValue( - value: eew.forecastMaxLpgmIntensity?.type != null - ? '長周期地震動階級 ${eew.forecastMaxLpgmIntensity!.type}' - : '', - isNumeric: false, - ), - _EewTableColumn.accuracy when eew.accuracy != null => - _EewTableColumnValue( - value: () { - final accuracy = eew.accuracy!; - return '${accuracy.depth}'; - }(), - isNumeric: true, - ), - _EewTableColumn.accuracy => const _EewTableColumnValue( - value: '', - isNumeric: false, - ), - _EewTableColumn.type => _EewTableColumnValue( - value: (eew.isWarning ?? false) ? '緊急地震速報 (警報)' : '緊急地震速報 (予報)', - isNumeric: false, - ), - }; + _EewTableColumn.serialNo => _EewTableColumnValue( + value: eew.serialNo?.toString() ?? '', + isNumeric: true, + ), + _EewTableColumn.originTime => _EewTableColumnValue( + value: + eew.originTime != null + ? DateFormat( + 'yyyy/MM/dd HH:mm:ss', + ).format(eew.originTime!.toLocal()) + : '', + isNumeric: false, + ), + _EewTableColumn.elapsedTime => _EewTableColumnValue( + value: + eew.arrivalTime != null + ? '+${eew.reportTime.difference(eew.arrivalTime!).inSeconds}秒' + : '', + isNumeric: false, + ), + _EewTableColumn.epicenterName => _EewTableColumnValue( + value: eew.hypoName ?? '', + isNumeric: false, + ), + _EewTableColumn.epicenterLatitude => _EewTableColumnValue( + value: eew.latitude?.toString() ?? '', + isNumeric: true, + ), + _EewTableColumn.epicenterLongitude => _EewTableColumnValue( + value: eew.longitude?.toString() ?? '', + isNumeric: true, + ), + _EewTableColumn.magnitude => _EewTableColumnValue( + value: eew.magnitude != null ? 'M${eew.magnitude}' : '', + isNumeric: true, + ), + _EewTableColumn.maxIntensity => _EewTableColumnValue( + value: + eew.forecastMaxIntensity != null + ? '震度 ${eew.forecastMaxIntensity!.type.replaceAll('-', '弱').replaceAll('+', '強')}' + '${eew.forecastMaxIntensityIsOver ?? false ? '以上' : ''}' + : '', + isNumeric: false, + ), + _EewTableColumn.epicenterDepth => _EewTableColumnValue( + value: eew.depth != null ? '${eew.depth}km' : '', + isNumeric: true, + ), + _EewTableColumn.maxLongPeriodIntensity => _EewTableColumnValue( + value: + eew.forecastMaxLpgmIntensity?.type != null + ? '長周期地震動階級 ${eew.forecastMaxLpgmIntensity!.type}' + : '', + isNumeric: false, + ), + _EewTableColumn.accuracy when eew.accuracy != null => _EewTableColumnValue( + value: () { + final accuracy = eew.accuracy!; + return '${accuracy.depth}'; + }(), + isNumeric: true, + ), + _EewTableColumn.accuracy => const _EewTableColumnValue( + value: '', + isNumeric: false, + ), + _EewTableColumn.type => _EewTableColumnValue( + value: (eew.isWarning ?? false) ? '緊急地震速報 (警報)' : '緊急地震速報 (予報)', + isNumeric: false, + ), + }; } class _EewTableColumnValue { - const _EewTableColumnValue({ - required this.value, - required this.isNumeric, - }); + const _EewTableColumnValue({required this.value, required this.isNumeric}); final String value; final bool isNumeric; diff --git a/app/lib/feature/eew/ui/screen/eew_details_by_event_id_page.dart b/app/lib/feature/eew/ui/screen/eew_details_by_event_id_page.dart index d56446ec..e62845a6 100644 --- a/app/lib/feature/eew/ui/screen/eew_details_by_event_id_page.dart +++ b/app/lib/feature/eew/ui/screen/eew_details_by_event_id_page.dart @@ -8,25 +8,18 @@ import 'package:go_router/go_router.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; class EewDetailsByEventIdRoute extends GoRouteData { - const EewDetailsByEventIdRoute({ - required this.eventId, - }); + const EewDetailsByEventIdRoute({required this.eventId}); final String eventId; @override Widget build(BuildContext context, GoRouterState state) { - return EewDetailsByEventIdPage( - eventId: eventId, - ); + return EewDetailsByEventIdPage(eventId: eventId); } } class EewDetailsByEventIdPage extends HookConsumerWidget { - const EewDetailsByEventIdPage({ - required this.eventId, - super.key, - }); + const EewDetailsByEventIdPage({required this.eventId, super.key}); final String eventId; @@ -35,15 +28,11 @@ class EewDetailsByEventIdPage extends HookConsumerWidget { final eewsAsyncValue = ref.watch(eewsByEventIdProvider(eventId)); return Scaffold( - appBar: AppBar( - title: const Text('緊急地震速報の履歴'), - ), + appBar: AppBar(title: const Text('緊急地震速報の履歴')), body: eewsAsyncValue.when( data: (eews) { if (eews.isEmpty) { - return const Center( - child: Text('データがありません'), - ); + return const Center(child: Text('データがありません')); } // serial_no の昇順でソート final sortedEews = useMemoized( @@ -55,10 +44,11 @@ class EewDetailsByEventIdPage extends HookConsumerWidget { return EewTable(eews: sortedEews); }, loading: () => const Center(child: CircularProgressIndicator()), - error: (error, stack) => ErrorCard( - error: error, - onReload: () async => ref.refresh(eewsByEventIdProvider(eventId)), - ), + error: + (error, stack) => ErrorCard( + error: error, + onReload: () async => ref.refresh(eewsByEventIdProvider(eventId)), + ), ), ); } diff --git a/app/lib/feature/eew/ui/screen/eew_details_screen.dart b/app/lib/feature/eew/ui/screen/eew_details_screen.dart index 496d1ce2..492a1aef 100644 --- a/app/lib/feature/eew/ui/screen/eew_details_screen.dart +++ b/app/lib/feature/eew/ui/screen/eew_details_screen.dart @@ -5,10 +5,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class EewDetailsByEventIdPage extends HookConsumerWidget { - const EewDetailsByEventIdPage({ - required this.eventId, - super.key, - }); + const EewDetailsByEventIdPage({required this.eventId, super.key}); final String eventId; @@ -17,24 +14,18 @@ class EewDetailsByEventIdPage extends HookConsumerWidget { final eewsAsyncValue = ref.watch(eewsByEventIdProvider(eventId)); return Scaffold( - appBar: AppBar( - title: Text('緊急地震速報 詳細 ($eventId)'), - ), + appBar: AppBar(title: Text('緊急地震速報 詳細 ($eventId)')), body: eewsAsyncValue.when( data: _buildEewList, loading: () => const Center(child: CircularProgressIndicator()), - error: (error, stack) => Center( - child: Text('エラーが発生しました: $error'), - ), + error: (error, stack) => Center(child: Text('エラーが発生しました: $error')), ), ); } Widget _buildEewList(List eews) { if (eews.isEmpty) { - return const Center( - child: Text('データがありません'), - ); + return const Center(child: Text('データがありません')); } return ListView.builder( @@ -48,9 +39,7 @@ class EewDetailsByEventIdPage extends HookConsumerWidget { } class _EewCard extends StatelessWidget { - const _EewCard({ - required this.eew, - }); + const _EewCard({required this.eew}); final EewV1 eew; diff --git a/app/lib/feature/home/component/eew/eew_widget.dart b/app/lib/feature/home/component/eew/eew_widget.dart index 3bbd4562..88b0bb7c 100644 --- a/app/lib/feature/home/component/eew/eew_widget.dart +++ b/app/lib/feature/home/component/eew/eew_widget.dart @@ -22,24 +22,21 @@ class EewWidgets extends ConsumerWidget { final state = ref.watch(eewAliveTelegramProvider) ?? []; return Column( - children: state.reversed - .mapIndexed( - (index, element) => EewWidget( - eew: element, - index: (state.length > 1) ? '${index + 1}' : null, - ), - ) - .toList(), + children: + state.reversed + .mapIndexed( + (index, element) => EewWidget( + eew: element, + index: (state.length > 1) ? '${index + 1}' : null, + ), + ) + .toList(), ); } } class EewWidget extends ConsumerWidget { - const EewWidget({ - required this.eew, - required this.index, - super.key, - }); + const EewWidget({required this.eew, required this.index, super.key}); final EewV1 eew; final String? index; @@ -53,16 +50,10 @@ class EewWidget extends ConsumerWidget { if (eew.isCanceled) { return BorderedContainer( elevation: 1, - margin: const EdgeInsets.symmetric( - horizontal: 12, - ) + - const EdgeInsets.only( - bottom: 8, - ), - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + margin: + const EdgeInsets.symmetric(horizontal: 12) + + const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Center( child: Padding( padding: const EdgeInsets.all(8), @@ -73,10 +64,13 @@ class EewWidget extends ConsumerWidget { } final maxIntensity = eew.forecastMaxIntensity ?? JmaForecastIntensity.unknown; - final intensityScheme = - intensityColorScheme.fromJmaForecastIntensity(maxIntensity); - final (_, backgroundColor) = - (intensityScheme.foreground, intensityScheme.background); + final intensityScheme = intensityColorScheme.fromJmaForecastIntensity( + maxIntensity, + ); + final (_, backgroundColor) = ( + intensityScheme.foreground, + intensityScheme.background, + ); // 「緊急地震速報 警報 [SPACE] #5(最終)」 final isWarning = eew.isWarning ?? eew.headline?.contains('強い揺れ') ?? false; final header = Wrap( @@ -100,9 +94,7 @@ class EewWidget extends ConsumerWidget { backgroundColor: Colors.transparent, child: Text( 'レベル法', - style: TextStyle( - fontWeight: FontWeight.w900, - ), + style: TextStyle(fontWeight: FontWeight.w900), ), ), if (eew.isIpfOnePoint) @@ -111,9 +103,7 @@ class EewWidget extends ConsumerWidget { backgroundColor: Colors.transparent, child: Text( '1点観測点による検知', - style: TextStyle( - fontWeight: FontWeight.w900, - ), + style: TextStyle(fontWeight: FontWeight.w900), ), ), if (eew.isPlum ?? false) @@ -122,9 +112,7 @@ class EewWidget extends ConsumerWidget { backgroundColor: Colors.transparent, child: Text( 'PLUM法', - style: TextStyle( - fontWeight: FontWeight.w900, - ), + style: TextStyle(fontWeight: FontWeight.w900), ), ), ], @@ -143,10 +131,7 @@ class EewWidget extends ConsumerWidget { mainAxisSize: MainAxisSize.min, children: [ const Text('最大震度'), - JmaForecastIntensityWidget( - size: 60, - intensity: maxIntensity, - ), + JmaForecastIntensityWidget(size: 60, intensity: maxIntensity), ], ); // 「[MaxInt, 震源地, 規模」 @@ -180,9 +165,7 @@ class EewWidget extends ConsumerWidget { return const SizedBox.shrink(); } final timeWidget = Text( - '${DateFormat('yyyy/MM/dd HH:mm:ss').format( - happenedTime.toLocal(), - )}' + '${DateFormat('yyyy/MM/dd HH:mm:ss').format(happenedTime.toLocal())}' ' ' '${eew.originTime == null ? "検知" : "発生"}', style: textTheme.bodyMedium, @@ -311,37 +294,34 @@ class EewWidget extends ConsumerWidget { ], ); final headline = eew.headline?.toString().toHalfWidth; - final warningMessageWidget = (headline != null) - ? [ - Text( - headline.split('で地震 ').getOrNull(1) ?? headline, - style: textTheme.titleMedium!.copyWith( - fontWeight: FontWeight.bold, + final warningMessageWidget = + (headline != null) + ? [ + Text( + headline.split('で地震 ').getOrNull(1) ?? headline, + style: textTheme.titleMedium!.copyWith( + fontWeight: FontWeight.bold, + ), ), - ), - Divider( - color: colorTheme.onSurface.withValues(alpha: 0.6), - ), - ] - : null; + Divider(color: colorTheme.onSurface.withValues(alpha: 0.6)), + ] + : null; final card = Card( elevation: 1, color: backgroundColor.withValues(alpha: 0.3), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16), side: BorderSide( - color: Color.lerp( - backgroundColor, - colorTheme.outline.withValues(alpha: 0.6), - 0.7, - )!, + color: + Color.lerp( + backgroundColor, + colorTheme.outline.withValues(alpha: 0.6), + 0.7, + )!, ), ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -426,79 +406,73 @@ class EewWidget extends ConsumerWidget { } } -List preview() => [ - // EEW 警報 - EewWidget( - eew: EewV1( - id: -1, - eventId: 20220101000000, - isPlum: false, - type: 'eew', - schemaType: 'eew-information', - status: TelegramStatus.normal.type, - infoType: TelegramInfoType.issue.type, - reportTime: DateTime.now(), - isCanceled: false, - isLastInfo: true, - isWarning: true, - accuracy: null, - hypoName: 'XX沖', - arrivalTime: DateTime.now(), - depth: 50, - headline: 'XX沖で地震 XX地方では強い揺れに警戒', - magnitude: 6.7, - originTime: DateTime.now(), - serialNo: 12, - forecastMaxIntensity: JmaForecastIntensity.sixLower, - ), - index: null, - ), - // EEW 予報 - EewWidget( - eew: EewV1( - id: -1, - eventId: 20220101000000, - isPlum: false, - type: 'eew', - schemaType: 'eew-information', - status: TelegramStatus.normal.type, - infoType: TelegramInfoType.issue.type, - reportTime: DateTime.now(), - isCanceled: false, - isLastInfo: false, - accuracy: null, - hypoName: 'XX沖', - arrivalTime: DateTime.now(), - depth: 40, - magnitude: 4.7, - forecastMaxIntensity: JmaForecastIntensity.fiveLower, - ), - index: null, - ), - // EEW キャンセル報 - EewWidget( - eew: EewV1( - id: -1, - eventId: 20220101000000, - isPlum: false, - type: 'eew', - schemaType: 'eew-information', - status: TelegramStatus.normal.type, - infoType: TelegramInfoType.issue.type, - reportTime: DateTime.now(), - isCanceled: true, - isLastInfo: true, - accuracy: null, - ), - index: null, - ), - ] - .map( - (e) => Column( - mainAxisSize: MainAxisSize.min, - children: [ - e, - ], +List preview() => + [ + // EEW 警報 + EewWidget( + eew: EewV1( + id: -1, + eventId: 20220101000000, + isPlum: false, + type: 'eew', + schemaType: 'eew-information', + status: TelegramStatus.normal.type, + infoType: TelegramInfoType.issue.type, + reportTime: DateTime.now(), + isCanceled: false, + isLastInfo: true, + isWarning: true, + accuracy: null, + hypoName: 'XX沖', + arrivalTime: DateTime.now(), + depth: 50, + headline: 'XX沖で地震 XX地方では強い揺れに警戒', + magnitude: 6.7, + originTime: DateTime.now(), + serialNo: 12, + forecastMaxIntensity: JmaForecastIntensity.sixLower, + ), + index: null, + ), + // EEW 予報 + EewWidget( + eew: EewV1( + id: -1, + eventId: 20220101000000, + isPlum: false, + type: 'eew', + schemaType: 'eew-information', + status: TelegramStatus.normal.type, + infoType: TelegramInfoType.issue.type, + reportTime: DateTime.now(), + isCanceled: false, + isLastInfo: false, + accuracy: null, + hypoName: 'XX沖', + arrivalTime: DateTime.now(), + depth: 40, + magnitude: 4.7, + forecastMaxIntensity: JmaForecastIntensity.fiveLower, + ), + index: null, + ), + // EEW キャンセル報 + EewWidget( + eew: EewV1( + id: -1, + eventId: 20220101000000, + isPlum: false, + type: 'eew', + schemaType: 'eew-information', + status: TelegramStatus.normal.type, + infoType: TelegramInfoType.issue.type, + reportTime: DateTime.now(), + isCanceled: true, + isLastInfo: true, + accuracy: null, + ), + index: null, ), - ) + ] + .map((e) => Column(mainAxisSize: MainAxisSize.min, children: [e])) .toList(); diff --git a/app/lib/feature/home/component/map/home_map_content.dart b/app/lib/feature/home/component/map/home_map_content.dart index 30acca52..1df834dc 100644 --- a/app/lib/feature/home/component/map/home_map_content.dart +++ b/app/lib/feature/home/component/map/home_map_content.dart @@ -35,9 +35,7 @@ class HomeMapContent extends HookConsumerWidget { final configuration = configurationState.valueOrNull; if (configuration == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); + return const Center(child: CircularProgressIndicator.adaptive()); } final styleString = configuration.styleString; @@ -56,24 +54,16 @@ class HomeMapContent extends HookConsumerWidget { layers: [ for (final intensity in JmaForecastIntensity.values) ref.watch(eewEstimatedIntensityLayerControllerProvider(intensity)), - ...ref.watch( - eewPsWaveLineLayerControllerProvider, - ), + ...ref.watch(eewPsWaveLineLayerControllerProvider), ref.watch( eewHypocenterLayerControllerProvider(EewHypocenterIcon.normal), ), ref.watch( - eewHypocenterLayerControllerProvider( - EewHypocenterIcon.lowPrecise, - ), + eewHypocenterLayerControllerProvider(EewHypocenterIcon.lowPrecise), ), if (isKyoshinLayerEnabled) kyoshinLayer, - ...ref.watch( - eewPsWaveFillLayerControllerProvider, - ), - ref.watch( - eewPsWaveSourceLayerControllerProvider, - ), + ...ref.watch(eewPsWaveFillLayerControllerProvider), + ref.watch(eewPsWaveSourceLayerControllerProvider), ], ), ); diff --git a/app/lib/feature/home/component/map/home_map_layer_modal.dart b/app/lib/feature/home/component/map/home_map_layer_modal.dart index c7edee1f..8a956e12 100644 --- a/app/lib/feature/home/component/map/home_map_layer_modal.dart +++ b/app/lib/feature/home/component/map/home_map_layer_modal.dart @@ -16,15 +16,14 @@ class HomeMapLayerModal extends HookConsumerWidget { const HomeMapLayerModal({super.key}); static Future show(BuildContext context) => Navigator.of(context).push( - AppSheetRoute( - builder: (context) => const ClipRRect( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16), - ), + AppSheetRoute( + builder: + (context) => const ClipRRect( + borderRadius: BorderRadius.vertical(top: Radius.circular(16)), child: HomeMapLayerModal(), ), - ), - ); + ), + ); @override Widget build(BuildContext context, WidgetRef ref) { @@ -69,12 +68,8 @@ class HomeMapLayerModal extends HookConsumerWidget { ), ], ), - const SliverToBoxAdapter( - child: _KyoshinMonitorIsEnabledTile(), - ), - const SliverToBoxAdapter( - child: _LocationSettingCards(), - ), + const SliverToBoxAdapter(child: _KyoshinMonitorIsEnabledTile()), + const SliverToBoxAdapter(child: _LocationSettingCards()), ], ), ); @@ -109,13 +104,12 @@ class _LocationSettingCards extends ConsumerWidget { title: '非表示', icon: Icons.location_off_outlined, isSelected: !config.showLocation, - onTap: () async => lightHapticFunction( - () async => ref - .read(homeConfigurationNotifierProvider.notifier) - .save( - config.copyWith(showLocation: false), - ), - ), + onTap: + () async => lightHapticFunction( + () async => ref + .read(homeConfigurationNotifierProvider.notifier) + .save(config.copyWith(showLocation: false)), + ), ), ), Expanded( @@ -124,26 +118,23 @@ class _LocationSettingCards extends ConsumerWidget { icon: Icons.location_on_outlined, isSelected: config.showLocation, subtitle: !permissionState.location ? '位置情報が許可されていません' : null, - onTap: () async => lightHapticFunction( - () async { - // 位置情報の権限がない場合は要求する - if (!permissionState.location) { - await ref - .read(permissionNotifierProvider.notifier) - .requestLocationWhenInUsePermission(); - // 権限が付与されなかった場合は早期リターン - if (!ref.read(permissionNotifierProvider).location) { - return; + onTap: + () async => lightHapticFunction(() async { + // 位置情報の権限がない場合は要求する + if (!permissionState.location) { + await ref + .read(permissionNotifierProvider.notifier) + .requestLocationWhenInUsePermission(); + // 権限が付与されなかった場合は早期リターン + if (!ref.read(permissionNotifierProvider).location) { + return; + } } - } - // 権限がある場合は位置情報表示を有効化 - await ref - .read(homeConfigurationNotifierProvider.notifier) - .save( - config.copyWith(showLocation: true), - ); - }, - ), + // 権限がある場合は位置情報表示を有効化 + await ref + .read(homeConfigurationNotifierProvider.notifier) + .save(config.copyWith(showLocation: true)); + }), ), ), ], @@ -176,17 +167,15 @@ class _LocationCard extends StatelessWidget { return Card.outlined( elevation: 0, - color: isSelected - ? colorScheme.primaryContainer - : colorScheme.surfaceContainer, + color: + isSelected + ? colorScheme.primaryContainer + : colorScheme.surfaceContainer, child: InkWell( onTap: onTap, borderRadius: BorderRadius.circular(12), child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 12, - horizontal: 16, - ), + padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -195,17 +184,19 @@ class _LocationCard extends StatelessWidget { children: [ Icon( icon, - color: isSelected - ? colorScheme.onPrimaryContainer - : colorScheme.onSurfaceVariant, + color: + isSelected + ? colorScheme.onPrimaryContainer + : colorScheme.onSurfaceVariant, ), const SizedBox(width: 8), Text( title, style: theme.textTheme.bodyMedium?.copyWith( - color: isSelected - ? colorScheme.onPrimaryContainer - : colorScheme.onSurfaceVariant, + color: + isSelected + ? colorScheme.onPrimaryContainer + : colorScheme.onSurfaceVariant, fontWeight: FontWeight.bold, ), ), @@ -236,10 +227,11 @@ class _KyoshinMonitorIsEnabledTile extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final setting = ref.watch(kyoshinMonitorSettingsProvider); - final subtitle = setting.useKmoni - ? '強震モニタのリアルタイムデータを表示します \n' - '(${setting.realtimeDataType.displayName}: ${setting.realtimeLayer.displayName})' - : '強震モニタを利用していません'; + final subtitle = + setting.useKmoni + ? '強震モニタのリアルタイムデータを表示します \n' + '(${setting.realtimeDataType.displayName}: ${setting.realtimeLayer.displayName})' + : '強震モニタを利用していません'; return Padding( padding: const EdgeInsets.all(8), diff --git a/app/lib/feature/home/component/map/home_map_view.dart b/app/lib/feature/home/component/map/home_map_view.dart index 487c2e68..afd339d4 100644 --- a/app/lib/feature/home/component/map/home_map_view.dart +++ b/app/lib/feature/home/component/map/home_map_view.dart @@ -53,10 +53,7 @@ class HomeMapView extends HookConsumerWidget { } class _MapHeader extends ConsumerWidget { - const _MapHeader({ - required this.mapController, - required this.size, - }); + const _MapHeader({required this.mapController, required this.size}); final DeclarativeMapController mapController; final Size size; @@ -76,31 +73,32 @@ class _MapHeader extends ConsumerWidget { children: [ AnimatedSwitcher( duration: const Duration(milliseconds: 200), - child: useKmoni - ? Column( - key: const ValueKey('kyoshin_monitor_status_card'), - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - spacing: 4, - children: [ - KyoshinMonitorStatusCard( - onTap: () async => - KyoshinMonitorSettingsModal.show(context), - ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, + child: + useKmoni + ? Column( + key: const ValueKey('kyoshin_monitor_status_card'), + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 4, + children: [ + KyoshinMonitorStatusCard( + onTap: + () async => + KyoshinMonitorSettingsModal.show(context), ), - child: AnimatedSwitcher( - duration: const Duration(milliseconds: 200), - child: showScaleCard - ? const KyoshinMonitorScaleCard() - : const SizedBox.shrink(), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 200), + child: + showScaleCard + ? const KyoshinMonitorScaleCard() + : const SizedBox.shrink(), + ), ), - ), - ], - ) - : const SizedBox.shrink(), + ], + ) + : const SizedBox.shrink(), ), const Column(), MapLayerControllerCard( diff --git a/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart b/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart index a2e8fd63..167bc83e 100644 --- a/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart +++ b/app/lib/feature/home/component/map/kyoshin_monitor_scale_card.dart @@ -7,10 +7,7 @@ import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; /// 強震モニタの設定状況を考慮したスケールカード class KyoshinMonitorScaleCard extends ConsumerWidget { - const KyoshinMonitorScaleCard({ - this.onTap, - super.key, - }); + const KyoshinMonitorScaleCard({this.onTap, super.key}); final void Function()? onTap; @@ -28,12 +25,9 @@ class KyoshinMonitorScaleCard extends ConsumerWidget { RealtimeDataType.response05Hz || RealtimeDataType.response1Hz || RealtimeDataType.response2Hz || - RealtimeDataType.response4Hz => - KyoshinMonitorScaleType.pgv, + RealtimeDataType.response4Hz => KyoshinMonitorScaleType.pgv, RealtimeDataType.pgd => KyoshinMonitorScaleType.pgd, - _ => throw ArgumentError( - 'Invalid realtimeDataType: $realtimeDataType)', - ), + _ => throw ArgumentError('Invalid realtimeDataType: $realtimeDataType)'), }; final theme = Theme.of(context); return GestureDetector( diff --git a/app/lib/feature/home/component/parameter/parameter_loader_widget.dart b/app/lib/feature/home/component/parameter/parameter_loader_widget.dart index 3b369483..754ee138 100644 --- a/app/lib/feature/home/component/parameter/parameter_loader_widget.dart +++ b/app/lib/feature/home/component/parameter/parameter_loader_widget.dart @@ -12,70 +12,62 @@ class ParameterLoaderWidget extends HookConsumerWidget { final state = ref.watch(jmaParameterProvider); return switch (state) { AsyncError(:final error) => BorderedContainer( - elevation: 1, - child: Column( - children: [ - Row( - children: [ - const Icon(Icons.warning), - const SizedBox(width: 8), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Text('観測点情報の取得に失敗しました'), - if (error is DioException) - const Text('ネットワーク接続を確認してください'), - ], - ), + elevation: 1, + child: Column( + children: [ + Row( + children: [ + const Icon(Icons.warning), + const SizedBox(width: 8), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('観測点情報の取得に失敗しました'), + if (error is DioException) + const Text('ネットワーク接続を確認してください'), + ], ), - ], - ), - const SizedBox(height: 8), - if (state.isLoading) - const CircularProgressIndicator.adaptive() - else - FilledButton( - child: const Text('再取得'), - onPressed: () async => ref.invalidate(jmaParameterProvider), ), - ], - ), + ], + ), + const SizedBox(height: 8), + if (state.isLoading) + const CircularProgressIndicator.adaptive() + else + FilledButton( + child: const Text('再取得'), + onPressed: () async => ref.invalidate(jmaParameterProvider), + ), + ], ), + ), AsyncData() => const AnimatedSwitcher( - duration: Duration(milliseconds: 150), - child: SizedBox.shrink( - key: ValueKey('non'), - ), - ), + duration: Duration(milliseconds: 150), + child: SizedBox.shrink(key: ValueKey('non')), + ), _ => AnimatedSwitcher( - duration: const Duration(milliseconds: 150), - child: BorderedContainer( - key: const ValueKey('loading'), - elevation: 1, - margin: const EdgeInsets.symmetric( - horizontal: 12, - ) + - const EdgeInsets.only( - bottom: 8, - ), - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 8, - ), - child: const Row( - children: [ - Text('観測点の情報を取得中...'), - SizedBox(width: 8), - SizedBox( - width: 16, - height: 16, - child: CircularProgressIndicator.adaptive(), - ), - ], - ), + duration: const Duration(milliseconds: 150), + child: BorderedContainer( + key: const ValueKey('loading'), + elevation: 1, + margin: + const EdgeInsets.symmetric(horizontal: 12) + + const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), + child: const Row( + children: [ + Text('観測点の情報を取得中...'), + SizedBox(width: 8), + SizedBox( + width: 16, + height: 16, + child: CircularProgressIndicator.adaptive(), + ), + ], ), ), + ), }; } } diff --git a/app/lib/feature/home/component/shake-detect/shake_detection_card.dart b/app/lib/feature/home/component/shake-detect/shake_detection_card.dart index d36db571..aad06802 100644 --- a/app/lib/feature/home/component/shake-detect/shake_detection_card.dart +++ b/app/lib/feature/home/component/shake-detect/shake_detection_card.dart @@ -6,10 +6,7 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; class ShakeDetectionCard extends ConsumerWidget { - const ShakeDetectionCard({ - required this.event, - super.key, - }); + const ShakeDetectionCard({required this.event, super.key}); final ShakeDetectionEvent event; @@ -28,22 +25,20 @@ class ShakeDetectionCard extends ConsumerWidget { final now = ref.watch(timeTickerProvider()).value ?? DateTime.now(); final intensityColorSchema = ref.watch(intensityColorProvider); - final maxIntensityColor = - intensityColorSchema.fromJmaForecastIntensity(maxIntensity); + final maxIntensityColor = intensityColorSchema.fromJmaForecastIntensity( + maxIntensity, + ); final maxIntensityText = switch (maxIntensity) { JmaForecastIntensity.zero => '微弱な反応を検知しました', JmaForecastIntensity.one => '弱い揺れを検知しました', JmaForecastIntensity.two => '揺れを検知しました', JmaForecastIntensity.three || - JmaForecastIntensity.four => - 'やや強い揺れを検知しました', + JmaForecastIntensity.four => 'やや強い揺れを検知しました', JmaForecastIntensity.fiveLower || - JmaForecastIntensity.fiveUpper => - '強い揺れを検知しました', + JmaForecastIntensity.fiveUpper => '強い揺れを検知しました', JmaForecastIntensity.sixLower || - JmaForecastIntensity.sixUpper => - '非常に強い揺れを検知しました', + JmaForecastIntensity.sixUpper => '非常に強い揺れを検知しました', JmaForecastIntensity.seven => '非常に強い揺れを検知しました', JmaForecastIntensity.unknown => '揺れを検知しました', }; diff --git a/app/lib/feature/home/component/sheet/earthquake_history_widget.dart b/app/lib/feature/home/component/sheet/earthquake_history_widget.dart index c1999bef..2e358834 100644 --- a/app/lib/feature/home/component/sheet/earthquake_history_widget.dart +++ b/app/lib/feature/home/component/sheet/earthquake_history_widget.dart @@ -15,9 +15,7 @@ class EarthquakeHistorySheetWidget extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final defaultEarthquakeHistoryNotifierProvider = earthquakeHistoryNotifierProvider(const EarthquakeHistoryParameter()); - final state = ref.watch( - defaultEarthquakeHistoryNotifierProvider, - ); + final state = ref.watch(defaultEarthquakeHistoryNotifierProvider); const loading = Center( child: Padding( padding: EdgeInsets.all(24), @@ -27,55 +25,54 @@ class EarthquakeHistorySheetWidget extends HookConsumerWidget { return BorderedContainer( elevation: 1, - margin: const EdgeInsets.symmetric( - horizontal: 12, - ) + - const EdgeInsets.only( - bottom: 8, - ), - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + margin: + const EdgeInsets.symmetric(horizontal: 12) + + const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Column( children: [ - const SheetHeader( - title: '地震履歴', - ), + const SheetHeader(title: '地震履歴'), switch (state) { AsyncData(:final value) => () { - final data = value.$1.take(3).toList(); - if (data.isEmpty) { - return const SizedBox.shrink(); - } - return Column( - children: data - .map( - (e) => EarthquakeHistoryListTile( - item: e, - onTap: () async => EarthquakeHistoryDetailsRoute( - eventId: e.eventId, - ).push(context), - showBackgroundColor: false, - ), - ) - .toList(), - ); - }(), + final data = value.$1.take(3).toList(); + if (data.isEmpty) { + return const SizedBox.shrink(); + } + return Column( + children: + data + .map( + (e) => EarthquakeHistoryListTile( + item: e, + onTap: + () async => EarthquakeHistoryDetailsRoute( + eventId: e.eventId, + ).push(context), + showBackgroundColor: false, + ), + ) + .toList(), + ); + }(), AsyncError(:final error) => ErrorCard( - error: error, - onReload: () async => ref - .read(defaultEarthquakeHistoryNotifierProvider.notifier) - .refresh(), - ), + error: error, + onReload: + () async => + ref + .read( + defaultEarthquakeHistoryNotifierProvider.notifier, + ) + .refresh(), + ), _ => loading, }, Row( children: [ const Spacer(), TextButton( - onPressed: () async => - const EarthquakeHistoryRoute().push(context), + onPressed: + () async => + const EarthquakeHistoryRoute().push(context), child: const Text('さらに表示'), ), ], diff --git a/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart b/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart index bc042534..d46b86ce 100644 --- a/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart +++ b/app/lib/feature/home/component/sheet/home_earthquake_history_sheet.dart @@ -19,25 +19,19 @@ class HomeEarthquakeHistorySheet extends HookConsumerWidget { return Card.outlined( color: Theme.of(context).colorScheme.surfaceContainerHigh, child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ const _Header(), switch (state) { - AsyncData(:final value) => value.$1.isEmpty - ? const EarthquakeHistoryNotFound() - : _EarthquakeList(earthquakes: value.$1), - AsyncError(:final error) => Center( - child: Text(error.toString()), - ), - _ => const Center( - child: CircularProgressIndicator.adaptive(), - ), + AsyncData(:final value) => + value.$1.isEmpty + ? const EarthquakeHistoryNotFound() + : _EarthquakeList(earthquakes: value.$1), + AsyncError(:final error) => Center(child: Text(error.toString())), + _ => const Center(child: CircularProgressIndicator.adaptive()), }, ], ), @@ -71,8 +65,8 @@ class _Header extends StatelessWidget { backgroundColor: colorScheme.secondaryContainer, foregroundColor: colorScheme.onSecondaryContainer, ), - onPressed: () async => - const EarthquakeHistoryRoute().push(context), + onPressed: + () async => const EarthquakeHistoryRoute().push(context), icon: const Icon(Icons.arrow_forward), label: const Text('さらに表示'), ), @@ -82,9 +76,7 @@ class _Header extends StatelessWidget { } class _EarthquakeList extends StatelessWidget { - const _EarthquakeList({ - required this.earthquakes, - }); + const _EarthquakeList({required this.earthquakes}); final List earthquakes; @@ -93,26 +85,28 @@ class _EarthquakeList extends StatelessWidget { final colorScheme = Theme.of(context).colorScheme; return Column( - children: earthquakes - .take(3) - .map( - (item) => InkWell( - borderRadius: BorderRadius.circular(12), - onTap: () async => EarthquakeHistoryDetailsRoute( - eventId: item.eventId, - ).push(context), - child: EarthquakeHistoryListTile( - visualDensity: VisualDensity.compact, - item: item, - showBackgroundColor: false, - intensityIconSize: 32, - titleTextColor: colorScheme.onSurfaceVariant, - descriptionTextColor: colorScheme.onSurfaceVariant, - magnitudeTextColor: colorScheme.onPrimaryContainer, - ), - ), - ) - .toList(), + children: + earthquakes + .take(3) + .map( + (item) => InkWell( + borderRadius: BorderRadius.circular(12), + onTap: + () async => EarthquakeHistoryDetailsRoute( + eventId: item.eventId, + ).push(context), + child: EarthquakeHistoryListTile( + visualDensity: VisualDensity.compact, + item: item, + showBackgroundColor: false, + intensityIconSize: 32, + titleTextColor: colorScheme.onSurfaceVariant, + descriptionTextColor: colorScheme.onSurfaceVariant, + magnitudeTextColor: colorScheme.onPrimaryContainer, + ), + ), + ) + .toList(), ); } } diff --git a/app/lib/feature/home/component/sheet/sheet_header.dart b/app/lib/feature/home/component/sheet/sheet_header.dart index 4fecd541..59278e2f 100644 --- a/app/lib/feature/home/component/sheet/sheet_header.dart +++ b/app/lib/feature/home/component/sheet/sheet_header.dart @@ -1,11 +1,7 @@ import 'package:flutter/material.dart'; class SheetHeader extends StatelessWidget { - const SheetHeader({ - required this.title, - super.key, - this.action, - }); + const SheetHeader({required this.title, super.key, this.action}); final String title; final Widget? action; diff --git a/app/lib/feature/home/data/model/home_configuration_model.freezed.dart b/app/lib/feature/home/data/model/home_configuration_model.freezed.dart index 85b132ed..df69c17d 100644 --- a/app/lib/feature/home/data/model/home_configuration_model.freezed.dart +++ b/app/lib/feature/home/data/model/home_configuration_model.freezed.dart @@ -12,10 +12,12 @@ part of 'home_configuration_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); HomeConfigurationModel _$HomeConfigurationModelFromJson( - Map json) { + Map json, +) { return _HomeConfigurationModel.fromJson(json); } @@ -36,16 +38,19 @@ mixin _$HomeConfigurationModel { /// @nodoc abstract class $HomeConfigurationModelCopyWith<$Res> { - factory $HomeConfigurationModelCopyWith(HomeConfigurationModel value, - $Res Function(HomeConfigurationModel) then) = - _$HomeConfigurationModelCopyWithImpl<$Res, HomeConfigurationModel>; + factory $HomeConfigurationModelCopyWith( + HomeConfigurationModel value, + $Res Function(HomeConfigurationModel) then, + ) = _$HomeConfigurationModelCopyWithImpl<$Res, HomeConfigurationModel>; @useResult $Res call({bool showLocation}); } /// @nodoc -class _$HomeConfigurationModelCopyWithImpl<$Res, - $Val extends HomeConfigurationModel> +class _$HomeConfigurationModelCopyWithImpl< + $Res, + $Val extends HomeConfigurationModel +> implements $HomeConfigurationModelCopyWith<$Res> { _$HomeConfigurationModelCopyWithImpl(this._value, this._then); @@ -58,15 +63,17 @@ class _$HomeConfigurationModelCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? showLocation = null, - }) { - return _then(_value.copyWith( - showLocation: null == showLocation - ? _value.showLocation - : showLocation // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + $Res call({Object? showLocation = null}) { + return _then( + _value.copyWith( + showLocation: + null == showLocation + ? _value.showLocation + : showLocation // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } @@ -74,9 +81,9 @@ class _$HomeConfigurationModelCopyWithImpl<$Res, abstract class _$$HomeConfigurationModelImplCopyWith<$Res> implements $HomeConfigurationModelCopyWith<$Res> { factory _$$HomeConfigurationModelImplCopyWith( - _$HomeConfigurationModelImpl value, - $Res Function(_$HomeConfigurationModelImpl) then) = - __$$HomeConfigurationModelImplCopyWithImpl<$Res>; + _$HomeConfigurationModelImpl value, + $Res Function(_$HomeConfigurationModelImpl) then, + ) = __$$HomeConfigurationModelImplCopyWithImpl<$Res>; @override @useResult $Res call({bool showLocation}); @@ -84,27 +91,28 @@ abstract class _$$HomeConfigurationModelImplCopyWith<$Res> /// @nodoc class __$$HomeConfigurationModelImplCopyWithImpl<$Res> - extends _$HomeConfigurationModelCopyWithImpl<$Res, - _$HomeConfigurationModelImpl> + extends + _$HomeConfigurationModelCopyWithImpl<$Res, _$HomeConfigurationModelImpl> implements _$$HomeConfigurationModelImplCopyWith<$Res> { __$$HomeConfigurationModelImplCopyWithImpl( - _$HomeConfigurationModelImpl _value, - $Res Function(_$HomeConfigurationModelImpl) _then) - : super(_value, _then); + _$HomeConfigurationModelImpl _value, + $Res Function(_$HomeConfigurationModelImpl) _then, + ) : super(_value, _then); /// Create a copy of HomeConfigurationModel /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? showLocation = null, - }) { - return _then(_$HomeConfigurationModelImpl( - showLocation: null == showLocation - ? _value.showLocation - : showLocation // ignore: cast_nullable_to_non_nullable - as bool, - )); + $Res call({Object? showLocation = null}) { + return _then( + _$HomeConfigurationModelImpl( + showLocation: + null == showLocation + ? _value.showLocation + : showLocation // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } @@ -145,14 +153,15 @@ class _$HomeConfigurationModelImpl implements _HomeConfigurationModel { @override @pragma('vm:prefer-inline') _$$HomeConfigurationModelImplCopyWith<_$HomeConfigurationModelImpl> - get copyWith => __$$HomeConfigurationModelImplCopyWithImpl< - _$HomeConfigurationModelImpl>(this, _$identity); + get copyWith => + __$$HomeConfigurationModelImplCopyWithImpl<_$HomeConfigurationModelImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$HomeConfigurationModelImplToJson( - this, - ); + return _$$HomeConfigurationModelImplToJson(this); } } @@ -172,5 +181,5 @@ abstract class _HomeConfigurationModel implements HomeConfigurationModel { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$HomeConfigurationModelImplCopyWith<_$HomeConfigurationModelImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/home/data/model/home_configuration_model.g.dart b/app/lib/feature/home/data/model/home_configuration_model.g.dart index f8134fc2..39ab4985 100644 --- a/app/lib/feature/home/data/model/home_configuration_model.g.dart +++ b/app/lib/feature/home/data/model/home_configuration_model.g.dart @@ -9,22 +9,22 @@ part of 'home_configuration_model.dart'; // ************************************************************************** _$HomeConfigurationModelImpl _$$HomeConfigurationModelImplFromJson( - Map json) => - $checkedCreate( - r'_$HomeConfigurationModelImpl', - json, - ($checkedConvert) { - final val = _$HomeConfigurationModelImpl( - showLocation: - $checkedConvert('show_location', (v) => v as bool? ?? false), - ); - return val; - }, - fieldKeyMap: const {'showLocation': 'show_location'}, + Map json, +) => $checkedCreate( + r'_$HomeConfigurationModelImpl', + json, + ($checkedConvert) { + final val = _$HomeConfigurationModelImpl( + showLocation: $checkedConvert( + 'show_location', + (v) => v as bool? ?? false, + ), ); + return val; + }, + fieldKeyMap: const {'showLocation': 'show_location'}, +); Map _$$HomeConfigurationModelImplToJson( - _$HomeConfigurationModelImpl instance) => - { - 'show_location': instance.showLocation, - }; + _$HomeConfigurationModelImpl instance, +) => {'show_location': instance.showLocation}; diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart index 9fcb5279..19250036 100644 --- a/app/lib/feature/home/data/notifier/home_configuration_notifier.dart +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.dart @@ -36,9 +36,8 @@ class HomeConfigurationNotifier extends _$HomeConfigurationNotifier { Future save(HomeConfigurationModel configuration) async { state = configuration; - await ref.read(sharedPreferencesProvider).setString( - _key, - jsonEncode(configuration.toJson()), - ); + await ref + .read(sharedPreferencesProvider) + .setString(_key, jsonEncode(configuration.toJson())); } } diff --git a/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart b/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart index 199925b1..e8d986dc 100644 --- a/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart +++ b/app/lib/feature/home/data/notifier/home_configuration_notifier.g.dart @@ -14,17 +14,20 @@ String _$homeConfigurationNotifierHash() => /// See also [HomeConfigurationNotifier]. @ProviderFor(HomeConfigurationNotifier) final homeConfigurationNotifierProvider = AutoDisposeNotifierProvider< - HomeConfigurationNotifier, HomeConfigurationModel>.internal( + HomeConfigurationNotifier, + HomeConfigurationModel +>.internal( HomeConfigurationNotifier.new, name: r'homeConfigurationNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$homeConfigurationNotifierHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$homeConfigurationNotifierHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$HomeConfigurationNotifier - = AutoDisposeNotifier; +typedef _$HomeConfigurationNotifier = + AutoDisposeNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/home/page/home_page.dart b/app/lib/feature/home/page/home_page.dart index fd0c59a8..917e5d8a 100644 --- a/app/lib/feature/home/page/home_page.dart +++ b/app/lib/feature/home/page/home_page.dart @@ -26,17 +26,18 @@ class HomePage extends HookConsumerWidget { Align( alignment: Alignment.centerRight, child: FloatingActionButton.small( - onPressed: () async => Navigator.of(context).push( - ModalBottomSheetRoute( - isScrollControlled: false, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16), + onPressed: + () async => Navigator.of(context).push( + ModalBottomSheetRoute( + isScrollControlled: false, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + ), + builder: (context) => const _DebugModal(), ), ), - builder: (context) => const _DebugModal(), - ), - ), child: const Icon(Icons.bug_report), ), ), @@ -66,16 +67,12 @@ class _Sheet extends StatelessWidget { final sheet = Sheet( elevation: 4, initialExtent: size.height * 0.2, - physics: const SnapSheetPhysics( - stops: [0.1, 0.2, 0.5, 0.8, 1], - ), + physics: const SnapSheetPhysics(stops: [0.1, 0.2, 0.5, 0.8, 1]), child: Material( color: colorScheme.surfaceContainer, clipBehavior: Clip.hardEdge, shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16), - ), + borderRadius: BorderRadius.vertical(top: Radius.circular(16)), ), child: Column( children: [ @@ -91,9 +88,7 @@ class _Sheet extends StatelessWidget { ), const Expanded( child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 8, - ), + padding: EdgeInsets.symmetric(horizontal: 8), child: _SheetBody(), ), ), @@ -158,12 +153,9 @@ class _ShakeDetectionList extends ConsumerWidget { return switch (shakeDetectionEvents) { AsyncData(:final value) when value.isNotEmpty => Column( - children: value - .map( - (event) => ShakeDetectionCard(event: event), - ) - .toList(), - ), + children: + value.map((event) => ShakeDetectionCard(event: event)).toList(), + ), _ => const SizedBox.shrink(), }; } @@ -175,9 +167,7 @@ class _DebugModal extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return Scaffold( - appBar: AppBar( - title: const Text('DEBUG'), - ), + appBar: AppBar(title: const Text('DEBUG')), body: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -204,39 +194,45 @@ class _DebugModal extends ConsumerWidget { magnitude: (Random().nextDouble() * 100).toInt() / 10, depth: Random().nextInt(100), originTime: DateTime.now(), - forecastMaxIntensity: JmaForecastIntensity.values[ - Random().nextInt(JmaForecastIntensity.values.length)], - regions: [ - for (final region in ref - .read(jmaCodeTableProvider) - .areaForecastLocalEew - .items) - () { - if (Random().nextDouble() > 0.8) { - return EstimatedIntensityRegion( - code: region.code, - name: region.name, - arrivalTime: null, - isPlum: false, - isWarning: false, - forecastMaxInt: ForecastMaxInt( - from: JmaForecastIntensity.one, - to: JmaForecastIntensityOver - .values[Random().nextInt( - JmaForecastIntensityOver.values.length, - )], - ), - forecastMaxLgInt: ForecastMaxLgInt( - from: JmaForecastLgIntensity.one, - to: JmaForecastLgIntensityOver - .values[Random().nextInt( - JmaForecastLgIntensityOver.values.length, - )], - ), - ); - } - }(), - ].nonNulls.toList(), + forecastMaxIntensity: + JmaForecastIntensity.values[Random().nextInt( + JmaForecastIntensity.values.length, + )], + regions: + [ + for (final region + in ref + .read(jmaCodeTableProvider) + .areaForecastLocalEew + .items) + () { + if (Random().nextDouble() > 0.8) { + return EstimatedIntensityRegion( + code: region.code, + name: region.name, + arrivalTime: null, + isPlum: false, + isWarning: false, + forecastMaxInt: ForecastMaxInt( + from: JmaForecastIntensity.one, + to: + JmaForecastIntensityOver + .values[Random().nextInt( + JmaForecastIntensityOver.values.length, + )], + ), + forecastMaxLgInt: ForecastMaxLgInt( + from: JmaForecastLgIntensity.one, + to: + JmaForecastLgIntensityOver + .values[Random().nextInt( + JmaForecastLgIntensityOver.values.length, + )], + ), + ); + } + }(), + ].nonNulls.toList(), ); print(eew.regions); ref.read(eewProvider.notifier).upsert(eew); diff --git a/app/lib/feature/information_history/page/information_history_page.dart b/app/lib/feature/information_history/page/information_history_page.dart index 26be974b..3bff729a 100644 --- a/app/lib/feature/information_history/page/information_history_page.dart +++ b/app/lib/feature/information_history/page/information_history_page.dart @@ -11,53 +11,45 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class InformationHistoryPage extends HookConsumerWidget { - const InformationHistoryPage({ - super.key, - }); + const InformationHistoryPage({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { final state = ref.watch(informationHistoryViewModelProvider); final scrollController = PrimaryScrollController.of(context); - useEffect( - () { - unawaited( - WidgetsBinding.instance.endOfFrame.then( - (_) async { - scrollController.addListener( - () => ref - .read(informationHistoryViewModelProvider.notifier) - .onScrollPositionChanged( - scrollController, - ), - ); - await ref - .read(informationHistoryViewModelProvider.notifier) - .updateIfNull(); - }, - ), - ); - return null; - }, - ); + useEffect(() { + unawaited( + WidgetsBinding.instance.endOfFrame.then((_) async { + scrollController.addListener( + () => ref + .read(informationHistoryViewModelProvider.notifier) + .onScrollPositionChanged(scrollController), + ); + await ref + .read(informationHistoryViewModelProvider.notifier) + .updateIfNull(); + }), + ); + return null; + }); final body = PrimaryScrollController( controller: scrollController, child: CustomScrollView( primary: true, slivers: [ - const SliverAppBar.medium( - title: Text('地震・津波に関するお知らせ'), - ), + const SliverAppBar.medium(title: Text('地震・津波に関するお知らせ')), switch (state) { - AsyncData(:final value) => - _InformationDataSliverListView(data: value), + AsyncData(:final value) => _InformationDataSliverListView( + data: value, + ), AsyncError(:final error) => SliverFillRemaining( - child: ErrorCard( - error: error, - onReload: () async => - ref.refresh(informationHistoryViewModelProvider), - ), + child: ErrorCard( + error: error, + onReload: + () async => + ref.refresh(informationHistoryViewModelProvider), ), + ), _ => const _LoadingSliverview(), }, ], @@ -74,9 +66,7 @@ class InformationHistoryPage extends HookConsumerWidget { } class _InformationDataSliverListView extends HookConsumerWidget { - const _InformationDataSliverListView({ - required this.data, - }); + const _InformationDataSliverListView({required this.data}); final List data; @@ -85,48 +75,43 @@ class _InformationDataSliverListView extends HookConsumerWidget { final hasNext = !data.any((e) => e.id == 1); final dateFormat = DateFormat('yyyy/MM/dd HH:mm'); return SliverList( - delegate: SliverChildBuilderDelegate( - childCount: data.length + 1, - (context, index) { - if (index == data.length) { - if (hasNext) { - return const Center( - child: Padding( - padding: EdgeInsets.all(16), - child: CircularProgressIndicator.adaptive(), - ), - ); - } else { - return const Padding( + delegate: SliverChildBuilderDelegate(childCount: data.length + 1, ( + context, + index, + ) { + if (index == data.length) { + if (hasNext) { + return const Center( + child: Padding( padding: EdgeInsets.all(16), - child: SafeArea( - top: false, - child: Text( - 'これ以上過去のお知らせはありません。', - textAlign: TextAlign.center, - ), - ), - ); - } + child: CircularProgressIndicator.adaptive(), + ), + ); + } else { + return const Padding( + padding: EdgeInsets.all(16), + child: SafeArea( + top: false, + child: Text('これ以上過去のお知らせはありません。', textAlign: TextAlign.center), + ), + ); } - final item = data[index]; - return ListTile( - title: Text(item.title.toHalfWidth), - subtitle: Text( - '${dateFormat.format(item.createdAt.toLocal())}頃発表', - ), - onTap: () async => - InformationHistoryDetailsRoute($extra: item).push( - context, - ), - tileColor: switch (item.level) { - Level.info => Colors.transparent, - Level.warning => Colors.yellow.withValues(alpha: 0.2), - Level.critical => Colors.red.withValues(alpha: 0.2), - }, - ); - }, - ), + } + final item = data[index]; + return ListTile( + title: Text(item.title.toHalfWidth), + subtitle: Text('${dateFormat.format(item.createdAt.toLocal())}頃発表'), + onTap: + () async => InformationHistoryDetailsRoute( + $extra: item, + ).push(context), + tileColor: switch (item.level) { + Level.info => Colors.transparent, + Level.warning => Colors.yellow.withValues(alpha: 0.2), + Level.critical => Colors.red.withValues(alpha: 0.2), + }, + ); + }), ); } } @@ -140,9 +125,7 @@ class _LoadingSliverview extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - 'お知らせを取得中です。', - ), + Text('お知らせを取得中です。'), Center( child: Padding( padding: EdgeInsets.all(16), diff --git a/app/lib/feature/information_history/repository/information_repository.dart b/app/lib/feature/information_history/repository/information_repository.dart index 08b2e37e..1f050018 100644 --- a/app/lib/feature/information_history/repository/information_repository.dart +++ b/app/lib/feature/information_history/repository/information_repository.dart @@ -19,11 +19,7 @@ class InformationRepository { Future> fetchInformation({ required int limit, required int offset, - }) async => - Result.capture( - () => _api.v3.getInformation( - limit: limit, - offset: offset, - ), - ); + }) async => Result.capture( + () => _api.v3.getInformation(limit: limit, offset: offset), + ); } diff --git a/app/lib/feature/information_history/repository/information_repository.g.dart b/app/lib/feature/information_history/repository/information_repository.g.dart index 16923928..78a0d1a2 100644 --- a/app/lib/feature/information_history/repository/information_repository.g.dart +++ b/app/lib/feature/information_history/repository/information_repository.g.dart @@ -16,9 +16,10 @@ String _$informationRepositoryHash() => final informationRepositoryProvider = Provider.internal( informationRepository, name: r'informationRepositoryProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$informationRepositoryHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$informationRepositoryHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/information_history/viewmodel/information_history_view_model.dart b/app/lib/feature/information_history/viewmodel/information_history_view_model.dart index 2b09e69f..12bbbbeb 100644 --- a/app/lib/feature/information_history/viewmodel/information_history_view_model.dart +++ b/app/lib/feature/information_history/viewmodel/information_history_view_model.dart @@ -11,15 +11,14 @@ class InformationHistoryViewModel extends _$InformationHistoryViewModel { @override AsyncValue>? build() => null; - Future update({ - required bool loadMore, - }) async { + Future update({required bool loadMore}) async { if (state?.isLoading ?? false) { return; } if (state != null) { - state = - const AsyncLoading>().copyWithPrevious(state!); + state = const AsyncLoading>().copyWithPrevious( + state!, + ); } else { state = const AsyncLoading>(); } @@ -28,12 +27,10 @@ class InformationHistoryViewModel extends _$InformationHistoryViewModel { .read(informationRepositoryProvider) .fetchInformation(limit: offset == 0 ? 10 : 50, offset: offset); final _ = switch (res) { - Success(:final value) => state = AsyncData([ - ...state?.valueOrNull ?? [], - ...value.items, - ]), - Failure(:final exception, :final stackTrace) => state = - AsyncError>( + Success(:final value) => + state = AsyncData([...state?.valueOrNull ?? [], ...value.items]), + Failure(:final exception, :final stackTrace) => + state = AsyncError>( exception, stackTrace ?? StackTrace.current, ).copyWithPrevious(state!), diff --git a/app/lib/feature/information_history/viewmodel/information_history_view_model.g.dart b/app/lib/feature/information_history/viewmodel/information_history_view_model.g.dart index 5fdcab0c..15ab620b 100644 --- a/app/lib/feature/information_history/viewmodel/information_history_view_model.g.dart +++ b/app/lib/feature/information_history/viewmodel/information_history_view_model.g.dart @@ -14,17 +14,20 @@ String _$informationHistoryViewModelHash() => /// See also [InformationHistoryViewModel]. @ProviderFor(InformationHistoryViewModel) final informationHistoryViewModelProvider = NotifierProvider< - InformationHistoryViewModel, AsyncValue>?>.internal( + InformationHistoryViewModel, + AsyncValue>? +>.internal( InformationHistoryViewModel.new, name: r'informationHistoryViewModelProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$informationHistoryViewModelHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$informationHistoryViewModelHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$InformationHistoryViewModel - = Notifier>?>; +typedef _$InformationHistoryViewModel = + Notifier>?>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/information_history_details/information_history_details_page.dart b/app/lib/feature/information_history_details/information_history_details_page.dart index 33427a15..491ba31f 100644 --- a/app/lib/feature/information_history_details/information_history_details_page.dart +++ b/app/lib/feature/information_history_details/information_history_details_page.dart @@ -6,10 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class InformationHistoryDetailsPage extends HookConsumerWidget { - const InformationHistoryDetailsPage({ - required this.data, - super.key, - }); + const InformationHistoryDetailsPage({required this.data, super.key}); final InformationV3 data; @@ -18,9 +15,7 @@ class InformationHistoryDetailsPage extends HookConsumerWidget { final theme = Theme.of(context); final onSecondaryContainer = theme.colorScheme.onSecondaryContainer; return Scaffold( - appBar: AppBar( - title: Text(data.title), - ), + appBar: AppBar(title: Text(data.title)), body: CustomScrollView( slivers: [ SliverToBoxAdapter( @@ -35,14 +30,12 @@ class InformationHistoryDetailsPage extends HookConsumerWidget { children: [ Row( children: [ - Icon( - Icons.info, - color: onSecondaryContainer, - ), + Icon(Icons.info, color: onSecondaryContainer), const SizedBox(width: 8), Text( - DateFormat('発表時刻: yyyy/MM/dd HH:mm頃') - .format(data.createdAt.toLocal()), + DateFormat( + '発表時刻: yyyy/MM/dd HH:mm頃', + ).format(data.createdAt.toLocal()), style: theme.textTheme.bodyMedium!.copyWith( color: onSecondaryContainer, ), @@ -52,10 +45,7 @@ class InformationHistoryDetailsPage extends HookConsumerWidget { const SizedBox(height: 8), Row( children: [ - Icon( - Icons.edit, - color: onSecondaryContainer, - ), + Icon(Icons.edit, color: onSecondaryContainer), const SizedBox(width: 8), Text( '発表機関: ${data.author.name}', diff --git a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart index 496e2362..122666c4 100644 --- a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart +++ b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.dart @@ -8,18 +8,18 @@ part 'kyoshin_monitor_dio.g.dart'; @Riverpod(keepAlive: true) Dio kyoshinMonitorDio(Ref ref) => Dio( - BaseOptions( - connectTimeout: const Duration(seconds: 2), - receiveTimeout: const Duration(seconds: 2), - sendTimeout: const Duration(seconds: 2), - headers: { - HttpHeaders.userAgentHeader: - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', - HttpHeaders.refererHeader: 'http://www.kmoni.bosai.go.jp/', - HttpHeaders.hostHeader: 'www.kmoni.bosai.go.jp', - HttpHeaders.cacheControlHeader: 'no-cache', - HttpHeaders.acceptHeader: - 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8', - }, - ), - ); + BaseOptions( + connectTimeout: const Duration(seconds: 2), + receiveTimeout: const Duration(seconds: 2), + sendTimeout: const Duration(seconds: 2), + headers: { + HttpHeaders.userAgentHeader: + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36', + HttpHeaders.refererHeader: 'http://www.kmoni.bosai.go.jp/', + HttpHeaders.hostHeader: 'www.kmoni.bosai.go.jp', + HttpHeaders.cacheControlHeader: 'no-cache', + HttpHeaders.acceptHeader: + 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8', + }, + ), +); diff --git a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.g.dart b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.g.dart index bcad90cb..3b8e29a0 100644 --- a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_dio.g.dart @@ -15,9 +15,10 @@ String _$kyoshinMonitorDioHash() => r'ae8ea88e1a74bd51d5a2216c1b22cadd68b07bb9'; final kyoshinMonitorDioProvider = Provider.internal( kyoshinMonitorDio, name: r'kyoshinMonitorDioProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorDioHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorDioHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.dart b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.dart index 19297f6e..80631e49 100644 --- a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.dart +++ b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.dart @@ -10,13 +10,14 @@ part 'kyoshin_monitor_web_api_client_provider.g.dart'; KyoshinMonitorWebApiClient kyoshinMonitorWebApiClient(Ref ref) => KyoshinMonitorWebApiClient( ref.watch(kyoshinMonitorDioProvider), - baseUrl: ref - .watch(kyoshinMonitorSettingsProvider.select((v) => v.api.endpoint)) - .url, + baseUrl: + ref + .watch( + kyoshinMonitorSettingsProvider.select((v) => v.api.endpoint), + ) + .url, ); @Riverpod(keepAlive: true) LpgmKyoshinMonitorWebApiClient lpgmKyoshinMonitorWebApiClient(Ref ref) => - LpgmKyoshinMonitorWebApiClient( - ref.watch(kyoshinMonitorDioProvider), - ); + LpgmKyoshinMonitorWebApiClient(ref.watch(kyoshinMonitorDioProvider)); diff --git a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.g.dart b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.g.dart index bcd87b66..eb90452b 100644 --- a/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/api/kyoshin_monitor_web_api_client_provider.g.dart @@ -15,14 +15,15 @@ String _$kyoshinMonitorWebApiClientHash() => @ProviderFor(kyoshinMonitorWebApiClient) final kyoshinMonitorWebApiClientProvider = Provider.internal( - kyoshinMonitorWebApiClient, - name: r'kyoshinMonitorWebApiClientProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorWebApiClientHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorWebApiClient, + name: r'kyoshinMonitorWebApiClientProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorWebApiClientHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element @@ -34,18 +35,19 @@ String _$lpgmKyoshinMonitorWebApiClientHash() => @ProviderFor(lpgmKyoshinMonitorWebApiClient) final lpgmKyoshinMonitorWebApiClientProvider = Provider.internal( - lpgmKyoshinMonitorWebApiClient, - name: r'lpgmKyoshinMonitorWebApiClientProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$lpgmKyoshinMonitorWebApiClientHash, - dependencies: null, - allTransitiveDependencies: null, -); + lpgmKyoshinMonitorWebApiClient, + name: r'lpgmKyoshinMonitorWebApiClientProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$lpgmKyoshinMonitorWebApiClientHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef LpgmKyoshinMonitorWebApiClientRef - = ProviderRef; +typedef LpgmKyoshinMonitorWebApiClientRef = + ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart index 00eb07b3..1aa609df 100644 --- a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart +++ b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.dart @@ -14,7 +14,6 @@ KyoshinMonitorWebApiDataSource kyoshinMonitorWebApiDataSource(Ref ref) => @Riverpod(keepAlive: true) LpgmKyoshinMonitorWebApiDataSource lpgmKyoshinMonitorWebApiDataSource( Ref ref, -) => - LpgmKyoshinMonitorWebApiDataSource( - client: ref.watch(lpgmKyoshinMonitorWebApiClientProvider), - ); +) => LpgmKyoshinMonitorWebApiDataSource( + client: ref.watch(lpgmKyoshinMonitorWebApiClientProvider), +); diff --git a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.g.dart b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.g.dart index 5dc0a60c..d354dcd9 100644 --- a/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/data_source/kyoshin_monitor_web_api_data_source.g.dart @@ -15,19 +15,20 @@ String _$kyoshinMonitorWebApiDataSourceHash() => @ProviderFor(kyoshinMonitorWebApiDataSource) final kyoshinMonitorWebApiDataSourceProvider = Provider.internal( - kyoshinMonitorWebApiDataSource, - name: r'kyoshinMonitorWebApiDataSourceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorWebApiDataSourceHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorWebApiDataSource, + name: r'kyoshinMonitorWebApiDataSourceProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorWebApiDataSourceHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef KyoshinMonitorWebApiDataSourceRef - = ProviderRef; +typedef KyoshinMonitorWebApiDataSourceRef = + ProviderRef; String _$lpgmKyoshinMonitorWebApiDataSourceHash() => r'b9550e9d91f4ccea757577c71731599c7c38abaf'; @@ -35,18 +36,19 @@ String _$lpgmKyoshinMonitorWebApiDataSourceHash() => @ProviderFor(lpgmKyoshinMonitorWebApiDataSource) final lpgmKyoshinMonitorWebApiDataSourceProvider = Provider.internal( - lpgmKyoshinMonitorWebApiDataSource, - name: r'lpgmKyoshinMonitorWebApiDataSourceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$lpgmKyoshinMonitorWebApiDataSourceHash, - dependencies: null, - allTransitiveDependencies: null, -); + lpgmKyoshinMonitorWebApiDataSource, + name: r'lpgmKyoshinMonitorWebApiDataSourceProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$lpgmKyoshinMonitorWebApiDataSourceHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef LpgmKyoshinMonitorWebApiDataSourceRef - = ProviderRef; +typedef LpgmKyoshinMonitorWebApiDataSourceRef = + ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart b/app/lib/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart index f536eaec..dc344b22 100644 --- a/app/lib/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart +++ b/app/lib/feature/kyoshin_monitor/data/kyoshin_color_map_data_source.dart @@ -8,8 +8,6 @@ Future> getKyoshinColorMap() async { final str = await rootBundle.loadString(Assets.kyoshinShindoColorMap); final json = jsonDecode(str) as List; return json - .map( - (e) => KyoshinColorMapModel.fromJson(e as Map), - ) + .map((e) => KyoshinColorMapModel.fromJson(e as Map)) .toList(); } diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.freezed.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.freezed.dart index b379696b..de00fbdd 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.freezed.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.freezed.dart @@ -12,7 +12,8 @@ part of 'kyoshin_color_map_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); KyoshinColorMapModel _$KyoshinColorMapModelFromJson(Map json) { return _KyoshinColorMapModel.fromJson(json); @@ -37,16 +38,19 @@ mixin _$KyoshinColorMapModel { /// @nodoc abstract class $KyoshinColorMapModelCopyWith<$Res> { - factory $KyoshinColorMapModelCopyWith(KyoshinColorMapModel value, - $Res Function(KyoshinColorMapModel) then) = - _$KyoshinColorMapModelCopyWithImpl<$Res, KyoshinColorMapModel>; + factory $KyoshinColorMapModelCopyWith( + KyoshinColorMapModel value, + $Res Function(KyoshinColorMapModel) then, + ) = _$KyoshinColorMapModelCopyWithImpl<$Res, KyoshinColorMapModel>; @useResult $Res call({double intensity, int r, int g, int b}); } /// @nodoc -class _$KyoshinColorMapModelCopyWithImpl<$Res, - $Val extends KyoshinColorMapModel> +class _$KyoshinColorMapModelCopyWithImpl< + $Res, + $Val extends KyoshinColorMapModel +> implements $KyoshinColorMapModelCopyWith<$Res> { _$KyoshinColorMapModelCopyWithImpl(this._value, this._then); @@ -65,33 +69,41 @@ class _$KyoshinColorMapModelCopyWithImpl<$Res, Object? g = null, Object? b = null, }) { - return _then(_value.copyWith( - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as double, - r: null == r - ? _value.r - : r // ignore: cast_nullable_to_non_nullable - as int, - g: null == g - ? _value.g - : g // ignore: cast_nullable_to_non_nullable - as int, - b: null == b - ? _value.b - : b // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + return _then( + _value.copyWith( + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as double, + r: + null == r + ? _value.r + : r // ignore: cast_nullable_to_non_nullable + as int, + g: + null == g + ? _value.g + : g // ignore: cast_nullable_to_non_nullable + as int, + b: + null == b + ? _value.b + : b // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); } } /// @nodoc abstract class _$$KyoshinColorMapModelImplCopyWith<$Res> implements $KyoshinColorMapModelCopyWith<$Res> { - factory _$$KyoshinColorMapModelImplCopyWith(_$KyoshinColorMapModelImpl value, - $Res Function(_$KyoshinColorMapModelImpl) then) = - __$$KyoshinColorMapModelImplCopyWithImpl<$Res>; + factory _$$KyoshinColorMapModelImplCopyWith( + _$KyoshinColorMapModelImpl value, + $Res Function(_$KyoshinColorMapModelImpl) then, + ) = __$$KyoshinColorMapModelImplCopyWithImpl<$Res>; @override @useResult $Res call({double intensity, int r, int g, int b}); @@ -101,9 +113,10 @@ abstract class _$$KyoshinColorMapModelImplCopyWith<$Res> class __$$KyoshinColorMapModelImplCopyWithImpl<$Res> extends _$KyoshinColorMapModelCopyWithImpl<$Res, _$KyoshinColorMapModelImpl> implements _$$KyoshinColorMapModelImplCopyWith<$Res> { - __$$KyoshinColorMapModelImplCopyWithImpl(_$KyoshinColorMapModelImpl _value, - $Res Function(_$KyoshinColorMapModelImpl) _then) - : super(_value, _then); + __$$KyoshinColorMapModelImplCopyWithImpl( + _$KyoshinColorMapModelImpl _value, + $Res Function(_$KyoshinColorMapModelImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinColorMapModel /// with the given fields replaced by the non-null parameter values. @@ -115,35 +128,42 @@ class __$$KyoshinColorMapModelImplCopyWithImpl<$Res> Object? g = null, Object? b = null, }) { - return _then(_$KyoshinColorMapModelImpl( - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as double, - r: null == r - ? _value.r - : r // ignore: cast_nullable_to_non_nullable - as int, - g: null == g - ? _value.g - : g // ignore: cast_nullable_to_non_nullable - as int, - b: null == b - ? _value.b - : b // ignore: cast_nullable_to_non_nullable - as int, - )); + return _then( + _$KyoshinColorMapModelImpl( + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as double, + r: + null == r + ? _value.r + : r // ignore: cast_nullable_to_non_nullable + as int, + g: + null == g + ? _value.g + : g // ignore: cast_nullable_to_non_nullable + as int, + b: + null == b + ? _value.b + : b // ignore: cast_nullable_to_non_nullable + as int, + ), + ); } } /// @nodoc @JsonSerializable() class _$KyoshinColorMapModelImpl implements _KyoshinColorMapModel { - const _$KyoshinColorMapModelImpl( - {required this.intensity, - required this.r, - required this.g, - required this.b}); + const _$KyoshinColorMapModelImpl({ + required this.intensity, + required this.r, + required this.g, + required this.b, + }); factory _$KyoshinColorMapModelImpl.fromJson(Map json) => _$$KyoshinColorMapModelImplFromJson(json); @@ -184,24 +204,25 @@ class _$KyoshinColorMapModelImpl implements _KyoshinColorMapModel { @override @pragma('vm:prefer-inline') _$$KyoshinColorMapModelImplCopyWith<_$KyoshinColorMapModelImpl> - get copyWith => - __$$KyoshinColorMapModelImplCopyWithImpl<_$KyoshinColorMapModelImpl>( - this, _$identity); + get copyWith => + __$$KyoshinColorMapModelImplCopyWithImpl<_$KyoshinColorMapModelImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$KyoshinColorMapModelImplToJson( - this, - ); + return _$$KyoshinColorMapModelImplToJson(this); } } abstract class _KyoshinColorMapModel implements KyoshinColorMapModel { - const factory _KyoshinColorMapModel( - {required final double intensity, - required final int r, - required final int g, - required final int b}) = _$KyoshinColorMapModelImpl; + const factory _KyoshinColorMapModel({ + required final double intensity, + required final int r, + required final int g, + required final int b, + }) = _$KyoshinColorMapModelImpl; factory _KyoshinColorMapModel.fromJson(Map json) = _$KyoshinColorMapModelImpl.fromJson; @@ -220,5 +241,5 @@ abstract class _KyoshinColorMapModel implements KyoshinColorMapModel { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinColorMapModelImplCopyWith<_$KyoshinColorMapModelImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.g.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.g.dart index 6cadc5ff..9c51723c 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_color_map_model.g.dart @@ -9,26 +9,22 @@ part of 'kyoshin_color_map_model.dart'; // ************************************************************************** _$KyoshinColorMapModelImpl _$$KyoshinColorMapModelImplFromJson( - Map json) => - $checkedCreate( - r'_$KyoshinColorMapModelImpl', - json, - ($checkedConvert) { - final val = _$KyoshinColorMapModelImpl( - intensity: $checkedConvert('intensity', (v) => (v as num).toDouble()), - r: $checkedConvert('r', (v) => (v as num).toInt()), - g: $checkedConvert('g', (v) => (v as num).toInt()), - b: $checkedConvert('b', (v) => (v as num).toInt()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$KyoshinColorMapModelImpl', json, ($checkedConvert) { + final val = _$KyoshinColorMapModelImpl( + intensity: $checkedConvert('intensity', (v) => (v as num).toDouble()), + r: $checkedConvert('r', (v) => (v as num).toInt()), + g: $checkedConvert('g', (v) => (v as num).toInt()), + b: $checkedConvert('b', (v) => (v as num).toInt()), + ); + return val; +}); Map _$$KyoshinColorMapModelImplToJson( - _$KyoshinColorMapModelImpl instance) => - { - 'intensity': instance.intensity, - 'r': instance.r, - 'g': instance.g, - 'b': instance.b, - }; + _$KyoshinColorMapModelImpl instance, +) => { + 'intensity': instance.intensity, + 'r': instance.r, + 'g': instance.g, + 'b': instance.b, +}; diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart index 20c9106d..5d3225ae 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.dart @@ -40,9 +40,7 @@ class KyoshinMonitorSettingsApiModel with _$KyoshinMonitorSettingsApiModel { const factory KyoshinMonitorSettingsApiModel({ /// 強震モニタ APIのベースURL @Default(KyoshinMonitorEndpoint.kmoni) - @JsonKey( - unknownEnumValue: KyoshinMonitorEndpoint.kmoni, - ) + @JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) KyoshinMonitorEndpoint endpoint, /// 画像取得頻度 @@ -64,8 +62,7 @@ class KyoshinMonitorSettingsApiModel with _$KyoshinMonitorSettingsApiModel { @JsonEnum(valueField: 'url') enum KyoshinMonitorEndpoint { kmoni('http://www.kmoni.bosai.go.jp'), - lmoniexp('https://smi.lmoniexp.bosai.go.jp'), - ; + lmoniexp('https://smi.lmoniexp.bosai.go.jp'); const KyoshinMonitorEndpoint(this.url); @@ -81,5 +78,4 @@ enum KyoshinMonitorMarkerType { /// 常に枠を表示しない never, - ; } diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart index cca06c22..9ccf7a60 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.freezed.dart @@ -12,10 +12,12 @@ part of 'kyoshin_monitor_settings_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); KyoshinMonitorSettingsModel _$KyoshinMonitorSettingsModelFromJson( - Map json) { + Map json, +) { return _KyoshinMonitorSettingsModel.fromJson(json); } @@ -50,32 +52,38 @@ mixin _$KyoshinMonitorSettingsModel { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorSettingsModelCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorSettingsModelCopyWith<$Res> { factory $KyoshinMonitorSettingsModelCopyWith( - KyoshinMonitorSettingsModel value, - $Res Function(KyoshinMonitorSettingsModel) then) = - _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, - KyoshinMonitorSettingsModel>; + KyoshinMonitorSettingsModel value, + $Res Function(KyoshinMonitorSettingsModel) then, + ) = + _$KyoshinMonitorSettingsModelCopyWithImpl< + $Res, + KyoshinMonitorSettingsModel + >; @useResult - $Res call( - {double? minRealtimeShindo, - bool showScale, - bool useKmoni, - KyoshinMonitorMarkerType kmoniMarkerType, - RealtimeDataType realtimeDataType, - RealtimeLayer realtimeLayer, - KyoshinMonitorSettingsApiModel api}); + $Res call({ + double? minRealtimeShindo, + bool showScale, + bool useKmoni, + KyoshinMonitorMarkerType kmoniMarkerType, + RealtimeDataType realtimeDataType, + RealtimeLayer realtimeLayer, + KyoshinMonitorSettingsApiModel api, + }); $KyoshinMonitorSettingsApiModelCopyWith<$Res> get api; } /// @nodoc -class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, - $Val extends KyoshinMonitorSettingsModel> +class _$KyoshinMonitorSettingsModelCopyWithImpl< + $Res, + $Val extends KyoshinMonitorSettingsModel +> implements $KyoshinMonitorSettingsModelCopyWith<$Res> { _$KyoshinMonitorSettingsModelCopyWithImpl(this._value, this._then); @@ -97,36 +105,46 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, Object? realtimeLayer = null, Object? api = null, }) { - return _then(_value.copyWith( - minRealtimeShindo: freezed == minRealtimeShindo - ? _value.minRealtimeShindo - : minRealtimeShindo // ignore: cast_nullable_to_non_nullable - as double?, - showScale: null == showScale - ? _value.showScale - : showScale // ignore: cast_nullable_to_non_nullable - as bool, - useKmoni: null == useKmoni - ? _value.useKmoni - : useKmoni // ignore: cast_nullable_to_non_nullable - as bool, - kmoniMarkerType: null == kmoniMarkerType - ? _value.kmoniMarkerType - : kmoniMarkerType // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorMarkerType, - realtimeDataType: null == realtimeDataType - ? _value.realtimeDataType - : realtimeDataType // ignore: cast_nullable_to_non_nullable - as RealtimeDataType, - realtimeLayer: null == realtimeLayer - ? _value.realtimeLayer - : realtimeLayer // ignore: cast_nullable_to_non_nullable - as RealtimeLayer, - api: null == api - ? _value.api - : api // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorSettingsApiModel, - ) as $Val); + return _then( + _value.copyWith( + minRealtimeShindo: + freezed == minRealtimeShindo + ? _value.minRealtimeShindo + : minRealtimeShindo // ignore: cast_nullable_to_non_nullable + as double?, + showScale: + null == showScale + ? _value.showScale + : showScale // ignore: cast_nullable_to_non_nullable + as bool, + useKmoni: + null == useKmoni + ? _value.useKmoni + : useKmoni // ignore: cast_nullable_to_non_nullable + as bool, + kmoniMarkerType: + null == kmoniMarkerType + ? _value.kmoniMarkerType + : kmoniMarkerType // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorMarkerType, + realtimeDataType: + null == realtimeDataType + ? _value.realtimeDataType + : realtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType, + realtimeLayer: + null == realtimeLayer + ? _value.realtimeLayer + : realtimeLayer // ignore: cast_nullable_to_non_nullable + as RealtimeLayer, + api: + null == api + ? _value.api + : api // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorSettingsApiModel, + ) + as $Val, + ); } /// Create a copy of KyoshinMonitorSettingsModel @@ -144,19 +162,20 @@ class _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, abstract class _$$KyoshinMonitorSettingsModelImplCopyWith<$Res> implements $KyoshinMonitorSettingsModelCopyWith<$Res> { factory _$$KyoshinMonitorSettingsModelImplCopyWith( - _$KyoshinMonitorSettingsModelImpl value, - $Res Function(_$KyoshinMonitorSettingsModelImpl) then) = - __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res>; + _$KyoshinMonitorSettingsModelImpl value, + $Res Function(_$KyoshinMonitorSettingsModelImpl) then, + ) = __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {double? minRealtimeShindo, - bool showScale, - bool useKmoni, - KyoshinMonitorMarkerType kmoniMarkerType, - RealtimeDataType realtimeDataType, - RealtimeLayer realtimeLayer, - KyoshinMonitorSettingsApiModel api}); + $Res call({ + double? minRealtimeShindo, + bool showScale, + bool useKmoni, + KyoshinMonitorMarkerType kmoniMarkerType, + RealtimeDataType realtimeDataType, + RealtimeLayer realtimeLayer, + KyoshinMonitorSettingsApiModel api, + }); @override $KyoshinMonitorSettingsApiModelCopyWith<$Res> get api; @@ -164,13 +183,16 @@ abstract class _$$KyoshinMonitorSettingsModelImplCopyWith<$Res> /// @nodoc class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> - extends _$KyoshinMonitorSettingsModelCopyWithImpl<$Res, - _$KyoshinMonitorSettingsModelImpl> + extends + _$KyoshinMonitorSettingsModelCopyWithImpl< + $Res, + _$KyoshinMonitorSettingsModelImpl + > implements _$$KyoshinMonitorSettingsModelImplCopyWith<$Res> { __$$KyoshinMonitorSettingsModelImplCopyWithImpl( - _$KyoshinMonitorSettingsModelImpl _value, - $Res Function(_$KyoshinMonitorSettingsModelImpl) _then) - : super(_value, _then); + _$KyoshinMonitorSettingsModelImpl _value, + $Res Function(_$KyoshinMonitorSettingsModelImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -185,36 +207,45 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> Object? realtimeLayer = null, Object? api = null, }) { - return _then(_$KyoshinMonitorSettingsModelImpl( - minRealtimeShindo: freezed == minRealtimeShindo - ? _value.minRealtimeShindo - : minRealtimeShindo // ignore: cast_nullable_to_non_nullable - as double?, - showScale: null == showScale - ? _value.showScale - : showScale // ignore: cast_nullable_to_non_nullable - as bool, - useKmoni: null == useKmoni - ? _value.useKmoni - : useKmoni // ignore: cast_nullable_to_non_nullable - as bool, - kmoniMarkerType: null == kmoniMarkerType - ? _value.kmoniMarkerType - : kmoniMarkerType // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorMarkerType, - realtimeDataType: null == realtimeDataType - ? _value.realtimeDataType - : realtimeDataType // ignore: cast_nullable_to_non_nullable - as RealtimeDataType, - realtimeLayer: null == realtimeLayer - ? _value.realtimeLayer - : realtimeLayer // ignore: cast_nullable_to_non_nullable - as RealtimeLayer, - api: null == api - ? _value.api - : api // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorSettingsApiModel, - )); + return _then( + _$KyoshinMonitorSettingsModelImpl( + minRealtimeShindo: + freezed == minRealtimeShindo + ? _value.minRealtimeShindo + : minRealtimeShindo // ignore: cast_nullable_to_non_nullable + as double?, + showScale: + null == showScale + ? _value.showScale + : showScale // ignore: cast_nullable_to_non_nullable + as bool, + useKmoni: + null == useKmoni + ? _value.useKmoni + : useKmoni // ignore: cast_nullable_to_non_nullable + as bool, + kmoniMarkerType: + null == kmoniMarkerType + ? _value.kmoniMarkerType + : kmoniMarkerType // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorMarkerType, + realtimeDataType: + null == realtimeDataType + ? _value.realtimeDataType + : realtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType, + realtimeLayer: + null == realtimeLayer + ? _value.realtimeLayer + : realtimeLayer // ignore: cast_nullable_to_non_nullable + as RealtimeLayer, + api: + null == api + ? _value.api + : api // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorSettingsApiModel, + ), + ); } } @@ -222,18 +253,19 @@ class __$$KyoshinMonitorSettingsModelImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorSettingsModelImpl implements _KyoshinMonitorSettingsModel { - const _$KyoshinMonitorSettingsModelImpl( - {this.minRealtimeShindo = null, - this.showScale = true, - this.useKmoni = true, - this.kmoniMarkerType = KyoshinMonitorMarkerType.onlyEew, - this.realtimeDataType = RealtimeDataType.shindo, - this.realtimeLayer = RealtimeLayer.surface, - this.api = const KyoshinMonitorSettingsApiModel()}); + const _$KyoshinMonitorSettingsModelImpl({ + this.minRealtimeShindo = null, + this.showScale = true, + this.useKmoni = true, + this.kmoniMarkerType = KyoshinMonitorMarkerType.onlyEew, + this.realtimeDataType = RealtimeDataType.shindo, + this.realtimeLayer = RealtimeLayer.surface, + this.api = const KyoshinMonitorSettingsApiModel(), + }); factory _$KyoshinMonitorSettingsModelImpl.fromJson( - Map json) => - _$$KyoshinMonitorSettingsModelImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorSettingsModelImplFromJson(json); /// 強震モニタの表示最低リアルタイム震度 @override @@ -297,8 +329,16 @@ class _$KyoshinMonitorSettingsModelImpl @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, minRealtimeShindo, showScale, - useKmoni, kmoniMarkerType, realtimeDataType, realtimeLayer, api); + int get hashCode => Object.hash( + runtimeType, + minRealtimeShindo, + showScale, + useKmoni, + kmoniMarkerType, + realtimeDataType, + realtimeLayer, + api, + ); /// Create a copy of KyoshinMonitorSettingsModel /// with the given fields replaced by the non-null parameter values. @@ -306,28 +346,27 @@ class _$KyoshinMonitorSettingsModelImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorSettingsModelImplCopyWith<_$KyoshinMonitorSettingsModelImpl> - get copyWith => __$$KyoshinMonitorSettingsModelImplCopyWithImpl< - _$KyoshinMonitorSettingsModelImpl>(this, _$identity); + get copyWith => __$$KyoshinMonitorSettingsModelImplCopyWithImpl< + _$KyoshinMonitorSettingsModelImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorSettingsModelImplToJson( - this, - ); + return _$$KyoshinMonitorSettingsModelImplToJson(this); } } abstract class _KyoshinMonitorSettingsModel implements KyoshinMonitorSettingsModel { - const factory _KyoshinMonitorSettingsModel( - {final double? minRealtimeShindo, - final bool showScale, - final bool useKmoni, - final KyoshinMonitorMarkerType kmoniMarkerType, - final RealtimeDataType realtimeDataType, - final RealtimeLayer realtimeLayer, - final KyoshinMonitorSettingsApiModel api}) = - _$KyoshinMonitorSettingsModelImpl; + const factory _KyoshinMonitorSettingsModel({ + final double? minRealtimeShindo, + final bool showScale, + final bool useKmoni, + final KyoshinMonitorMarkerType kmoniMarkerType, + final RealtimeDataType realtimeDataType, + final RealtimeLayer realtimeLayer, + final KyoshinMonitorSettingsApiModel api, + }) = _$KyoshinMonitorSettingsModelImpl; factory _KyoshinMonitorSettingsModel.fromJson(Map json) = _$KyoshinMonitorSettingsModelImpl.fromJson; @@ -365,11 +404,12 @@ abstract class _KyoshinMonitorSettingsModel @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorSettingsModelImplCopyWith<_$KyoshinMonitorSettingsModelImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } KyoshinMonitorSettingsApiModel _$KyoshinMonitorSettingsApiModelFromJson( - Map json) { + Map json, +) { return _KyoshinMonitorSettingsApiModel.fromJson(json); } @@ -380,8 +420,10 @@ mixin _$KyoshinMonitorSettingsApiModel { KyoshinMonitorEndpoint get endpoint => throw _privateConstructorUsedError; /// 画像取得頻度 - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) Duration get imageFetchInterval => throw _privateConstructorUsedError; /// 遅延調整間隔 @@ -394,29 +436,37 @@ mixin _$KyoshinMonitorSettingsApiModel { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorSettingsApiModelCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorSettingsApiModelCopyWith<$Res> { factory $KyoshinMonitorSettingsApiModelCopyWith( - KyoshinMonitorSettingsApiModel value, - $Res Function(KyoshinMonitorSettingsApiModel) then) = - _$KyoshinMonitorSettingsApiModelCopyWithImpl<$Res, - KyoshinMonitorSettingsApiModel>; + KyoshinMonitorSettingsApiModel value, + $Res Function(KyoshinMonitorSettingsApiModel) then, + ) = + _$KyoshinMonitorSettingsApiModelCopyWithImpl< + $Res, + KyoshinMonitorSettingsApiModel + >; @useResult - $Res call( - {@JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) - KyoshinMonitorEndpoint endpoint, - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') - Duration imageFetchInterval, - Duration delayAdjustInterval}); + $Res call({ + @JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) + KyoshinMonitorEndpoint endpoint, + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) + Duration imageFetchInterval, + Duration delayAdjustInterval, + }); } /// @nodoc -class _$KyoshinMonitorSettingsApiModelCopyWithImpl<$Res, - $Val extends KyoshinMonitorSettingsApiModel> +class _$KyoshinMonitorSettingsApiModelCopyWithImpl< + $Res, + $Val extends KyoshinMonitorSettingsApiModel +> implements $KyoshinMonitorSettingsApiModelCopyWith<$Res> { _$KyoshinMonitorSettingsApiModelCopyWithImpl(this._value, this._then); @@ -434,20 +484,26 @@ class _$KyoshinMonitorSettingsApiModelCopyWithImpl<$Res, Object? imageFetchInterval = null, Object? delayAdjustInterval = null, }) { - return _then(_value.copyWith( - endpoint: null == endpoint - ? _value.endpoint - : endpoint // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorEndpoint, - imageFetchInterval: null == imageFetchInterval - ? _value.imageFetchInterval - : imageFetchInterval // ignore: cast_nullable_to_non_nullable - as Duration, - delayAdjustInterval: null == delayAdjustInterval - ? _value.delayAdjustInterval - : delayAdjustInterval // ignore: cast_nullable_to_non_nullable - as Duration, - ) as $Val); + return _then( + _value.copyWith( + endpoint: + null == endpoint + ? _value.endpoint + : endpoint // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorEndpoint, + imageFetchInterval: + null == imageFetchInterval + ? _value.imageFetchInterval + : imageFetchInterval // ignore: cast_nullable_to_non_nullable + as Duration, + delayAdjustInterval: + null == delayAdjustInterval + ? _value.delayAdjustInterval + : delayAdjustInterval // ignore: cast_nullable_to_non_nullable + as Duration, + ) + as $Val, + ); } } @@ -455,29 +511,35 @@ class _$KyoshinMonitorSettingsApiModelCopyWithImpl<$Res, abstract class _$$KyoshinMonitorSettingsApiModelImplCopyWith<$Res> implements $KyoshinMonitorSettingsApiModelCopyWith<$Res> { factory _$$KyoshinMonitorSettingsApiModelImplCopyWith( - _$KyoshinMonitorSettingsApiModelImpl value, - $Res Function(_$KyoshinMonitorSettingsApiModelImpl) then) = - __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl<$Res>; + _$KyoshinMonitorSettingsApiModelImpl value, + $Res Function(_$KyoshinMonitorSettingsApiModelImpl) then, + ) = __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) - KyoshinMonitorEndpoint endpoint, - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') - Duration imageFetchInterval, - Duration delayAdjustInterval}); + $Res call({ + @JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) + KyoshinMonitorEndpoint endpoint, + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) + Duration imageFetchInterval, + Duration delayAdjustInterval, + }); } /// @nodoc class __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl<$Res> - extends _$KyoshinMonitorSettingsApiModelCopyWithImpl<$Res, - _$KyoshinMonitorSettingsApiModelImpl> + extends + _$KyoshinMonitorSettingsApiModelCopyWithImpl< + $Res, + _$KyoshinMonitorSettingsApiModelImpl + > implements _$$KyoshinMonitorSettingsApiModelImplCopyWith<$Res> { __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl( - _$KyoshinMonitorSettingsApiModelImpl _value, - $Res Function(_$KyoshinMonitorSettingsApiModelImpl) _then) - : super(_value, _then); + _$KyoshinMonitorSettingsApiModelImpl _value, + $Res Function(_$KyoshinMonitorSettingsApiModelImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorSettingsApiModel /// with the given fields replaced by the non-null parameter values. @@ -488,20 +550,25 @@ class __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl<$Res> Object? imageFetchInterval = null, Object? delayAdjustInterval = null, }) { - return _then(_$KyoshinMonitorSettingsApiModelImpl( - endpoint: null == endpoint - ? _value.endpoint - : endpoint // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorEndpoint, - imageFetchInterval: null == imageFetchInterval - ? _value.imageFetchInterval - : imageFetchInterval // ignore: cast_nullable_to_non_nullable - as Duration, - delayAdjustInterval: null == delayAdjustInterval - ? _value.delayAdjustInterval - : delayAdjustInterval // ignore: cast_nullable_to_non_nullable - as Duration, - )); + return _then( + _$KyoshinMonitorSettingsApiModelImpl( + endpoint: + null == endpoint + ? _value.endpoint + : endpoint // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorEndpoint, + imageFetchInterval: + null == imageFetchInterval + ? _value.imageFetchInterval + : imageFetchInterval // ignore: cast_nullable_to_non_nullable + as Duration, + delayAdjustInterval: + null == delayAdjustInterval + ? _value.delayAdjustInterval + : delayAdjustInterval // ignore: cast_nullable_to_non_nullable + as Duration, + ), + ); } } @@ -509,17 +576,20 @@ class __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorSettingsApiModelImpl implements _KyoshinMonitorSettingsApiModel { - const _$KyoshinMonitorSettingsApiModelImpl( - {@JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) - this.endpoint = KyoshinMonitorEndpoint.kmoni, - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') - this.imageFetchInterval = const Duration(seconds: 1), - this.delayAdjustInterval = const Duration(minutes: 10)}); + const _$KyoshinMonitorSettingsApiModelImpl({ + @JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) + this.endpoint = KyoshinMonitorEndpoint.kmoni, + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) + this.imageFetchInterval = const Duration(seconds: 1), + this.delayAdjustInterval = const Duration(minutes: 10), + }); factory _$KyoshinMonitorSettingsApiModelImpl.fromJson( - Map json) => - _$$KyoshinMonitorSettingsApiModelImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorSettingsApiModelImplFromJson(json); /// 強震モニタ APIのベースURL @override @@ -529,8 +599,10 @@ class _$KyoshinMonitorSettingsApiModelImpl /// 画像取得頻度 @override @JsonKey() - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) final Duration imageFetchInterval; /// 遅延調整間隔 @@ -559,7 +631,11 @@ class _$KyoshinMonitorSettingsApiModelImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, endpoint, imageFetchInterval, delayAdjustInterval); + runtimeType, + endpoint, + imageFetchInterval, + delayAdjustInterval, + ); /// Create a copy of KyoshinMonitorSettingsApiModel /// with the given fields replaced by the non-null parameter values. @@ -567,28 +643,30 @@ class _$KyoshinMonitorSettingsApiModelImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorSettingsApiModelImplCopyWith< - _$KyoshinMonitorSettingsApiModelImpl> - get copyWith => __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl< - _$KyoshinMonitorSettingsApiModelImpl>(this, _$identity); + _$KyoshinMonitorSettingsApiModelImpl + > + get copyWith => __$$KyoshinMonitorSettingsApiModelImplCopyWithImpl< + _$KyoshinMonitorSettingsApiModelImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorSettingsApiModelImplToJson( - this, - ); + return _$$KyoshinMonitorSettingsApiModelImplToJson(this); } } abstract class _KyoshinMonitorSettingsApiModel implements KyoshinMonitorSettingsApiModel { - const factory _KyoshinMonitorSettingsApiModel( - {@JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) - final KyoshinMonitorEndpoint endpoint, - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') - final Duration imageFetchInterval, - final Duration delayAdjustInterval}) = - _$KyoshinMonitorSettingsApiModelImpl; + const factory _KyoshinMonitorSettingsApiModel({ + @JsonKey(unknownEnumValue: KyoshinMonitorEndpoint.kmoni) + final KyoshinMonitorEndpoint endpoint, + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) + final Duration imageFetchInterval, + final Duration delayAdjustInterval, + }) = _$KyoshinMonitorSettingsApiModelImpl; factory _KyoshinMonitorSettingsApiModel.fromJson(Map json) = _$KyoshinMonitorSettingsApiModelImpl.fromJson; @@ -600,8 +678,10 @@ abstract class _KyoshinMonitorSettingsApiModel /// 画像取得頻度 @override - @Assert('imageFetchInterval.inSeconds > 1', - 'imageFetchInterval must be greater than 1 second') + @Assert( + 'imageFetchInterval.inSeconds > 1', + 'imageFetchInterval must be greater than 1 second', + ) Duration get imageFetchInterval; /// 遅延調整間隔 @@ -613,6 +693,7 @@ abstract class _KyoshinMonitorSettingsApiModel @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorSettingsApiModelImplCopyWith< - _$KyoshinMonitorSettingsApiModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorSettingsApiModelImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart index b048b423..726ca4e8 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_settings_model.g.dart @@ -9,63 +9,70 @@ part of 'kyoshin_monitor_settings_model.dart'; // ************************************************************************** _$KyoshinMonitorSettingsModelImpl _$$KyoshinMonitorSettingsModelImplFromJson( - Map json) => - $checkedCreate( - r'_$KyoshinMonitorSettingsModelImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorSettingsModelImpl( - minRealtimeShindo: $checkedConvert( - 'min_realtime_shindo', (v) => (v as num?)?.toDouble() ?? null), - showScale: $checkedConvert('show_scale', (v) => v as bool? ?? true), - useKmoni: $checkedConvert('use_kmoni', (v) => v as bool? ?? true), - kmoniMarkerType: $checkedConvert( - 'kmoni_marker_type', - (v) => - $enumDecodeNullable(_$KyoshinMonitorMarkerTypeEnumMap, v) ?? - KyoshinMonitorMarkerType.onlyEew), - realtimeDataType: $checkedConvert( - 'realtime_data_type', - (v) => - $enumDecodeNullable(_$RealtimeDataTypeEnumMap, v) ?? - RealtimeDataType.shindo), - realtimeLayer: $checkedConvert( - 'realtime_layer', - (v) => - $enumDecodeNullable(_$RealtimeLayerEnumMap, v) ?? - RealtimeLayer.surface), - api: $checkedConvert( - 'api', - (v) => v == null - ? const KyoshinMonitorSettingsApiModel() - : KyoshinMonitorSettingsApiModel.fromJson( - v as Map)), - ); - return val; - }, - fieldKeyMap: const { - 'minRealtimeShindo': 'min_realtime_shindo', - 'showScale': 'show_scale', - 'useKmoni': 'use_kmoni', - 'kmoniMarkerType': 'kmoni_marker_type', - 'realtimeDataType': 'realtime_data_type', - 'realtimeLayer': 'realtime_layer' - }, + Map json, +) => $checkedCreate( + r'_$KyoshinMonitorSettingsModelImpl', + json, + ($checkedConvert) { + final val = _$KyoshinMonitorSettingsModelImpl( + minRealtimeShindo: $checkedConvert( + 'min_realtime_shindo', + (v) => (v as num?)?.toDouble() ?? null, + ), + showScale: $checkedConvert('show_scale', (v) => v as bool? ?? true), + useKmoni: $checkedConvert('use_kmoni', (v) => v as bool? ?? true), + kmoniMarkerType: $checkedConvert( + 'kmoni_marker_type', + (v) => + $enumDecodeNullable(_$KyoshinMonitorMarkerTypeEnumMap, v) ?? + KyoshinMonitorMarkerType.onlyEew, + ), + realtimeDataType: $checkedConvert( + 'realtime_data_type', + (v) => + $enumDecodeNullable(_$RealtimeDataTypeEnumMap, v) ?? + RealtimeDataType.shindo, + ), + realtimeLayer: $checkedConvert( + 'realtime_layer', + (v) => + $enumDecodeNullable(_$RealtimeLayerEnumMap, v) ?? + RealtimeLayer.surface, + ), + api: $checkedConvert( + 'api', + (v) => + v == null + ? const KyoshinMonitorSettingsApiModel() + : KyoshinMonitorSettingsApiModel.fromJson( + v as Map, + ), + ), ); + return val; + }, + fieldKeyMap: const { + 'minRealtimeShindo': 'min_realtime_shindo', + 'showScale': 'show_scale', + 'useKmoni': 'use_kmoni', + 'kmoniMarkerType': 'kmoni_marker_type', + 'realtimeDataType': 'realtime_data_type', + 'realtimeLayer': 'realtime_layer', + }, +); Map _$$KyoshinMonitorSettingsModelImplToJson( - _$KyoshinMonitorSettingsModelImpl instance) => - { - 'min_realtime_shindo': instance.minRealtimeShindo, - 'show_scale': instance.showScale, - 'use_kmoni': instance.useKmoni, - 'kmoni_marker_type': - _$KyoshinMonitorMarkerTypeEnumMap[instance.kmoniMarkerType]!, - 'realtime_data_type': - _$RealtimeDataTypeEnumMap[instance.realtimeDataType]!, - 'realtime_layer': _$RealtimeLayerEnumMap[instance.realtimeLayer]!, - 'api': instance.api, - }; + _$KyoshinMonitorSettingsModelImpl instance, +) => { + 'min_realtime_shindo': instance.minRealtimeShindo, + 'show_scale': instance.showScale, + 'use_kmoni': instance.useKmoni, + 'kmoni_marker_type': + _$KyoshinMonitorMarkerTypeEnumMap[instance.kmoniMarkerType]!, + 'realtime_data_type': _$RealtimeDataTypeEnumMap[instance.realtimeDataType]!, + 'realtime_layer': _$RealtimeLayerEnumMap[instance.realtimeLayer]!, + 'api': instance.api, +}; const _$KyoshinMonitorMarkerTypeEnumMap = { KyoshinMonitorMarkerType.always: 'always', @@ -100,44 +107,52 @@ const _$RealtimeLayerEnumMap = { }; _$KyoshinMonitorSettingsApiModelImpl - _$$KyoshinMonitorSettingsApiModelImplFromJson(Map json) => - $checkedCreate( - r'_$KyoshinMonitorSettingsApiModelImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorSettingsApiModelImpl( - endpoint: $checkedConvert( - 'endpoint', - (v) => - $enumDecodeNullable(_$KyoshinMonitorEndpointEnumMap, v, - unknownValue: KyoshinMonitorEndpoint.kmoni) ?? - KyoshinMonitorEndpoint.kmoni), - imageFetchInterval: $checkedConvert( - 'image_fetch_interval', - (v) => v == null - ? const Duration(seconds: 1) - : Duration(microseconds: (v as num).toInt())), - delayAdjustInterval: $checkedConvert( - 'delay_adjust_interval', - (v) => v == null - ? const Duration(minutes: 10) - : Duration(microseconds: (v as num).toInt())), - ); - return val; - }, - fieldKeyMap: const { - 'imageFetchInterval': 'image_fetch_interval', - 'delayAdjustInterval': 'delay_adjust_interval' - }, +_$$KyoshinMonitorSettingsApiModelImplFromJson(Map json) => + $checkedCreate( + r'_$KyoshinMonitorSettingsApiModelImpl', + json, + ($checkedConvert) { + final val = _$KyoshinMonitorSettingsApiModelImpl( + endpoint: $checkedConvert( + 'endpoint', + (v) => + $enumDecodeNullable( + _$KyoshinMonitorEndpointEnumMap, + v, + unknownValue: KyoshinMonitorEndpoint.kmoni, + ) ?? + KyoshinMonitorEndpoint.kmoni, + ), + imageFetchInterval: $checkedConvert( + 'image_fetch_interval', + (v) => + v == null + ? const Duration(seconds: 1) + : Duration(microseconds: (v as num).toInt()), + ), + delayAdjustInterval: $checkedConvert( + 'delay_adjust_interval', + (v) => + v == null + ? const Duration(minutes: 10) + : Duration(microseconds: (v as num).toInt()), + ), ); + return val; + }, + fieldKeyMap: const { + 'imageFetchInterval': 'image_fetch_interval', + 'delayAdjustInterval': 'delay_adjust_interval', + }, + ); Map _$$KyoshinMonitorSettingsApiModelImplToJson( - _$KyoshinMonitorSettingsApiModelImpl instance) => - { - 'endpoint': _$KyoshinMonitorEndpointEnumMap[instance.endpoint]!, - 'image_fetch_interval': instance.imageFetchInterval.inMicroseconds, - 'delay_adjust_interval': instance.delayAdjustInterval.inMicroseconds, - }; + _$KyoshinMonitorSettingsApiModelImpl instance, +) => { + 'endpoint': _$KyoshinMonitorEndpointEnumMap[instance.endpoint]!, + 'image_fetch_interval': instance.imageFetchInterval.inMicroseconds, + 'delay_adjust_interval': instance.delayAdjustInterval.inMicroseconds, +}; const _$KyoshinMonitorEndpointEnumMap = { KyoshinMonitorEndpoint.kmoni: 'http://www.kmoni.bosai.go.jp', diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart index 1207b1e4..ef9de7ec 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.dart @@ -40,7 +40,6 @@ enum KyoshinMonitorStatus { // 初期化中 initializing, - ; } @freezed @@ -57,16 +56,13 @@ class KyoshinMonitorImageParseObservationPoint factory KyoshinMonitorImageParseObservationPoint.fromJson( Map json, - ) => - _$KyoshinMonitorImageParseObservationPointFromJson(json); + ) => _$KyoshinMonitorImageParseObservationPointFromJson(json); } Map _kyoshinObservationPointToJson( KyoshinObservationPoint point, -) => - point.writeToJsonMap(); +) => point.writeToJsonMap(); KyoshinObservationPoint _kyoshinObservationPointFromJson( Map json, -) => - KyoshinObservationPoint.fromJson(jsonEncode(json)); +) => KyoshinObservationPoint.fromJson(jsonEncode(json)); diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.freezed.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.freezed.dart index 82fd80ca..98c9348b 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.freezed.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.freezed.dart @@ -12,7 +12,8 @@ part of 'kyoshin_monitor_state.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); KyoshinMonitorState _$KyoshinMonitorStateFromJson(Map json) { return _KyoshinMonitorState.fromJson(json); @@ -44,18 +45,20 @@ mixin _$KyoshinMonitorState { /// @nodoc abstract class $KyoshinMonitorStateCopyWith<$Res> { factory $KyoshinMonitorStateCopyWith( - KyoshinMonitorState value, $Res Function(KyoshinMonitorState) then) = - _$KyoshinMonitorStateCopyWithImpl<$Res, KyoshinMonitorState>; + KyoshinMonitorState value, + $Res Function(KyoshinMonitorState) then, + ) = _$KyoshinMonitorStateCopyWithImpl<$Res, KyoshinMonitorState>; @useResult - $Res call( - {RealtimeDataType? currentRealtimeDataType, - RealtimeLayer? currentRealtimeLayer, - KyoshinMonitorStatus status, - DateTime? lastUpdatedAt, - DateTime? lastImageFetchTargetTime, - Duration? lastImageFetchDuration, - List? analyzedPoints, - List? currentImageRaw}); + $Res call({ + RealtimeDataType? currentRealtimeDataType, + RealtimeLayer? currentRealtimeLayer, + KyoshinMonitorStatus status, + DateTime? lastUpdatedAt, + DateTime? lastImageFetchTargetTime, + Duration? lastImageFetchDuration, + List? analyzedPoints, + List? currentImageRaw, + }); } /// @nodoc @@ -82,69 +85,83 @@ class _$KyoshinMonitorStateCopyWithImpl<$Res, $Val extends KyoshinMonitorState> Object? analyzedPoints = freezed, Object? currentImageRaw = freezed, }) { - return _then(_value.copyWith( - currentRealtimeDataType: freezed == currentRealtimeDataType - ? _value.currentRealtimeDataType - : currentRealtimeDataType // ignore: cast_nullable_to_non_nullable - as RealtimeDataType?, - currentRealtimeLayer: freezed == currentRealtimeLayer - ? _value.currentRealtimeLayer - : currentRealtimeLayer // ignore: cast_nullable_to_non_nullable - as RealtimeLayer?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorStatus, - lastUpdatedAt: freezed == lastUpdatedAt - ? _value.lastUpdatedAt - : lastUpdatedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - lastImageFetchTargetTime: freezed == lastImageFetchTargetTime - ? _value.lastImageFetchTargetTime - : lastImageFetchTargetTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - lastImageFetchDuration: freezed == lastImageFetchDuration - ? _value.lastImageFetchDuration - : lastImageFetchDuration // ignore: cast_nullable_to_non_nullable - as Duration?, - analyzedPoints: freezed == analyzedPoints - ? _value.analyzedPoints - : analyzedPoints // ignore: cast_nullable_to_non_nullable - as List?, - currentImageRaw: freezed == currentImageRaw - ? _value.currentImageRaw - : currentImageRaw // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); + return _then( + _value.copyWith( + currentRealtimeDataType: + freezed == currentRealtimeDataType + ? _value.currentRealtimeDataType + : currentRealtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType?, + currentRealtimeLayer: + freezed == currentRealtimeLayer + ? _value.currentRealtimeLayer + : currentRealtimeLayer // ignore: cast_nullable_to_non_nullable + as RealtimeLayer?, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorStatus, + lastUpdatedAt: + freezed == lastUpdatedAt + ? _value.lastUpdatedAt + : lastUpdatedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + lastImageFetchTargetTime: + freezed == lastImageFetchTargetTime + ? _value.lastImageFetchTargetTime + : lastImageFetchTargetTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + lastImageFetchDuration: + freezed == lastImageFetchDuration + ? _value.lastImageFetchDuration + : lastImageFetchDuration // ignore: cast_nullable_to_non_nullable + as Duration?, + analyzedPoints: + freezed == analyzedPoints + ? _value.analyzedPoints + : analyzedPoints // ignore: cast_nullable_to_non_nullable + as List?, + currentImageRaw: + freezed == currentImageRaw + ? _value.currentImageRaw + : currentImageRaw // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$KyoshinMonitorStateImplCopyWith<$Res> implements $KyoshinMonitorStateCopyWith<$Res> { - factory _$$KyoshinMonitorStateImplCopyWith(_$KyoshinMonitorStateImpl value, - $Res Function(_$KyoshinMonitorStateImpl) then) = - __$$KyoshinMonitorStateImplCopyWithImpl<$Res>; + factory _$$KyoshinMonitorStateImplCopyWith( + _$KyoshinMonitorStateImpl value, + $Res Function(_$KyoshinMonitorStateImpl) then, + ) = __$$KyoshinMonitorStateImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {RealtimeDataType? currentRealtimeDataType, - RealtimeLayer? currentRealtimeLayer, - KyoshinMonitorStatus status, - DateTime? lastUpdatedAt, - DateTime? lastImageFetchTargetTime, - Duration? lastImageFetchDuration, - List? analyzedPoints, - List? currentImageRaw}); + $Res call({ + RealtimeDataType? currentRealtimeDataType, + RealtimeLayer? currentRealtimeLayer, + KyoshinMonitorStatus status, + DateTime? lastUpdatedAt, + DateTime? lastImageFetchTargetTime, + Duration? lastImageFetchDuration, + List? analyzedPoints, + List? currentImageRaw, + }); } /// @nodoc class __$$KyoshinMonitorStateImplCopyWithImpl<$Res> extends _$KyoshinMonitorStateCopyWithImpl<$Res, _$KyoshinMonitorStateImpl> implements _$$KyoshinMonitorStateImplCopyWith<$Res> { - __$$KyoshinMonitorStateImplCopyWithImpl(_$KyoshinMonitorStateImpl _value, - $Res Function(_$KyoshinMonitorStateImpl) _then) - : super(_value, _then); + __$$KyoshinMonitorStateImplCopyWithImpl( + _$KyoshinMonitorStateImpl _value, + $Res Function(_$KyoshinMonitorStateImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorState /// with the given fields replaced by the non-null parameter values. @@ -160,57 +177,67 @@ class __$$KyoshinMonitorStateImplCopyWithImpl<$Res> Object? analyzedPoints = freezed, Object? currentImageRaw = freezed, }) { - return _then(_$KyoshinMonitorStateImpl( - currentRealtimeDataType: freezed == currentRealtimeDataType - ? _value.currentRealtimeDataType - : currentRealtimeDataType // ignore: cast_nullable_to_non_nullable - as RealtimeDataType?, - currentRealtimeLayer: freezed == currentRealtimeLayer - ? _value.currentRealtimeLayer - : currentRealtimeLayer // ignore: cast_nullable_to_non_nullable - as RealtimeLayer?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorStatus, - lastUpdatedAt: freezed == lastUpdatedAt - ? _value.lastUpdatedAt - : lastUpdatedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - lastImageFetchTargetTime: freezed == lastImageFetchTargetTime - ? _value.lastImageFetchTargetTime - : lastImageFetchTargetTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - lastImageFetchDuration: freezed == lastImageFetchDuration - ? _value.lastImageFetchDuration - : lastImageFetchDuration // ignore: cast_nullable_to_non_nullable - as Duration?, - analyzedPoints: freezed == analyzedPoints - ? _value._analyzedPoints - : analyzedPoints // ignore: cast_nullable_to_non_nullable - as List?, - currentImageRaw: freezed == currentImageRaw - ? _value._currentImageRaw - : currentImageRaw // ignore: cast_nullable_to_non_nullable - as List?, - )); + return _then( + _$KyoshinMonitorStateImpl( + currentRealtimeDataType: + freezed == currentRealtimeDataType + ? _value.currentRealtimeDataType + : currentRealtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType?, + currentRealtimeLayer: + freezed == currentRealtimeLayer + ? _value.currentRealtimeLayer + : currentRealtimeLayer // ignore: cast_nullable_to_non_nullable + as RealtimeLayer?, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorStatus, + lastUpdatedAt: + freezed == lastUpdatedAt + ? _value.lastUpdatedAt + : lastUpdatedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + lastImageFetchTargetTime: + freezed == lastImageFetchTargetTime + ? _value.lastImageFetchTargetTime + : lastImageFetchTargetTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + lastImageFetchDuration: + freezed == lastImageFetchDuration + ? _value.lastImageFetchDuration + : lastImageFetchDuration // ignore: cast_nullable_to_non_nullable + as Duration?, + analyzedPoints: + freezed == analyzedPoints + ? _value._analyzedPoints + : analyzedPoints // ignore: cast_nullable_to_non_nullable + as List?, + currentImageRaw: + freezed == currentImageRaw + ? _value._currentImageRaw + : currentImageRaw // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); } } /// @nodoc @JsonSerializable() class _$KyoshinMonitorStateImpl implements _KyoshinMonitorState { - const _$KyoshinMonitorStateImpl( - {this.currentRealtimeDataType, - this.currentRealtimeLayer, - this.status = KyoshinMonitorStatus.initializing, - this.lastUpdatedAt, - this.lastImageFetchTargetTime, - this.lastImageFetchDuration, - final List? analyzedPoints, - final List? currentImageRaw}) - : _analyzedPoints = analyzedPoints, - _currentImageRaw = currentImageRaw; + const _$KyoshinMonitorStateImpl({ + this.currentRealtimeDataType, + this.currentRealtimeLayer, + this.status = KyoshinMonitorStatus.initializing, + this.lastUpdatedAt, + this.lastImageFetchTargetTime, + this.lastImageFetchDuration, + final List? analyzedPoints, + final List? currentImageRaw, + }) : _analyzedPoints = analyzedPoints, + _currentImageRaw = currentImageRaw; factory _$KyoshinMonitorStateImpl.fromJson(Map json) => _$$KyoshinMonitorStateImplFromJson(json); @@ -259,7 +286,9 @@ class _$KyoshinMonitorStateImpl implements _KyoshinMonitorState { (other.runtimeType == runtimeType && other is _$KyoshinMonitorStateImpl && (identical( - other.currentRealtimeDataType, currentRealtimeDataType) || + other.currentRealtimeDataType, + currentRealtimeDataType, + ) || other.currentRealtimeDataType == currentRealtimeDataType) && (identical(other.currentRealtimeLayer, currentRealtimeLayer) || other.currentRealtimeLayer == currentRealtimeLayer) && @@ -267,28 +296,35 @@ class _$KyoshinMonitorStateImpl implements _KyoshinMonitorState { (identical(other.lastUpdatedAt, lastUpdatedAt) || other.lastUpdatedAt == lastUpdatedAt) && (identical( - other.lastImageFetchTargetTime, lastImageFetchTargetTime) || + other.lastImageFetchTargetTime, + lastImageFetchTargetTime, + ) || other.lastImageFetchTargetTime == lastImageFetchTargetTime) && (identical(other.lastImageFetchDuration, lastImageFetchDuration) || other.lastImageFetchDuration == lastImageFetchDuration) && - const DeepCollectionEquality() - .equals(other._analyzedPoints, _analyzedPoints) && - const DeepCollectionEquality() - .equals(other._currentImageRaw, _currentImageRaw)); + const DeepCollectionEquality().equals( + other._analyzedPoints, + _analyzedPoints, + ) && + const DeepCollectionEquality().equals( + other._currentImageRaw, + _currentImageRaw, + )); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - currentRealtimeDataType, - currentRealtimeLayer, - status, - lastUpdatedAt, - lastImageFetchTargetTime, - lastImageFetchDuration, - const DeepCollectionEquality().hash(_analyzedPoints), - const DeepCollectionEquality().hash(_currentImageRaw)); + runtimeType, + currentRealtimeDataType, + currentRealtimeLayer, + status, + lastUpdatedAt, + lastImageFetchTargetTime, + lastImageFetchDuration, + const DeepCollectionEquality().hash(_analyzedPoints), + const DeepCollectionEquality().hash(_currentImageRaw), + ); /// Create a copy of KyoshinMonitorState /// with the given fields replaced by the non-null parameter values. @@ -297,26 +333,27 @@ class _$KyoshinMonitorStateImpl implements _KyoshinMonitorState { @pragma('vm:prefer-inline') _$$KyoshinMonitorStateImplCopyWith<_$KyoshinMonitorStateImpl> get copyWith => __$$KyoshinMonitorStateImplCopyWithImpl<_$KyoshinMonitorStateImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$KyoshinMonitorStateImplToJson( - this, - ); + return _$$KyoshinMonitorStateImplToJson(this); } } abstract class _KyoshinMonitorState implements KyoshinMonitorState { - const factory _KyoshinMonitorState( - {final RealtimeDataType? currentRealtimeDataType, - final RealtimeLayer? currentRealtimeLayer, - final KyoshinMonitorStatus status, - final DateTime? lastUpdatedAt, - final DateTime? lastImageFetchTargetTime, - final Duration? lastImageFetchDuration, - final List? analyzedPoints, - final List? currentImageRaw}) = _$KyoshinMonitorStateImpl; + const factory _KyoshinMonitorState({ + final RealtimeDataType? currentRealtimeDataType, + final RealtimeLayer? currentRealtimeLayer, + final KyoshinMonitorStatus status, + final DateTime? lastUpdatedAt, + final DateTime? lastImageFetchTargetTime, + final Duration? lastImageFetchDuration, + final List? analyzedPoints, + final List? currentImageRaw, + }) = _$KyoshinMonitorStateImpl; factory _KyoshinMonitorState.fromJson(Map json) = _$KyoshinMonitorStateImpl.fromJson; @@ -347,16 +384,16 @@ abstract class _KyoshinMonitorState implements KyoshinMonitorState { } KyoshinMonitorImageParseObservationPoint - _$KyoshinMonitorImageParseObservationPointFromJson( - Map json) { +_$KyoshinMonitorImageParseObservationPointFromJson(Map json) { return _KyoshinMonitorImageParseObservationPoint.fromJson(json); } /// @nodoc mixin _$KyoshinMonitorImageParseObservationPoint { @JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) KyoshinObservationPoint get point => throw _privateConstructorUsedError; KyoshinMonitorObservationAnalyzedPoint get observation => throw _privateConstructorUsedError; @@ -368,34 +405,44 @@ mixin _$KyoshinMonitorImageParseObservationPoint { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorImageParseObservationPointCopyWith< - KyoshinMonitorImageParseObservationPoint> - get copyWith => throw _privateConstructorUsedError; + KyoshinMonitorImageParseObservationPoint + > + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorImageParseObservationPointCopyWith<$Res> { factory $KyoshinMonitorImageParseObservationPointCopyWith( - KyoshinMonitorImageParseObservationPoint value, - $Res Function(KyoshinMonitorImageParseObservationPoint) then) = - _$KyoshinMonitorImageParseObservationPointCopyWithImpl<$Res, - KyoshinMonitorImageParseObservationPoint>; + KyoshinMonitorImageParseObservationPoint value, + $Res Function(KyoshinMonitorImageParseObservationPoint) then, + ) = + _$KyoshinMonitorImageParseObservationPointCopyWithImpl< + $Res, + KyoshinMonitorImageParseObservationPoint + >; @useResult - $Res call( - {@JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) - KyoshinObservationPoint point, - KyoshinMonitorObservationAnalyzedPoint observation}); + $Res call({ + @JsonKey( + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) + KyoshinObservationPoint point, + KyoshinMonitorObservationAnalyzedPoint observation, + }); $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res> get observation; } /// @nodoc -class _$KyoshinMonitorImageParseObservationPointCopyWithImpl<$Res, - $Val extends KyoshinMonitorImageParseObservationPoint> +class _$KyoshinMonitorImageParseObservationPointCopyWithImpl< + $Res, + $Val extends KyoshinMonitorImageParseObservationPoint +> implements $KyoshinMonitorImageParseObservationPointCopyWith<$Res> { _$KyoshinMonitorImageParseObservationPointCopyWithImpl( - this._value, this._then); + this._value, + this._then, + ); // ignore: unused_field final $Val _value; @@ -406,20 +453,22 @@ class _$KyoshinMonitorImageParseObservationPointCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? point = null, - Object? observation = null, - }) { - return _then(_value.copyWith( - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinObservationPoint, - observation: null == observation - ? _value.observation - : observation // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorObservationAnalyzedPoint, - ) as $Val); + $Res call({Object? point = null, Object? observation = null}) { + return _then( + _value.copyWith( + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinObservationPoint, + observation: + null == observation + ? _value.observation + : observation // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorObservationAnalyzedPoint, + ) + as $Val, + ); } /// Create a copy of KyoshinMonitorImageParseObservationPoint @@ -428,9 +477,11 @@ class _$KyoshinMonitorImageParseObservationPointCopyWithImpl<$Res, @pragma('vm:prefer-inline') $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res> get observation { return $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res>( - _value.observation, (value) { - return _then(_value.copyWith(observation: value) as $Val); - }); + _value.observation, + (value) { + return _then(_value.copyWith(observation: value) as $Val); + }, + ); } } @@ -438,17 +489,19 @@ class _$KyoshinMonitorImageParseObservationPointCopyWithImpl<$Res, abstract class _$$KyoshinMonitorImageParseObservationPointImplCopyWith<$Res> implements $KyoshinMonitorImageParseObservationPointCopyWith<$Res> { factory _$$KyoshinMonitorImageParseObservationPointImplCopyWith( - _$KyoshinMonitorImageParseObservationPointImpl value, - $Res Function(_$KyoshinMonitorImageParseObservationPointImpl) then) = - __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl<$Res>; + _$KyoshinMonitorImageParseObservationPointImpl value, + $Res Function(_$KyoshinMonitorImageParseObservationPointImpl) then, + ) = __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) - KyoshinObservationPoint point, - KyoshinMonitorObservationAnalyzedPoint observation}); + $Res call({ + @JsonKey( + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) + KyoshinObservationPoint point, + KyoshinMonitorObservationAnalyzedPoint observation, + }); @override $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res> get observation; @@ -456,32 +509,36 @@ abstract class _$$KyoshinMonitorImageParseObservationPointImplCopyWith<$Res> /// @nodoc class __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl<$Res> - extends _$KyoshinMonitorImageParseObservationPointCopyWithImpl<$Res, - _$KyoshinMonitorImageParseObservationPointImpl> + extends + _$KyoshinMonitorImageParseObservationPointCopyWithImpl< + $Res, + _$KyoshinMonitorImageParseObservationPointImpl + > implements _$$KyoshinMonitorImageParseObservationPointImplCopyWith<$Res> { __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl( - _$KyoshinMonitorImageParseObservationPointImpl _value, - $Res Function(_$KyoshinMonitorImageParseObservationPointImpl) _then) - : super(_value, _then); + _$KyoshinMonitorImageParseObservationPointImpl _value, + $Res Function(_$KyoshinMonitorImageParseObservationPointImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorImageParseObservationPoint /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? point = null, - Object? observation = null, - }) { - return _then(_$KyoshinMonitorImageParseObservationPointImpl( - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinObservationPoint, - observation: null == observation - ? _value.observation - : observation // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorObservationAnalyzedPoint, - )); + $Res call({Object? point = null, Object? observation = null}) { + return _then( + _$KyoshinMonitorImageParseObservationPointImpl( + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinObservationPoint, + observation: + null == observation + ? _value.observation + : observation // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorObservationAnalyzedPoint, + ), + ); } } @@ -489,21 +546,24 @@ class __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorImageParseObservationPointImpl implements _KyoshinMonitorImageParseObservationPoint { - const _$KyoshinMonitorImageParseObservationPointImpl( - {@JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) - required this.point, - required this.observation}); + const _$KyoshinMonitorImageParseObservationPointImpl({ + @JsonKey( + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) + required this.point, + required this.observation, + }); factory _$KyoshinMonitorImageParseObservationPointImpl.fromJson( - Map json) => - _$$KyoshinMonitorImageParseObservationPointImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorImageParseObservationPointImplFromJson(json); @override @JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) final KyoshinObservationPoint point; @override final KyoshinMonitorObservationAnalyzedPoint observation; @@ -533,37 +593,38 @@ class _$KyoshinMonitorImageParseObservationPointImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorImageParseObservationPointImplCopyWith< - _$KyoshinMonitorImageParseObservationPointImpl> - get copyWith => - __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl< - _$KyoshinMonitorImageParseObservationPointImpl>(this, _$identity); + _$KyoshinMonitorImageParseObservationPointImpl + > + get copyWith => __$$KyoshinMonitorImageParseObservationPointImplCopyWithImpl< + _$KyoshinMonitorImageParseObservationPointImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorImageParseObservationPointImplToJson( - this, - ); + return _$$KyoshinMonitorImageParseObservationPointImplToJson(this); } } abstract class _KyoshinMonitorImageParseObservationPoint implements KyoshinMonitorImageParseObservationPoint { - const factory _KyoshinMonitorImageParseObservationPoint( - {@JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) - required final KyoshinObservationPoint point, - required final KyoshinMonitorObservationAnalyzedPoint observation}) = - _$KyoshinMonitorImageParseObservationPointImpl; + const factory _KyoshinMonitorImageParseObservationPoint({ + @JsonKey( + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) + required final KyoshinObservationPoint point, + required final KyoshinMonitorObservationAnalyzedPoint observation, + }) = _$KyoshinMonitorImageParseObservationPointImpl; factory _KyoshinMonitorImageParseObservationPoint.fromJson( - Map json) = - _$KyoshinMonitorImageParseObservationPointImpl.fromJson; + Map json, + ) = _$KyoshinMonitorImageParseObservationPointImpl.fromJson; @override @JsonKey( - fromJson: _kyoshinObservationPointFromJson, - toJson: _kyoshinObservationPointToJson) + fromJson: _kyoshinObservationPointFromJson, + toJson: _kyoshinObservationPointToJson, + ) KyoshinObservationPoint get point; @override KyoshinMonitorObservationAnalyzedPoint get observation; @@ -573,6 +634,7 @@ abstract class _KyoshinMonitorImageParseObservationPoint @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorImageParseObservationPointImplCopyWith< - _$KyoshinMonitorImageParseObservationPointImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorImageParseObservationPointImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.g.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.g.dart index eacac696..e358c366 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_state.g.dart @@ -9,73 +9,82 @@ part of 'kyoshin_monitor_state.dart'; // ************************************************************************** _$KyoshinMonitorStateImpl _$$KyoshinMonitorStateImplFromJson( - Map json) => - $checkedCreate( - r'_$KyoshinMonitorStateImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorStateImpl( - currentRealtimeDataType: $checkedConvert('current_realtime_data_type', - (v) => $enumDecodeNullable(_$RealtimeDataTypeEnumMap, v)), - currentRealtimeLayer: $checkedConvert('current_realtime_layer', - (v) => $enumDecodeNullable(_$RealtimeLayerEnumMap, v)), - status: $checkedConvert( - 'status', - (v) => - $enumDecodeNullable(_$KyoshinMonitorStatusEnumMap, v) ?? - KyoshinMonitorStatus.initializing), - lastUpdatedAt: $checkedConvert('last_updated_at', - (v) => v == null ? null : DateTime.parse(v as String)), - lastImageFetchTargetTime: $checkedConvert( - 'last_image_fetch_target_time', - (v) => v == null ? null : DateTime.parse(v as String)), - lastImageFetchDuration: $checkedConvert( - 'last_image_fetch_duration', - (v) => v == null - ? null - : Duration(microseconds: (v as num).toInt())), - analyzedPoints: $checkedConvert( - 'analyzed_points', - (v) => (v as List?) - ?.map((e) => - KyoshinMonitorImageParseObservationPoint.fromJson( - e as Map)) - .toList()), - currentImageRaw: $checkedConvert( - 'current_image_raw', - (v) => (v as List?) - ?.map((e) => (e as num).toInt()) - .toList()), - ); - return val; - }, - fieldKeyMap: const { - 'currentRealtimeDataType': 'current_realtime_data_type', - 'currentRealtimeLayer': 'current_realtime_layer', - 'lastUpdatedAt': 'last_updated_at', - 'lastImageFetchTargetTime': 'last_image_fetch_target_time', - 'lastImageFetchDuration': 'last_image_fetch_duration', - 'analyzedPoints': 'analyzed_points', - 'currentImageRaw': 'current_image_raw' - }, + Map json, +) => $checkedCreate( + r'_$KyoshinMonitorStateImpl', + json, + ($checkedConvert) { + final val = _$KyoshinMonitorStateImpl( + currentRealtimeDataType: $checkedConvert( + 'current_realtime_data_type', + (v) => $enumDecodeNullable(_$RealtimeDataTypeEnumMap, v), + ), + currentRealtimeLayer: $checkedConvert( + 'current_realtime_layer', + (v) => $enumDecodeNullable(_$RealtimeLayerEnumMap, v), + ), + status: $checkedConvert( + 'status', + (v) => + $enumDecodeNullable(_$KyoshinMonitorStatusEnumMap, v) ?? + KyoshinMonitorStatus.initializing, + ), + lastUpdatedAt: $checkedConvert( + 'last_updated_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + lastImageFetchTargetTime: $checkedConvert( + 'last_image_fetch_target_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + lastImageFetchDuration: $checkedConvert( + 'last_image_fetch_duration', + (v) => v == null ? null : Duration(microseconds: (v as num).toInt()), + ), + analyzedPoints: $checkedConvert( + 'analyzed_points', + (v) => + (v as List?) + ?.map( + (e) => KyoshinMonitorImageParseObservationPoint.fromJson( + e as Map, + ), + ) + .toList(), + ), + currentImageRaw: $checkedConvert( + 'current_image_raw', + (v) => (v as List?)?.map((e) => (e as num).toInt()).toList(), + ), ); + return val; + }, + fieldKeyMap: const { + 'currentRealtimeDataType': 'current_realtime_data_type', + 'currentRealtimeLayer': 'current_realtime_layer', + 'lastUpdatedAt': 'last_updated_at', + 'lastImageFetchTargetTime': 'last_image_fetch_target_time', + 'lastImageFetchDuration': 'last_image_fetch_duration', + 'analyzedPoints': 'analyzed_points', + 'currentImageRaw': 'current_image_raw', + }, +); Map _$$KyoshinMonitorStateImplToJson( - _$KyoshinMonitorStateImpl instance) => - { - 'current_realtime_data_type': - _$RealtimeDataTypeEnumMap[instance.currentRealtimeDataType], - 'current_realtime_layer': - _$RealtimeLayerEnumMap[instance.currentRealtimeLayer], - 'status': _$KyoshinMonitorStatusEnumMap[instance.status]!, - 'last_updated_at': instance.lastUpdatedAt?.toIso8601String(), - 'last_image_fetch_target_time': - instance.lastImageFetchTargetTime?.toIso8601String(), - 'last_image_fetch_duration': - instance.lastImageFetchDuration?.inMicroseconds, - 'analyzed_points': instance.analyzedPoints, - 'current_image_raw': instance.currentImageRaw, - }; + _$KyoshinMonitorStateImpl instance, +) => { + 'current_realtime_data_type': + _$RealtimeDataTypeEnumMap[instance.currentRealtimeDataType], + 'current_realtime_layer': + _$RealtimeLayerEnumMap[instance.currentRealtimeLayer], + 'status': _$KyoshinMonitorStatusEnumMap[instance.status]!, + 'last_updated_at': instance.lastUpdatedAt?.toIso8601String(), + 'last_image_fetch_target_time': + instance.lastImageFetchTargetTime?.toIso8601String(), + 'last_image_fetch_duration': instance.lastImageFetchDuration?.inMicroseconds, + 'analyzed_points': instance.analyzedPoints, + 'current_image_raw': instance.currentImageRaw, +}; const _$RealtimeDataTypeEnumMap = { RealtimeDataType.shindo: 'jma', @@ -112,29 +121,29 @@ const _$KyoshinMonitorStatusEnumMap = { }; _$KyoshinMonitorImageParseObservationPointImpl - _$$KyoshinMonitorImageParseObservationPointImplFromJson( - Map json) => - $checkedCreate( - r'_$KyoshinMonitorImageParseObservationPointImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorImageParseObservationPointImpl( - point: $checkedConvert( - 'point', - (v) => _kyoshinObservationPointFromJson( - v as Map)), - observation: $checkedConvert( - 'observation', - (v) => KyoshinMonitorObservationAnalyzedPoint.fromJson( - v as Map)), - ); - return val; - }, - ); +_$$KyoshinMonitorImageParseObservationPointImplFromJson( + Map json, +) => $checkedCreate(r'_$KyoshinMonitorImageParseObservationPointImpl', json, ( + $checkedConvert, +) { + final val = _$KyoshinMonitorImageParseObservationPointImpl( + point: $checkedConvert( + 'point', + (v) => _kyoshinObservationPointFromJson(v as Map), + ), + observation: $checkedConvert( + 'observation', + (v) => KyoshinMonitorObservationAnalyzedPoint.fromJson( + v as Map, + ), + ), + ); + return val; +}); Map _$$KyoshinMonitorImageParseObservationPointImplToJson( - _$KyoshinMonitorImageParseObservationPointImpl instance) => - { - 'point': _kyoshinObservationPointToJson(instance.point), - 'observation': instance.observation, - }; + _$KyoshinMonitorImageParseObservationPointImpl instance, +) => { + 'point': _kyoshinObservationPointToJson(instance.point), + 'observation': instance.observation, +}; diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.freezed.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.freezed.dart index ef1cb7e6..67f71d19 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.freezed.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.freezed.dart @@ -12,10 +12,12 @@ part of 'kyoshin_monitor_timer_state.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); KyoshinMonitorTimerState _$KyoshinMonitorTimerStateFromJson( - Map json) { + Map json, +) { return _KyoshinMonitorTimerState.fromJson(json); } @@ -36,16 +38,19 @@ mixin _$KyoshinMonitorTimerState { /// @nodoc abstract class $KyoshinMonitorTimerStateCopyWith<$Res> { - factory $KyoshinMonitorTimerStateCopyWith(KyoshinMonitorTimerState value, - $Res Function(KyoshinMonitorTimerState) then) = - _$KyoshinMonitorTimerStateCopyWithImpl<$Res, KyoshinMonitorTimerState>; + factory $KyoshinMonitorTimerStateCopyWith( + KyoshinMonitorTimerState value, + $Res Function(KyoshinMonitorTimerState) then, + ) = _$KyoshinMonitorTimerStateCopyWithImpl<$Res, KyoshinMonitorTimerState>; @useResult $Res call({Duration delayFromDevice, DateTime? lastSyncedAt}); } /// @nodoc -class _$KyoshinMonitorTimerStateCopyWithImpl<$Res, - $Val extends KyoshinMonitorTimerState> +class _$KyoshinMonitorTimerStateCopyWithImpl< + $Res, + $Val extends KyoshinMonitorTimerState +> implements $KyoshinMonitorTimerStateCopyWith<$Res> { _$KyoshinMonitorTimerStateCopyWithImpl(this._value, this._then); @@ -58,20 +63,22 @@ class _$KyoshinMonitorTimerStateCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? delayFromDevice = null, - Object? lastSyncedAt = freezed, - }) { - return _then(_value.copyWith( - delayFromDevice: null == delayFromDevice - ? _value.delayFromDevice - : delayFromDevice // ignore: cast_nullable_to_non_nullable - as Duration, - lastSyncedAt: freezed == lastSyncedAt - ? _value.lastSyncedAt - : lastSyncedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - ) as $Val); + $Res call({Object? delayFromDevice = null, Object? lastSyncedAt = freezed}) { + return _then( + _value.copyWith( + delayFromDevice: + null == delayFromDevice + ? _value.delayFromDevice + : delayFromDevice // ignore: cast_nullable_to_non_nullable + as Duration, + lastSyncedAt: + freezed == lastSyncedAt + ? _value.lastSyncedAt + : lastSyncedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + ) + as $Val, + ); } } @@ -79,9 +86,9 @@ class _$KyoshinMonitorTimerStateCopyWithImpl<$Res, abstract class _$$KyoshinMonitorTimerStateImplCopyWith<$Res> implements $KyoshinMonitorTimerStateCopyWith<$Res> { factory _$$KyoshinMonitorTimerStateImplCopyWith( - _$KyoshinMonitorTimerStateImpl value, - $Res Function(_$KyoshinMonitorTimerStateImpl) then) = - __$$KyoshinMonitorTimerStateImplCopyWithImpl<$Res>; + _$KyoshinMonitorTimerStateImpl value, + $Res Function(_$KyoshinMonitorTimerStateImpl) then, + ) = __$$KyoshinMonitorTimerStateImplCopyWithImpl<$Res>; @override @useResult $Res call({Duration delayFromDevice, DateTime? lastSyncedAt}); @@ -89,40 +96,46 @@ abstract class _$$KyoshinMonitorTimerStateImplCopyWith<$Res> /// @nodoc class __$$KyoshinMonitorTimerStateImplCopyWithImpl<$Res> - extends _$KyoshinMonitorTimerStateCopyWithImpl<$Res, - _$KyoshinMonitorTimerStateImpl> + extends + _$KyoshinMonitorTimerStateCopyWithImpl< + $Res, + _$KyoshinMonitorTimerStateImpl + > implements _$$KyoshinMonitorTimerStateImplCopyWith<$Res> { __$$KyoshinMonitorTimerStateImplCopyWithImpl( - _$KyoshinMonitorTimerStateImpl _value, - $Res Function(_$KyoshinMonitorTimerStateImpl) _then) - : super(_value, _then); + _$KyoshinMonitorTimerStateImpl _value, + $Res Function(_$KyoshinMonitorTimerStateImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorTimerState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? delayFromDevice = null, - Object? lastSyncedAt = freezed, - }) { - return _then(_$KyoshinMonitorTimerStateImpl( - delayFromDevice: null == delayFromDevice - ? _value.delayFromDevice - : delayFromDevice // ignore: cast_nullable_to_non_nullable - as Duration, - lastSyncedAt: freezed == lastSyncedAt - ? _value.lastSyncedAt - : lastSyncedAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - )); + $Res call({Object? delayFromDevice = null, Object? lastSyncedAt = freezed}) { + return _then( + _$KyoshinMonitorTimerStateImpl( + delayFromDevice: + null == delayFromDevice + ? _value.delayFromDevice + : delayFromDevice // ignore: cast_nullable_to_non_nullable + as Duration, + lastSyncedAt: + freezed == lastSyncedAt + ? _value.lastSyncedAt + : lastSyncedAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + ), + ); } } /// @nodoc @JsonSerializable() class _$KyoshinMonitorTimerStateImpl implements _KyoshinMonitorTimerState { - const _$KyoshinMonitorTimerStateImpl( - {required this.delayFromDevice, required this.lastSyncedAt}); + const _$KyoshinMonitorTimerStateImpl({ + required this.delayFromDevice, + required this.lastSyncedAt, + }); factory _$KyoshinMonitorTimerStateImpl.fromJson(Map json) => _$$KyoshinMonitorTimerStateImplFromJson(json); @@ -158,21 +171,21 @@ class _$KyoshinMonitorTimerStateImpl implements _KyoshinMonitorTimerState { @override @pragma('vm:prefer-inline') _$$KyoshinMonitorTimerStateImplCopyWith<_$KyoshinMonitorTimerStateImpl> - get copyWith => __$$KyoshinMonitorTimerStateImplCopyWithImpl< - _$KyoshinMonitorTimerStateImpl>(this, _$identity); + get copyWith => __$$KyoshinMonitorTimerStateImplCopyWithImpl< + _$KyoshinMonitorTimerStateImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorTimerStateImplToJson( - this, - ); + return _$$KyoshinMonitorTimerStateImplToJson(this); } } abstract class _KyoshinMonitorTimerState implements KyoshinMonitorTimerState { - const factory _KyoshinMonitorTimerState( - {required final Duration delayFromDevice, - required final DateTime? lastSyncedAt}) = _$KyoshinMonitorTimerStateImpl; + const factory _KyoshinMonitorTimerState({ + required final Duration delayFromDevice, + required final DateTime? lastSyncedAt, + }) = _$KyoshinMonitorTimerStateImpl; factory _KyoshinMonitorTimerState.fromJson(Map json) = _$KyoshinMonitorTimerStateImpl.fromJson; @@ -187,5 +200,5 @@ abstract class _KyoshinMonitorTimerState implements KyoshinMonitorTimerState { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorTimerStateImplCopyWith<_$KyoshinMonitorTimerStateImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.g.dart b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.g.dart index d9dfee5c..f999c0c1 100644 --- a/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/model/kyoshin_monitor_timer_state.g.dart @@ -9,28 +9,32 @@ part of 'kyoshin_monitor_timer_state.dart'; // ************************************************************************** _$KyoshinMonitorTimerStateImpl _$$KyoshinMonitorTimerStateImplFromJson( - Map json) => - $checkedCreate( - r'_$KyoshinMonitorTimerStateImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorTimerStateImpl( - delayFromDevice: $checkedConvert('delay_from_device', - (v) => Duration(microseconds: (v as num).toInt())), - lastSyncedAt: $checkedConvert('last_synced_at', - (v) => v == null ? null : DateTime.parse(v as String)), - ); - return val; - }, - fieldKeyMap: const { - 'delayFromDevice': 'delay_from_device', - 'lastSyncedAt': 'last_synced_at' - }, + Map json, +) => $checkedCreate( + r'_$KyoshinMonitorTimerStateImpl', + json, + ($checkedConvert) { + final val = _$KyoshinMonitorTimerStateImpl( + delayFromDevice: $checkedConvert( + 'delay_from_device', + (v) => Duration(microseconds: (v as num).toInt()), + ), + lastSyncedAt: $checkedConvert( + 'last_synced_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), ); + return val; + }, + fieldKeyMap: const { + 'delayFromDevice': 'delay_from_device', + 'lastSyncedAt': 'last_synced_at', + }, +); Map _$$KyoshinMonitorTimerStateImplToJson( - _$KyoshinMonitorTimerStateImpl instance) => - { - 'delay_from_device': instance.delayFromDevice.inMicroseconds, - 'last_synced_at': instance.lastSyncedAt?.toIso8601String(), - }; + _$KyoshinMonitorTimerStateImpl instance, +) => { + 'delay_from_device': instance.delayFromDevice.inMicroseconds, + 'last_synced_at': instance.lastSyncedAt?.toIso8601String(), +}; diff --git a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart index cd868e34..cc60a82d 100644 --- a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart +++ b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.dart @@ -24,21 +24,18 @@ class KyoshinMonitorNotifier extends _$KyoshinMonitorNotifier { }); // 設定変更を監視 - ref.listen( - kyoshinMonitorSettingsProvider, - (previous, next) { - void onSettingsChanged() => - state = const AsyncData(KyoshinMonitorState()); + ref.listen(kyoshinMonitorSettingsProvider, (previous, next) { + void onSettingsChanged() => + state = const AsyncData(KyoshinMonitorState()); - if (previous == null) { - return; - } - if (previous.realtimeDataType != next.realtimeDataType || - previous.realtimeLayer != next.realtimeLayer) { - onSettingsChanged(); - } - }, - ); + if (previous == null) { + return; + } + if (previous.realtimeDataType != next.realtimeDataType || + previous.realtimeLayer != next.realtimeLayer) { + onSettingsChanged(); + } + }); return const KyoshinMonitorState(); } @@ -56,56 +53,56 @@ class KyoshinMonitorNotifier extends _$KyoshinMonitorNotifier { } final stopwatch = Stopwatch()..start(); state = const AsyncLoading().copyWithPrevious(state); - state = await AsyncValue.guard( - () async { - final dataSource = ref.read(kyoshinMonitorWebApiDataSourceProvider); - final imageParser = ref.read(kyoshinMonitorImageParserProvider); - final points = ref.read(kyoshinMonitorObservationPointsProvider); - final observationPoints = ref.read(kyoshinObservationPointsProvider); - // 画像を取得 - final realtimeDataType = - ref.read(kyoshinMonitorSettingsProvider).realtimeDataType; - final realtimeLayer = - ref.read(kyoshinMonitorSettingsProvider).realtimeLayer; - final image = await dataSource.getRealtimeImageData( - type: realtimeDataType, - layer: realtimeLayer, - dateTime: targetTime, - ); + state = await AsyncValue.guard(() async { + final dataSource = ref.read(kyoshinMonitorWebApiDataSourceProvider); + final imageParser = ref.read(kyoshinMonitorImageParserProvider); + final points = ref.read(kyoshinMonitorObservationPointsProvider); + final observationPoints = ref.read(kyoshinObservationPointsProvider); + // 画像を取得 + final realtimeDataType = + ref.read(kyoshinMonitorSettingsProvider).realtimeDataType; + final realtimeLayer = + ref.read(kyoshinMonitorSettingsProvider).realtimeLayer; + final image = await dataSource.getRealtimeImageData( + type: realtimeDataType, + layer: realtimeLayer, + dateTime: targetTime, + ); - // 画像を解析 - final result = await imageParser.parseGif( - gifImage: image, - points: points, - ); + // 画像を解析 + final result = await imageParser.parseGif( + gifImage: image, + points: points, + ); - final results = result - .mapIndexed((index, element) { - final point = observationPoints.points[index]; - return switch (element) { - KyoshinMonitorImageParseObservationSuccess() => - KyoshinMonitorImageParseObservationPoint( - point: point, - observation: element.point, - ), - KyoshinMonitorImageParseObservationFailure() => null, - }; - }) - .nonNulls - .toList(); - return KyoshinMonitorState( - lastUpdatedAt: DateTime.now(), - lastImageFetchTargetTime: targetTime, - status: isDelayed - ? KyoshinMonitorStatus.delayed - : KyoshinMonitorStatus.realtime, - currentRealtimeDataType: realtimeDataType, - currentRealtimeLayer: realtimeLayer, - analyzedPoints: results, - lastImageFetchDuration: stopwatch.elapsed, - currentImageRaw: image, - ); - }, - ); + final results = + result + .mapIndexed((index, element) { + final point = observationPoints.points[index]; + return switch (element) { + KyoshinMonitorImageParseObservationSuccess() => + KyoshinMonitorImageParseObservationPoint( + point: point, + observation: element.point, + ), + KyoshinMonitorImageParseObservationFailure() => null, + }; + }) + .nonNulls + .toList(); + return KyoshinMonitorState( + lastUpdatedAt: DateTime.now(), + lastImageFetchTargetTime: targetTime, + status: + isDelayed + ? KyoshinMonitorStatus.delayed + : KyoshinMonitorStatus.realtime, + currentRealtimeDataType: realtimeDataType, + currentRealtimeLayer: realtimeLayer, + analyzedPoints: results, + lastImageFetchDuration: stopwatch.elapsed, + currentImageRaw: image, + ); + }); } } diff --git a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.g.dart b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.g.dart index 20ca96b8..4541b6f3 100644 --- a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_notifier.g.dart @@ -15,14 +15,15 @@ String _$kyoshinMonitorNotifierHash() => @ProviderFor(KyoshinMonitorNotifier) final kyoshinMonitorNotifierProvider = AsyncNotifierProvider.internal( - KyoshinMonitorNotifier.new, - name: r'kyoshinMonitorNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + KyoshinMonitorNotifier.new, + name: r'kyoshinMonitorNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$KyoshinMonitorNotifier = AsyncNotifier; // ignore_for_file: type=lint diff --git a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.dart b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.dart index 1882e75d..8aa440ac 100644 --- a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.dart +++ b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.dart @@ -44,32 +44,29 @@ class KyoshinMonitorTimerNotifier extends _$KyoshinMonitorTimerNotifier { (_, next) => ref.read(periodicTimerProvider(key).notifier).setInterval(next), ) - ..listen( - periodicTimerProvider(key), - (_, next) async { - if (isResyncing) { - return; - } - var retryCount = 0; - while (retryCount < 3) { - isResyncing = true; - final result = await _syncDelaySimple(); - if (result case Success(:final value)) { - streamController.add( - KyoshinMonitorTimerState( - delayFromDevice: value, - lastSyncedAt: DateTime.now(), - ), - ); - break; - } else { - retryCount++; - await Future.delayed(const Duration(seconds: 5)); - } + ..listen(periodicTimerProvider(key), (_, next) async { + if (isResyncing) { + return; + } + var retryCount = 0; + while (retryCount < 3) { + isResyncing = true; + final result = await _syncDelaySimple(); + if (result case Success(:final value)) { + streamController.add( + KyoshinMonitorTimerState( + delayFromDevice: value, + lastSyncedAt: DateTime.now(), + ), + ); + break; + } else { + retryCount++; + await Future.delayed(const Duration(seconds: 5)); } - isResyncing = false; - }, - ); + } + isResyncing = false; + }); ref.onDispose(streamController.close); yield* streamController.stream; @@ -82,9 +79,10 @@ class KyoshinMonitorTimerNotifier extends _$KyoshinMonitorTimerNotifier { /// サーバの現在時刻を1回取得して、デバイスの現在時刻との差分を返す Future> _syncDelaySimple() async => Result.capture(() async { - final latestJson = await ref - .read(kyoshinMonitorWebApiDataSourceProvider) - .getLatestDataTime(); + final latestJson = + await ref + .read(kyoshinMonitorWebApiDataSourceProvider) + .getLatestDataTime(); final deviceTime = DateTime.now(); return deviceTime.difference(latestJson.latestTime); }); @@ -92,32 +90,32 @@ class KyoshinMonitorTimerNotifier extends _$KyoshinMonitorTimerNotifier { @visibleForTesting Future> syncDelay([ Duration interval = const Duration(milliseconds: 200), - ]) async => - _syncDelay(interval); + ]) async => _syncDelay(interval); /// サーバの現在取得が変わるまでくりかえし取得し、変わったらその差分を返す Future> _syncDelay([ Duration interval = const Duration(milliseconds: 200), - ]) async => - Result.capture(() async { - final firstTime = (await ref + ]) async => Result.capture(() async { + final firstTime = + (await ref .read(kyoshinMonitorWebApiDataSourceProvider) .getLatestDataTime()) .latestTime; - var latestTime = firstTime; - while (true) { - await Future.delayed(interval); - latestTime = (await ref + var latestTime = firstTime; + while (true) { + await Future.delayed(interval); + latestTime = + (await ref .read(kyoshinMonitorWebApiDataSourceProvider) .getLatestDataTime()) .latestTime; - if (latestTime != firstTime) { - break; - } - } - final deviceTime = DateTime.now(); - return deviceTime.difference(latestTime); - }); + if (latestTime != firstTime) { + break; + } + } + final deviceTime = DateTime.now(); + return deviceTime.difference(latestTime); + }); } @riverpod @@ -125,12 +123,9 @@ Stream _kyoshinMonitorDelayAdujustTiming(Ref ref) { const key = Key('kyoshin_monitor_delay_adjust_timing'); final streamController = StreamController(); ref - ..listen( - periodicTimerProvider(key), - (previous, next) { - streamController.add(null); - }, - ) + ..listen(periodicTimerProvider(key), (previous, next) { + streamController.add(null); + }) ..listen( kyoshinMonitorSettingsProvider.select((v) => v.api.delayAdjustInterval), (_, next) { @@ -138,7 +133,9 @@ Stream _kyoshinMonitorDelayAdujustTiming(Ref ref) { }, ); - ref.read(periodicTimerProvider(key).notifier).setInterval( + ref + .read(periodicTimerProvider(key).notifier) + .setInterval( ref.read(kyoshinMonitorSettingsProvider).api.delayAdjustInterval, ); diff --git a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.g.dart b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.g.dart index 44649ff4..d941ac0a 100644 --- a/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/notifier/kyoshin_monitor_timer_notifier.g.dart @@ -15,36 +15,40 @@ String _$kyoshinMonitorDelayAdujustTimingHash() => @ProviderFor(_kyoshinMonitorDelayAdujustTiming) final _kyoshinMonitorDelayAdujustTimingProvider = AutoDisposeStreamProvider.internal( - _kyoshinMonitorDelayAdujustTiming, - name: r'_kyoshinMonitorDelayAdujustTimingProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorDelayAdujustTimingHash, - dependencies: null, - allTransitiveDependencies: null, -); + _kyoshinMonitorDelayAdujustTiming, + name: r'_kyoshinMonitorDelayAdujustTimingProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorDelayAdujustTimingHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef _KyoshinMonitorDelayAdujustTimingRef - = AutoDisposeStreamProviderRef; +typedef _KyoshinMonitorDelayAdujustTimingRef = + AutoDisposeStreamProviderRef; String _$kyoshinMonitorTimerNotifierHash() => r'344b38935163fac1cce8de724e781381158eb1db'; /// See also [KyoshinMonitorTimerNotifier]. @ProviderFor(KyoshinMonitorTimerNotifier) final kyoshinMonitorTimerNotifierProvider = AutoDisposeStreamNotifierProvider< - KyoshinMonitorTimerNotifier, KyoshinMonitorTimerState>.internal( + KyoshinMonitorTimerNotifier, + KyoshinMonitorTimerState +>.internal( KyoshinMonitorTimerNotifier.new, name: r'kyoshinMonitorTimerNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorTimerNotifierHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorTimerNotifierHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$KyoshinMonitorTimerNotifier - = AutoDisposeStreamNotifier; +typedef _$KyoshinMonitorTimerNotifier = + AutoDisposeStreamNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart index 8cebcbdf..77bc268e 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.dart @@ -7,9 +7,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'kyoshin_color_map.g.dart'; @Riverpod(keepAlive: true) -List kyoshinColorMap( - Ref ref, -) => +List kyoshinColorMap(Ref ref) => throw UnimplementedError(); extension IntensityToKyoshinColor on List { diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.g.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.g.dart index 22c4ee26..a51da9d2 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_color_map.g.dart @@ -15,9 +15,10 @@ String _$kyoshinColorMapHash() => r'74b3acf2ebc484ef656b4184e435dc4861052c0f'; final kyoshinColorMapProvider = Provider>.internal( kyoshinColorMap, name: r'kyoshinColorMapProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinColorMapHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinColorMapHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_image_parser_provider.g.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_image_parser_provider.g.dart index 384fb97b..2e0e2238 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_image_parser_provider.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_image_parser_provider.g.dart @@ -15,14 +15,15 @@ String _$kyoshinMonitorImageParserHash() => @ProviderFor(kyoshinMonitorImageParser) final kyoshinMonitorImageParserProvider = Provider.internal( - kyoshinMonitorImageParser, - name: r'kyoshinMonitorImageParserProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorImageParserHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorImageParser, + name: r'kyoshinMonitorImageParserProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorImageParserHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_maintenance_provider.g.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_maintenance_provider.g.dart index 75a2a671..098c4f9e 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_maintenance_provider.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_maintenance_provider.g.dart @@ -15,18 +15,19 @@ String _$kyoshinMonitorMaintenanceHash() => @ProviderFor(kyoshinMonitorMaintenance) final kyoshinMonitorMaintenanceProvider = FutureProvider.internal( - kyoshinMonitorMaintenance, - name: r'kyoshinMonitorMaintenanceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorMaintenanceHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorMaintenance, + name: r'kyoshinMonitorMaintenanceProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorMaintenanceHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef KyoshinMonitorMaintenanceRef - = FutureProviderRef; +typedef KyoshinMonitorMaintenanceRef = + FutureProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart index 0c65294e..25d3b5f5 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.dart @@ -37,9 +37,8 @@ class KyoshinMonitorSettings extends _$KyoshinMonitorSettings { Future save(KyoshinMonitorSettingsModel model) async { state = model; - await ref.read(sharedPreferencesProvider).setString( - _prefsKey, - jsonEncode(state.toJson()), - ); + await ref + .read(sharedPreferencesProvider) + .setString(_prefsKey, jsonEncode(state.toJson())); } } diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.g.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.g.dart index fed6fec3..96fc51cb 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_settings.g.dart @@ -13,13 +13,16 @@ String _$kyoshinMonitorSettingsHash() => /// See also [KyoshinMonitorSettings]. @ProviderFor(KyoshinMonitorSettings) -final kyoshinMonitorSettingsProvider = NotifierProvider.internal( +final kyoshinMonitorSettingsProvider = NotifierProvider< + KyoshinMonitorSettings, + KyoshinMonitorSettingsModel +>.internal( KyoshinMonitorSettings.new, name: r'kyoshinMonitorSettingsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorSettingsHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorSettingsHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.dart index 3538f000..f74ea6ca 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.dart @@ -24,23 +24,27 @@ Stream kyoshinMonitorTimerStream(Ref ref) async* { }) ..listen(periodicTimerProvider(key), (_, next) async { if (next case AsyncData()) { - final delay = ref - .read(kyoshinMonitorTimerNotifierProvider) - .valueOrNull - ?.delayFromDevice; + final delay = + ref + .read(kyoshinMonitorTimerNotifierProvider) + .valueOrNull + ?.delayFromDevice; if (delay != null) { streamController.add(DateTime.now().subtract(delay)); } } }); - final kyoshinMonitorTimerNotifier = - ref.read(kyoshinMonitorTimerNotifierProvider); + final kyoshinMonitorTimerNotifier = ref.read( + kyoshinMonitorTimerNotifierProvider, + ); final delay = kyoshinMonitorTimerNotifier.valueOrNull?.delayFromDevice; if (delay != null) { streamController.add(DateTime.now().subtract(delay)); } - ref.read(periodicTimerProvider(key).notifier).setInterval( + ref + .read(periodicTimerProvider(key).notifier) + .setInterval( ref.read(kyoshinMonitorSettingsProvider).api.imageFetchInterval, ); diff --git a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.g.dart b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.g.dart index 5daa95f6..00f84c8f 100644 --- a/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.g.dart +++ b/app/lib/feature/kyoshin_monitor/data/provider/kyoshin_monitor_timer_stream.g.dart @@ -15,14 +15,15 @@ String _$kyoshinMonitorTimerStreamHash() => @ProviderFor(kyoshinMonitorTimerStream) final kyoshinMonitorTimerStreamProvider = AutoDisposeStreamProvider.internal( - kyoshinMonitorTimerStream, - name: r'kyoshinMonitorTimerStreamProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorTimerStreamHash, - dependencies: null, - allTransitiveDependencies: null, -); + kyoshinMonitorTimerStream, + name: r'kyoshinMonitorTimerStreamProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorTimerStreamHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element diff --git a/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart b/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart index 8ff7df88..b6262215 100644 --- a/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart +++ b/app/lib/feature/kyoshin_monitor/data/service/kyoshin_monitor_delay_adjust_service.dart @@ -10,7 +10,6 @@ enum KyoshinMonitorDelayAdjustType { /// 画像取得APIで404が返ってきたら、内部の遅延カウンタを増やす (NTPサーバーを基準にしている) imageFetch404Ntp, - ; } abstract class KyoshinMonitorDelayAdjustService {} diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_layer_information_dialog.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_layer_information_dialog.dart index 7883c4a6..239c8272 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_layer_information_dialog.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_layer_information_dialog.dart @@ -5,9 +5,9 @@ class RealtimeDataTypeInfoDialog extends StatelessWidget { const RealtimeDataTypeInfoDialog({super.key}); static Future show(BuildContext context) async => showDialog( - context: context, - builder: (context) => const RealtimeDataTypeInfoDialog(), - ); + context: context, + builder: (context) => const RealtimeDataTypeInfoDialog(), + ); @override Widget build(BuildContext context) { @@ -76,19 +76,16 @@ class _KyoshinMonitorSource extends StatelessWidget { const TextSpan(text: '上記説明は、'), WidgetSpan( child: InkWell( - onTap: () async => launchUrl( - Uri.parse( - 'https://www.kyoshin.bosai.go.jp/kyoshin/docs/new_kyoshinmonitor.shtml', - ), - ), + onTap: + () async => launchUrl( + Uri.parse( + 'https://www.kyoshin.bosai.go.jp/kyoshin/docs/new_kyoshinmonitor.shtml', + ), + ), child: Row( mainAxisSize: MainAxisSize.min, children: [ - Icon( - Icons.open_in_new, - size: 12, - color: hyperLinkColor, - ), + Icon(Icons.open_in_new, size: 12, color: hyperLinkColor), Text( '強震モニタについて - 防災科研', style: textTheme.bodyMedium!.copyWith( @@ -107,10 +104,7 @@ class _KyoshinMonitorSource extends StatelessWidget { } class _DataTypeInfo extends StatelessWidget { - const _DataTypeInfo({ - required this.title, - required this.description, - }); + const _DataTypeInfo({required this.title, required this.description}); final String title; final String description; @@ -128,9 +122,7 @@ class _DataTypeInfo extends StatelessWidget { children: [ Text( title, - style: textTheme.titleSmall!.copyWith( - fontWeight: FontWeight.bold, - ), + style: textTheme.titleSmall!.copyWith(fontWeight: FontWeight.bold), ), const SizedBox(height: 4), Text( diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_maintenance_card.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_maintenance_card.dart index 91182642..2dc05a78 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_maintenance_card.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_maintenance_card.dart @@ -17,34 +17,27 @@ class KyoshinMonitorMaintenanceCardnceCard extends ConsumerWidget { } final state = ref.watch(kyoshinMonitorMaintenanceProvider); return state.maybeWhen( - data: (data) => switch (data.type) { - MaintenanceMessageType.non => const SizedBox.shrink(), - _ => BorderedContainer( - accentColor: data.type == MaintenanceMessageType.highLight - ? Colors.orangeAccent.withValues(alpha: 0.2) - : null, - elevation: 1, - margin: const EdgeInsets.symmetric( - horizontal: 12, - ) + - const EdgeInsets.only( - bottom: 8, - ), - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, + data: + (data) => switch (data.type) { + MaintenanceMessageType.non => const SizedBox.shrink(), + _ => BorderedContainer( + accentColor: + data.type == MaintenanceMessageType.highLight + ? Colors.orangeAccent.withValues(alpha: 0.2) + : null, + elevation: 1, + margin: + const EdgeInsets.symmetric(horizontal: 12) + + const EdgeInsets.only(bottom: 8), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: Column( + children: [ + const SheetHeader(title: '強震モニタからのお知らせ'), + Html(shrinkWrap: true, data: data.message), + ], + ), ), - child: Column( - children: [ - const SheetHeader(title: '強震モニタからのお知らせ'), - Html( - shrinkWrap: true, - data: data.message, - ), - ], - ), - ), - }, + }, orElse: SizedBox.shrink, ); } diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart index b4e6456a..d672f230 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_scale.dart @@ -69,19 +69,12 @@ class KyoshinMonitorScale extends StatelessWidget { /// 各値に対応する位置と色を計算します List<({double position, double value, Color color})> get colorStops { final values = type.scaleValues; - return List.generate( - values.length, - (i) { - final value = values[i]; - final position = type.convertToPosition(value); - final colorIndex = (position * (_colors.length - 1)).round(); - return ( - position: position, - value: value, - color: _colors[colorIndex].$2, - ); - }, - ); + return List.generate(values.length, (i) { + final value = values[i]; + final position = type.convertToPosition(value); + final colorIndex = (position * (_colors.length - 1)).round(); + return (position: position, value: value, color: _colors[colorIndex].$2); + }); } @override @@ -95,10 +88,7 @@ class KyoshinMonitorScale extends StatelessWidget { orientation: orientation, textPosition: textPosition, textColor: textColor, - textStyle: textStyle ?? - const TextStyle( - fontSize: 10, - ), + textStyle: textStyle ?? const TextStyle(fontSize: 10), gradientDirection: gradientDirection, ), ); @@ -175,8 +165,7 @@ enum KyoshinMonitorScaleType { pgv, /// 最大変位(PGD: Peak Ground Displacement) - pgd, - ; + pgd; /// 値を0-1の範囲に正規化する /// @@ -192,44 +181,44 @@ enum KyoshinMonitorScaleType { /// 単位を取得 String get unit => switch (this) { - KyoshinMonitorScaleType.intensity => '', - KyoshinMonitorScaleType.pga => 'gal', - KyoshinMonitorScaleType.pgv => 'cm/s', - KyoshinMonitorScaleType.pgd => 'cm', - }; + KyoshinMonitorScaleType.intensity => '', + KyoshinMonitorScaleType.pga => 'gal', + KyoshinMonitorScaleType.pgv => 'cm/s', + KyoshinMonitorScaleType.pgd => 'cm', + }; /// タイトルを取得 String get title => switch (this) { - KyoshinMonitorScaleType.intensity => '震度', - KyoshinMonitorScaleType.pga => 'PGA', - KyoshinMonitorScaleType.pgv => 'PGV', - KyoshinMonitorScaleType.pgd => 'PGD', - }; + KyoshinMonitorScaleType.intensity => '震度', + KyoshinMonitorScaleType.pga => 'PGA', + KyoshinMonitorScaleType.pgv => 'PGV', + KyoshinMonitorScaleType.pgd => 'PGD', + }; /// 最小値を取得 double get minValue => switch (this) { - KyoshinMonitorScaleType.intensity => -3.0, - KyoshinMonitorScaleType.pga => 0.01, - KyoshinMonitorScaleType.pgv => 0.001, - KyoshinMonitorScaleType.pgd => 0.0001, - }; + KyoshinMonitorScaleType.intensity => -3.0, + KyoshinMonitorScaleType.pga => 0.01, + KyoshinMonitorScaleType.pgv => 0.001, + KyoshinMonitorScaleType.pgd => 0.0001, + }; /// 最大値を取得 double get maxValue => switch (this) { - KyoshinMonitorScaleType.intensity => 7.0, - KyoshinMonitorScaleType.pga => 1000.0, - KyoshinMonitorScaleType.pgv => 100.0, - KyoshinMonitorScaleType.pgd => 10.0, - }; + KyoshinMonitorScaleType.intensity => 7.0, + KyoshinMonitorScaleType.pga => 1000.0, + KyoshinMonitorScaleType.pgv => 100.0, + KyoshinMonitorScaleType.pgd => 10.0, + }; /// スケール値のリストを取得 List get scaleValues => switch (this) { - KyoshinMonitorScaleType.intensity => - List.generate(11, (i) => i - 3).map((e) => e.toDouble()).toList(), - KyoshinMonitorScaleType.pga => _generateLogValues(0.01, 1000), - KyoshinMonitorScaleType.pgv => _generateLogValues(0.001, 100), - KyoshinMonitorScaleType.pgd => _generateLogValues(0.0001, 10), - }; + KyoshinMonitorScaleType.intensity => + List.generate(11, (i) => i - 3).map((e) => e.toDouble()).toList(), + KyoshinMonitorScaleType.pga => _generateLogValues(0.01, 1000), + KyoshinMonitorScaleType.pgv => _generateLogValues(0.001, 100), + KyoshinMonitorScaleType.pgd => _generateLogValues(0.0001, 10), + }; /// 対数スケールの値を生成 List _generateLogValues(double min, double max) { @@ -295,51 +284,52 @@ class _KyoshinMonitorScalePainter extends CustomPainter { begin: switch ((orientation, gradientDirection)) { ( KyoshinMonitorScaleOrientation.horizontal, - KyoshinMonitorScaleGradientDirection.forward + KyoshinMonitorScaleGradientDirection.forward, ) => Alignment.centerLeft, ( KyoshinMonitorScaleOrientation.horizontal, - KyoshinMonitorScaleGradientDirection.reverse + KyoshinMonitorScaleGradientDirection.reverse, ) => Alignment.centerRight, ( KyoshinMonitorScaleOrientation.vertical, - KyoshinMonitorScaleGradientDirection.forward + KyoshinMonitorScaleGradientDirection.forward, ) => Alignment.topCenter, ( KyoshinMonitorScaleOrientation.vertical, - KyoshinMonitorScaleGradientDirection.reverse + KyoshinMonitorScaleGradientDirection.reverse, ) => Alignment.bottomCenter, }, end: switch ((orientation, gradientDirection)) { ( KyoshinMonitorScaleOrientation.horizontal, - KyoshinMonitorScaleGradientDirection.forward + KyoshinMonitorScaleGradientDirection.forward, ) => Alignment.centerRight, ( KyoshinMonitorScaleOrientation.horizontal, - KyoshinMonitorScaleGradientDirection.reverse + KyoshinMonitorScaleGradientDirection.reverse, ) => Alignment.centerLeft, ( KyoshinMonitorScaleOrientation.vertical, - KyoshinMonitorScaleGradientDirection.forward + KyoshinMonitorScaleGradientDirection.forward, ) => Alignment.bottomCenter, ( KyoshinMonitorScaleOrientation.vertical, - KyoshinMonitorScaleGradientDirection.reverse + KyoshinMonitorScaleGradientDirection.reverse, ) => Alignment.topCenter, }, ); - final paint = Paint() - ..shader = gradient.createShader(rect) - ..style = PaintingStyle.fill; + final paint = + Paint() + ..shader = gradient.createShader(rect) + ..style = PaintingStyle.fill; canvas.drawRect(rect, paint); @@ -350,10 +340,11 @@ class _KyoshinMonitorScalePainter extends CustomPainter { ); // 目盛り線の描画用のペイント - final tickPaint = Paint() - ..color = textColor - ..strokeWidth = 1.0 - ..style = PaintingStyle.stroke; + final tickPaint = + Paint() + ..color = textColor + ..strokeWidth = 1.0 + ..style = PaintingStyle.stroke; // 目盛りを描画する間隔を決定(震度は1固定) final interval = @@ -378,7 +369,8 @@ class _KyoshinMonitorScalePainter extends CustomPainter { gradientDirection == KyoshinMonitorScaleGradientDirection.reverse ? 1 - stop.position : stop.position; - final position = basePosition * + final position = + basePosition * (orientation == KyoshinMonitorScaleOrientation.horizontal ? size.width : size.height); @@ -415,9 +407,7 @@ class _KyoshinMonitorScalePainter extends CustomPainter { textPainter ..text = TextSpan( text: text, - style: textStyle.copyWith( - color: textColor, - ), + style: textStyle.copyWith(color: textColor), ) ..layout(); @@ -430,9 +420,10 @@ class _KyoshinMonitorScalePainter extends CustomPainter { ); case KyoshinMonitorScaleOrientation.vertical: // 重ならない場合は通常通り表示 - final x = textPosition == KyoshinMonitorScaleTextPosition.start - ? -textPainter.width - 6 - : size.width + 6; + final x = + textPosition == KyoshinMonitorScaleTextPosition.start + ? -textPainter.width - 6 + : size.width + 6; textPainter.paint( canvas, Offset(x, position - textPainter.height / 2), diff --git a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart index 8355f4af..5bc82fc3 100644 --- a/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart +++ b/app/lib/feature/kyoshin_monitor/page/components/kyoshin_monitor_status_card.dart @@ -6,22 +6,22 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:intl/intl.dart'; class KyoshinMonitorStatusCard extends ConsumerWidget { - const KyoshinMonitorStatusCard({ - this.onTap, - super.key, - }); + const KyoshinMonitorStatusCard({this.onTap, super.key}); final void Function()? onTap; @override Widget build(BuildContext context, WidgetRef ref) { - final latestTime = ref - .watch( - kyoshinMonitorNotifierProvider - .select((v) => v.valueOrNull?.lastUpdatedAt), - ) - ?.toLocal(); - final status = ref.watch( + final latestTime = + ref + .watch( + kyoshinMonitorNotifierProvider.select( + (v) => v.valueOrNull?.lastUpdatedAt, + ), + ) + ?.toLocal(); + final status = + ref.watch( kyoshinMonitorNotifierProvider.select((v) => v.valueOrNull?.status), ) ?? KyoshinMonitorStatus.stopped; @@ -52,45 +52,33 @@ class KyoshinMonitorStatusCard extends ConsumerWidget { // 現在時刻 ...switch (status) { KyoshinMonitorStatus.stopped => [ - const Icon( - Icons.access_time_rounded, - size: 16, - ), - const SizedBox(width: 4), - const Flexible( - child: Text( - '強震モニタ 取得停止中', - ), - ), - ], + const Icon(Icons.access_time_rounded, size: 16), + const SizedBox(width: 4), + const Flexible(child: Text('強震モニタ 取得停止中')), + ], _ when latestTime != null && status == KyoshinMonitorStatus.delayed => [ Flexible( child: Text( - DateFormat('yyyy/MM/dd HH:mm:ss') - .format(latestTime), - style: const TextStyle( - color: Colors.redAccent, - ), + DateFormat( + 'yyyy/MM/dd HH:mm:ss', + ).format(latestTime), + style: const TextStyle(color: Colors.redAccent), ), ), ], _ when latestTime != null => [ - Flexible( - child: Text( - dateFormat.format(latestTime), - ), - ), - ], + Flexible(child: Text(dateFormat.format(latestTime))), + ], _ => [ - const SizedBox( - height: 20, - width: 20, - child: CircularProgressIndicator.adaptive(), - ), - ], + const SizedBox( + height: 20, + width: 20, + child: CircularProgressIndicator.adaptive(), + ), + ], }, ], ), diff --git a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_observation_network_page.dart b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_observation_network_page.dart index 66b850f6..734e99c6 100644 --- a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_observation_network_page.dart +++ b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_observation_network_page.dart @@ -21,9 +21,7 @@ class KyoshinMonitorAboutObservationNetworkPage extends StatelessWidget { return Scaffold( extendBodyBehindAppBar: true, - appBar: AppBar( - title: const Text('MOWLASについて'), - ), + appBar: AppBar(title: const Text('MOWLASについて')), body: SingleChildScrollView( child: SafeArea( child: Padding( @@ -162,9 +160,7 @@ class KyoshinMonitorAboutObservationNetworkPage extends StatelessWidget { ), ), ), - const Text( - '※上記内容は2025年2月現在の情報です。最新の情報は各公式サイトをご確認ください。', - ), + const Text('※上記内容は2025年2月現在の情報です。最新の情報は各公式サイトをご確認ください。'), ], ), ), @@ -212,11 +208,7 @@ class _ObservationNetworkSection extends StatelessWidget { ), ), if (url != null) - Icon( - Icons.open_in_new, - size: 16, - color: colorScheme.primary, - ), + Icon(Icons.open_in_new, size: 16, color: colorScheme.primary), ], ), ), @@ -224,7 +216,8 @@ class _ObservationNetworkSection extends StatelessWidget { Text( description.map((e) => '・$e').join('\n'), style: textTheme.bodyMedium?.copyWith( - color: descriptionColor ?? + color: + descriptionColor ?? colorScheme.onSurfaceVariant.withValues(alpha: 0.8), height: 1.5, ), @@ -235,10 +228,7 @@ class _ObservationNetworkSection extends StatelessWidget { } class _LinkItem extends StatelessWidget { - const _LinkItem({ - required this.title, - required this.url, - }); + const _LinkItem({required this.title, required this.url}); final String title; final String url; @@ -253,18 +243,9 @@ class _LinkItem extends StatelessWidget { child: Row( children: [ Expanded( - child: Text( - title, - style: TextStyle( - color: colorScheme.primary, - ), - ), - ), - Icon( - Icons.open_in_new, - size: 16, - color: colorScheme.primary, + child: Text(title, style: TextStyle(color: colorScheme.primary)), ), + Icon(Icons.open_in_new, size: 16, color: colorScheme.primary), ], ), ); diff --git a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_page.dart b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_page.dart index 0b959f7f..4804d828 100644 --- a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_page.dart +++ b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_about_page.dart @@ -22,9 +22,7 @@ class KyoshinMonitorAboutPage extends HookConsumerWidget { final textTheme = theme.textTheme; return Scaffold( - appBar: AppBar( - title: const Text('強震モニタとは?'), - ), + appBar: AppBar(title: const Text('強震モニタとは?')), body: SingleChildScrollView( child: SafeArea( child: Padding( @@ -38,10 +36,7 @@ class KyoshinMonitorAboutPage extends HookConsumerWidget { '日本全国の観測点の揺れの状況を青から赤までの色で表示します。', style: textTheme.bodyMedium, ), - _SectionTitle( - title: '表示可能なデータ', - style: textTheme.titleMedium, - ), + _SectionTitle(title: '表示可能なデータ', style: textTheme.titleMedium), const _InfoCard( items: [ _InfoItem( @@ -66,10 +61,7 @@ class KyoshinMonitorAboutPage extends HookConsumerWidget { ), ], ), - _SectionTitle( - title: '観測点について', - style: textTheme.titleMedium, - ), + _SectionTitle(title: '観測点について', style: textTheme.titleMedium), _InfoCard( items: const [ _InfoItem( @@ -82,15 +74,13 @@ class KyoshinMonitorAboutPage extends HookConsumerWidget { '全国約700ヶ所に設置された地中の強震計による観測網です。地表と地中の両方で観測を行います。', ), ], - onTapMore: () async => - const KyoshinMonitorAboutObservationNetworkRoute() - .push(context), + onTapMore: + () async => + const KyoshinMonitorAboutObservationNetworkRoute() + .push(context), tapMoreText: '日本を取り巻く観測網について', ), - _SectionTitle( - title: '利用上の注意', - style: textTheme.titleMedium, - ), + _SectionTitle(title: '利用上の注意', style: textTheme.titleMedium), const _InfoCard( isWarning: true, items: [ @@ -122,10 +112,7 @@ class KyoshinMonitorAboutPage extends HookConsumerWidget { } class _SectionTitle extends StatelessWidget { - const _SectionTitle({ - required this.title, - required this.style, - }); + const _SectionTitle({required this.title, required this.style}); final String title; final TextStyle? style; @@ -134,12 +121,7 @@ class _SectionTitle extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.symmetric(horizontal: 8), - child: Text( - title, - style: style?.copyWith( - fontWeight: FontWeight.bold, - ), - ), + child: Text(title, style: style?.copyWith(fontWeight: FontWeight.bold)), ); } } @@ -210,20 +192,14 @@ class _InfoCard extends StatelessWidget { } class _InfoItem { - const _InfoItem({ - required this.title, - required this.description, - }); + const _InfoItem({required this.title, required this.description}); final String title; final String description; } class _InfoItemWidget extends StatelessWidget { - const _InfoItemWidget({ - required this.item, - this.textColor, - }); + const _InfoItemWidget({required this.item, this.textColor}); final _InfoItem item; final Color? textColor; @@ -239,15 +215,14 @@ class _InfoItemWidget extends StatelessWidget { children: [ Text( '• ${item.title}', - style: textTheme.bodyLarge?.copyWith( - color: textColor, - ), + style: textTheme.bodyLarge?.copyWith(color: textColor), ), Text( item.description, style: textTheme.bodyMedium?.copyWith( - color: (textColor ?? colorScheme.onSurfaceVariant) - .withValues(alpha: 0.8), + color: (textColor ?? colorScheme.onSurfaceVariant).withValues( + alpha: 0.8, + ), ), ), ], diff --git a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart index bac4f95d..dec7f765 100644 --- a/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart +++ b/app/lib/feature/kyoshin_monitor/page/kyoshin_monitor_settings_modal.dart @@ -18,15 +18,14 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { const KyoshinMonitorSettingsModal({super.key}); static Future show(BuildContext context) => Navigator.of(context).push( - AppSheetRoute( - builder: (context) => const ClipRRect( - borderRadius: BorderRadius.vertical( - top: Radius.circular(16), - ), + AppSheetRoute( + builder: + (context) => const ClipRRect( + borderRadius: BorderRadius.vertical(top: Radius.circular(16)), child: KyoshinMonitorSettingsModal(), ), - ), - ); + ), + ); @override Widget build(BuildContext context, WidgetRef ref) { @@ -34,8 +33,9 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { final colorScheme = theme.colorScheme; final backgroundColor = colorScheme.surfaceContainerLow; - final isEnabled = - ref.watch(kyoshinMonitorSettingsProvider.select((v) => v.useKmoni)); + final isEnabled = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.useKmoni), + ); return Scaffold( backgroundColor: backgroundColor, @@ -75,9 +75,7 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { ), ], ), - const SliverToBoxAdapter( - child: _KyoshinMonitorSwitchListTile(), - ), + const SliverToBoxAdapter(child: _KyoshinMonitorSwitchListTile()), if (isEnabled) SliverSafeArea( top: false, @@ -86,8 +84,9 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { Align( alignment: Alignment.centerRight, child: TextButton.icon( - onPressed: () async => - const KyoshinMonitorAboutRoute().push(context), + onPressed: + () async => const KyoshinMonitorAboutRoute() + .push(context), icon: const Icon(Icons.info_outline_rounded), label: const Text('強震モニタとは?'), ), @@ -96,35 +95,39 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { title: 'リアルタイムデータの種類', trailing: IconButton( icon: const Icon(Icons.info_outline), - onPressed: () async => - RealtimeDataTypeInfoDialog.show(context), + onPressed: + () async => RealtimeDataTypeInfoDialog.show(context), ), child: _RealtimeDataTypeSelector( - value: ref - .watch(kyoshinMonitorSettingsProvider) - .realtimeDataType, - onChanged: (value) async => ref - .read(kyoshinMonitorSettingsProvider.notifier) - .save( - ref - .read(kyoshinMonitorSettingsProvider) - .copyWith(realtimeDataType: value), - ), + value: + ref + .watch(kyoshinMonitorSettingsProvider) + .realtimeDataType, + onChanged: + (value) async => ref + .read(kyoshinMonitorSettingsProvider.notifier) + .save( + ref + .read(kyoshinMonitorSettingsProvider) + .copyWith(realtimeDataType: value), + ), ), ), _SettingSection( title: 'リアルタイムデータのレイヤー', child: _RealtimeLayerSelector( - value: ref - .watch(kyoshinMonitorSettingsProvider) - .realtimeLayer, - onChanged: (value) async => ref - .read(kyoshinMonitorSettingsProvider.notifier) - .save( - ref - .read(kyoshinMonitorSettingsProvider) - .copyWith(realtimeLayer: value), - ), + value: + ref + .watch(kyoshinMonitorSettingsProvider) + .realtimeLayer, + onChanged: + (value) async => ref + .read(kyoshinMonitorSettingsProvider.notifier) + .save( + ref + .read(kyoshinMonitorSettingsProvider) + .copyWith(realtimeLayer: value), + ), ), ), _SettingSection( @@ -132,16 +135,18 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { description: '観測点の円の周りに灰色の枠を表示します。\n地図の背景や他の観測点とのコントラストを高めることができます。', child: _MarkerTypeSelector( - value: ref - .watch(kyoshinMonitorSettingsProvider) - .kmoniMarkerType, - onChanged: (value) async => ref - .read(kyoshinMonitorSettingsProvider.notifier) - .save( - ref - .read(kyoshinMonitorSettingsProvider) - .copyWith(kmoniMarkerType: value), - ), + value: + ref + .watch(kyoshinMonitorSettingsProvider) + .kmoniMarkerType, + onChanged: + (value) async => ref + .read(kyoshinMonitorSettingsProvider.notifier) + .save( + ref + .read(kyoshinMonitorSettingsProvider) + .copyWith(kmoniMarkerType: value), + ), ), ), _SettingSection( @@ -155,16 +160,18 @@ class KyoshinMonitorSettingsModal extends HookConsumerWidget { 'リアルタイムデータの点の色が、どの値を示すかのスケールを表示します\n' '地図画面左上の時刻表示をタップすることで、切り替えることもできます', ), - value: ref - .watch(kyoshinMonitorSettingsProvider) - .showScale, - onChanged: (value) async => ref - .read(kyoshinMonitorSettingsProvider.notifier) - .save( - ref - .read(kyoshinMonitorSettingsProvider) - .copyWith(showScale: value), - ), + value: + ref + .watch(kyoshinMonitorSettingsProvider) + .showScale, + onChanged: + (value) async => ref + .read(kyoshinMonitorSettingsProvider.notifier) + .save( + ref + .read(kyoshinMonitorSettingsProvider) + .copyWith(showScale: value), + ), ), ], ), @@ -183,25 +190,26 @@ class _KyoshinMonitorSwitchListTile extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final isEnabled = - ref.watch(kyoshinMonitorSettingsProvider.select((v) => v.useKmoni)); + final isEnabled = ref.watch( + kyoshinMonitorSettingsProvider.select((v) => v.useKmoni), + ); return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: AppListTile.switchListTile( title: '強震モニタを利用する', subtitle: '強震モニタを利用するかどうかを選択します', value: isEnabled, - onChanged: (value) async => selectionHapticFunction( - () async => ref.read(kyoshinMonitorSettingsProvider.notifier).save( - ref - .read(kyoshinMonitorSettingsProvider) - .copyWith(useKmoni: value), - ), - ), + onChanged: + (value) async => selectionHapticFunction( + () async => ref + .read(kyoshinMonitorSettingsProvider.notifier) + .save( + ref + .read(kyoshinMonitorSettingsProvider) + .copyWith(useKmoni: value), + ), + ), ), ); } @@ -226,10 +234,7 @@ class _SettingSection extends StatelessWidget { final colorScheme = theme.colorScheme; final textTheme = theme.textTheme; return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -279,24 +284,17 @@ class _RealtimeDataTypeSelector extends StatelessWidget { onChanged(value); } }, - dropdownMenuEntries: RealtimeDataType.values - .where((e) => !e.isLpgm) - .map( - (e) => DropdownMenuEntry( - value: e, - label: e.displayName, - ), - ) - .toList(), + dropdownMenuEntries: + RealtimeDataType.values + .where((e) => !e.isLpgm) + .map((e) => DropdownMenuEntry(value: e, label: e.displayName)) + .toList(), ); } } class _RealtimeLayerSelector extends StatelessWidget { - const _RealtimeLayerSelector({ - required this.value, - required this.onChanged, - }); + const _RealtimeLayerSelector({required this.value, required this.onChanged}); final RealtimeLayer value; final void Function(RealtimeLayer) onChanged; @@ -311,24 +309,15 @@ class _RealtimeLayerSelector extends StatelessWidget { } }, dropdownMenuEntries: const [ - DropdownMenuEntry( - value: RealtimeLayer.surface, - label: '地表', - ), - DropdownMenuEntry( - value: RealtimeLayer.underground, - label: '地中', - ), + DropdownMenuEntry(value: RealtimeLayer.surface, label: '地表'), + DropdownMenuEntry(value: RealtimeLayer.underground, label: '地中'), ], ); } } class _MarkerTypeSelector extends StatelessWidget { - const _MarkerTypeSelector({ - required this.value, - required this.onChanged, - }); + const _MarkerTypeSelector({required this.value, required this.onChanged}); final KyoshinMonitorMarkerType value; final void Function(KyoshinMonitorMarkerType) onChanged; @@ -342,18 +331,19 @@ class _MarkerTypeSelector extends StatelessWidget { onChanged(value); } }, - dropdownMenuEntries: KyoshinMonitorMarkerType.values - .map( - (value) => DropdownMenuEntry( - value: value, - label: switch (value) { - KyoshinMonitorMarkerType.always => '常に表示', - KyoshinMonitorMarkerType.onlyEew => 'EEW時のみ', - KyoshinMonitorMarkerType.never => '表示しない', - }, - ), - ) - .toList(), + dropdownMenuEntries: + KyoshinMonitorMarkerType.values + .map( + (value) => DropdownMenuEntry( + value: value, + label: switch (value) { + KyoshinMonitorMarkerType.always => '常に表示', + KyoshinMonitorMarkerType.onlyEew => 'EEW時のみ', + KyoshinMonitorMarkerType.never => '表示しない', + }, + ), + ) + .toList(), ); } } diff --git a/app/lib/feature/location/data/location.dart b/app/lib/feature/location/data/location.dart index 8d6e9491..d2c527a4 100644 --- a/app/lib/feature/location/data/location.dart +++ b/app/lib/feature/location/data/location.dart @@ -10,9 +10,7 @@ part 'location.g.dart'; @riverpod Stream locationStream(Ref ref) async* { final stream = Geolocator.getPositionStream( - locationSettings: const LocationSettings( - accuracy: LocationAccuracy.low, - ), + locationSettings: const LocationSettings(accuracy: LocationAccuracy.low), ); final lastKnownPosition = await Geolocator.getLastKnownPosition(); @@ -21,9 +19,7 @@ Stream locationStream(Ref ref) async* { } final currentPosition = await Geolocator.getCurrentPosition( - locationSettings: const LocationSettings( - accuracy: LocationAccuracy.low, - ), + locationSettings: const LocationSettings(accuracy: LocationAccuracy.low), ); yield currentPosition; @@ -50,7 +46,7 @@ Stream<(KyoshinObservationPoint, double km)> closestKmoniObservationPointStream( LengthUnit.Kilometer, LatLng(e.location.latitude, e.location.longitude), currentPosition, - ) + ), ), ) .reduce((a, b) => a.$2 < b.$2 ? a : b); diff --git a/app/lib/feature/location/data/location.g.dart b/app/lib/feature/location/data/location.g.dart index 54098f45..ba5cc3a6 100644 --- a/app/lib/feature/location/data/location.g.dart +++ b/app/lib/feature/location/data/location.g.dart @@ -15,9 +15,10 @@ String _$locationStreamHash() => r'512cf5869f3db7a5bc88d1c027ab5cc84e006ab8'; final locationStreamProvider = AutoDisposeStreamProvider.internal( locationStream, name: r'locationStreamProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$locationStreamHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$locationStreamHash, dependencies: null, allTransitiveDependencies: null, ); @@ -34,18 +35,19 @@ String _$closestKmoniObservationPointStreamHash() => @ProviderFor(closestKmoniObservationPointStream) final closestKmoniObservationPointStreamProvider = AutoDisposeStreamProvider<(KyoshinObservationPoint, double km)>.internal( - closestKmoniObservationPointStream, - name: r'closestKmoniObservationPointStreamProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$closestKmoniObservationPointStreamHash, - dependencies: null, - allTransitiveDependencies: null, -); + closestKmoniObservationPointStream, + name: r'closestKmoniObservationPointStreamProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$closestKmoniObservationPointStreamHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef ClosestKmoniObservationPointStreamRef - = AutoDisposeStreamProviderRef<(KyoshinObservationPoint, double km)>; +typedef ClosestKmoniObservationPointStreamRef = + AutoDisposeStreamProviderRef<(KyoshinObservationPoint, double km)>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/location/data/location_tracking_mode.g.dart b/app/lib/feature/location/data/location_tracking_mode.g.dart index f4ec1ffa..8761beff 100644 --- a/app/lib/feature/location/data/location_tracking_mode.g.dart +++ b/app/lib/feature/location/data/location_tracking_mode.g.dart @@ -15,14 +15,15 @@ String _$locationTrackingModeHash() => @ProviderFor(LocationTrackingMode) final locationTrackingModeProvider = AutoDisposeNotifierProvider.internal( - LocationTrackingMode.new, - name: r'locationTrackingModeProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$locationTrackingModeHash, - dependencies: null, - allTransitiveDependencies: null, -); + LocationTrackingMode.new, + name: r'locationTrackingModeProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$locationTrackingModeHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$LocationTrackingMode = AutoDisposeNotifier; // ignore_for_file: type=lint diff --git a/app/lib/feature/map/data/controller/camera_controller.dart b/app/lib/feature/map/data/controller/camera_controller.dart index 7a40317e..1df53771 100644 --- a/app/lib/feature/map/data/controller/camera_controller.dart +++ b/app/lib/feature/map/data/controller/camera_controller.dart @@ -22,12 +22,7 @@ class MapCameraController extends _$MapCameraController { } /// カメラを指定位置に移動 - void moveTo({ - LatLng? target, - double? zoom, - double? tilt, - double? bearing, - }) { + void moveTo({LatLng? target, double? zoom, double? tilt, double? bearing}) { state = MapCameraPosition( target: target ?? state.target, zoom: zoom ?? state.zoom, @@ -37,10 +32,7 @@ class MapCameraController extends _$MapCameraController { } /// カメラを指定の境界に合わせて移動 - void moveToLatLngBounds( - LatLngBounds bounds, { - double padding = 50, - }) { + void moveToLatLngBounds(LatLngBounds bounds, {double padding = 50}) { // 境界の中心を計算 final center = LatLng( (bounds.northeast.latitude + bounds.southwest.latitude) / 2, @@ -57,10 +49,7 @@ class MapCameraController extends _$MapCameraController { padding, ); - moveTo( - target: center, - zoom: min(latZoom, lngZoom), - ); + moveTo(target: center, zoom: min(latZoom, lngZoom)); } /// 距離からズームレベルを計算 diff --git a/app/lib/feature/map/data/controller/camera_controller.g.dart b/app/lib/feature/map/data/controller/camera_controller.g.dart index 9e3b8074..bb99af6b 100644 --- a/app/lib/feature/map/data/controller/camera_controller.g.dart +++ b/app/lib/feature/map/data/controller/camera_controller.g.dart @@ -16,12 +16,15 @@ String _$mapCameraControllerHash() => /// Copied from [MapCameraController]. @ProviderFor(MapCameraController) final mapCameraControllerProvider = AutoDisposeNotifierProvider< - MapCameraController, MapCameraPosition>.internal( + MapCameraController, + MapCameraPosition +>.internal( MapCameraController.new, name: r'mapCameraControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$mapCameraControllerHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$mapCameraControllerHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/map/data/controller/declarative_map_controller.dart b/app/lib/feature/map/data/controller/declarative_map_controller.dart index 38a11651..6fb7244a 100644 --- a/app/lib/feature/map/data/controller/declarative_map_controller.dart +++ b/app/lib/feature/map/data/controller/declarative_map_controller.dart @@ -26,9 +26,7 @@ class DeclarativeMapController { /// カメラの位置を設定 Future moveCameraToPosition(CameraPosition position) async { - await moveCamera( - CameraUpdate.newCameraPosition(position), - ); + await moveCamera(CameraUpdate.newCameraPosition(position)); } Future addHypocenterImages() async { diff --git a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart index 0ad57c3c..173bc43f 100644 --- a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart +++ b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.dart @@ -13,20 +13,22 @@ class EewEstimatedIntensityLayerController extends _$EewEstimatedIntensityLayerController { @override EewEstimatedIntensityLayer build(JmaForecastIntensity intensity) { - final intensityColorMap = - ref.watch(intensityColorProvider).fromJmaForecastIntensity(intensity); + final intensityColorMap = ref + .watch(intensityColorProvider) + .fromJmaForecastIntensity(intensity); final backgroundColor = intensityColorMap.background; final aliveEews = ref.watch(eewAliveTelegramProvider); - final regionCodes = (aliveEews ?? []) - .map((eew) => eew.regions) - .nonNulls - .flattened - .where( - (eew) => eew.forecastMaxInt.toDisplayMaxInt().maxInt == intensity, - ) - .map((eew) => eew.code) - .toList(); + final regionCodes = + (aliveEews ?? []) + .map((eew) => eew.regions) + .nonNulls + .flattened + .where( + (eew) => eew.forecastMaxInt.toDisplayMaxInt().maxInt == intensity, + ) + .map((eew) => eew.code) + .toList(); return EewEstimatedIntensityLayer.fromJmaForecastIntensity( color: backgroundColor, intensity: intensity, diff --git a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart index 6b20492f..32dce083 100644 --- a/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart +++ b/app/lib/feature/map/data/controller/eew_estimated_intensity_controller.g.dart @@ -36,9 +36,7 @@ abstract class _$EewEstimatedIntensityLayerController extends BuildlessNotifier { late final JmaForecastIntensity intensity; - EewEstimatedIntensityLayer build( - JmaForecastIntensity intensity, - ); + EewEstimatedIntensityLayer build(JmaForecastIntensity intensity); } /// See also [EewEstimatedIntensityLayerController]. @@ -56,18 +54,14 @@ class EewEstimatedIntensityLayerControllerFamily EewEstimatedIntensityLayerControllerProvider call( JmaForecastIntensity intensity, ) { - return EewEstimatedIntensityLayerControllerProvider( - intensity, - ); + return EewEstimatedIntensityLayerControllerProvider(intensity); } @override EewEstimatedIntensityLayerControllerProvider getProviderOverride( covariant EewEstimatedIntensityLayerControllerProvider provider, ) { - return call( - provider.intensity, - ); + return call(provider.intensity); } static const Iterable? _dependencies = null; @@ -86,25 +80,28 @@ class EewEstimatedIntensityLayerControllerFamily } /// See also [EewEstimatedIntensityLayerController]. -class EewEstimatedIntensityLayerControllerProvider extends NotifierProviderImpl< - EewEstimatedIntensityLayerController, EewEstimatedIntensityLayer> { +class EewEstimatedIntensityLayerControllerProvider + extends + NotifierProviderImpl< + EewEstimatedIntensityLayerController, + EewEstimatedIntensityLayer + > { /// See also [EewEstimatedIntensityLayerController]. - EewEstimatedIntensityLayerControllerProvider( - JmaForecastIntensity intensity, - ) : this._internal( - () => EewEstimatedIntensityLayerController()..intensity = intensity, - from: eewEstimatedIntensityLayerControllerProvider, - name: r'eewEstimatedIntensityLayerControllerProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewEstimatedIntensityLayerControllerHash, - dependencies: - EewEstimatedIntensityLayerControllerFamily._dependencies, - allTransitiveDependencies: EewEstimatedIntensityLayerControllerFamily - ._allTransitiveDependencies, - intensity: intensity, - ); + EewEstimatedIntensityLayerControllerProvider(JmaForecastIntensity intensity) + : this._internal( + () => EewEstimatedIntensityLayerController()..intensity = intensity, + from: eewEstimatedIntensityLayerControllerProvider, + name: r'eewEstimatedIntensityLayerControllerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewEstimatedIntensityLayerControllerHash, + dependencies: EewEstimatedIntensityLayerControllerFamily._dependencies, + allTransitiveDependencies: + EewEstimatedIntensityLayerControllerFamily + ._allTransitiveDependencies, + intensity: intensity, + ); EewEstimatedIntensityLayerControllerProvider._internal( super._createNotifier, { @@ -122,14 +119,13 @@ class EewEstimatedIntensityLayerControllerProvider extends NotifierProviderImpl< EewEstimatedIntensityLayer runNotifierBuild( covariant EewEstimatedIntensityLayerController notifier, ) { - return notifier.build( - intensity, - ); + return notifier.build(intensity); } @override Override overrideWith( - EewEstimatedIntensityLayerController Function() create) { + EewEstimatedIntensityLayerController Function() create, + ) { return ProviderOverride( origin: this, override: EewEstimatedIntensityLayerControllerProvider._internal( @@ -145,8 +141,11 @@ class EewEstimatedIntensityLayerControllerProvider extends NotifierProviderImpl< } @override - NotifierProviderElement createElement() { + NotifierProviderElement< + EewEstimatedIntensityLayerController, + EewEstimatedIntensityLayer + > + createElement() { return _EewEstimatedIntensityLayerControllerProviderElement(this); } @@ -174,8 +173,11 @@ mixin EewEstimatedIntensityLayerControllerRef } class _EewEstimatedIntensityLayerControllerProviderElement - extends NotifierProviderElement + extends + NotifierProviderElement< + EewEstimatedIntensityLayerController, + EewEstimatedIntensityLayer + > with EewEstimatedIntensityLayerControllerRef { _EewEstimatedIntensityLayerControllerProviderElement(super.provider); @@ -183,5 +185,6 @@ class _EewEstimatedIntensityLayerControllerProviderElement JmaForecastIntensity get intensity => (origin as EewEstimatedIntensityLayerControllerProvider).intensity; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart index f24af12a..ed77abc8 100644 --- a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart +++ b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.dart @@ -10,17 +10,17 @@ class EewHypocenterLayerController extends _$EewHypocenterLayerController { @override EewHypocenterLayer build(EewHypocenterIcon icon) { ref - ..listen( - eewAliveTelegramProvider, - (_, next) { - final hypocenters = (next ?? []) - .where( - (eew) { - final isLowPrecise = eew.isLevelEew || + ..listen(eewAliveTelegramProvider, (_, next) { + final hypocenters = + (next ?? []) + .where((eew) { + final isLowPrecise = + eew.isLevelEew || (eew.isPlum ?? false) || (eew.isIpfOnePoint); - final base = eew.latitude != null && + final base = + eew.latitude != null && eew.longitude != null && !eew.isCanceled; @@ -28,29 +28,20 @@ class EewHypocenterLayerController extends _$EewHypocenterLayerController { EewHypocenterIcon.normal => base && !isLowPrecise, EewHypocenterIcon.lowPrecise => base && isLowPrecise, }; - }, - ) - .map( - (eew) => EewHypocenter( - latitude: eew.latitude!, - longitude: eew.longitude!, - ), - ) - .toList(); + }) + .map( + (eew) => EewHypocenter( + latitude: eew.latitude!, + longitude: eew.longitude!, + ), + ) + .toList(); - state = state.copyWith( - hypocenters: hypocenters, - ); - }, - ) - ..listen( - timeTickerProvider(const Duration(milliseconds: 500)), - (_, __) { - state = state.copyWith( - visible: !state.visible, - ); - }, - ); + state = state.copyWith(hypocenters: hypocenters); + }) + ..listen(timeTickerProvider(const Duration(milliseconds: 500)), (_, __) { + state = state.copyWith(visible: !state.visible); + }); return EewHypocenterLayer( id: 'eew-hypocenter-${icon.name}', diff --git a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart index cfbcd5d7..1e06ecf3 100644 --- a/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/eew_hypocenter_layer_controller.g.dart @@ -36,9 +36,7 @@ abstract class _$EewHypocenterLayerController extends BuildlessAutoDisposeNotifier { late final EewHypocenterIcon icon; - EewHypocenterLayer build( - EewHypocenterIcon icon, - ); + EewHypocenterLayer build(EewHypocenterIcon icon); } /// See also [EewHypocenterLayerController]. @@ -52,21 +50,15 @@ class EewHypocenterLayerControllerFamily extends Family { const EewHypocenterLayerControllerFamily(); /// See also [EewHypocenterLayerController]. - EewHypocenterLayerControllerProvider call( - EewHypocenterIcon icon, - ) { - return EewHypocenterLayerControllerProvider( - icon, - ); + EewHypocenterLayerControllerProvider call(EewHypocenterIcon icon) { + return EewHypocenterLayerControllerProvider(icon); } @override EewHypocenterLayerControllerProvider getProviderOverride( covariant EewHypocenterLayerControllerProvider provider, ) { - return call( - provider.icon, - ); + return call(provider.icon); } static const Iterable? _dependencies = null; @@ -86,24 +78,26 @@ class EewHypocenterLayerControllerFamily extends Family { /// See also [EewHypocenterLayerController]. class EewHypocenterLayerControllerProvider - extends AutoDisposeNotifierProviderImpl { + extends + AutoDisposeNotifierProviderImpl< + EewHypocenterLayerController, + EewHypocenterLayer + > { /// See also [EewHypocenterLayerController]. - EewHypocenterLayerControllerProvider( - EewHypocenterIcon icon, - ) : this._internal( - () => EewHypocenterLayerController()..icon = icon, - from: eewHypocenterLayerControllerProvider, - name: r'eewHypocenterLayerControllerProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewHypocenterLayerControllerHash, - dependencies: EewHypocenterLayerControllerFamily._dependencies, - allTransitiveDependencies: - EewHypocenterLayerControllerFamily._allTransitiveDependencies, - icon: icon, - ); + EewHypocenterLayerControllerProvider(EewHypocenterIcon icon) + : this._internal( + () => EewHypocenterLayerController()..icon = icon, + from: eewHypocenterLayerControllerProvider, + name: r'eewHypocenterLayerControllerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewHypocenterLayerControllerHash, + dependencies: EewHypocenterLayerControllerFamily._dependencies, + allTransitiveDependencies: + EewHypocenterLayerControllerFamily._allTransitiveDependencies, + icon: icon, + ); EewHypocenterLayerControllerProvider._internal( super._createNotifier, { @@ -121,9 +115,7 @@ class EewHypocenterLayerControllerProvider EewHypocenterLayer runNotifierBuild( covariant EewHypocenterLayerController notifier, ) { - return notifier.build( - icon, - ); + return notifier.build(icon); } @override @@ -143,8 +135,11 @@ class EewHypocenterLayerControllerProvider } @override - AutoDisposeNotifierProviderElement createElement() { + AutoDisposeNotifierProviderElement< + EewHypocenterLayerController, + EewHypocenterLayer + > + createElement() { return _EewHypocenterLayerControllerProviderElement(this); } @@ -171,13 +166,18 @@ mixin EewHypocenterLayerControllerRef } class _EewHypocenterLayerControllerProviderElement - extends AutoDisposeNotifierProviderElement with EewHypocenterLayerControllerRef { + extends + AutoDisposeNotifierProviderElement< + EewHypocenterLayerController, + EewHypocenterLayer + > + with EewHypocenterLayerControllerRef { _EewHypocenterLayerControllerProviderElement(super.provider); @override EewHypocenterIcon get icon => (origin as EewHypocenterLayerControllerProvider).icon; } + // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart b/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart index d9ae5891..db74ee0c 100644 --- a/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart +++ b/app/lib/feature/map/data/controller/eew_ps_wave_controller.dart @@ -12,32 +12,20 @@ part 'eew_ps_wave_controller.g.dart'; class EewPsWaveFillLayerController extends _$EewPsWaveFillLayerController { @override List build() => [ - EewWaveFillLayer.sWaveWarning( - color: Colors.redAccent, - ), - EewWaveFillLayer.sWaveNotWarning( - color: Colors.orangeAccent, - ), - EewWaveFillLayer.pWave( - color: Colors.blue, - ), - ]; + EewWaveFillLayer.sWaveWarning(color: Colors.redAccent), + EewWaveFillLayer.sWaveNotWarning(color: Colors.orangeAccent), + EewWaveFillLayer.pWave(color: Colors.blue), + ]; } @Riverpod(keepAlive: true) class EewPsWaveLineLayerController extends _$EewPsWaveLineLayerController { @override List build() => [ - EewWaveLineLayer.sWaveWarning( - color: Colors.redAccent, - ), - EewWaveLineLayer.sWaveNotWarning( - color: Colors.orangeAccent, - ), - EewWaveLineLayer.pWave( - color: Colors.blue, - ), - ]; + EewWaveLineLayer.sWaveWarning(color: Colors.redAccent), + EewWaveLineLayer.sWaveNotWarning(color: Colors.orangeAccent), + EewWaveLineLayer.pWave(color: Colors.blue), + ]; } @Riverpod(keepAlive: true) @@ -45,49 +33,45 @@ class EewPsWaveSourceLayerController extends _$EewPsWaveSourceLayerController { @override EewPsWaveSourceLayer build() { final travelTime = ref.watch(travelTimeDepthMapProvider); - final now = ref - .watch( - timeTickerProvider( - const Duration(milliseconds: 100), - ), - ) + final now = + ref + .watch(timeTickerProvider(const Duration(milliseconds: 100))) .valueOrNull ?? DateTime.now(); final aliveEews = ref.watch(eewAliveTelegramProvider); - final items = (aliveEews ?? []) - .whereNot( - (eew) => eew.isIpfOnePoint || eew.isLevelEew || (eew.isPlum ?? false), - ) - .map((eew) { - final latitude = eew.latitude; - final longitude = eew.longitude; - final depth = eew.depth; - final originTime = eew.originTime; - if (latitude == null || - longitude == null || - depth == null || - originTime == null) { - print( - 'latitude: $latitude, longitude: $longitude, depth: $depth, originTime: $originTime', - ); - return null; - } - final time = now.difference(originTime).inMilliseconds / 1000; - final result = travelTime.getTravelTime(depth ~/ 10 * 10, time); - return EewPsWaveLayerItem( - latitude: latitude, - longitude: longitude, - travelTime: result, - isWarning: eew.isWarning ?? false, - ); - }) - .nonNulls - .toList(); + final items = + (aliveEews ?? []) + .whereNot( + (eew) => + eew.isIpfOnePoint || eew.isLevelEew || (eew.isPlum ?? false), + ) + .map((eew) { + final latitude = eew.latitude; + final longitude = eew.longitude; + final depth = eew.depth; + final originTime = eew.originTime; + if (latitude == null || + longitude == null || + depth == null || + originTime == null) { + print( + 'latitude: $latitude, longitude: $longitude, depth: $depth, originTime: $originTime', + ); + return null; + } + final time = now.difference(originTime).inMilliseconds / 1000; + final result = travelTime.getTravelTime(depth ~/ 10 * 10, time); + return EewPsWaveLayerItem( + latitude: latitude, + longitude: longitude, + travelTime: result, + isWarning: eew.isWarning ?? false, + ); + }) + .nonNulls + .toList(); - return EewPsWaveSourceLayer( - id: 'eew_ps_wave_source', - items: items, - ); + return EewPsWaveSourceLayer(id: 'eew_ps_wave_source', items: items); } } diff --git a/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart b/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart index d3d3ce45..b50c9fb3 100644 --- a/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart +++ b/app/lib/feature/map/data/controller/eew_ps_wave_controller.g.dart @@ -14,12 +14,15 @@ String _$eewPsWaveFillLayerControllerHash() => /// See also [EewPsWaveFillLayerController]. @ProviderFor(EewPsWaveFillLayerController) final eewPsWaveFillLayerControllerProvider = NotifierProvider< - EewPsWaveFillLayerController, List>.internal( + EewPsWaveFillLayerController, + List +>.internal( EewPsWaveFillLayerController.new, name: r'eewPsWaveFillLayerControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewPsWaveFillLayerControllerHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewPsWaveFillLayerControllerHash, dependencies: null, allTransitiveDependencies: null, ); @@ -31,12 +34,15 @@ String _$eewPsWaveLineLayerControllerHash() => /// See also [EewPsWaveLineLayerController]. @ProviderFor(EewPsWaveLineLayerController) final eewPsWaveLineLayerControllerProvider = NotifierProvider< - EewPsWaveLineLayerController, List>.internal( + EewPsWaveLineLayerController, + List +>.internal( EewPsWaveLineLayerController.new, name: r'eewPsWaveLineLayerControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewPsWaveLineLayerControllerHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewPsWaveLineLayerControllerHash, dependencies: null, allTransitiveDependencies: null, ); @@ -48,12 +54,15 @@ String _$eewPsWaveSourceLayerControllerHash() => /// See also [EewPsWaveSourceLayerController]. @ProviderFor(EewPsWaveSourceLayerController) final eewPsWaveSourceLayerControllerProvider = NotifierProvider< - EewPsWaveSourceLayerController, EewPsWaveSourceLayer>.internal( + EewPsWaveSourceLayerController, + EewPsWaveSourceLayer +>.internal( EewPsWaveSourceLayerController.new, name: r'eewPsWaveSourceLayerControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewPsWaveSourceLayerControllerHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewPsWaveSourceLayerControllerHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart index 301f42d4..1677ad76 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.dart @@ -25,54 +25,43 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { KyoshinMonitorObservationLayer build() { // 強震モニタの状態を監視 ref - ..listen( - kyoshinMonitorNotifierProvider, - (prev, next) { - // 現在の設定と違うLayerが来たらIgnore - final nextLayer = ( - next.valueOrNull?.currentRealtimeDataType, - next.valueOrNull?.currentRealtimeLayer - ); - final settingsLayer = ( - ref.read(kyoshinMonitorSettingsProvider).realtimeDataType, - ref.read(kyoshinMonitorSettingsProvider).realtimeLayer, - ); - if (nextLayer != settingsLayer) { - _updateLayer([]); - return; - } - final previousPoints = prev?.valueOrNull?.analyzedPoints; - final nextPoints = next.valueOrNull?.analyzedPoints; - if (previousPoints != nextPoints) { - _updateLayer(nextPoints ?? []); - } - }, - ) - ..listen( - kyoshinMonitorSettingsProvider, - (prev, next) { - log('prev: ${jsonEncode(prev)}'); - log('next: ${jsonEncode(next)}'); - if (prev?.realtimeDataType != next.realtimeDataType || - prev?.realtimeLayer != next.realtimeLayer || - prev?.kmoniMarkerType != next.kmoniMarkerType) { - state = state.copyWith( - points: [], - realtimeDataType: next.realtimeDataType, - markerType: next.kmoniMarkerType, - ); - } - }, - ) - ..listen( - eewAliveTelegramProvider, - (_, next) { - final isInEew = next?.isNotEmpty ?? false; + ..listen(kyoshinMonitorNotifierProvider, (prev, next) { + // 現在の設定と違うLayerが来たらIgnore + final nextLayer = ( + next.valueOrNull?.currentRealtimeDataType, + next.valueOrNull?.currentRealtimeLayer, + ); + final settingsLayer = ( + ref.read(kyoshinMonitorSettingsProvider).realtimeDataType, + ref.read(kyoshinMonitorSettingsProvider).realtimeLayer, + ); + if (nextLayer != settingsLayer) { + _updateLayer([]); + return; + } + final previousPoints = prev?.valueOrNull?.analyzedPoints; + final nextPoints = next.valueOrNull?.analyzedPoints; + if (previousPoints != nextPoints) { + _updateLayer(nextPoints ?? []); + } + }) + ..listen(kyoshinMonitorSettingsProvider, (prev, next) { + log('prev: ${jsonEncode(prev)}'); + log('next: ${jsonEncode(next)}'); + if (prev?.realtimeDataType != next.realtimeDataType || + prev?.realtimeLayer != next.realtimeLayer || + prev?.kmoniMarkerType != next.kmoniMarkerType) { state = state.copyWith( - isInEew: isInEew, + points: [], + realtimeDataType: next.realtimeDataType, + markerType: next.kmoniMarkerType, ); - }, - ); + } + }) + ..listen(eewAliveTelegramProvider, (_, next) { + final isInEew = next?.isNotEmpty ?? false; + state = state.copyWith(isInEew: isInEew); + }); return KyoshinMonitorObservationLayer( id: 'kyoshin-monitor-points', sourceId: 'kyoshin-monitor-points', @@ -88,15 +77,11 @@ class KyoshinMonitorLayerController extends _$KyoshinMonitorLayerController { /// レイヤーを更新 void _updateLayer(List points) { if (points.isEmpty) { - state = state.copyWith( - points: [], - ); + state = state.copyWith(points: []); return; } - state = state.copyWith( - points: points, - ); + state = state.copyWith(points: points); } } @@ -131,26 +116,27 @@ class KyoshinMonitorObservationLayer extends MapLayer Map toGeoJsonSource() { return { 'type': 'FeatureCollection', - 'features': points - .map( - (e) => { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [ - e.point.location.longitude, - e.point.location.latitude, - ], - }, - 'properties': { - 'color': e.observation.colorHex, - 'name': e.point.code, - 'zIndex': e.observation.scale, - 'showStroke': markerType == KyoshinMonitorMarkerType.always, - }, - }, - ) - .toList(), + 'features': + points + .map( + (e) => { + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [ + e.point.location.longitude, + e.point.location.latitude, + ], + }, + 'properties': { + 'color': e.observation.colorHex, + 'name': e.point.code, + 'zIndex': e.observation.scale, + 'showStroke': markerType == KyoshinMonitorMarkerType.always, + }, + }, + ) + .toList(), }; } @@ -178,26 +164,17 @@ class KyoshinMonitorObservationLayer extends MapLayer 10, 10, ], - circleColor: [ - 'get', - 'color', - ], + circleColor: ['get', 'color'], circleStrokeColor: "#${Colors.grey.hex.toRadixString(16).padLeft(6, '0')}", - circleStrokeOpacity: [ - 'get', - 'strokeOpacity', - ], + circleStrokeOpacity: ['get', 'strokeOpacity'], circleStrokeWidth: switch (markerType) { KyoshinMonitorMarkerType.always => defaultStrokeWidthStatement, KyoshinMonitorMarkerType.onlyEew when isInEew => defaultStrokeWidthStatement, _ => 0, }, - circleSortKey: [ - 'get', - 'zIndex', - ], + circleSortKey: ['get', 'zIndex'], ); } diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart index a02aed66..ce463e1b 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.freezed.dart @@ -12,7 +12,8 @@ part of 'kyoshin_monitor_layer_controller.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$KyoshinMonitorObservationLayer { @@ -32,33 +33,39 @@ mixin _$KyoshinMonitorObservationLayer { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorObservationLayerCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorObservationLayerCopyWith<$Res> { factory $KyoshinMonitorObservationLayerCopyWith( - KyoshinMonitorObservationLayer value, - $Res Function(KyoshinMonitorObservationLayer) then) = - _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, - KyoshinMonitorObservationLayer>; + KyoshinMonitorObservationLayer value, + $Res Function(KyoshinMonitorObservationLayer) then, + ) = + _$KyoshinMonitorObservationLayerCopyWithImpl< + $Res, + KyoshinMonitorObservationLayer + >; @useResult - $Res call( - {String id, - String sourceId, - bool visible, - List points, - bool isInEew, - KyoshinMonitorMarkerType markerType, - RealtimeDataType realtimeDataType, - double? minZoom, - double? maxZoom, - dynamic filter}); + $Res call({ + String id, + String sourceId, + bool visible, + List points, + bool isInEew, + KyoshinMonitorMarkerType markerType, + RealtimeDataType realtimeDataType, + double? minZoom, + double? maxZoom, + dynamic filter, + }); } /// @nodoc -class _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, - $Val extends KyoshinMonitorObservationLayer> +class _$KyoshinMonitorObservationLayerCopyWithImpl< + $Res, + $Val extends KyoshinMonitorObservationLayer +> implements $KyoshinMonitorObservationLayerCopyWith<$Res> { _$KyoshinMonitorObservationLayerCopyWithImpl(this._value, this._then); @@ -83,48 +90,61 @@ class _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, Object? maxZoom = freezed, Object? filter = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - points: null == points - ? _value.points - : points // ignore: cast_nullable_to_non_nullable - as List, - isInEew: null == isInEew - ? _value.isInEew - : isInEew // ignore: cast_nullable_to_non_nullable - as bool, - markerType: null == markerType - ? _value.markerType - : markerType // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorMarkerType, - realtimeDataType: null == realtimeDataType - ? _value.realtimeDataType - : realtimeDataType // ignore: cast_nullable_to_non_nullable - as RealtimeDataType, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + points: + null == points + ? _value.points + : points // ignore: cast_nullable_to_non_nullable + as List, + isInEew: + null == isInEew + ? _value.isInEew + : isInEew // ignore: cast_nullable_to_non_nullable + as bool, + markerType: + null == markerType + ? _value.markerType + : markerType // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorMarkerType, + realtimeDataType: + null == realtimeDataType + ? _value.realtimeDataType + : realtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ) + as $Val, + ); } } @@ -132,33 +152,37 @@ class _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, abstract class _$$KyoshinMonitorObservationLayerImplCopyWith<$Res> implements $KyoshinMonitorObservationLayerCopyWith<$Res> { factory _$$KyoshinMonitorObservationLayerImplCopyWith( - _$KyoshinMonitorObservationLayerImpl value, - $Res Function(_$KyoshinMonitorObservationLayerImpl) then) = - __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res>; + _$KyoshinMonitorObservationLayerImpl value, + $Res Function(_$KyoshinMonitorObservationLayerImpl) then, + ) = __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - String sourceId, - bool visible, - List points, - bool isInEew, - KyoshinMonitorMarkerType markerType, - RealtimeDataType realtimeDataType, - double? minZoom, - double? maxZoom, - dynamic filter}); + $Res call({ + String id, + String sourceId, + bool visible, + List points, + bool isInEew, + KyoshinMonitorMarkerType markerType, + RealtimeDataType realtimeDataType, + double? minZoom, + double? maxZoom, + dynamic filter, + }); } /// @nodoc class __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res> - extends _$KyoshinMonitorObservationLayerCopyWithImpl<$Res, - _$KyoshinMonitorObservationLayerImpl> + extends + _$KyoshinMonitorObservationLayerCopyWithImpl< + $Res, + _$KyoshinMonitorObservationLayerImpl + > implements _$$KyoshinMonitorObservationLayerImplCopyWith<$Res> { __$$KyoshinMonitorObservationLayerImplCopyWithImpl( - _$KyoshinMonitorObservationLayerImpl _value, - $Res Function(_$KyoshinMonitorObservationLayerImpl) _then) - : super(_value, _then); + _$KyoshinMonitorObservationLayerImpl _value, + $Res Function(_$KyoshinMonitorObservationLayerImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorObservationLayer /// with the given fields replaced by the non-null parameter values. @@ -176,48 +200,60 @@ class __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res> Object? maxZoom = freezed, Object? filter = freezed, }) { - return _then(_$KyoshinMonitorObservationLayerImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - points: null == points - ? _value._points - : points // ignore: cast_nullable_to_non_nullable - as List, - isInEew: null == isInEew - ? _value.isInEew - : isInEew // ignore: cast_nullable_to_non_nullable - as bool, - markerType: null == markerType - ? _value.markerType - : markerType // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorMarkerType, - realtimeDataType: null == realtimeDataType - ? _value.realtimeDataType - : realtimeDataType // ignore: cast_nullable_to_non_nullable - as RealtimeDataType, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - )); + return _then( + _$KyoshinMonitorObservationLayerImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + points: + null == points + ? _value._points + : points // ignore: cast_nullable_to_non_nullable + as List, + isInEew: + null == isInEew + ? _value.isInEew + : isInEew // ignore: cast_nullable_to_non_nullable + as bool, + markerType: + null == markerType + ? _value.markerType + : markerType // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorMarkerType, + realtimeDataType: + null == realtimeDataType + ? _value.realtimeDataType + : realtimeDataType // ignore: cast_nullable_to_non_nullable + as RealtimeDataType, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ), + ); } } @@ -225,19 +261,19 @@ class __$$KyoshinMonitorObservationLayerImplCopyWithImpl<$Res> class _$KyoshinMonitorObservationLayerImpl extends _KyoshinMonitorObservationLayer { - _$KyoshinMonitorObservationLayerImpl( - {required this.id, - required this.sourceId, - required this.visible, - required final List points, - required this.isInEew, - required this.markerType, - required this.realtimeDataType, - this.minZoom, - this.maxZoom, - this.filter}) - : _points = points, - super._(); + _$KyoshinMonitorObservationLayerImpl({ + required this.id, + required this.sourceId, + required this.visible, + required final List points, + required this.isInEew, + required this.markerType, + required this.realtimeDataType, + this.minZoom, + this.maxZoom, + this.filter, + }) : _points = points, + super._(); @override final String id; @@ -293,17 +329,18 @@ class _$KyoshinMonitorObservationLayerImpl @override int get hashCode => Object.hash( - runtimeType, - id, - sourceId, - visible, - const DeepCollectionEquality().hash(_points), - isInEew, - markerType, - realtimeDataType, - minZoom, - maxZoom, - const DeepCollectionEquality().hash(filter)); + runtimeType, + id, + sourceId, + visible, + const DeepCollectionEquality().hash(_points), + isInEew, + markerType, + realtimeDataType, + minZoom, + maxZoom, + const DeepCollectionEquality().hash(filter), + ); /// Create a copy of KyoshinMonitorObservationLayer /// with the given fields replaced by the non-null parameter values. @@ -311,24 +348,27 @@ class _$KyoshinMonitorObservationLayerImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorObservationLayerImplCopyWith< - _$KyoshinMonitorObservationLayerImpl> - get copyWith => __$$KyoshinMonitorObservationLayerImplCopyWithImpl< - _$KyoshinMonitorObservationLayerImpl>(this, _$identity); + _$KyoshinMonitorObservationLayerImpl + > + get copyWith => __$$KyoshinMonitorObservationLayerImplCopyWithImpl< + _$KyoshinMonitorObservationLayerImpl + >(this, _$identity); } abstract class _KyoshinMonitorObservationLayer extends KyoshinMonitorObservationLayer { - factory _KyoshinMonitorObservationLayer( - {required final String id, - required final String sourceId, - required final bool visible, - required final List points, - required final bool isInEew, - required final KyoshinMonitorMarkerType markerType, - required final RealtimeDataType realtimeDataType, - final double? minZoom, - final double? maxZoom, - final dynamic filter}) = _$KyoshinMonitorObservationLayerImpl; + factory _KyoshinMonitorObservationLayer({ + required final String id, + required final String sourceId, + required final bool visible, + required final List points, + required final bool isInEew, + required final KyoshinMonitorMarkerType markerType, + required final RealtimeDataType realtimeDataType, + final double? minZoom, + final double? maxZoom, + final dynamic filter, + }) = _$KyoshinMonitorObservationLayerImpl; _KyoshinMonitorObservationLayer._() : super._(); @override @@ -357,6 +397,7 @@ abstract class _KyoshinMonitorObservationLayer @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorObservationLayerImplCopyWith< - _$KyoshinMonitorObservationLayerImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorObservationLayerImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart index ba8fda85..55eedd04 100644 --- a/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/kyoshin_monitor_layer_controller.g.dart @@ -16,17 +16,20 @@ String _$kyoshinMonitorLayerControllerHash() => /// Copied from [KyoshinMonitorLayerController]. @ProviderFor(KyoshinMonitorLayerController) final kyoshinMonitorLayerControllerProvider = AutoDisposeNotifierProvider< - KyoshinMonitorLayerController, KyoshinMonitorObservationLayer>.internal( + KyoshinMonitorLayerController, + KyoshinMonitorObservationLayer +>.internal( KyoshinMonitorLayerController.new, name: r'kyoshinMonitorLayerControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$kyoshinMonitorLayerControllerHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$kyoshinMonitorLayerControllerHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$KyoshinMonitorLayerController - = AutoDisposeNotifier; +typedef _$KyoshinMonitorLayerController = + AutoDisposeNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/map/data/controller/layer_controller.dart b/app/lib/feature/map/data/controller/layer_controller.dart index 7d92e824..08c5909c 100644 --- a/app/lib/feature/map/data/controller/layer_controller.dart +++ b/app/lib/feature/map/data/controller/layer_controller.dart @@ -29,9 +29,10 @@ class MapLayerController extends _$MapLayerController { /// レイヤーの順序を変更 void reorderLayers(List orderedIds) { final layerMap = {for (final l in state) l.id: l}; - state = orderedIds - .where(layerMap.containsKey) - .map((id) => layerMap[id]!) - .toList(); + state = + orderedIds + .where(layerMap.containsKey) + .map((id) => layerMap[id]!) + .toList(); } } diff --git a/app/lib/feature/map/data/controller/layer_controller.g.dart b/app/lib/feature/map/data/controller/layer_controller.g.dart index 97577b90..31fcf48e 100644 --- a/app/lib/feature/map/data/controller/layer_controller.g.dart +++ b/app/lib/feature/map/data/controller/layer_controller.g.dart @@ -17,14 +17,15 @@ String _$mapLayerControllerHash() => @ProviderFor(MapLayerController) final mapLayerControllerProvider = AutoDisposeNotifierProvider>.internal( - MapLayerController.new, - name: r'mapLayerControllerProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$mapLayerControllerHash, - dependencies: null, - allTransitiveDependencies: null, -); + MapLayerController.new, + name: r'mapLayerControllerProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$mapLayerControllerHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$MapLayerController = AutoDisposeNotifier>; // ignore_for_file: type=lint diff --git a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart index fa2284ac..3f27baea 100644 --- a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart +++ b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.dart @@ -26,25 +26,23 @@ class EewEstimatedIntensityLayer extends MapLayer required JmaForecastIntensity intensity, required Color color, required List regionCodes, - }) => - EewEstimatedIntensityLayer( - id: 'eew_estimated_intensity_layer_${intensity.name}', - color: color, - filter: [ - 'in', - ['get', 'code'], - 'literal', - regionCodes, - ], - ); + }) => EewEstimatedIntensityLayer( + id: 'eew_estimated_intensity_layer_${intensity.name}', + color: color, + filter: [ + 'in', + ['get', 'code'], + 'literal', + regionCodes, + ], + ); @override Map? toGeoJsonSource() => null; @override - LayerProperties toLayerProperties() => FillLayerProperties( - fillColor: color.toHexStringRGB(), - ); + LayerProperties toLayerProperties() => + FillLayerProperties(fillColor: color.toHexStringRGB()); @override String get geoJsonSourceHash => ''; diff --git a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart index ed6cb8f6..ee410984 100644 --- a/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart +++ b/app/lib/feature/map/data/layer/eew_estimated_intensity/eew_estimated_intensity_layer.freezed.dart @@ -12,7 +12,8 @@ part of 'eew_estimated_intensity_layer.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$EewEstimatedIntensityLayer { @@ -28,29 +29,36 @@ mixin _$EewEstimatedIntensityLayer { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EewEstimatedIntensityLayerCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EewEstimatedIntensityLayerCopyWith<$Res> { - factory $EewEstimatedIntensityLayerCopyWith(EewEstimatedIntensityLayer value, - $Res Function(EewEstimatedIntensityLayer) then) = - _$EewEstimatedIntensityLayerCopyWithImpl<$Res, - EewEstimatedIntensityLayer>; + factory $EewEstimatedIntensityLayerCopyWith( + EewEstimatedIntensityLayer value, + $Res Function(EewEstimatedIntensityLayer) then, + ) = + _$EewEstimatedIntensityLayerCopyWithImpl< + $Res, + EewEstimatedIntensityLayer + >; @useResult - $Res call( - {String id, - Color color, - dynamic filter, - bool visible, - String? sourceId, - double? minZoom, - double? maxZoom}); + $Res call({ + String id, + Color color, + dynamic filter, + bool visible, + String? sourceId, + double? minZoom, + double? maxZoom, + }); } /// @nodoc -class _$EewEstimatedIntensityLayerCopyWithImpl<$Res, - $Val extends EewEstimatedIntensityLayer> +class _$EewEstimatedIntensityLayerCopyWithImpl< + $Res, + $Val extends EewEstimatedIntensityLayer +> implements $EewEstimatedIntensityLayerCopyWith<$Res> { _$EewEstimatedIntensityLayerCopyWithImpl(this._value, this._then); @@ -72,36 +80,46 @@ class _$EewEstimatedIntensityLayerCopyWithImpl<$Res, Object? minZoom = freezed, Object? maxZoom = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - color: null == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: freezed == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String?, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: + null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + freezed == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String?, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) + as $Val, + ); } } @@ -109,30 +127,34 @@ class _$EewEstimatedIntensityLayerCopyWithImpl<$Res, abstract class _$$EewEstimatedIntensityLayerImplCopyWith<$Res> implements $EewEstimatedIntensityLayerCopyWith<$Res> { factory _$$EewEstimatedIntensityLayerImplCopyWith( - _$EewEstimatedIntensityLayerImpl value, - $Res Function(_$EewEstimatedIntensityLayerImpl) then) = - __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res>; + _$EewEstimatedIntensityLayerImpl value, + $Res Function(_$EewEstimatedIntensityLayerImpl) then, + ) = __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - Color color, - dynamic filter, - bool visible, - String? sourceId, - double? minZoom, - double? maxZoom}); + $Res call({ + String id, + Color color, + dynamic filter, + bool visible, + String? sourceId, + double? minZoom, + double? maxZoom, + }); } /// @nodoc class __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res> - extends _$EewEstimatedIntensityLayerCopyWithImpl<$Res, - _$EewEstimatedIntensityLayerImpl> + extends + _$EewEstimatedIntensityLayerCopyWithImpl< + $Res, + _$EewEstimatedIntensityLayerImpl + > implements _$$EewEstimatedIntensityLayerImplCopyWith<$Res> { __$$EewEstimatedIntensityLayerImplCopyWithImpl( - _$EewEstimatedIntensityLayerImpl _value, - $Res Function(_$EewEstimatedIntensityLayerImpl) _then) - : super(_value, _then); + _$EewEstimatedIntensityLayerImpl _value, + $Res Function(_$EewEstimatedIntensityLayerImpl) _then, + ) : super(_value, _then); /// Create a copy of EewEstimatedIntensityLayer /// with the given fields replaced by the non-null parameter values. @@ -147,51 +169,60 @@ class __$$EewEstimatedIntensityLayerImplCopyWithImpl<$Res> Object? minZoom = freezed, Object? maxZoom = freezed, }) { - return _then(_$EewEstimatedIntensityLayerImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - color: null == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: freezed == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String?, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - )); + return _then( + _$EewEstimatedIntensityLayerImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: + null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + freezed == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String?, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ), + ); } } /// @nodoc class _$EewEstimatedIntensityLayerImpl extends _EewEstimatedIntensityLayer { - const _$EewEstimatedIntensityLayerImpl( - {required this.id, - required this.color, - required this.filter, - this.visible = true, - this.sourceId = null, - this.minZoom = null, - this.maxZoom = null}) - : super._(); + const _$EewEstimatedIntensityLayerImpl({ + required this.id, + required this.color, + required this.filter, + this.visible = true, + this.sourceId = null, + this.minZoom = null, + this.maxZoom = null, + }) : super._(); @override final String id; @@ -234,14 +265,15 @@ class _$EewEstimatedIntensityLayerImpl extends _EewEstimatedIntensityLayer { @override int get hashCode => Object.hash( - runtimeType, - id, - color, - const DeepCollectionEquality().hash(filter), - visible, - sourceId, - minZoom, - maxZoom); + runtimeType, + id, + color, + const DeepCollectionEquality().hash(filter), + visible, + sourceId, + minZoom, + maxZoom, + ); /// Create a copy of EewEstimatedIntensityLayer /// with the given fields replaced by the non-null parameter values. @@ -249,19 +281,21 @@ class _$EewEstimatedIntensityLayerImpl extends _EewEstimatedIntensityLayer { @override @pragma('vm:prefer-inline') _$$EewEstimatedIntensityLayerImplCopyWith<_$EewEstimatedIntensityLayerImpl> - get copyWith => __$$EewEstimatedIntensityLayerImplCopyWithImpl< - _$EewEstimatedIntensityLayerImpl>(this, _$identity); + get copyWith => __$$EewEstimatedIntensityLayerImplCopyWithImpl< + _$EewEstimatedIntensityLayerImpl + >(this, _$identity); } abstract class _EewEstimatedIntensityLayer extends EewEstimatedIntensityLayer { - const factory _EewEstimatedIntensityLayer( - {required final String id, - required final Color color, - required final dynamic filter, - final bool visible, - final String? sourceId, - final double? minZoom, - final double? maxZoom}) = _$EewEstimatedIntensityLayerImpl; + const factory _EewEstimatedIntensityLayer({ + required final String id, + required final Color color, + required final dynamic filter, + final bool visible, + final String? sourceId, + final double? minZoom, + final double? maxZoom, + }) = _$EewEstimatedIntensityLayerImpl; const _EewEstimatedIntensityLayer._() : super._(); @override @@ -284,5 +318,5 @@ abstract class _EewEstimatedIntensityLayer extends EewEstimatedIntensityLayer { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EewEstimatedIntensityLayerImplCopyWith<_$EewEstimatedIntensityLayerImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart index 80306e39..cc43cb66 100644 --- a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.dart @@ -32,22 +32,23 @@ class EewHypocenterLayer extends MapLayer with _$EewHypocenterLayer { Map toGeoJsonSource() { return { 'type': 'FeatureCollection', - 'features': hypocenters - .map( - (e) => { - 'type': 'Feature', - 'geometry': { - 'type': 'Point', - 'coordinates': [e.longitude, e.latitude], - }, - 'properties': { - 'iconImage': iconImage, - 'latitude': e.latitude, - 'longitude': e.longitude, - }, - }, - ) - .toList(), + 'features': + hypocenters + .map( + (e) => { + 'type': 'Feature', + 'geometry': { + 'type': 'Point', + 'coordinates': [e.longitude, e.latitude], + }, + 'properties': { + 'iconImage': iconImage, + 'latitude': e.latitude, + 'longitude': e.longitude, + }, + }, + ) + .toList(), }; } @@ -81,11 +82,10 @@ class EewHypocenterLayer extends MapLayer with _$EewHypocenterLayer { enum EewHypocenterIcon { normal, - lowPrecise, - ; + lowPrecise; DeclarativeAssets get asset => switch (this) { - normal => DeclarativeAssets.normalHypocenter, - lowPrecise => DeclarativeAssets.lowPreciseHypocenter, - }; + normal => DeclarativeAssets.normalHypocenter, + lowPrecise => DeclarativeAssets.lowPreciseHypocenter, + }; } diff --git a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart index 55ab0839..00c05dda 100644 --- a/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart +++ b/app/lib/feature/map/data/layer/eew_hypocenter/eew_hypocenter_layer.freezed.dart @@ -12,7 +12,8 @@ part of 'eew_hypocenter_layer.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$EewHypocenter { @@ -29,8 +30,9 @@ mixin _$EewHypocenter { /// @nodoc abstract class $EewHypocenterCopyWith<$Res> { factory $EewHypocenterCopyWith( - EewHypocenter value, $Res Function(EewHypocenter) then) = - _$EewHypocenterCopyWithImpl<$Res, EewHypocenter>; + EewHypocenter value, + $Res Function(EewHypocenter) then, + ) = _$EewHypocenterCopyWithImpl<$Res, EewHypocenter>; @useResult $Res call({double latitude, double longitude}); } @@ -49,20 +51,22 @@ class _$EewHypocenterCopyWithImpl<$Res, $Val extends EewHypocenter> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? latitude = null, - Object? longitude = null, - }) { - return _then(_value.copyWith( - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + $Res call({Object? latitude = null, Object? longitude = null}) { + return _then( + _value.copyWith( + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } } @@ -70,8 +74,9 @@ class _$EewHypocenterCopyWithImpl<$Res, $Val extends EewHypocenter> abstract class _$$EewHypocenterImplCopyWith<$Res> implements $EewHypocenterCopyWith<$Res> { factory _$$EewHypocenterImplCopyWith( - _$EewHypocenterImpl value, $Res Function(_$EewHypocenterImpl) then) = - __$$EewHypocenterImplCopyWithImpl<$Res>; + _$EewHypocenterImpl value, + $Res Function(_$EewHypocenterImpl) then, + ) = __$$EewHypocenterImplCopyWithImpl<$Res>; @override @useResult $Res call({double latitude, double longitude}); @@ -82,27 +87,29 @@ class __$$EewHypocenterImplCopyWithImpl<$Res> extends _$EewHypocenterCopyWithImpl<$Res, _$EewHypocenterImpl> implements _$$EewHypocenterImplCopyWith<$Res> { __$$EewHypocenterImplCopyWithImpl( - _$EewHypocenterImpl _value, $Res Function(_$EewHypocenterImpl) _then) - : super(_value, _then); + _$EewHypocenterImpl _value, + $Res Function(_$EewHypocenterImpl) _then, + ) : super(_value, _then); /// Create a copy of EewHypocenter /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? latitude = null, - Object? longitude = null, - }) { - return _then(_$EewHypocenterImpl( - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - )); + $Res call({Object? latitude = null, Object? longitude = null}) { + return _then( + _$EewHypocenterImpl( + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } @@ -145,9 +152,10 @@ class _$EewHypocenterImpl implements _EewHypocenter { } abstract class _EewHypocenter implements EewHypocenter { - const factory _EewHypocenter( - {required final double latitude, - required final double longitude}) = _$EewHypocenterImpl; + const factory _EewHypocenter({ + required final double latitude, + required final double longitude, + }) = _$EewHypocenterImpl; @override double get latitude; @@ -183,18 +191,20 @@ mixin _$EewHypocenterLayer { /// @nodoc abstract class $EewHypocenterLayerCopyWith<$Res> { factory $EewHypocenterLayerCopyWith( - EewHypocenterLayer value, $Res Function(EewHypocenterLayer) then) = - _$EewHypocenterLayerCopyWithImpl<$Res, EewHypocenterLayer>; + EewHypocenterLayer value, + $Res Function(EewHypocenterLayer) then, + ) = _$EewHypocenterLayerCopyWithImpl<$Res, EewHypocenterLayer>; @useResult - $Res call( - {String id, - String sourceId, - bool visible, - List hypocenters, - String iconImage, - double? minZoom, - double? maxZoom, - dynamic filter}); + $Res call({ + String id, + String sourceId, + bool visible, + List hypocenters, + String iconImage, + double? minZoom, + double? maxZoom, + dynamic filter, + }); } /// @nodoc @@ -221,69 +231,83 @@ class _$EewHypocenterLayerCopyWithImpl<$Res, $Val extends EewHypocenterLayer> Object? maxZoom = freezed, Object? filter = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - hypocenters: null == hypocenters - ? _value.hypocenters - : hypocenters // ignore: cast_nullable_to_non_nullable - as List, - iconImage: null == iconImage - ? _value.iconImage - : iconImage // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + hypocenters: + null == hypocenters + ? _value.hypocenters + : hypocenters // ignore: cast_nullable_to_non_nullable + as List, + iconImage: + null == iconImage + ? _value.iconImage + : iconImage // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EewHypocenterLayerImplCopyWith<$Res> implements $EewHypocenterLayerCopyWith<$Res> { - factory _$$EewHypocenterLayerImplCopyWith(_$EewHypocenterLayerImpl value, - $Res Function(_$EewHypocenterLayerImpl) then) = - __$$EewHypocenterLayerImplCopyWithImpl<$Res>; + factory _$$EewHypocenterLayerImplCopyWith( + _$EewHypocenterLayerImpl value, + $Res Function(_$EewHypocenterLayerImpl) then, + ) = __$$EewHypocenterLayerImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - String sourceId, - bool visible, - List hypocenters, - String iconImage, - double? minZoom, - double? maxZoom, - dynamic filter}); + $Res call({ + String id, + String sourceId, + bool visible, + List hypocenters, + String iconImage, + double? minZoom, + double? maxZoom, + dynamic filter, + }); } /// @nodoc class __$$EewHypocenterLayerImplCopyWithImpl<$Res> extends _$EewHypocenterLayerCopyWithImpl<$Res, _$EewHypocenterLayerImpl> implements _$$EewHypocenterLayerImplCopyWith<$Res> { - __$$EewHypocenterLayerImplCopyWithImpl(_$EewHypocenterLayerImpl _value, - $Res Function(_$EewHypocenterLayerImpl) _then) - : super(_value, _then); + __$$EewHypocenterLayerImplCopyWithImpl( + _$EewHypocenterLayerImpl _value, + $Res Function(_$EewHypocenterLayerImpl) _then, + ) : super(_value, _then); /// Create a copy of EewHypocenterLayer /// with the given fields replaced by the non-null parameter values. @@ -299,57 +323,67 @@ class __$$EewHypocenterLayerImplCopyWithImpl<$Res> Object? maxZoom = freezed, Object? filter = freezed, }) { - return _then(_$EewHypocenterLayerImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - hypocenters: null == hypocenters - ? _value._hypocenters - : hypocenters // ignore: cast_nullable_to_non_nullable - as List, - iconImage: null == iconImage - ? _value.iconImage - : iconImage // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - )); + return _then( + _$EewHypocenterLayerImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + hypocenters: + null == hypocenters + ? _value._hypocenters + : hypocenters // ignore: cast_nullable_to_non_nullable + as List, + iconImage: + null == iconImage + ? _value.iconImage + : iconImage // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ), + ); } } /// @nodoc class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { - _$EewHypocenterLayerImpl( - {required this.id, - required this.sourceId, - required this.visible, - required final List hypocenters, - required this.iconImage, - this.minZoom = null, - this.maxZoom = null, - this.filter}) - : _hypocenters = hypocenters, - super._(); + _$EewHypocenterLayerImpl({ + required this.id, + required this.sourceId, + required this.visible, + required final List hypocenters, + required this.iconImage, + this.minZoom = null, + this.maxZoom = null, + this.filter, + }) : _hypocenters = hypocenters, + super._(); @override final String id; @@ -390,8 +424,10 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { (identical(other.sourceId, sourceId) || other.sourceId == sourceId) && (identical(other.visible, visible) || other.visible == visible) && - const DeepCollectionEquality() - .equals(other._hypocenters, _hypocenters) && + const DeepCollectionEquality().equals( + other._hypocenters, + _hypocenters, + ) && (identical(other.iconImage, iconImage) || other.iconImage == iconImage) && (identical(other.minZoom, minZoom) || other.minZoom == minZoom) && @@ -401,15 +437,16 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { @override int get hashCode => Object.hash( - runtimeType, - id, - sourceId, - visible, - const DeepCollectionEquality().hash(_hypocenters), - iconImage, - minZoom, - maxZoom, - const DeepCollectionEquality().hash(filter)); + runtimeType, + id, + sourceId, + visible, + const DeepCollectionEquality().hash(_hypocenters), + iconImage, + minZoom, + maxZoom, + const DeepCollectionEquality().hash(filter), + ); /// Create a copy of EewHypocenterLayer /// with the given fields replaced by the non-null parameter values. @@ -418,19 +455,22 @@ class _$EewHypocenterLayerImpl extends _EewHypocenterLayer { @pragma('vm:prefer-inline') _$$EewHypocenterLayerImplCopyWith<_$EewHypocenterLayerImpl> get copyWith => __$$EewHypocenterLayerImplCopyWithImpl<_$EewHypocenterLayerImpl>( - this, _$identity); + this, + _$identity, + ); } abstract class _EewHypocenterLayer extends EewHypocenterLayer { - factory _EewHypocenterLayer( - {required final String id, - required final String sourceId, - required final bool visible, - required final List hypocenters, - required final String iconImage, - final double? minZoom, - final double? maxZoom, - final dynamic filter}) = _$EewHypocenterLayerImpl; + factory _EewHypocenterLayer({ + required final String id, + required final String sourceId, + required final bool visible, + required final List hypocenters, + required final String iconImage, + final double? minZoom, + final double? maxZoom, + final dynamic filter, + }) = _$EewHypocenterLayerImpl; _EewHypocenterLayer._() : super._(); @override diff --git a/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart index ad538711..67e2a3b8 100644 --- a/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart +++ b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.dart @@ -66,8 +66,10 @@ class EewPsWaveLayerItem with _$EewPsWaveLayerItem { 'type': 'Polygon', 'coordinates': [ [ - for (final bearing - in List.generate(91, (index) => index * 4)) + for (final bearing in List.generate( + 91, + (index) => index * 4, + )) () { final latLng = distance.offset( lat_long.LatLng(latitude, longitude), @@ -79,10 +81,7 @@ class EewPsWaveLayerItem with _$EewPsWaveLayerItem { ], ], }, - 'properties': { - 'type': 's', - 'is_warning': isWarning, - }, + 'properties': {'type': 's', 'is_warning': isWarning}, }, if (pTravel != null) { @@ -91,8 +90,10 @@ class EewPsWaveLayerItem with _$EewPsWaveLayerItem { 'type': 'Polygon', 'coordinates': [ [ - for (final bearing - in List.generate(91, (index) => index * 4)) + for (final bearing in List.generate( + 91, + (index) => index * 4, + )) () { final latLng = distance.offset( lat_long.LatLng(latitude, longitude), @@ -104,10 +105,7 @@ class EewPsWaveLayerItem with _$EewPsWaveLayerItem { ], ], }, - 'properties': { - 'type': 'p', - 'is_warning': isWarning, - }, + 'properties': {'type': 'p', 'is_warning': isWarning}, }, ]; } @@ -127,22 +125,13 @@ class EewWaveFillLayer extends MapLayer with _$EewWaveFillLayer { const EewWaveFillLayer._(); - factory EewWaveFillLayer.pWave({ - required Color color, - }) => - EewWaveFillLayer( - id: 'eew_wave_fill_p', - color: color, - filter: [ - '==', - 'type', - 'p', - ], - ); + factory EewWaveFillLayer.pWave({required Color color}) => EewWaveFillLayer( + id: 'eew_wave_fill_p', + color: color, + filter: ['==', 'type', 'p'], + ); - factory EewWaveFillLayer.sWaveWarning({ - required Color color, - }) => + factory EewWaveFillLayer.sWaveWarning({required Color color}) => EewWaveFillLayer( id: 'eew_wave_fill_s_warning', color: color, @@ -153,9 +142,7 @@ class EewWaveFillLayer extends MapLayer with _$EewWaveFillLayer { ], ); - factory EewWaveFillLayer.sWaveNotWarning({ - required Color color, - }) => + factory EewWaveFillLayer.sWaveNotWarning({required Color color}) => EewWaveFillLayer( id: 'eew_wave_fill_s_not_warning', color: color, @@ -170,9 +157,8 @@ class EewWaveFillLayer extends MapLayer with _$EewWaveFillLayer { Map? toGeoJsonSource() => null; @override - LayerProperties toLayerProperties() => FillLayerProperties( - fillColor: color.toHexStringRGB(), - ); + LayerProperties toLayerProperties() => + FillLayerProperties(fillColor: color.toHexStringRGB()); @override String get geoJsonSourceHash => ''; @@ -195,22 +181,13 @@ class EewWaveLineLayer extends MapLayer with _$EewWaveLineLayer { const EewWaveLineLayer._(); - factory EewWaveLineLayer.pWave({ - required Color color, - }) => - EewWaveLineLayer( - id: 'eew_wave_line_p', - color: color, - filter: [ - '==', - 'type', - 'p', - ], - ); + factory EewWaveLineLayer.pWave({required Color color}) => EewWaveLineLayer( + id: 'eew_wave_line_p', + color: color, + filter: ['==', 'type', 'p'], + ); - factory EewWaveLineLayer.sWaveWarning({ - required Color color, - }) => + factory EewWaveLineLayer.sWaveWarning({required Color color}) => EewWaveLineLayer( id: 'eew_wave_line_s', color: color, @@ -221,9 +198,7 @@ class EewWaveLineLayer extends MapLayer with _$EewWaveLineLayer { ], ); - factory EewWaveLineLayer.sWaveNotWarning({ - required Color color, - }) => + factory EewWaveLineLayer.sWaveNotWarning({required Color color}) => EewWaveLineLayer( id: 'eew_wave_line_s_not_warning', color: color, @@ -238,10 +213,8 @@ class EewWaveLineLayer extends MapLayer with _$EewWaveLineLayer { Map? toGeoJsonSource() => null; @override - LayerProperties toLayerProperties() => LineLayerProperties( - lineColor: color.toHexStringRGB(), - lineCap: 'round', - ); + LayerProperties toLayerProperties() => + LineLayerProperties(lineColor: color.toHexStringRGB(), lineCap: 'round'); @override String get geoJsonSourceHash => ''; diff --git a/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart index a8ad51ec..6c19c59a 100644 --- a/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart +++ b/app/lib/feature/map/data/layer/eew_ps_wave/eew_ps_wave_layer.freezed.dart @@ -12,7 +12,8 @@ part of 'eew_ps_wave_layer.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); /// @nodoc mixin _$EewPsWaveSourceLayer { @@ -33,23 +34,27 @@ mixin _$EewPsWaveSourceLayer { /// @nodoc abstract class $EewPsWaveSourceLayerCopyWith<$Res> { - factory $EewPsWaveSourceLayerCopyWith(EewPsWaveSourceLayer value, - $Res Function(EewPsWaveSourceLayer) then) = - _$EewPsWaveSourceLayerCopyWithImpl<$Res, EewPsWaveSourceLayer>; + factory $EewPsWaveSourceLayerCopyWith( + EewPsWaveSourceLayer value, + $Res Function(EewPsWaveSourceLayer) then, + ) = _$EewPsWaveSourceLayerCopyWithImpl<$Res, EewPsWaveSourceLayer>; @useResult - $Res call( - {String id, - List items, - bool visible, - String sourceId, - double? minZoom, - double? maxZoom, - dynamic filter}); + $Res call({ + String id, + List items, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + dynamic filter, + }); } /// @nodoc -class _$EewPsWaveSourceLayerCopyWithImpl<$Res, - $Val extends EewPsWaveSourceLayer> +class _$EewPsWaveSourceLayerCopyWithImpl< + $Res, + $Val extends EewPsWaveSourceLayer +> implements $EewPsWaveSourceLayerCopyWith<$Res> { _$EewPsWaveSourceLayerCopyWithImpl(this._value, this._then); @@ -71,64 +76,77 @@ class _$EewPsWaveSourceLayerCopyWithImpl<$Res, Object? maxZoom = freezed, Object? filter = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - items: null == items - ? _value.items - : items // ignore: cast_nullable_to_non_nullable - as List, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + items: + null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EewPsWaveSourceLayerImplCopyWith<$Res> implements $EewPsWaveSourceLayerCopyWith<$Res> { - factory _$$EewPsWaveSourceLayerImplCopyWith(_$EewPsWaveSourceLayerImpl value, - $Res Function(_$EewPsWaveSourceLayerImpl) then) = - __$$EewPsWaveSourceLayerImplCopyWithImpl<$Res>; + factory _$$EewPsWaveSourceLayerImplCopyWith( + _$EewPsWaveSourceLayerImpl value, + $Res Function(_$EewPsWaveSourceLayerImpl) then, + ) = __$$EewPsWaveSourceLayerImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - List items, - bool visible, - String sourceId, - double? minZoom, - double? maxZoom, - dynamic filter}); + $Res call({ + String id, + List items, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + dynamic filter, + }); } /// @nodoc class __$$EewPsWaveSourceLayerImplCopyWithImpl<$Res> extends _$EewPsWaveSourceLayerCopyWithImpl<$Res, _$EewPsWaveSourceLayerImpl> implements _$$EewPsWaveSourceLayerImplCopyWith<$Res> { - __$$EewPsWaveSourceLayerImplCopyWithImpl(_$EewPsWaveSourceLayerImpl _value, - $Res Function(_$EewPsWaveSourceLayerImpl) _then) - : super(_value, _then); + __$$EewPsWaveSourceLayerImplCopyWithImpl( + _$EewPsWaveSourceLayerImpl _value, + $Res Function(_$EewPsWaveSourceLayerImpl) _then, + ) : super(_value, _then); /// Create a copy of EewPsWaveSourceLayer /// with the given fields replaced by the non-null parameter values. @@ -143,52 +161,61 @@ class __$$EewPsWaveSourceLayerImplCopyWithImpl<$Res> Object? maxZoom = freezed, Object? filter = freezed, }) { - return _then(_$EewPsWaveSourceLayerImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - items: null == items - ? _value._items - : items // ignore: cast_nullable_to_non_nullable - as List, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - )); + return _then( + _$EewPsWaveSourceLayerImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + items: + null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + ), + ); } } /// @nodoc class _$EewPsWaveSourceLayerImpl extends _EewPsWaveSourceLayer { - const _$EewPsWaveSourceLayerImpl( - {required this.id, - required final List items, - this.visible = true, - this.sourceId = 'eew_ps_wave_source', - this.minZoom = null, - this.maxZoom = null, - this.filter}) - : _items = items, - super._(); + const _$EewPsWaveSourceLayerImpl({ + required this.id, + required final List items, + this.visible = true, + this.sourceId = 'eew_ps_wave_source', + this.minZoom = null, + this.maxZoom = null, + this.filter, + }) : _items = items, + super._(); @override final String id; @@ -237,14 +264,15 @@ class _$EewPsWaveSourceLayerImpl extends _EewPsWaveSourceLayer { @override int get hashCode => Object.hash( - runtimeType, - id, - const DeepCollectionEquality().hash(_items), - visible, - sourceId, - minZoom, - maxZoom, - const DeepCollectionEquality().hash(filter)); + runtimeType, + id, + const DeepCollectionEquality().hash(_items), + visible, + sourceId, + minZoom, + maxZoom, + const DeepCollectionEquality().hash(filter), + ); /// Create a copy of EewPsWaveSourceLayer /// with the given fields replaced by the non-null parameter values. @@ -252,20 +280,23 @@ class _$EewPsWaveSourceLayerImpl extends _EewPsWaveSourceLayer { @override @pragma('vm:prefer-inline') _$$EewPsWaveSourceLayerImplCopyWith<_$EewPsWaveSourceLayerImpl> - get copyWith => - __$$EewPsWaveSourceLayerImplCopyWithImpl<_$EewPsWaveSourceLayerImpl>( - this, _$identity); + get copyWith => + __$$EewPsWaveSourceLayerImplCopyWithImpl<_$EewPsWaveSourceLayerImpl>( + this, + _$identity, + ); } abstract class _EewPsWaveSourceLayer extends EewPsWaveSourceLayer { - const factory _EewPsWaveSourceLayer( - {required final String id, - required final List items, - final bool visible, - final String sourceId, - final double? minZoom, - final double? maxZoom, - final dynamic filter}) = _$EewPsWaveSourceLayerImpl; + const factory _EewPsWaveSourceLayer({ + required final String id, + required final List items, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom, + final dynamic filter, + }) = _$EewPsWaveSourceLayerImpl; const _EewPsWaveSourceLayer._() : super._(); @override @@ -288,7 +319,7 @@ abstract class _EewPsWaveSourceLayer extends EewPsWaveSourceLayer { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EewPsWaveSourceLayerImplCopyWith<_$EewPsWaveSourceLayerImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc @@ -308,14 +339,16 @@ mixin _$EewPsWaveLayerItem { /// @nodoc abstract class $EewPsWaveLayerItemCopyWith<$Res> { factory $EewPsWaveLayerItemCopyWith( - EewPsWaveLayerItem value, $Res Function(EewPsWaveLayerItem) then) = - _$EewPsWaveLayerItemCopyWithImpl<$Res, EewPsWaveLayerItem>; + EewPsWaveLayerItem value, + $Res Function(EewPsWaveLayerItem) then, + ) = _$EewPsWaveLayerItemCopyWithImpl<$Res, EewPsWaveLayerItem>; @useResult - $Res call( - {double latitude, - double longitude, - TravelTimeResult travelTime, - bool isWarning}); + $Res call({ + double latitude, + double longitude, + TravelTimeResult travelTime, + bool isWarning, + }); } /// @nodoc @@ -338,49 +371,59 @@ class _$EewPsWaveLayerItemCopyWithImpl<$Res, $Val extends EewPsWaveLayerItem> Object? travelTime = null, Object? isWarning = null, }) { - return _then(_value.copyWith( - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - travelTime: null == travelTime - ? _value.travelTime - : travelTime // ignore: cast_nullable_to_non_nullable - as TravelTimeResult, - isWarning: null == isWarning - ? _value.isWarning - : isWarning // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + travelTime: + null == travelTime + ? _value.travelTime + : travelTime // ignore: cast_nullable_to_non_nullable + as TravelTimeResult, + isWarning: + null == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EewPsWaveLayerItemImplCopyWith<$Res> implements $EewPsWaveLayerItemCopyWith<$Res> { - factory _$$EewPsWaveLayerItemImplCopyWith(_$EewPsWaveLayerItemImpl value, - $Res Function(_$EewPsWaveLayerItemImpl) then) = - __$$EewPsWaveLayerItemImplCopyWithImpl<$Res>; + factory _$$EewPsWaveLayerItemImplCopyWith( + _$EewPsWaveLayerItemImpl value, + $Res Function(_$EewPsWaveLayerItemImpl) then, + ) = __$$EewPsWaveLayerItemImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {double latitude, - double longitude, - TravelTimeResult travelTime, - bool isWarning}); + $Res call({ + double latitude, + double longitude, + TravelTimeResult travelTime, + bool isWarning, + }); } /// @nodoc class __$$EewPsWaveLayerItemImplCopyWithImpl<$Res> extends _$EewPsWaveLayerItemCopyWithImpl<$Res, _$EewPsWaveLayerItemImpl> implements _$$EewPsWaveLayerItemImplCopyWith<$Res> { - __$$EewPsWaveLayerItemImplCopyWithImpl(_$EewPsWaveLayerItemImpl _value, - $Res Function(_$EewPsWaveLayerItemImpl) _then) - : super(_value, _then); + __$$EewPsWaveLayerItemImplCopyWithImpl( + _$EewPsWaveLayerItemImpl _value, + $Res Function(_$EewPsWaveLayerItemImpl) _then, + ) : super(_value, _then); /// Create a copy of EewPsWaveLayerItem /// with the given fields replaced by the non-null parameter values. @@ -392,36 +435,42 @@ class __$$EewPsWaveLayerItemImplCopyWithImpl<$Res> Object? travelTime = null, Object? isWarning = null, }) { - return _then(_$EewPsWaveLayerItemImpl( - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - travelTime: null == travelTime - ? _value.travelTime - : travelTime // ignore: cast_nullable_to_non_nullable - as TravelTimeResult, - isWarning: null == isWarning - ? _value.isWarning - : isWarning // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$EewPsWaveLayerItemImpl( + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + travelTime: + null == travelTime + ? _value.travelTime + : travelTime // ignore: cast_nullable_to_non_nullable + as TravelTimeResult, + isWarning: + null == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } /// @nodoc class _$EewPsWaveLayerItemImpl extends _EewPsWaveLayerItem { - const _$EewPsWaveLayerItemImpl( - {required this.latitude, - required this.longitude, - required this.travelTime, - required this.isWarning}) - : super._(); + const _$EewPsWaveLayerItemImpl({ + required this.latitude, + required this.longitude, + required this.travelTime, + required this.isWarning, + }) : super._(); @override final double latitude; @@ -463,15 +512,18 @@ class _$EewPsWaveLayerItemImpl extends _EewPsWaveLayerItem { @pragma('vm:prefer-inline') _$$EewPsWaveLayerItemImplCopyWith<_$EewPsWaveLayerItemImpl> get copyWith => __$$EewPsWaveLayerItemImplCopyWithImpl<_$EewPsWaveLayerItemImpl>( - this, _$identity); + this, + _$identity, + ); } abstract class _EewPsWaveLayerItem extends EewPsWaveLayerItem { - const factory _EewPsWaveLayerItem( - {required final double latitude, - required final double longitude, - required final TravelTimeResult travelTime, - required final bool isWarning}) = _$EewPsWaveLayerItemImpl; + const factory _EewPsWaveLayerItem({ + required final double latitude, + required final double longitude, + required final TravelTimeResult travelTime, + required final bool isWarning, + }) = _$EewPsWaveLayerItemImpl; const _EewPsWaveLayerItem._() : super._(); @override @@ -511,17 +563,19 @@ mixin _$EewWaveFillLayer { /// @nodoc abstract class $EewWaveFillLayerCopyWith<$Res> { factory $EewWaveFillLayerCopyWith( - EewWaveFillLayer value, $Res Function(EewWaveFillLayer) then) = - _$EewWaveFillLayerCopyWithImpl<$Res, EewWaveFillLayer>; + EewWaveFillLayer value, + $Res Function(EewWaveFillLayer) then, + ) = _$EewWaveFillLayerCopyWithImpl<$Res, EewWaveFillLayer>; @useResult - $Res call( - {String id, - Color color, - dynamic filter, - bool visible, - String sourceId, - double? minZoom, - double? maxZoom}); + $Res call({ + String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + }); } /// @nodoc @@ -547,64 +601,77 @@ class _$EewWaveFillLayerCopyWithImpl<$Res, $Val extends EewWaveFillLayer> Object? minZoom = freezed, Object? maxZoom = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - color: null == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: + null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EewWaveFillLayerImplCopyWith<$Res> implements $EewWaveFillLayerCopyWith<$Res> { - factory _$$EewWaveFillLayerImplCopyWith(_$EewWaveFillLayerImpl value, - $Res Function(_$EewWaveFillLayerImpl) then) = - __$$EewWaveFillLayerImplCopyWithImpl<$Res>; + factory _$$EewWaveFillLayerImplCopyWith( + _$EewWaveFillLayerImpl value, + $Res Function(_$EewWaveFillLayerImpl) then, + ) = __$$EewWaveFillLayerImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - Color color, - dynamic filter, - bool visible, - String sourceId, - double? minZoom, - double? maxZoom}); + $Res call({ + String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + }); } /// @nodoc class __$$EewWaveFillLayerImplCopyWithImpl<$Res> extends _$EewWaveFillLayerCopyWithImpl<$Res, _$EewWaveFillLayerImpl> implements _$$EewWaveFillLayerImplCopyWith<$Res> { - __$$EewWaveFillLayerImplCopyWithImpl(_$EewWaveFillLayerImpl _value, - $Res Function(_$EewWaveFillLayerImpl) _then) - : super(_value, _then); + __$$EewWaveFillLayerImplCopyWithImpl( + _$EewWaveFillLayerImpl _value, + $Res Function(_$EewWaveFillLayerImpl) _then, + ) : super(_value, _then); /// Create a copy of EewWaveFillLayer /// with the given fields replaced by the non-null parameter values. @@ -619,51 +686,60 @@ class __$$EewWaveFillLayerImplCopyWithImpl<$Res> Object? minZoom = freezed, Object? maxZoom = freezed, }) { - return _then(_$EewWaveFillLayerImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - color: null == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - )); + return _then( + _$EewWaveFillLayerImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: + null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ), + ); } } /// @nodoc class _$EewWaveFillLayerImpl extends _EewWaveFillLayer { - const _$EewWaveFillLayerImpl( - {required this.id, - required this.color, - required this.filter, - this.visible = true, - this.sourceId = 'eew_ps_wave_source', - this.minZoom = null, - this.maxZoom = null}) - : super._(); + const _$EewWaveFillLayerImpl({ + required this.id, + required this.color, + required this.filter, + this.visible = true, + this.sourceId = 'eew_ps_wave_source', + this.minZoom = null, + this.maxZoom = null, + }) : super._(); @override final String id; @@ -706,14 +782,15 @@ class _$EewWaveFillLayerImpl extends _EewWaveFillLayer { @override int get hashCode => Object.hash( - runtimeType, - id, - color, - const DeepCollectionEquality().hash(filter), - visible, - sourceId, - minZoom, - maxZoom); + runtimeType, + id, + color, + const DeepCollectionEquality().hash(filter), + visible, + sourceId, + minZoom, + maxZoom, + ); /// Create a copy of EewWaveFillLayer /// with the given fields replaced by the non-null parameter values. @@ -722,18 +799,21 @@ class _$EewWaveFillLayerImpl extends _EewWaveFillLayer { @pragma('vm:prefer-inline') _$$EewWaveFillLayerImplCopyWith<_$EewWaveFillLayerImpl> get copyWith => __$$EewWaveFillLayerImplCopyWithImpl<_$EewWaveFillLayerImpl>( - this, _$identity); + this, + _$identity, + ); } abstract class _EewWaveFillLayer extends EewWaveFillLayer { - const factory _EewWaveFillLayer( - {required final String id, - required final Color color, - required final dynamic filter, - final bool visible, - final String sourceId, - final double? minZoom, - final double? maxZoom}) = _$EewWaveFillLayerImpl; + const factory _EewWaveFillLayer({ + required final String id, + required final Color color, + required final dynamic filter, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom, + }) = _$EewWaveFillLayerImpl; const _EewWaveFillLayer._() : super._(); @override @@ -779,17 +859,19 @@ mixin _$EewWaveLineLayer { /// @nodoc abstract class $EewWaveLineLayerCopyWith<$Res> { factory $EewWaveLineLayerCopyWith( - EewWaveLineLayer value, $Res Function(EewWaveLineLayer) then) = - _$EewWaveLineLayerCopyWithImpl<$Res, EewWaveLineLayer>; + EewWaveLineLayer value, + $Res Function(EewWaveLineLayer) then, + ) = _$EewWaveLineLayerCopyWithImpl<$Res, EewWaveLineLayer>; @useResult - $Res call( - {String id, - Color color, - dynamic filter, - bool visible, - String sourceId, - double? minZoom, - double? maxZoom}); + $Res call({ + String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + }); } /// @nodoc @@ -815,64 +897,77 @@ class _$EewWaveLineLayerCopyWithImpl<$Res, $Val extends EewWaveLineLayer> Object? minZoom = freezed, Object? maxZoom = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - color: null == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: + null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EewWaveLineLayerImplCopyWith<$Res> implements $EewWaveLineLayerCopyWith<$Res> { - factory _$$EewWaveLineLayerImplCopyWith(_$EewWaveLineLayerImpl value, - $Res Function(_$EewWaveLineLayerImpl) then) = - __$$EewWaveLineLayerImplCopyWithImpl<$Res>; + factory _$$EewWaveLineLayerImplCopyWith( + _$EewWaveLineLayerImpl value, + $Res Function(_$EewWaveLineLayerImpl) then, + ) = __$$EewWaveLineLayerImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - Color color, - dynamic filter, - bool visible, - String sourceId, - double? minZoom, - double? maxZoom}); + $Res call({ + String id, + Color color, + dynamic filter, + bool visible, + String sourceId, + double? minZoom, + double? maxZoom, + }); } /// @nodoc class __$$EewWaveLineLayerImplCopyWithImpl<$Res> extends _$EewWaveLineLayerCopyWithImpl<$Res, _$EewWaveLineLayerImpl> implements _$$EewWaveLineLayerImplCopyWith<$Res> { - __$$EewWaveLineLayerImplCopyWithImpl(_$EewWaveLineLayerImpl _value, - $Res Function(_$EewWaveLineLayerImpl) _then) - : super(_value, _then); + __$$EewWaveLineLayerImplCopyWithImpl( + _$EewWaveLineLayerImpl _value, + $Res Function(_$EewWaveLineLayerImpl) _then, + ) : super(_value, _then); /// Create a copy of EewWaveLineLayer /// with the given fields replaced by the non-null parameter values. @@ -887,51 +982,60 @@ class __$$EewWaveLineLayerImplCopyWithImpl<$Res> Object? minZoom = freezed, Object? maxZoom = freezed, }) { - return _then(_$EewWaveLineLayerImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - color: null == color - ? _value.color - : color // ignore: cast_nullable_to_non_nullable - as Color, - filter: freezed == filter - ? _value.filter - : filter // ignore: cast_nullable_to_non_nullable - as dynamic, - visible: null == visible - ? _value.visible - : visible // ignore: cast_nullable_to_non_nullable - as bool, - sourceId: null == sourceId - ? _value.sourceId - : sourceId // ignore: cast_nullable_to_non_nullable - as String, - minZoom: freezed == minZoom - ? _value.minZoom - : minZoom // ignore: cast_nullable_to_non_nullable - as double?, - maxZoom: freezed == maxZoom - ? _value.maxZoom - : maxZoom // ignore: cast_nullable_to_non_nullable - as double?, - )); + return _then( + _$EewWaveLineLayerImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + color: + null == color + ? _value.color + : color // ignore: cast_nullable_to_non_nullable + as Color, + filter: + freezed == filter + ? _value.filter + : filter // ignore: cast_nullable_to_non_nullable + as dynamic, + visible: + null == visible + ? _value.visible + : visible // ignore: cast_nullable_to_non_nullable + as bool, + sourceId: + null == sourceId + ? _value.sourceId + : sourceId // ignore: cast_nullable_to_non_nullable + as String, + minZoom: + freezed == minZoom + ? _value.minZoom + : minZoom // ignore: cast_nullable_to_non_nullable + as double?, + maxZoom: + freezed == maxZoom + ? _value.maxZoom + : maxZoom // ignore: cast_nullable_to_non_nullable + as double?, + ), + ); } } /// @nodoc class _$EewWaveLineLayerImpl extends _EewWaveLineLayer { - const _$EewWaveLineLayerImpl( - {required this.id, - required this.color, - required this.filter, - this.visible = true, - this.sourceId = 'eew_ps_wave_source', - this.minZoom = null, - this.maxZoom = null}) - : super._(); + const _$EewWaveLineLayerImpl({ + required this.id, + required this.color, + required this.filter, + this.visible = true, + this.sourceId = 'eew_ps_wave_source', + this.minZoom = null, + this.maxZoom = null, + }) : super._(); @override final String id; @@ -974,14 +1078,15 @@ class _$EewWaveLineLayerImpl extends _EewWaveLineLayer { @override int get hashCode => Object.hash( - runtimeType, - id, - color, - const DeepCollectionEquality().hash(filter), - visible, - sourceId, - minZoom, - maxZoom); + runtimeType, + id, + color, + const DeepCollectionEquality().hash(filter), + visible, + sourceId, + minZoom, + maxZoom, + ); /// Create a copy of EewWaveLineLayer /// with the given fields replaced by the non-null parameter values. @@ -990,18 +1095,21 @@ class _$EewWaveLineLayerImpl extends _EewWaveLineLayer { @pragma('vm:prefer-inline') _$$EewWaveLineLayerImplCopyWith<_$EewWaveLineLayerImpl> get copyWith => __$$EewWaveLineLayerImplCopyWithImpl<_$EewWaveLineLayerImpl>( - this, _$identity); + this, + _$identity, + ); } abstract class _EewWaveLineLayer extends EewWaveLineLayer { - const factory _EewWaveLineLayer( - {required final String id, - required final Color color, - required final dynamic filter, - final bool visible, - final String sourceId, - final double? minZoom, - final double? maxZoom}) = _$EewWaveLineLayerImpl; + const factory _EewWaveLineLayer({ + required final String id, + required final Color color, + required final dynamic filter, + final bool visible, + final String sourceId, + final double? minZoom, + final double? maxZoom, + }) = _$EewWaveLineLayerImpl; const _EewWaveLineLayer._() : super._(); @override diff --git a/app/lib/feature/map/data/model/camera_position.dart b/app/lib/feature/map/data/model/camera_position.dart index 9e29e0b8..d28cea2e 100644 --- a/app/lib/feature/map/data/model/camera_position.dart +++ b/app/lib/feature/map/data/model/camera_position.dart @@ -36,10 +36,6 @@ class MapCameraPosition with _$MapCameraPosition { /// MapLibreのCameraPositionに変換 const MapCameraPosition._(); - CameraPosition toMapLibre() => CameraPosition( - target: target, - zoom: zoom, - tilt: tilt, - bearing: bearing, - ); + CameraPosition toMapLibre() => + CameraPosition(target: target, zoom: zoom, tilt: tilt, bearing: bearing); } diff --git a/app/lib/feature/map/data/model/camera_position.freezed.dart b/app/lib/feature/map/data/model/camera_position.freezed.dart index 5c7ab08d..bd6d5ddd 100644 --- a/app/lib/feature/map/data/model/camera_position.freezed.dart +++ b/app/lib/feature/map/data/model/camera_position.freezed.dart @@ -12,7 +12,8 @@ part of 'camera_position.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); MapCameraPosition _$MapCameraPositionFromJson(Map json) { return _MapCameraPosition.fromJson(json); @@ -46,14 +47,16 @@ mixin _$MapCameraPosition { /// @nodoc abstract class $MapCameraPositionCopyWith<$Res> { factory $MapCameraPositionCopyWith( - MapCameraPosition value, $Res Function(MapCameraPosition) then) = - _$MapCameraPositionCopyWithImpl<$Res, MapCameraPosition>; + MapCameraPosition value, + $Res Function(MapCameraPosition) then, + ) = _$MapCameraPositionCopyWithImpl<$Res, MapCameraPosition>; @useResult - $Res call( - {@LatLngConverter() LatLng target, - double zoom, - double tilt, - double bearing}); + $Res call({ + @LatLngConverter() LatLng target, + double zoom, + double tilt, + double bearing, + }); } /// @nodoc @@ -76,49 +79,59 @@ class _$MapCameraPositionCopyWithImpl<$Res, $Val extends MapCameraPosition> Object? tilt = null, Object? bearing = null, }) { - return _then(_value.copyWith( - target: null == target - ? _value.target - : target // ignore: cast_nullable_to_non_nullable - as LatLng, - zoom: null == zoom - ? _value.zoom - : zoom // ignore: cast_nullable_to_non_nullable - as double, - tilt: null == tilt - ? _value.tilt - : tilt // ignore: cast_nullable_to_non_nullable - as double, - bearing: null == bearing - ? _value.bearing - : bearing // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + return _then( + _value.copyWith( + target: + null == target + ? _value.target + : target // ignore: cast_nullable_to_non_nullable + as LatLng, + zoom: + null == zoom + ? _value.zoom + : zoom // ignore: cast_nullable_to_non_nullable + as double, + tilt: + null == tilt + ? _value.tilt + : tilt // ignore: cast_nullable_to_non_nullable + as double, + bearing: + null == bearing + ? _value.bearing + : bearing // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } } /// @nodoc abstract class _$$MapCameraPositionImplCopyWith<$Res> implements $MapCameraPositionCopyWith<$Res> { - factory _$$MapCameraPositionImplCopyWith(_$MapCameraPositionImpl value, - $Res Function(_$MapCameraPositionImpl) then) = - __$$MapCameraPositionImplCopyWithImpl<$Res>; + factory _$$MapCameraPositionImplCopyWith( + _$MapCameraPositionImpl value, + $Res Function(_$MapCameraPositionImpl) then, + ) = __$$MapCameraPositionImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@LatLngConverter() LatLng target, - double zoom, - double tilt, - double bearing}); + $Res call({ + @LatLngConverter() LatLng target, + double zoom, + double tilt, + double bearing, + }); } /// @nodoc class __$$MapCameraPositionImplCopyWithImpl<$Res> extends _$MapCameraPositionCopyWithImpl<$Res, _$MapCameraPositionImpl> implements _$$MapCameraPositionImplCopyWith<$Res> { - __$$MapCameraPositionImplCopyWithImpl(_$MapCameraPositionImpl _value, - $Res Function(_$MapCameraPositionImpl) _then) - : super(_value, _then); + __$$MapCameraPositionImplCopyWithImpl( + _$MapCameraPositionImpl _value, + $Res Function(_$MapCameraPositionImpl) _then, + ) : super(_value, _then); /// Create a copy of MapCameraPosition /// with the given fields replaced by the non-null parameter values. @@ -130,36 +143,42 @@ class __$$MapCameraPositionImplCopyWithImpl<$Res> Object? tilt = null, Object? bearing = null, }) { - return _then(_$MapCameraPositionImpl( - target: null == target - ? _value.target - : target // ignore: cast_nullable_to_non_nullable - as LatLng, - zoom: null == zoom - ? _value.zoom - : zoom // ignore: cast_nullable_to_non_nullable - as double, - tilt: null == tilt - ? _value.tilt - : tilt // ignore: cast_nullable_to_non_nullable - as double, - bearing: null == bearing - ? _value.bearing - : bearing // ignore: cast_nullable_to_non_nullable - as double, - )); + return _then( + _$MapCameraPositionImpl( + target: + null == target + ? _value.target + : target // ignore: cast_nullable_to_non_nullable + as LatLng, + zoom: + null == zoom + ? _value.zoom + : zoom // ignore: cast_nullable_to_non_nullable + as double, + tilt: + null == tilt + ? _value.tilt + : tilt // ignore: cast_nullable_to_non_nullable + as double, + bearing: + null == bearing + ? _value.bearing + : bearing // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } /// @nodoc @JsonSerializable() class _$MapCameraPositionImpl extends _MapCameraPosition { - const _$MapCameraPositionImpl( - {@LatLngConverter() required this.target, - this.zoom = 5.0, - this.tilt = 0.0, - this.bearing = 0.0}) - : super._(); + const _$MapCameraPositionImpl({ + @LatLngConverter() required this.target, + this.zoom = 5.0, + this.tilt = 0.0, + this.bearing = 0.0, + }) : super._(); factory _$MapCameraPositionImpl.fromJson(Map json) => _$$MapCameraPositionImplFromJson(json); @@ -211,22 +230,23 @@ class _$MapCameraPositionImpl extends _MapCameraPosition { @pragma('vm:prefer-inline') _$$MapCameraPositionImplCopyWith<_$MapCameraPositionImpl> get copyWith => __$$MapCameraPositionImplCopyWithImpl<_$MapCameraPositionImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$MapCameraPositionImplToJson( - this, - ); + return _$$MapCameraPositionImplToJson(this); } } abstract class _MapCameraPosition extends MapCameraPosition { - const factory _MapCameraPosition( - {@LatLngConverter() required final LatLng target, - final double zoom, - final double tilt, - final double bearing}) = _$MapCameraPositionImpl; + const factory _MapCameraPosition({ + @LatLngConverter() required final LatLng target, + final double zoom, + final double tilt, + final double bearing, + }) = _$MapCameraPositionImpl; const _MapCameraPosition._() : super._(); factory _MapCameraPosition.fromJson(Map json) = diff --git a/app/lib/feature/map/data/model/camera_position.g.dart b/app/lib/feature/map/data/model/camera_position.g.dart index b65c2580..dc7854e4 100644 --- a/app/lib/feature/map/data/model/camera_position.g.dart +++ b/app/lib/feature/map/data/model/camera_position.g.dart @@ -9,28 +9,25 @@ part of 'camera_position.dart'; // ************************************************************************** _$MapCameraPositionImpl _$$MapCameraPositionImplFromJson( - Map json) => - $checkedCreate( - r'_$MapCameraPositionImpl', - json, - ($checkedConvert) { - final val = _$MapCameraPositionImpl( - target: $checkedConvert('target', - (v) => const LatLngConverter().fromJson(v as List)), - zoom: $checkedConvert('zoom', (v) => (v as num?)?.toDouble() ?? 5.0), - tilt: $checkedConvert('tilt', (v) => (v as num?)?.toDouble() ?? 0.0), - bearing: - $checkedConvert('bearing', (v) => (v as num?)?.toDouble() ?? 0.0), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$MapCameraPositionImpl', json, ($checkedConvert) { + final val = _$MapCameraPositionImpl( + target: $checkedConvert( + 'target', + (v) => const LatLngConverter().fromJson(v as List), + ), + zoom: $checkedConvert('zoom', (v) => (v as num?)?.toDouble() ?? 5.0), + tilt: $checkedConvert('tilt', (v) => (v as num?)?.toDouble() ?? 0.0), + bearing: $checkedConvert('bearing', (v) => (v as num?)?.toDouble() ?? 0.0), + ); + return val; +}); Map _$$MapCameraPositionImplToJson( - _$MapCameraPositionImpl instance) => - { - 'target': const LatLngConverter().toJson(instance.target), - 'zoom': instance.zoom, - 'tilt': instance.tilt, - 'bearing': instance.bearing, - }; + _$MapCameraPositionImpl instance, +) => { + 'target': const LatLngConverter().toJson(instance.target), + 'zoom': instance.zoom, + 'tilt': instance.tilt, + 'bearing': instance.bearing, +}; diff --git a/app/lib/feature/map/data/model/map_configuration.dart b/app/lib/feature/map/data/model/map_configuration.dart index 1c357be3..3f31145e 100644 --- a/app/lib/feature/map/data/model/map_configuration.dart +++ b/app/lib/feature/map/data/model/map_configuration.dart @@ -18,12 +18,7 @@ class MapConfiguration with _$MapConfiguration { _$MapConfigurationFromJson(json); } -enum MapTheme { - light, - dark, - system, - ; -} +enum MapTheme { light, dark, system } Color colorFromJson(String json) => Color(int.parse(json)); String colorToJson(Color color) => color.hex.toRadixString(16); @@ -60,11 +55,12 @@ class MapColorScheme with _$MapColorScheme { factory MapColorScheme.dark() { const colorScheme = ColorScheme.dark(); return MapColorScheme( - backgroundColor: Color.lerp( - colorScheme.surfaceContainerLowest, - Colors.blue.shade900, - 0.1, - )!, + backgroundColor: + Color.lerp( + colorScheme.surfaceContainerLowest, + Colors.blue.shade900, + 0.1, + )!, worldLandColor: colorScheme.surfaceContainerHighest, worldLineColor: colorScheme.onSurfaceVariant, japanLandColor: colorScheme.surfaceContainerHighest, diff --git a/app/lib/feature/map/data/model/map_configuration.freezed.dart b/app/lib/feature/map/data/model/map_configuration.freezed.dart index c8cf7894..90deb317 100644 --- a/app/lib/feature/map/data/model/map_configuration.freezed.dart +++ b/app/lib/feature/map/data/model/map_configuration.freezed.dart @@ -12,7 +12,8 @@ part of 'map_configuration.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); MapConfiguration _$MapConfigurationFromJson(Map json) { return _MapConfiguration.fromJson(json); @@ -39,15 +40,16 @@ mixin _$MapConfiguration { /// @nodoc abstract class $MapConfigurationCopyWith<$Res> { factory $MapConfigurationCopyWith( - MapConfiguration value, $Res Function(MapConfiguration) then) = - _$MapConfigurationCopyWithImpl<$Res, MapConfiguration>; + MapConfiguration value, + $Res Function(MapConfiguration) then, + ) = _$MapConfigurationCopyWithImpl<$Res, MapConfiguration>; @useResult - $Res call( - {MapTheme theme, - @JsonKey(includeToJson: false, includeFromJson: false) - MapColorScheme? colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) - String? styleString}); + $Res call({ + MapTheme theme, + @JsonKey(includeToJson: false, includeFromJson: false) + MapColorScheme? colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) String? styleString, + }); $MapColorSchemeCopyWith<$Res>? get colorScheme; } @@ -71,20 +73,26 @@ class _$MapConfigurationCopyWithImpl<$Res, $Val extends MapConfiguration> Object? colorScheme = freezed, Object? styleString = freezed, }) { - return _then(_value.copyWith( - theme: null == theme - ? _value.theme - : theme // ignore: cast_nullable_to_non_nullable - as MapTheme, - colorScheme: freezed == colorScheme - ? _value.colorScheme - : colorScheme // ignore: cast_nullable_to_non_nullable - as MapColorScheme?, - styleString: freezed == styleString - ? _value.styleString - : styleString // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + theme: + null == theme + ? _value.theme + : theme // ignore: cast_nullable_to_non_nullable + as MapTheme, + colorScheme: + freezed == colorScheme + ? _value.colorScheme + : colorScheme // ignore: cast_nullable_to_non_nullable + as MapColorScheme?, + styleString: + freezed == styleString + ? _value.styleString + : styleString // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } /// Create a copy of MapConfiguration @@ -105,17 +113,18 @@ class _$MapConfigurationCopyWithImpl<$Res, $Val extends MapConfiguration> /// @nodoc abstract class _$$MapConfigurationImplCopyWith<$Res> implements $MapConfigurationCopyWith<$Res> { - factory _$$MapConfigurationImplCopyWith(_$MapConfigurationImpl value, - $Res Function(_$MapConfigurationImpl) then) = - __$$MapConfigurationImplCopyWithImpl<$Res>; + factory _$$MapConfigurationImplCopyWith( + _$MapConfigurationImpl value, + $Res Function(_$MapConfigurationImpl) then, + ) = __$$MapConfigurationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {MapTheme theme, - @JsonKey(includeToJson: false, includeFromJson: false) - MapColorScheme? colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) - String? styleString}); + $Res call({ + MapTheme theme, + @JsonKey(includeToJson: false, includeFromJson: false) + MapColorScheme? colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) String? styleString, + }); @override $MapColorSchemeCopyWith<$Res>? get colorScheme; @@ -125,9 +134,10 @@ abstract class _$$MapConfigurationImplCopyWith<$Res> class __$$MapConfigurationImplCopyWithImpl<$Res> extends _$MapConfigurationCopyWithImpl<$Res, _$MapConfigurationImpl> implements _$$MapConfigurationImplCopyWith<$Res> { - __$$MapConfigurationImplCopyWithImpl(_$MapConfigurationImpl _value, - $Res Function(_$MapConfigurationImpl) _then) - : super(_value, _then); + __$$MapConfigurationImplCopyWithImpl( + _$MapConfigurationImpl _value, + $Res Function(_$MapConfigurationImpl) _then, + ) : super(_value, _then); /// Create a copy of MapConfiguration /// with the given fields replaced by the non-null parameter values. @@ -138,30 +148,36 @@ class __$$MapConfigurationImplCopyWithImpl<$Res> Object? colorScheme = freezed, Object? styleString = freezed, }) { - return _then(_$MapConfigurationImpl( - theme: null == theme - ? _value.theme - : theme // ignore: cast_nullable_to_non_nullable - as MapTheme, - colorScheme: freezed == colorScheme - ? _value.colorScheme - : colorScheme // ignore: cast_nullable_to_non_nullable - as MapColorScheme?, - styleString: freezed == styleString - ? _value.styleString - : styleString // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$MapConfigurationImpl( + theme: + null == theme + ? _value.theme + : theme // ignore: cast_nullable_to_non_nullable + as MapTheme, + colorScheme: + freezed == colorScheme + ? _value.colorScheme + : colorScheme // ignore: cast_nullable_to_non_nullable + as MapColorScheme?, + styleString: + freezed == styleString + ? _value.styleString + : styleString // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$MapConfigurationImpl implements _MapConfiguration { - const _$MapConfigurationImpl( - {required this.theme, - @JsonKey(includeToJson: false, includeFromJson: false) this.colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) this.styleString}); + const _$MapConfigurationImpl({ + required this.theme, + @JsonKey(includeToJson: false, includeFromJson: false) this.colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) this.styleString, + }); factory _$MapConfigurationImpl.fromJson(Map json) => _$$MapConfigurationImplFromJson(json); @@ -203,23 +219,24 @@ class _$MapConfigurationImpl implements _MapConfiguration { @pragma('vm:prefer-inline') _$$MapConfigurationImplCopyWith<_$MapConfigurationImpl> get copyWith => __$$MapConfigurationImplCopyWithImpl<_$MapConfigurationImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$MapConfigurationImplToJson( - this, - ); + return _$$MapConfigurationImplToJson(this); } } abstract class _MapConfiguration implements MapConfiguration { - const factory _MapConfiguration( - {required final MapTheme theme, - @JsonKey(includeToJson: false, includeFromJson: false) - final MapColorScheme? colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) - final String? styleString}) = _$MapConfigurationImpl; + const factory _MapConfiguration({ + required final MapTheme theme, + @JsonKey(includeToJson: false, includeFromJson: false) + final MapColorScheme? colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) + final String? styleString, + }) = _$MapConfigurationImpl; factory _MapConfiguration.fromJson(Map json) = _$MapConfigurationImpl.fromJson; @@ -271,20 +288,18 @@ mixin _$MapColorScheme { /// @nodoc abstract class $MapColorSchemeCopyWith<$Res> { factory $MapColorSchemeCopyWith( - MapColorScheme value, $Res Function(MapColorScheme) then) = - _$MapColorSchemeCopyWithImpl<$Res, MapColorScheme>; + MapColorScheme value, + $Res Function(MapColorScheme) then, + ) = _$MapColorSchemeCopyWithImpl<$Res, MapColorScheme>; @useResult - $Res call( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color backgroundColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color worldLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color worldLineColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color japanLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color japanLineColor}); + $Res call({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + Color backgroundColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color worldLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color worldLineColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color japanLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color japanLineColor, + }); } /// @nodoc @@ -308,50 +323,56 @@ class _$MapColorSchemeCopyWithImpl<$Res, $Val extends MapColorScheme> Object? japanLandColor = null, Object? japanLineColor = null, }) { - return _then(_value.copyWith( - backgroundColor: null == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color, - worldLandColor: null == worldLandColor - ? _value.worldLandColor - : worldLandColor // ignore: cast_nullable_to_non_nullable - as Color, - worldLineColor: null == worldLineColor - ? _value.worldLineColor - : worldLineColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLandColor: null == japanLandColor - ? _value.japanLandColor - : japanLandColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLineColor: null == japanLineColor - ? _value.japanLineColor - : japanLineColor // ignore: cast_nullable_to_non_nullable - as Color, - ) as $Val); + return _then( + _value.copyWith( + backgroundColor: + null == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as Color, + worldLandColor: + null == worldLandColor + ? _value.worldLandColor + : worldLandColor // ignore: cast_nullable_to_non_nullable + as Color, + worldLineColor: + null == worldLineColor + ? _value.worldLineColor + : worldLineColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLandColor: + null == japanLandColor + ? _value.japanLandColor + : japanLandColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLineColor: + null == japanLineColor + ? _value.japanLineColor + : japanLineColor // ignore: cast_nullable_to_non_nullable + as Color, + ) + as $Val, + ); } } /// @nodoc abstract class _$$MapColorSchemeImplCopyWith<$Res> implements $MapColorSchemeCopyWith<$Res> { - factory _$$MapColorSchemeImplCopyWith(_$MapColorSchemeImpl value, - $Res Function(_$MapColorSchemeImpl) then) = - __$$MapColorSchemeImplCopyWithImpl<$Res>; + factory _$$MapColorSchemeImplCopyWith( + _$MapColorSchemeImpl value, + $Res Function(_$MapColorSchemeImpl) then, + ) = __$$MapColorSchemeImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color backgroundColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color worldLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color worldLineColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color japanLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - Color japanLineColor}); + $Res call({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + Color backgroundColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color worldLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color worldLineColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color japanLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) Color japanLineColor, + }); } /// @nodoc @@ -359,8 +380,9 @@ class __$$MapColorSchemeImplCopyWithImpl<$Res> extends _$MapColorSchemeCopyWithImpl<$Res, _$MapColorSchemeImpl> implements _$$MapColorSchemeImplCopyWith<$Res> { __$$MapColorSchemeImplCopyWithImpl( - _$MapColorSchemeImpl _value, $Res Function(_$MapColorSchemeImpl) _then) - : super(_value, _then); + _$MapColorSchemeImpl _value, + $Res Function(_$MapColorSchemeImpl) _then, + ) : super(_value, _then); /// Create a copy of MapColorScheme /// with the given fields replaced by the non-null parameter values. @@ -373,45 +395,53 @@ class __$$MapColorSchemeImplCopyWithImpl<$Res> Object? japanLandColor = null, Object? japanLineColor = null, }) { - return _then(_$MapColorSchemeImpl( - backgroundColor: null == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color, - worldLandColor: null == worldLandColor - ? _value.worldLandColor - : worldLandColor // ignore: cast_nullable_to_non_nullable - as Color, - worldLineColor: null == worldLineColor - ? _value.worldLineColor - : worldLineColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLandColor: null == japanLandColor - ? _value.japanLandColor - : japanLandColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLineColor: null == japanLineColor - ? _value.japanLineColor - : japanLineColor // ignore: cast_nullable_to_non_nullable - as Color, - )); + return _then( + _$MapColorSchemeImpl( + backgroundColor: + null == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as Color, + worldLandColor: + null == worldLandColor + ? _value.worldLandColor + : worldLandColor // ignore: cast_nullable_to_non_nullable + as Color, + worldLineColor: + null == worldLineColor + ? _value.worldLineColor + : worldLineColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLandColor: + null == japanLandColor + ? _value.japanLandColor + : japanLandColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLineColor: + null == japanLineColor + ? _value.japanLineColor + : japanLineColor // ignore: cast_nullable_to_non_nullable + as Color, + ), + ); } } /// @nodoc @JsonSerializable() class _$MapColorSchemeImpl implements _MapColorScheme { - const _$MapColorSchemeImpl( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.backgroundColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.worldLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.worldLineColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.japanLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required this.japanLineColor}); + const _$MapColorSchemeImpl({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.backgroundColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.worldLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.worldLineColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.japanLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required this.japanLineColor, + }); factory _$MapColorSchemeImpl.fromJson(Map json) => _$$MapColorSchemeImplFromJson(json); @@ -456,8 +486,14 @@ class _$MapColorSchemeImpl implements _MapColorScheme { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, backgroundColor, worldLandColor, - worldLineColor, japanLandColor, japanLineColor); + int get hashCode => Object.hash( + runtimeType, + backgroundColor, + worldLandColor, + worldLineColor, + japanLandColor, + japanLineColor, + ); /// Create a copy of MapColorScheme /// with the given fields replaced by the non-null parameter values. @@ -466,28 +502,29 @@ class _$MapColorSchemeImpl implements _MapColorScheme { @pragma('vm:prefer-inline') _$$MapColorSchemeImplCopyWith<_$MapColorSchemeImpl> get copyWith => __$$MapColorSchemeImplCopyWithImpl<_$MapColorSchemeImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$MapColorSchemeImplToJson( - this, - ); + return _$$MapColorSchemeImplToJson(this); } } abstract class _MapColorScheme implements MapColorScheme { - const factory _MapColorScheme( - {@JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color backgroundColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color worldLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color worldLineColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color japanLandColor, - @JsonKey(fromJson: colorFromJson, toJson: colorToJson) - required final Color japanLineColor}) = _$MapColorSchemeImpl; + const factory _MapColorScheme({ + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color backgroundColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color worldLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color worldLineColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color japanLandColor, + @JsonKey(fromJson: colorFromJson, toJson: colorToJson) + required final Color japanLineColor, + }) = _$MapColorSchemeImpl; factory _MapColorScheme.fromJson(Map json) = _$MapColorSchemeImpl.fromJson; diff --git a/app/lib/feature/map/data/model/map_configuration.g.dart b/app/lib/feature/map/data/model/map_configuration.g.dart index 8b8f51e8..597cb1d7 100644 --- a/app/lib/feature/map/data/model/map_configuration.g.dart +++ b/app/lib/feature/map/data/model/map_configuration.g.dart @@ -9,24 +9,17 @@ part of 'map_configuration.dart'; // ************************************************************************** _$MapConfigurationImpl _$$MapConfigurationImplFromJson( - Map json) => - $checkedCreate( - r'_$MapConfigurationImpl', - json, - ($checkedConvert) { - final val = _$MapConfigurationImpl( - theme: $checkedConvert( - 'theme', (v) => $enumDecode(_$MapThemeEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$MapConfigurationImpl', json, ($checkedConvert) { + final val = _$MapConfigurationImpl( + theme: $checkedConvert('theme', (v) => $enumDecode(_$MapThemeEnumMap, v)), + ); + return val; +}); Map _$$MapConfigurationImplToJson( - _$MapConfigurationImpl instance) => - { - 'theme': _$MapThemeEnumMap[instance.theme]!, - }; + _$MapConfigurationImpl instance, +) => {'theme': _$MapThemeEnumMap[instance.theme]!}; const _$MapThemeEnumMap = { MapTheme.light: 'light', @@ -41,15 +34,25 @@ _$MapColorSchemeImpl _$$MapColorSchemeImplFromJson(Map json) => ($checkedConvert) { final val = _$MapColorSchemeImpl( backgroundColor: $checkedConvert( - 'background_color', (v) => colorFromJson(v as String)), + 'background_color', + (v) => colorFromJson(v as String), + ), worldLandColor: $checkedConvert( - 'world_land_color', (v) => colorFromJson(v as String)), + 'world_land_color', + (v) => colorFromJson(v as String), + ), worldLineColor: $checkedConvert( - 'world_line_color', (v) => colorFromJson(v as String)), + 'world_line_color', + (v) => colorFromJson(v as String), + ), japanLandColor: $checkedConvert( - 'japan_land_color', (v) => colorFromJson(v as String)), + 'japan_land_color', + (v) => colorFromJson(v as String), + ), japanLineColor: $checkedConvert( - 'japan_line_color', (v) => colorFromJson(v as String)), + 'japan_line_color', + (v) => colorFromJson(v as String), + ), ); return val; }, @@ -58,16 +61,16 @@ _$MapColorSchemeImpl _$$MapColorSchemeImplFromJson(Map json) => 'worldLandColor': 'world_land_color', 'worldLineColor': 'world_line_color', 'japanLandColor': 'japan_land_color', - 'japanLineColor': 'japan_line_color' + 'japanLineColor': 'japan_line_color', }, ); Map _$$MapColorSchemeImplToJson( - _$MapColorSchemeImpl instance) => - { - 'background_color': colorToJson(instance.backgroundColor), - 'world_land_color': colorToJson(instance.worldLandColor), - 'world_line_color': colorToJson(instance.worldLineColor), - 'japan_land_color': colorToJson(instance.japanLandColor), - 'japan_line_color': colorToJson(instance.japanLineColor), - }; + _$MapColorSchemeImpl instance, +) => { + 'background_color': colorToJson(instance.backgroundColor), + 'world_land_color': colorToJson(instance.worldLandColor), + 'world_line_color': colorToJson(instance.worldLineColor), + 'japan_land_color': colorToJson(instance.japanLandColor), + 'japan_line_color': colorToJson(instance.japanLineColor), +}; diff --git a/app/lib/feature/map/data/model/map_style_config.dart b/app/lib/feature/map/data/model/map_style_config.dart index 2a850417..57dce5ee 100644 --- a/app/lib/feature/map/data/model/map_style_config.dart +++ b/app/lib/feature/map/data/model/map_style_config.dart @@ -20,12 +20,7 @@ class MapStyleConfig with _$MapStyleConfig { } /// マップのスタイルテーマ -enum MapStyleTheme { - light, - dark, - system, - ; -} +enum MapStyleTheme { light, dark, system } /// マップのカラースキーム @freezed @@ -57,11 +52,12 @@ class MapStyleColorScheme with _$MapStyleColorScheme { factory MapStyleColorScheme.dark() { const colorScheme = ColorScheme.dark(); return MapStyleColorScheme( - backgroundColor: Color.lerp( - colorScheme.surfaceContainerLowest, - Colors.blue.shade900, - 0.1, - )!, + backgroundColor: + Color.lerp( + colorScheme.surfaceContainerLowest, + Colors.blue.shade900, + 0.1, + )!, landColor: colorScheme.surfaceContainerHighest, lineColor: colorScheme.onSurfaceVariant, japanLandColor: colorScheme.surfaceContainerHighest, diff --git a/app/lib/feature/map/data/model/map_style_config.freezed.dart b/app/lib/feature/map/data/model/map_style_config.freezed.dart index ad998487..6d37da1c 100644 --- a/app/lib/feature/map/data/model/map_style_config.freezed.dart +++ b/app/lib/feature/map/data/model/map_style_config.freezed.dart @@ -12,7 +12,8 @@ part of 'map_style_config.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); MapStyleConfig _$MapStyleConfigFromJson(Map json) { return _MapStyleConfig.fromJson(json); @@ -39,15 +40,16 @@ mixin _$MapStyleConfig { /// @nodoc abstract class $MapStyleConfigCopyWith<$Res> { factory $MapStyleConfigCopyWith( - MapStyleConfig value, $Res Function(MapStyleConfig) then) = - _$MapStyleConfigCopyWithImpl<$Res, MapStyleConfig>; + MapStyleConfig value, + $Res Function(MapStyleConfig) then, + ) = _$MapStyleConfigCopyWithImpl<$Res, MapStyleConfig>; @useResult - $Res call( - {MapStyleTheme theme, - @JsonKey(includeToJson: false, includeFromJson: false) - MapStyleColorScheme? colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) - String? styleString}); + $Res call({ + MapStyleTheme theme, + @JsonKey(includeToJson: false, includeFromJson: false) + MapStyleColorScheme? colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) String? styleString, + }); $MapStyleColorSchemeCopyWith<$Res>? get colorScheme; } @@ -71,20 +73,26 @@ class _$MapStyleConfigCopyWithImpl<$Res, $Val extends MapStyleConfig> Object? colorScheme = freezed, Object? styleString = freezed, }) { - return _then(_value.copyWith( - theme: null == theme - ? _value.theme - : theme // ignore: cast_nullable_to_non_nullable - as MapStyleTheme, - colorScheme: freezed == colorScheme - ? _value.colorScheme - : colorScheme // ignore: cast_nullable_to_non_nullable - as MapStyleColorScheme?, - styleString: freezed == styleString - ? _value.styleString - : styleString // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + theme: + null == theme + ? _value.theme + : theme // ignore: cast_nullable_to_non_nullable + as MapStyleTheme, + colorScheme: + freezed == colorScheme + ? _value.colorScheme + : colorScheme // ignore: cast_nullable_to_non_nullable + as MapStyleColorScheme?, + styleString: + freezed == styleString + ? _value.styleString + : styleString // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } /// Create a copy of MapStyleConfig @@ -105,17 +113,18 @@ class _$MapStyleConfigCopyWithImpl<$Res, $Val extends MapStyleConfig> /// @nodoc abstract class _$$MapStyleConfigImplCopyWith<$Res> implements $MapStyleConfigCopyWith<$Res> { - factory _$$MapStyleConfigImplCopyWith(_$MapStyleConfigImpl value, - $Res Function(_$MapStyleConfigImpl) then) = - __$$MapStyleConfigImplCopyWithImpl<$Res>; + factory _$$MapStyleConfigImplCopyWith( + _$MapStyleConfigImpl value, + $Res Function(_$MapStyleConfigImpl) then, + ) = __$$MapStyleConfigImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {MapStyleTheme theme, - @JsonKey(includeToJson: false, includeFromJson: false) - MapStyleColorScheme? colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) - String? styleString}); + $Res call({ + MapStyleTheme theme, + @JsonKey(includeToJson: false, includeFromJson: false) + MapStyleColorScheme? colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) String? styleString, + }); @override $MapStyleColorSchemeCopyWith<$Res>? get colorScheme; @@ -126,8 +135,9 @@ class __$$MapStyleConfigImplCopyWithImpl<$Res> extends _$MapStyleConfigCopyWithImpl<$Res, _$MapStyleConfigImpl> implements _$$MapStyleConfigImplCopyWith<$Res> { __$$MapStyleConfigImplCopyWithImpl( - _$MapStyleConfigImpl _value, $Res Function(_$MapStyleConfigImpl) _then) - : super(_value, _then); + _$MapStyleConfigImpl _value, + $Res Function(_$MapStyleConfigImpl) _then, + ) : super(_value, _then); /// Create a copy of MapStyleConfig /// with the given fields replaced by the non-null parameter values. @@ -138,30 +148,36 @@ class __$$MapStyleConfigImplCopyWithImpl<$Res> Object? colorScheme = freezed, Object? styleString = freezed, }) { - return _then(_$MapStyleConfigImpl( - theme: null == theme - ? _value.theme - : theme // ignore: cast_nullable_to_non_nullable - as MapStyleTheme, - colorScheme: freezed == colorScheme - ? _value.colorScheme - : colorScheme // ignore: cast_nullable_to_non_nullable - as MapStyleColorScheme?, - styleString: freezed == styleString - ? _value.styleString - : styleString // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$MapStyleConfigImpl( + theme: + null == theme + ? _value.theme + : theme // ignore: cast_nullable_to_non_nullable + as MapStyleTheme, + colorScheme: + freezed == colorScheme + ? _value.colorScheme + : colorScheme // ignore: cast_nullable_to_non_nullable + as MapStyleColorScheme?, + styleString: + freezed == styleString + ? _value.styleString + : styleString // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$MapStyleConfigImpl implements _MapStyleConfig { - const _$MapStyleConfigImpl( - {required this.theme, - @JsonKey(includeToJson: false, includeFromJson: false) this.colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) this.styleString}); + const _$MapStyleConfigImpl({ + required this.theme, + @JsonKey(includeToJson: false, includeFromJson: false) this.colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) this.styleString, + }); factory _$MapStyleConfigImpl.fromJson(Map json) => _$$MapStyleConfigImplFromJson(json); @@ -203,23 +219,24 @@ class _$MapStyleConfigImpl implements _MapStyleConfig { @pragma('vm:prefer-inline') _$$MapStyleConfigImplCopyWith<_$MapStyleConfigImpl> get copyWith => __$$MapStyleConfigImplCopyWithImpl<_$MapStyleConfigImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$MapStyleConfigImplToJson( - this, - ); + return _$$MapStyleConfigImplToJson(this); } } abstract class _MapStyleConfig implements MapStyleConfig { - const factory _MapStyleConfig( - {required final MapStyleTheme theme, - @JsonKey(includeToJson: false, includeFromJson: false) - final MapStyleColorScheme? colorScheme, - @JsonKey(includeToJson: false, includeFromJson: false) - final String? styleString}) = _$MapStyleConfigImpl; + const factory _MapStyleConfig({ + required final MapStyleTheme theme, + @JsonKey(includeToJson: false, includeFromJson: false) + final MapStyleColorScheme? colorScheme, + @JsonKey(includeToJson: false, includeFromJson: false) + final String? styleString, + }) = _$MapStyleConfigImpl; factory _MapStyleConfig.fromJson(Map json) = _$MapStyleConfigImpl.fromJson; @@ -271,15 +288,17 @@ mixin _$MapStyleColorScheme { /// @nodoc abstract class $MapStyleColorSchemeCopyWith<$Res> { factory $MapStyleColorSchemeCopyWith( - MapStyleColorScheme value, $Res Function(MapStyleColorScheme) then) = - _$MapStyleColorSchemeCopyWithImpl<$Res, MapStyleColorScheme>; + MapStyleColorScheme value, + $Res Function(MapStyleColorScheme) then, + ) = _$MapStyleColorSchemeCopyWithImpl<$Res, MapStyleColorScheme>; @useResult - $Res call( - {@ColorConverter() Color backgroundColor, - @ColorConverter() Color landColor, - @ColorConverter() Color lineColor, - @ColorConverter() Color japanLandColor, - @ColorConverter() Color japanLineColor}); + $Res call({ + @ColorConverter() Color backgroundColor, + @ColorConverter() Color landColor, + @ColorConverter() Color lineColor, + @ColorConverter() Color japanLandColor, + @ColorConverter() Color japanLineColor, + }); } /// @nodoc @@ -303,54 +322,65 @@ class _$MapStyleColorSchemeCopyWithImpl<$Res, $Val extends MapStyleColorScheme> Object? japanLandColor = null, Object? japanLineColor = null, }) { - return _then(_value.copyWith( - backgroundColor: null == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color, - landColor: null == landColor - ? _value.landColor - : landColor // ignore: cast_nullable_to_non_nullable - as Color, - lineColor: null == lineColor - ? _value.lineColor - : lineColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLandColor: null == japanLandColor - ? _value.japanLandColor - : japanLandColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLineColor: null == japanLineColor - ? _value.japanLineColor - : japanLineColor // ignore: cast_nullable_to_non_nullable - as Color, - ) as $Val); + return _then( + _value.copyWith( + backgroundColor: + null == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as Color, + landColor: + null == landColor + ? _value.landColor + : landColor // ignore: cast_nullable_to_non_nullable + as Color, + lineColor: + null == lineColor + ? _value.lineColor + : lineColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLandColor: + null == japanLandColor + ? _value.japanLandColor + : japanLandColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLineColor: + null == japanLineColor + ? _value.japanLineColor + : japanLineColor // ignore: cast_nullable_to_non_nullable + as Color, + ) + as $Val, + ); } } /// @nodoc abstract class _$$MapStyleColorSchemeImplCopyWith<$Res> implements $MapStyleColorSchemeCopyWith<$Res> { - factory _$$MapStyleColorSchemeImplCopyWith(_$MapStyleColorSchemeImpl value, - $Res Function(_$MapStyleColorSchemeImpl) then) = - __$$MapStyleColorSchemeImplCopyWithImpl<$Res>; + factory _$$MapStyleColorSchemeImplCopyWith( + _$MapStyleColorSchemeImpl value, + $Res Function(_$MapStyleColorSchemeImpl) then, + ) = __$$MapStyleColorSchemeImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@ColorConverter() Color backgroundColor, - @ColorConverter() Color landColor, - @ColorConverter() Color lineColor, - @ColorConverter() Color japanLandColor, - @ColorConverter() Color japanLineColor}); + $Res call({ + @ColorConverter() Color backgroundColor, + @ColorConverter() Color landColor, + @ColorConverter() Color lineColor, + @ColorConverter() Color japanLandColor, + @ColorConverter() Color japanLineColor, + }); } /// @nodoc class __$$MapStyleColorSchemeImplCopyWithImpl<$Res> extends _$MapStyleColorSchemeCopyWithImpl<$Res, _$MapStyleColorSchemeImpl> implements _$$MapStyleColorSchemeImplCopyWith<$Res> { - __$$MapStyleColorSchemeImplCopyWithImpl(_$MapStyleColorSchemeImpl _value, - $Res Function(_$MapStyleColorSchemeImpl) _then) - : super(_value, _then); + __$$MapStyleColorSchemeImplCopyWithImpl( + _$MapStyleColorSchemeImpl _value, + $Res Function(_$MapStyleColorSchemeImpl) _then, + ) : super(_value, _then); /// Create a copy of MapStyleColorScheme /// with the given fields replaced by the non-null parameter values. @@ -363,40 +393,48 @@ class __$$MapStyleColorSchemeImplCopyWithImpl<$Res> Object? japanLandColor = null, Object? japanLineColor = null, }) { - return _then(_$MapStyleColorSchemeImpl( - backgroundColor: null == backgroundColor - ? _value.backgroundColor - : backgroundColor // ignore: cast_nullable_to_non_nullable - as Color, - landColor: null == landColor - ? _value.landColor - : landColor // ignore: cast_nullable_to_non_nullable - as Color, - lineColor: null == lineColor - ? _value.lineColor - : lineColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLandColor: null == japanLandColor - ? _value.japanLandColor - : japanLandColor // ignore: cast_nullable_to_non_nullable - as Color, - japanLineColor: null == japanLineColor - ? _value.japanLineColor - : japanLineColor // ignore: cast_nullable_to_non_nullable - as Color, - )); + return _then( + _$MapStyleColorSchemeImpl( + backgroundColor: + null == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as Color, + landColor: + null == landColor + ? _value.landColor + : landColor // ignore: cast_nullable_to_non_nullable + as Color, + lineColor: + null == lineColor + ? _value.lineColor + : lineColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLandColor: + null == japanLandColor + ? _value.japanLandColor + : japanLandColor // ignore: cast_nullable_to_non_nullable + as Color, + japanLineColor: + null == japanLineColor + ? _value.japanLineColor + : japanLineColor // ignore: cast_nullable_to_non_nullable + as Color, + ), + ); } } /// @nodoc @JsonSerializable() class _$MapStyleColorSchemeImpl implements _MapStyleColorScheme { - const _$MapStyleColorSchemeImpl( - {@ColorConverter() required this.backgroundColor, - @ColorConverter() required this.landColor, - @ColorConverter() required this.lineColor, - @ColorConverter() required this.japanLandColor, - @ColorConverter() required this.japanLineColor}); + const _$MapStyleColorSchemeImpl({ + @ColorConverter() required this.backgroundColor, + @ColorConverter() required this.landColor, + @ColorConverter() required this.lineColor, + @ColorConverter() required this.japanLandColor, + @ColorConverter() required this.japanLineColor, + }); factory _$MapStyleColorSchemeImpl.fromJson(Map json) => _$$MapStyleColorSchemeImplFromJson(json); @@ -441,8 +479,14 @@ class _$MapStyleColorSchemeImpl implements _MapStyleColorScheme { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, backgroundColor, landColor, - lineColor, japanLandColor, japanLineColor); + int get hashCode => Object.hash( + runtimeType, + backgroundColor, + landColor, + lineColor, + japanLandColor, + japanLineColor, + ); /// Create a copy of MapStyleColorScheme /// with the given fields replaced by the non-null parameter values. @@ -451,24 +495,24 @@ class _$MapStyleColorSchemeImpl implements _MapStyleColorScheme { @pragma('vm:prefer-inline') _$$MapStyleColorSchemeImplCopyWith<_$MapStyleColorSchemeImpl> get copyWith => __$$MapStyleColorSchemeImplCopyWithImpl<_$MapStyleColorSchemeImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$MapStyleColorSchemeImplToJson( - this, - ); + return _$$MapStyleColorSchemeImplToJson(this); } } abstract class _MapStyleColorScheme implements MapStyleColorScheme { - const factory _MapStyleColorScheme( - {@ColorConverter() required final Color backgroundColor, - @ColorConverter() required final Color landColor, - @ColorConverter() required final Color lineColor, - @ColorConverter() required final Color japanLandColor, - @ColorConverter() required final Color japanLineColor}) = - _$MapStyleColorSchemeImpl; + const factory _MapStyleColorScheme({ + @ColorConverter() required final Color backgroundColor, + @ColorConverter() required final Color landColor, + @ColorConverter() required final Color lineColor, + @ColorConverter() required final Color japanLandColor, + @ColorConverter() required final Color japanLineColor, + }) = _$MapStyleColorSchemeImpl; factory _MapStyleColorScheme.fromJson(Map json) = _$MapStyleColorSchemeImpl.fromJson; diff --git a/app/lib/feature/map/data/model/map_style_config.g.dart b/app/lib/feature/map/data/model/map_style_config.g.dart index e7fdda28..2140cc0b 100644 --- a/app/lib/feature/map/data/model/map_style_config.g.dart +++ b/app/lib/feature/map/data/model/map_style_config.g.dart @@ -9,23 +9,19 @@ part of 'map_style_config.dart'; // ************************************************************************** _$MapStyleConfigImpl _$$MapStyleConfigImplFromJson(Map json) => - $checkedCreate( - r'_$MapStyleConfigImpl', - json, - ($checkedConvert) { - final val = _$MapStyleConfigImpl( - theme: $checkedConvert( - 'theme', (v) => $enumDecode(_$MapStyleThemeEnumMap, v)), - ); - return val; - }, - ); + $checkedCreate(r'_$MapStyleConfigImpl', json, ($checkedConvert) { + final val = _$MapStyleConfigImpl( + theme: $checkedConvert( + 'theme', + (v) => $enumDecode(_$MapStyleThemeEnumMap, v), + ), + ); + return val; + }); Map _$$MapStyleConfigImplToJson( - _$MapStyleConfigImpl instance) => - { - 'theme': _$MapStyleThemeEnumMap[instance.theme]!, - }; + _$MapStyleConfigImpl instance, +) => {'theme': _$MapStyleThemeEnumMap[instance.theme]!}; const _$MapStyleThemeEnumMap = { MapStyleTheme.light: 'light', @@ -34,43 +30,50 @@ const _$MapStyleThemeEnumMap = { }; _$MapStyleColorSchemeImpl _$$MapStyleColorSchemeImplFromJson( - Map json) => - $checkedCreate( - r'_$MapStyleColorSchemeImpl', - json, - ($checkedConvert) { - final val = _$MapStyleColorSchemeImpl( - backgroundColor: $checkedConvert('background_color', - (v) => const ColorConverter().fromJson(v as String)), - landColor: $checkedConvert('land_color', - (v) => const ColorConverter().fromJson(v as String)), - lineColor: $checkedConvert('line_color', - (v) => const ColorConverter().fromJson(v as String)), - japanLandColor: $checkedConvert('japan_land_color', - (v) => const ColorConverter().fromJson(v as String)), - japanLineColor: $checkedConvert('japan_line_color', - (v) => const ColorConverter().fromJson(v as String)), - ); - return val; - }, - fieldKeyMap: const { - 'backgroundColor': 'background_color', - 'landColor': 'land_color', - 'lineColor': 'line_color', - 'japanLandColor': 'japan_land_color', - 'japanLineColor': 'japan_line_color' - }, + Map json, +) => $checkedCreate( + r'_$MapStyleColorSchemeImpl', + json, + ($checkedConvert) { + final val = _$MapStyleColorSchemeImpl( + backgroundColor: $checkedConvert( + 'background_color', + (v) => const ColorConverter().fromJson(v as String), + ), + landColor: $checkedConvert( + 'land_color', + (v) => const ColorConverter().fromJson(v as String), + ), + lineColor: $checkedConvert( + 'line_color', + (v) => const ColorConverter().fromJson(v as String), + ), + japanLandColor: $checkedConvert( + 'japan_land_color', + (v) => const ColorConverter().fromJson(v as String), + ), + japanLineColor: $checkedConvert( + 'japan_line_color', + (v) => const ColorConverter().fromJson(v as String), + ), ); + return val; + }, + fieldKeyMap: const { + 'backgroundColor': 'background_color', + 'landColor': 'land_color', + 'lineColor': 'line_color', + 'japanLandColor': 'japan_land_color', + 'japanLineColor': 'japan_line_color', + }, +); Map _$$MapStyleColorSchemeImplToJson( - _$MapStyleColorSchemeImpl instance) => - { - 'background_color': - const ColorConverter().toJson(instance.backgroundColor), - 'land_color': const ColorConverter().toJson(instance.landColor), - 'line_color': const ColorConverter().toJson(instance.lineColor), - 'japan_land_color': - const ColorConverter().toJson(instance.japanLandColor), - 'japan_line_color': - const ColorConverter().toJson(instance.japanLineColor), - }; + _$MapStyleColorSchemeImpl instance, +) => { + 'background_color': const ColorConverter().toJson(instance.backgroundColor), + 'land_color': const ColorConverter().toJson(instance.landColor), + 'line_color': const ColorConverter().toJson(instance.lineColor), + 'japan_land_color': const ColorConverter().toJson(instance.japanLandColor), + 'japan_line_color': const ColorConverter().toJson(instance.japanLineColor), +}; diff --git a/app/lib/feature/map/data/notifier/map_configuration_notifier.dart b/app/lib/feature/map/data/notifier/map_configuration_notifier.dart index ece2eab5..c787aa76 100644 --- a/app/lib/feature/map/data/notifier/map_configuration_notifier.dart +++ b/app/lib/feature/map/data/notifier/map_configuration_notifier.dart @@ -23,7 +23,8 @@ class MapConfigurationNotifier extends _$MapConfigurationNotifier { final util = ref.watch(mapStyleUtilProvider); final styleString = await util.getStyle( - colorScheme: savedState.colorScheme ?? + colorScheme: + savedState.colorScheme ?? switch (savedState.theme) { MapTheme.light => MapColorScheme.light(), MapTheme.dark => MapColorScheme.dark(), diff --git a/app/lib/feature/map/data/notifier/map_configuration_notifier.g.dart b/app/lib/feature/map/data/notifier/map_configuration_notifier.g.dart index 2995e21f..203dfc90 100644 --- a/app/lib/feature/map/data/notifier/map_configuration_notifier.g.dart +++ b/app/lib/feature/map/data/notifier/map_configuration_notifier.g.dart @@ -15,14 +15,15 @@ String _$mapConfigurationNotifierHash() => @ProviderFor(MapConfigurationNotifier) final mapConfigurationNotifierProvider = AsyncNotifierProvider.internal( - MapConfigurationNotifier.new, - name: r'mapConfigurationNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$mapConfigurationNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + MapConfigurationNotifier.new, + name: r'mapConfigurationNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$mapConfigurationNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$MapConfigurationNotifier = AsyncNotifier; // ignore_for_file: type=lint diff --git a/app/lib/feature/map/data/provider/map_style_util.dart b/app/lib/feature/map/data/provider/map_style_util.dart index 0fad9c07..21696b9a 100644 --- a/app/lib/feature/map/data/provider/map_style_util.dart +++ b/app/lib/feature/map/data/provider/map_style_util.dart @@ -16,9 +16,7 @@ part 'map_style_util.g.dart'; MapStyleUtil mapStyleUtil(Ref ref) => MapStyleUtil(); class MapStyleUtil { - Future _saveStyleJson( - Map json, - ) async { + Future _saveStyleJson(Map json) async { final jsonStr = jsonEncode(json); final hash = sha256.convert(utf8.encode(jsonStr)).toString(); @@ -32,19 +30,14 @@ class MapStyleUtil { return styleFile.path; } - Future getStyle({ - required MapColorScheme colorScheme, - }) async { + Future getStyle({required MapColorScheme colorScheme}) async { if (kIsWeb) { return 'https://v2.map.eqmonitor.app/style-light.json'; } final json = { 'version': 8, 'name': 'EQMonitor Style', - 'center': [ - 139.767125, - 35.681236, - ], + 'center': [139.767125, 35.681236], 'zoom': 5, 'sources': { 'eqmonitor_map': { @@ -84,9 +77,7 @@ class MapStyleUtil { 'source-layer': 'countries', 'type': 'fill', 'layout': {'visibility': 'visible'}, - 'paint': { - 'fill-color': colorScheme.worldLandColor.toHexStringRGB(), - }, + 'paint': {'fill-color': colorScheme.worldLandColor.toHexStringRGB()}, }, { 'id': BaseLayer.countriesLines.name, @@ -112,9 +103,7 @@ class MapStyleUtil { 'source': 'eqmonitor_map', 'source-layer': 'areaForecastLocalE', 'type': 'fill', - 'paint': { - 'fill-color': colorScheme.japanLandColor.toHexStringRGB(), - }, + 'paint': {'fill-color': colorScheme.japanLandColor.toHexStringRGB()}, }, // areaForecastLocalEew_line { @@ -194,7 +183,6 @@ enum BaseLayer { areaForecastLocalEewLine, areaForecastLocalELine, areaInformationCityQuakeLine, - ; } extension ColorCode on Color { diff --git a/app/lib/feature/map/ui/components/controller/map_layer_controller_card.dart b/app/lib/feature/map/ui/components/controller/map_layer_controller_card.dart index f6d92b87..9b37fbf0 100644 --- a/app/lib/feature/map/ui/components/controller/map_layer_controller_card.dart +++ b/app/lib/feature/map/ui/components/controller/map_layer_controller_card.dart @@ -21,9 +21,7 @@ class MapLayerControllerCard extends StatelessWidget { const divider = Padding( padding: EdgeInsets.symmetric(horizontal: 4), - child: Divider( - height: 0, - ), + child: Divider(height: 0), ); void hapticFeedback() => unawaited(HapticFeedback.lightImpact()); @@ -32,42 +30,36 @@ class MapLayerControllerCard extends StatelessWidget { color: colorScheme.surfaceContainerHighest, clipBehavior: Clip.hardEdge, elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), child: IntrinsicWidth( child: Column( mainAxisSize: MainAxisSize.min, - children: [ - InkWell( - child: const Padding( - padding: EdgeInsets.all(8), - child: Icon(Icons.layers_rounded), - ), - onTap: () async { - hapticFeedback(); - onLayerButtonTap?.call(); - }, - ), - InkWell( - child: const Padding( - padding: EdgeInsets.all(8), - child: Icon(Icons.location_on), - ), - onTap: () { - hapticFeedback(); - onLocationButtonTap?.call(); - }, - ), - ] - .mapIndexed( - (index, child) => [ - if (index > 0) divider, - child, - ], - ) - .flattened - .toList(), + children: + [ + InkWell( + child: const Padding( + padding: EdgeInsets.all(8), + child: Icon(Icons.layers_rounded), + ), + onTap: () async { + hapticFeedback(); + onLayerButtonTap?.call(); + }, + ), + InkWell( + child: const Padding( + padding: EdgeInsets.all(8), + child: Icon(Icons.location_on), + ), + onTap: () { + hapticFeedback(); + onLocationButtonTap?.call(); + }, + ), + ] + .mapIndexed((index, child) => [if (index > 0) divider, child]) + .flattened + .toList(), ), ), ); diff --git a/app/lib/feature/map/ui/declarative_map.dart b/app/lib/feature/map/ui/declarative_map.dart index 20f601d2..35fcf371 100644 --- a/app/lib/feature/map/ui/declarative_map.dart +++ b/app/lib/feature/map/ui/declarative_map.dart @@ -105,9 +105,7 @@ class _DeclarativeMapState extends ConsumerState { onCameraIdle: () { final position = widget.controller.controller?.cameraPosition; if (position != null) { - widget.onCameraIdle?.call( - MapCameraPosition.fromMapLibre(position), - ); + widget.onCameraIdle?.call(MapCameraPosition.fromMapLibre(position)); } }, myLocationEnabled: widget.myLocationEnabled, @@ -137,9 +135,10 @@ class _DeclarativeMapState extends ConsumerState { _isUpdatingLayers = true; // 削除探索 - final layersToRemove = _addedLayers.entries - .where((entry) => !widget.layers.any((e) => e.id == entry.key)) - .toList(); + final layersToRemove = + _addedLayers.entries + .where((entry) => !widget.layers.any((e) => e.id == entry.key)) + .toList(); for (final entry in layersToRemove) { await controller.removeLayer(entry.key); @@ -153,9 +152,10 @@ class _DeclarativeMapState extends ConsumerState { for (var i = 0; i < widget.layers.length; i++) { final layer = widget.layers[i]; - final belowLayerId = i > 0 - ? widget.layers[i - 1].id - : BaseLayer.areaForecastLocalELine.name; + final belowLayerId = + i > 0 + ? widget.layers[i - 1].id + : BaseLayer.areaForecastLocalELine.name; if (_addedLayers.containsKey(layer.id)) { final cachedLayer = _addedLayers[layer.id]!; @@ -167,7 +167,7 @@ class _DeclarativeMapState extends ConsumerState { cachedLayer.layerPropertiesHash != layer.layerPropertiesHash; final isGeoJsonSourceChanged = cachedLayer.geoJsonSourceHash != layer.geoJsonSourceHash && - sourceId != null; + sourceId != null; final isFilterChanged = cachedLayer.filter != layer.filter; // style check @@ -185,10 +185,7 @@ class _DeclarativeMapState extends ConsumerState { e.code == 'LAYER_NOT_FOUND_ERROR') { // レイヤーが見つからない場合は、レイヤーを再追加する await controller.removeLayer(layer.id); - await _addLayer( - layer: layer, - belowLayerId: belowLayerId, - ); + await _addLayer(layer: layer, belowLayerId: belowLayerId); } else { rethrow; } @@ -199,19 +196,13 @@ class _DeclarativeMapState extends ConsumerState { if (isGeoJsonSourceChanged) { final geoJsonSource = layer.toGeoJsonSource(); if (geoJsonSource != null) { - await controller.setGeoJsonSource( - sourceId, - geoJsonSource, - ); + await controller.setGeoJsonSource(sourceId, geoJsonSource); _addedLayers[layer.id] = layer; } } // filter check if (isFilterChanged) { - await controller.setFilter( - layer.id, - layer.filter, - ); + await controller.setFilter(layer.id, layer.filter); _addedLayers[layer.id] = layer; } } @@ -222,10 +213,7 @@ class _DeclarativeMapState extends ConsumerState { print('add source: ${layer.sourceId}'); final sourceId = layer.sourceId; if (sourceId != null) { - await _addLayer( - layer: layer, - belowLayerId: belowLayerId, - ); + await _addLayer(layer: layer, belowLayerId: belowLayerId); _addedSources[sourceId] = layer.id; } } else { @@ -233,9 +221,7 @@ class _DeclarativeMapState extends ConsumerState { final layerProperties = layer.toLayerProperties(); final sourceId = layer.sourceId; if (layerProperties != null && sourceId != null) { - print( - '[ADD] layer only: ${layer.id} (source: $sourceId)', - ); + print('[ADD] layer only: ${layer.id} (source: $sourceId)'); await controller.addLayer( sourceId, layer.id, @@ -267,10 +253,7 @@ class _DeclarativeMapState extends ConsumerState { final geoJsonSource = layer.toGeoJsonSource(); if (geoJsonSource != null) { print('[ADD] geoJsonSource: $sourceId (layer: ${layer.id})'); - await controller.addGeoJsonSource( - sourceId, - geoJsonSource, - ); + await controller.addGeoJsonSource(sourceId, geoJsonSource); } else { print('no geoJsonSource: $sourceId'); } @@ -314,25 +297,20 @@ class _DeclarativeMapState extends ConsumerState { return; } if (oldWidget.styleString != widget.styleString) { - unawaited( - _updateAllLayers(), - ); + unawaited(_updateAllLayers()); } if (oldWidget.layers != widget.layers) { - unawaited( - _updateLayers(), - ); + unawaited(_updateLayers()); } } } enum DeclarativeAssets { normalHypocenter, - lowPreciseHypocenter, - ; + lowPreciseHypocenter; String get path => switch (this) { - normalHypocenter => Assets.images.map.normalHypocenter.path, - lowPreciseHypocenter => Assets.images.map.lowPreciseHypocenter.path, - }; + normalHypocenter => Assets.images.map.normalHypocenter.path, + lowPreciseHypocenter => Assets.images.map.lowPreciseHypocenter.path, + }; } diff --git a/app/lib/feature/settings/children/application_info/about_this_app.dart b/app/lib/feature/settings/children/application_info/about_this_app.dart index 65c28b59..a46103e7 100644 --- a/app/lib/feature/settings/children/application_info/about_this_app.dart +++ b/app/lib/feature/settings/children/application_info/about_this_app.dart @@ -18,9 +18,7 @@ class AboutThisAppScreen extends HookWidget { ); final markdown = useFuture(markdownFuture); return Scaffold( - appBar: AppBar( - title: const Text('このアプリについて'), - ), + appBar: AppBar(title: const Text('このアプリについて')), body: SingleChildScrollView( child: SafeArea( child: Column( @@ -28,19 +26,24 @@ class AboutThisAppScreen extends HookWidget { ListTile( title: const Text('利用規約'), leading: const Icon(Icons.description), - onTap: () async => - const TermOfServiceRoute($extra: null).push(context), + onTap: + () async => const TermOfServiceRoute( + $extra: null, + ).push(context), ), ListTile( title: const Text('プライバシーポリシー'), leading: const Icon(Icons.info), - onTap: () async => - const PrivacyPolicyRoute($extra: null).push(context), + onTap: + () async => const PrivacyPolicyRoute( + $extra: null, + ).push(context), ), ListTile( title: const Text('ライセンス情報'), - subtitle: - Text('MIT License ${DateTime.now().year} Ryotaro Onoue'), + subtitle: Text( + 'MIT License ${DateTime.now().year} Ryotaro Onoue', + ), leading: const Icon(Icons.settings), onTap: () async => const LicenseRoute().push(context), ), diff --git a/app/lib/feature/settings/children/application_info/license_page.dart b/app/lib/feature/settings/children/application_info/license_page.dart index 77adba4d..f9fa15e3 100644 --- a/app/lib/feature/settings/children/application_info/license_page.dart +++ b/app/lib/feature/settings/children/application_info/license_page.dart @@ -23,20 +23,19 @@ class LicensePage extends ConsumerWidget { padding: const EdgeInsets.all(8), child: ClipRRect( borderRadius: BorderRadius.circular(24), - child: Assets.images.icon.image( - height: 80, - ), + child: Assets.images.icon.image(height: 80), ), ), TextButton( child: const Text('https://github.com/YumNumm/EQMonitor'), - onPressed: () async => - launchUrlString('https://github.com/YumNumm/EQMonitor'), + onPressed: + () async => + launchUrlString('https://github.com/YumNumm/EQMonitor'), ), TextButton( child: const Text('https://license.eqmonitor.app'), - onPressed: () async => - launchUrlString('https://license.eqmonitor.app'), + onPressed: + () async => launchUrlString('https://license.eqmonitor.app'), ), ], ), diff --git a/app/lib/feature/settings/children/application_info/privacy_policy_screen.dart b/app/lib/feature/settings/children/application_info/privacy_policy_screen.dart index 5d5a4384..41da5f2e 100644 --- a/app/lib/feature/settings/children/application_info/privacy_policy_screen.dart +++ b/app/lib/feature/settings/children/application_info/privacy_policy_screen.dart @@ -18,9 +18,7 @@ class PrivacyPolicyScreen extends HookWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('プライバシーポリシー'), - ), + appBar: AppBar(title: const Text('プライバシーポリシー')), body: const _PrivacyPolicyScreenBody(), ); } @@ -33,16 +31,12 @@ class _PrivacyPolicyScreenBody extends HookWidget { Widget build(BuildContext context) { final markdownBody = useFuture( // ignore: discarded_futures - useMemoized( - () async => rootBundle.loadString(Assets.docs.privacyPolicy), - ), + useMemoized(() async => rootBundle.loadString(Assets.docs.privacyPolicy)), initialData: '', ); final data = markdownBody.data; if (data == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); + return const Center(child: CircularProgressIndicator.adaptive()); } return Markdown( data: data, @@ -52,9 +46,7 @@ class _PrivacyPolicyScreenBody extends HookWidget { if (uri == null) { return; } - await launchUrl( - uri, - ); + await launchUrl(uri); }, ); } diff --git a/app/lib/feature/settings/children/application_info/term_of_service_screen.dart b/app/lib/feature/settings/children/application_info/term_of_service_screen.dart index ea44bae3..03f70c0f 100644 --- a/app/lib/feature/settings/children/application_info/term_of_service_screen.dart +++ b/app/lib/feature/settings/children/application_info/term_of_service_screen.dart @@ -18,9 +18,7 @@ class TermOfServiceScreen extends HookWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('利用規約'), - ), + appBar: AppBar(title: const Text('利用規約')), body: const _TermOfServiceScreenBody(), ); } @@ -33,16 +31,12 @@ class _TermOfServiceScreenBody extends HookWidget { Widget build(BuildContext context) { final markdownBody = useFuture( // ignore: discarded_futures - useMemoized( - () async => rootBundle.loadString(Assets.docs.termOfService), - ), + useMemoized(() async => rootBundle.loadString(Assets.docs.termOfService)), initialData: '', ); final data = markdownBody.data; if (data == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); + return const Center(child: CircularProgressIndicator.adaptive()); } return Markdown( data: data, @@ -52,9 +46,7 @@ class _TermOfServiceScreenBody extends HookWidget { if (uri == null) { return; } - await launchUrl( - uri, - ); + await launchUrl(uri); }, ); } diff --git a/app/lib/feature/settings/children/config/debug/api_endpoint_selector/http_api_endpoint_selector_page.dart b/app/lib/feature/settings/children/config/debug/api_endpoint_selector/http_api_endpoint_selector_page.dart index 7e2fe49d..5f59cd91 100644 --- a/app/lib/feature/settings/children/config/debug/api_endpoint_selector/http_api_endpoint_selector_page.dart +++ b/app/lib/feature/settings/children/config/debug/api_endpoint_selector/http_api_endpoint_selector_page.dart @@ -13,9 +13,7 @@ class HttpApiEndpointSelectorPage extends ConsumerWidget { final developUrl = defaultUrl.replaceAll('api.', 'dev.api.'); final state = ref.watch(telegramUrlProvider.select((v) => v.restApiUrl)); return Scaffold( - appBar: AppBar( - title: const Text('API Endpoint Selector'), - ), + appBar: AppBar(title: const Text('API Endpoint Selector')), body: Column( children: [ BorderedContainer( @@ -26,18 +24,20 @@ class HttpApiEndpointSelectorPage extends ConsumerWidget { subtitle: const Text(defaultUrl), value: defaultUrl, groupValue: state, - onChanged: (value) async => ref - .read(telegramUrlProvider.notifier) - .updateRestUrl(value!), + onChanged: + (value) async => ref + .read(telegramUrlProvider.notifier) + .updateRestUrl(value!), ), RadioListTile.adaptive( title: const Text('[HTTP API] DEV'), value: developUrl, subtitle: Text(developUrl), groupValue: state, - onChanged: (value) async => ref - .read(telegramUrlProvider.notifier) - .updateRestUrl(value!), + onChanged: + (value) async => ref + .read(telegramUrlProvider.notifier) + .updateRestUrl(value!), ), ], ), diff --git a/app/lib/feature/settings/children/config/debug/api_endpoint_selector/websocket_api_endpoint_selector_page.dart b/app/lib/feature/settings/children/config/debug/api_endpoint_selector/websocket_api_endpoint_selector_page.dart index 1aaf6f5b..23bed616 100644 --- a/app/lib/feature/settings/children/config/debug/api_endpoint_selector/websocket_api_endpoint_selector_page.dart +++ b/app/lib/feature/settings/children/config/debug/api_endpoint_selector/websocket_api_endpoint_selector_page.dart @@ -13,9 +13,7 @@ class WebSocketApiEndpointSelectorPage extends ConsumerWidget { final developUrl = defaultUrl.replaceAll('api.', 'dev.api.'); final state = ref.watch(telegramUrlProvider.select((v) => v.wsApiUrl)); return Scaffold( - appBar: AppBar( - title: const Text('WebSocket Endpoint Selector'), - ), + appBar: AppBar(title: const Text('WebSocket Endpoint Selector')), body: Column( children: [ BorderedContainer( @@ -26,18 +24,20 @@ class WebSocketApiEndpointSelectorPage extends ConsumerWidget { subtitle: const Text(defaultUrl), value: defaultUrl, groupValue: state, - onChanged: (value) async => ref - .read(telegramUrlProvider.notifier) - .updateWebSocketUrl(value!), + onChanged: + (value) async => ref + .read(telegramUrlProvider.notifier) + .updateWebSocketUrl(value!), ), RadioListTile.adaptive( title: const Text('[WebSocket API] Development Endpoint'), value: developUrl, subtitle: Text(developUrl), groupValue: state, - onChanged: (value) async => ref - .read(telegramUrlProvider.notifier) - .updateWebSocketUrl(value!), + onChanged: + (value) async => ref + .read(telegramUrlProvider.notifier) + .updateWebSocketUrl(value!), ), ], ), diff --git a/app/lib/feature/settings/children/config/debug/debug_page.dart b/app/lib/feature/settings/children/config/debug/debug_page.dart index 20084cc2..472405cc 100644 --- a/app/lib/feature/settings/children/config/debug/debug_page.dart +++ b/app/lib/feature/settings/children/config/debug/debug_page.dart @@ -20,14 +20,8 @@ class DebugPage extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return Scaffold( - appBar: AppBar( - title: const Text('Debug Page'), - ), - body: ListView( - children: const [ - _DebugWidget(), - ], - ), + appBar: AppBar(title: const Text('Debug Page')), + body: ListView(children: const [_DebugWidget()]), ); } } @@ -53,10 +47,7 @@ class _DebugWidget extends ConsumerWidget { ), ), child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -65,8 +56,9 @@ class _DebugWidget extends ConsumerWidget { title: const Text('デバッグモード'), subtitle: Text(isDebugEnabled ? 'ON' : 'OFF'), value: isDebugEnabled, - onChanged: (value) async => - ref.read(debugProvider.notifier).save(isEnabled: value), + onChanged: + (value) async => + ref.read(debugProvider.notifier).save(isEnabled: value), ), ListTile( title: const Text('Flavor'), @@ -82,15 +74,18 @@ class _DebugWidget extends ConsumerWidget { title: const Text('REST APIエンドポイント'), leading: const Icon(Icons.http), subtitle: Text(ref.watch(telegramUrlProvider).restApiUrl), - onTap: () async => - const HttpApiEndpointSelectorRoute().push(context), + onTap: + () async => + const HttpApiEndpointSelectorRoute().push(context), ), ListTile( title: const Text('WebSocketエンドポイント'), leading: const Icon(Icons.http), subtitle: Text(ref.watch(telegramUrlProvider).wsApiUrl), - onTap: () async => - const WebsocketEndpointSelectorRoute().push(context), + onTap: + () async => const WebsocketEndpointSelectorRoute().push( + context, + ), ), ListTile( title: const Text('KyoshinMonitor'), @@ -105,11 +100,12 @@ class _DebugWidget extends ConsumerWidget { ListTile( title: const Text('震源アイコン生成'), leading: const Icon(Icons.place), - onTap: () async => Navigator.of(context).push( - MaterialPageRoute( - builder: (context) => const HypocenterIconPage(), - ), - ), + onTap: + () async => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const HypocenterIconPage(), + ), + ), ), ListTile( title: const Text('FCM Token'), @@ -130,11 +126,9 @@ class _DebugWidget extends ConsumerWidget { child: Column( children: ref.watch(goRouterProvider).configuration.routes.map((e) { - final route = e as GoRoute; - return _Route( - routes: [route], - ); - }).toList(), + final route = e as GoRoute; + return _Route(routes: [route]); + }).toList(), ), ), ], @@ -145,10 +139,7 @@ class _DebugWidget extends ConsumerWidget { } class _Route extends StatelessWidget { - const _Route({ - required this.routes, - this.parent = const [], - }); + const _Route({required this.routes, this.parent = const []}); final List routes; final List parent; @@ -156,27 +147,24 @@ class _Route extends StatelessWidget { @override Widget build(BuildContext context) { return Column( - children: routes.map( - (route) { - final currentPath = [...parent, route]; - if (route.routes.isEmpty) { - final path = [...parent, route].map((e) => e.path).join('/'); + children: + routes.map((route) { + final currentPath = [...parent, route]; + if (route.routes.isEmpty) { + final path = [...parent, route].map((e) => e.path).join('/'); - return ListTile( - title: Text(path), - onTap: () async => context.push( - path, - ), - visualDensity: VisualDensity.compact, - ); - } + return ListTile( + title: Text(path), + onTap: () async => context.push(path), + visualDensity: VisualDensity.compact, + ); + } - return _Route( - routes: route.routes.whereType().toList(), - parent: currentPath, - ); - }, - ).toList(), + return _Route( + routes: route.routes.whereType().toList(), + parent: currentPath, + ); + }).toList(), ); } } diff --git a/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart b/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart index 951b2edd..f15831cc 100644 --- a/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart +++ b/app/lib/feature/settings/children/config/debug/hypocenter_icon/hypocenter_icon_page.dart @@ -16,18 +16,13 @@ class HypocenterIconPage extends ConsumerWidget { final lowPreciseController = ScreenshotController(); return Scaffold( - appBar: AppBar( - title: const Text('震源アイコン生成'), - ), + appBar: AppBar(title: const Text('震源アイコン生成')), body: ListView( padding: const EdgeInsets.all(16), children: [ const Text( '通常の震源アイコン', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), const SizedBox(height: 8), Column( @@ -41,21 +36,17 @@ class HypocenterIconPage extends ConsumerWidget { height: 100, width: 100, child: const CustomPaint( - painter: _HypocenterPainter( - type: HypocenterType.normal, - ), + painter: _HypocenterPainter(type: HypocenterType.normal), ), ), ), - Assets.images.map.normalHypocenter.image( - width: 100, - height: 100, - ), + Assets.images.map.normalHypocenter.image(width: 100, height: 100), FilledButton.icon( - onPressed: () async => _captureAndShare( - controller: normalController, - fileName: 'normal_hypocenter.png', - ), + onPressed: + () async => _captureAndShare( + controller: normalController, + fileName: 'normal_hypocenter.png', + ), icon: const Icon(Icons.share), label: const Text('共有'), ), @@ -64,10 +55,7 @@ class HypocenterIconPage extends ConsumerWidget { const SizedBox(height: 16), const Text( '精度の低い震源アイコン', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), const SizedBox(height: 8), Column( @@ -94,10 +82,11 @@ class HypocenterIconPage extends ConsumerWidget { height: 100, ), FilledButton.icon( - onPressed: () async => _captureAndShare( - controller: lowPreciseController, - fileName: 'low_precise_hypocenter.png', - ), + onPressed: + () async => _captureAndShare( + controller: lowPreciseController, + fileName: 'low_precise_hypocenter.png', + ), icon: const Icon(Icons.share), label: const Text('共有'), ), @@ -123,16 +112,12 @@ class HypocenterIconPage extends ConsumerWidget { final file = await File('${tempDir.path}/$fileName').create(); await file.writeAsBytes(image); - await Share.shareXFiles( - [XFile(file.path)], - ); + await Share.shareXFiles([XFile(file.path)]); } } class _HypocenterPainter extends CustomPainter { - const _HypocenterPainter({ - required this.type, - }); + const _HypocenterPainter({required this.type}); final HypocenterType type; @override @@ -238,8 +223,4 @@ class _HypocenterPainter extends CustomPainter { bool shouldRepaint(covariant _) => false; } -enum HypocenterType { - normal, - lowPrecise, - ; -} +enum HypocenterType { normal, lowPrecise } diff --git a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart index cc04ba0b..61f9e679 100644 --- a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart +++ b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart @@ -31,17 +31,13 @@ class DebugKyoshinMonitorPage extends StatelessWidget { appBar: AppBar( title: const Text( 'KyoshinMonitor', - style: TextStyle( - fontFamily: FontFamily.jetBrainsMono, - ), + style: TextStyle(fontFamily: FontFamily.jetBrainsMono), ), actions: const [], ), body: const SingleChildScrollView( primary: true, - child: SafeArea( - child: _Body(), - ), + child: SafeArea(child: _Body()), ), ), ); @@ -67,8 +63,9 @@ class _Body extends ConsumerWidget { fontFamilyFallback: [FontFamily.notoSansJP], ); - final kyoshinMonitorTimerState = - ref.watch(kyoshinMonitorTimerNotifierProvider); + final kyoshinMonitorTimerState = ref.watch( + kyoshinMonitorTimerNotifierProvider, + ); return Column( spacing: 8, @@ -78,22 +75,17 @@ class _Body extends ConsumerWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - 'KyoshinMonitorTimerNotifier', - style: titleTextStyle, - ), - Text( - switch (kyoshinMonitorTimerState) { - AsyncData(:final value) => - const JsonEncoder.withIndent(' ').convert({ - ...value.toJson(), - 'delay_from_device': value.delayFromDevice.toString(), - }), - AsyncError(:final error) => error.toString(), - _ => 'Loading...', - }, - style: bodyTextStyle, - ), + Text('KyoshinMonitorTimerNotifier', style: titleTextStyle), + Text(switch (kyoshinMonitorTimerState) { + AsyncData(:final value) => const JsonEncoder.withIndent( + ' ', + ).convert({ + ...value.toJson(), + 'delay_from_device': value.delayFromDevice.toString(), + }), + AsyncError(:final error) => error.toString(), + _ => 'Loading...', + }, style: bodyTextStyle), ], ), ), @@ -102,14 +94,11 @@ class _Body extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('KyoshinMonitorTimerStream', style: titleTextStyle), - Text( - switch (ref.watch(kyoshinMonitorTimerStreamProvider)) { - AsyncData(:final value) => value.toString(), - AsyncError(:final error) => error.toString(), - _ => 'Loading...', - }, - style: bodyTextStyle, - ), + Text(switch (ref.watch(kyoshinMonitorTimerStreamProvider)) { + AsyncData(:final value) => value.toString(), + AsyncError(:final error) => error.toString(), + _ => 'Loading...', + }, style: bodyTextStyle), ], ), ), @@ -122,31 +111,26 @@ class _Body extends ConsumerWidget { Row( children: [ Text('KyoshinMonitorNotifier', style: titleTextStyle), - if (state.isLoading) - const Icon( - Icons.refresh, - size: 16, - ), + if (state.isLoading) const Icon(Icons.refresh, size: 16), ], ), - Text( - switch (state) { - AsyncData(:final value) => - const JsonEncoder.withIndent(' ').convert({ - ...value.toJson(), - 'analyzed_points': value.analyzedPoints?.length, - 'last_image_fetch_duration': switch ( - value.lastImageFetchDuration?.inMicroseconds) { - final int v => '${v / 1000}ms', - null => 'null', - }, - 'current_image_raw': value.currentImageRaw?.length, - }), - AsyncError(:final error) => error.toString(), - _ => 'Loading...', - }, - style: bodyTextStyle, - ), + Text(switch (state) { + AsyncData(:final value) => const JsonEncoder.withIndent( + ' ', + ).convert({ + ...value.toJson(), + 'analyzed_points': value.analyzedPoints?.length, + 'last_image_fetch_duration': switch (value + .lastImageFetchDuration + ?.inMicroseconds) { + final int v => '${v / 1000}ms', + null => 'null', + }, + 'current_image_raw': value.currentImageRaw?.length, + }), + AsyncError(:final error) => error.toString(), + _ => 'Loading...', + }, style: bodyTextStyle), if (state.valueOrNull?.currentImageRaw != null) ColoredBox( color: Colors.white, @@ -159,10 +143,7 @@ class _Body extends ConsumerWidget { else const ColoredBox( color: Colors.white, - child: SizedBox( - height: 200, - width: 200, - ), + child: SizedBox(height: 200, width: 200), ), ], ); @@ -173,15 +154,13 @@ class _Body extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('KyoshinMonitorMaintenance', style: titleTextStyle), - Text( - switch (ref.watch(kyoshinMonitorMaintenanceProvider)) { - AsyncData(:final value) => - const JsonEncoder.withIndent(' ').convert(value.toJson()), - AsyncError(:final error) => error.toString(), - _ => 'Loading...', - }, - style: bodyTextStyle, - ), + Text(switch (ref.watch(kyoshinMonitorMaintenanceProvider)) { + AsyncData(:final value) => const JsonEncoder.withIndent( + ' ', + ).convert(value.toJson()), + AsyncError(:final error) => error.toString(), + _ => 'Loading...', + }, style: bodyTextStyle), ], ), ), @@ -191,9 +170,9 @@ class _Body extends ConsumerWidget { children: [ Text('KyoshinMonitorSettings', style: titleTextStyle), Text( - const JsonEncoder.withIndent(' ').convert( - ref.watch(kyoshinMonitorSettingsProvider).toJson(), - ), + const JsonEncoder.withIndent( + ' ', + ).convert(ref.watch(kyoshinMonitorSettingsProvider).toJson()), style: bodyTextStyle, ), ], diff --git a/app/lib/feature/settings/children/config/debug/playground/playground_page.dart b/app/lib/feature/settings/children/config/debug/playground/playground_page.dart index e625c026..adb21b64 100644 --- a/app/lib/feature/settings/children/config/debug/playground/playground_page.dart +++ b/app/lib/feature/settings/children/config/debug/playground/playground_page.dart @@ -30,10 +30,7 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { final router = GoRouter( routes: [ - GoRoute( - path: '/', - builder: (context, state) => const PlaygroundPage(), - ), + GoRoute(path: '/', builder: (context, state) => const PlaygroundPage()), ], ); return MaterialApp.router( @@ -58,20 +55,23 @@ class PlaygroundPage extends StatelessWidget { children: [ ListTile( title: const Text('ScaleCheckList'), - onTap: () async => showDialog( - context: context, - builder: (context) => Scaffold( - appBar: AppBar(title: const Text('ScaleCheckList')), - body: const ScaleCheckList(), - ), - ), + onTap: + () async => showDialog( + context: context, + builder: + (context) => Scaffold( + appBar: AppBar(title: const Text('ScaleCheckList')), + body: const ScaleCheckList(), + ), + ), ), ListTile( title: const Text('KyoshinMonitorScaleColorPage'), - onTap: () async => showDialog( - context: context, - builder: (context) => const KyoshinMonitorScaleColorPage(), - ), + onTap: + () async => showDialog( + context: context, + builder: (context) => const KyoshinMonitorScaleColorPage(), + ), ), ], ), @@ -83,12 +83,7 @@ class PlaygroundPage extends StatelessWidget { /// ************* 多機能ユーティリティ: パラメータ<->p<->Color *************** /// *************************************************************************** -enum ParamType { - shindo, - pga, - pgv, - pgd, -} +enum ParamType { shindo, pga, pgv, pgd } class KyoshinMonitorScaleUtil { //==== (1) パラメータ (震度/PGA/PGV/PGD) -> p の変換 ====// @@ -253,16 +248,15 @@ class ScaleCheckList extends StatelessWidget { final diff = p2 - p; final absDiff = diff.abs(); - final textColor = (absDiff < 0.002) - ? Colors.green - : (absDiff < 0.01 ? Colors.orange : Colors.red); + final textColor = + (absDiff < 0.002) + ? Colors.green + : (absDiff < 0.01 ? Colors.orange : Colors.red); return Container( margin: const EdgeInsets.symmetric(vertical: 2), padding: const EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - border: Border.all(color: Colors.black12), - ), + decoration: BoxDecoration(border: Border.all(color: Colors.black12)), child: Row( children: [ Text('p=${p.toStringAsFixed(2)} '), @@ -316,8 +310,10 @@ class KyoshinMonitorScaleColorPage extends HookWidget { } // 1) param->p - var pTmp = - KyoshinMonitorScaleUtil.paramToScalePosition(selectedType.value, val); + var pTmp = KyoshinMonitorScaleUtil.paramToScalePosition( + selectedType.value, + val, + ); pTmp = pTmp.clamp(0.0, 1.0); // 2) p->color @@ -330,8 +326,10 @@ class KyoshinMonitorScaleColorPage extends HookWidget { final d = pTmp2 - pTmp; // 5) p' -> param' - final val2 = - KyoshinMonitorScaleUtil.scaleToParam(selectedType.value, pTmp2); + final val2 = KyoshinMonitorScaleUtil.scaleToParam( + selectedType.value, + pTmp2, + ); // 値を更新 (useState の value にセット) valueParam.value = val; @@ -345,9 +343,7 @@ class KyoshinMonitorScaleColorPage extends HookWidget { } return Scaffold( - appBar: AppBar( - title: const Text('強震モニタ値→スケール色 変換'), - ), + appBar: AppBar(title: const Text('強震モニタ値→スケール色 変換')), body: Padding( padding: const EdgeInsets.all(16), child: Column( @@ -359,12 +355,13 @@ class KyoshinMonitorScaleColorPage extends HookWidget { const SizedBox(width: 8), DropdownButton( value: selectedType.value, - items: ParamType.values.map((type) { - return DropdownMenuItem( - value: type, - child: Text(type.name), - ); - }).toList(), + items: + ParamType.values.map((type) { + return DropdownMenuItem( + value: type, + child: Text(type.name), + ); + }).toList(), onChanged: (val) { if (val != null) { selectedType.value = val; @@ -389,10 +386,7 @@ class KyoshinMonitorScaleColorPage extends HookWidget { const SizedBox(height: 16), //=== 3) ボタン === - ElevatedButton( - onPressed: onConvert, - child: const Text('変換して表示'), - ), + ElevatedButton(onPressed: onConvert, child: const Text('変換して表示')), const SizedBox(height: 24), //=== 4) 結果表示 === @@ -400,11 +394,7 @@ class KyoshinMonitorScaleColorPage extends HookWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // 色プレビュー - Container( - width: 80, - height: 80, - color: color.value, - ), + Container(width: 80, height: 80, color: color.value), const SizedBox(width: 16), // テキスト情報 Expanded( diff --git a/app/lib/feature/settings/children/config/earthquake_history/earthquake_history_config_page.dart b/app/lib/feature/settings/children/config/earthquake_history/earthquake_history_config_page.dart index 546db458..16c43a56 100644 --- a/app/lib/feature/settings/children/config/earthquake_history/earthquake_history_config_page.dart +++ b/app/lib/feature/settings/children/config/earthquake_history/earthquake_history_config_page.dart @@ -14,19 +14,13 @@ class EarthquakeHistoryConfigPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('地震履歴設定'), - ), + appBar: AppBar(title: const Text('地震履歴設定')), body: ListView( children: const [ - SettingsSectionHeader( - text: '地震履歴一覧', - ), + SettingsSectionHeader(text: '地震履歴一覧'), _EarthquakeHistoryListConfigWidget(), Divider(), - SettingsSectionHeader( - text: '地震履歴詳細', - ), + SettingsSectionHeader(text: '地震履歴詳細'), _EarthquakeHistoryDetailConfigWidget(), ], ), @@ -47,13 +41,10 @@ class _EarthquakeHistoryListConfigWidget extends ConsumerWidget { SwitchListTile.adaptive( title: const Text('最大震度ごとの背景塗りつぶし'), value: state.isFillBackground, - onChanged: (value) async => ref - .read(earthquakeHistoryConfigProvider.notifier) - .updateListConfig( - state.copyWith( - isFillBackground: value, - ), - ), + onChanged: + (value) async => ref + .read(earthquakeHistoryConfigProvider.notifier) + .updateListConfig(state.copyWith(isFillBackground: value)), ), /// includeTest @@ -61,13 +52,12 @@ class _EarthquakeHistoryListConfigWidget extends ConsumerWidget { title: const Text('訓練・試験報の情報を表示する'), subtitle: const Text('気象庁により作成された、訓練・試験用の緊急地震速報の情報を表示します。※非推奨'), value: state.includeTestTelegrams, - onChanged: (value) async => ref - .read(earthquakeHistoryConfigProvider.notifier) - .updateListConfig( - state.copyWith( - includeTestTelegrams: value, - ), - ), + onChanged: + (value) async => ref + .read(earthquakeHistoryConfigProvider.notifier) + .updateListConfig( + state.copyWith(includeTestTelegrams: value), + ), ), ], ); @@ -128,9 +118,7 @@ class _EarthquakeHistoryDetailConfigWidget extends ConsumerWidget { await ref .read(earthquakeHistoryConfigProvider.notifier) .updateDetailConfig( - state.copyWith( - intensityFillMode: result, - ), + state.copyWith(intensityFillMode: result), ); } }, @@ -142,10 +130,10 @@ class _EarthquakeHistoryDetailConfigWidget extends ConsumerWidget { extension _IntensityDisplayModeEx on IntensityFillMode { String get name => switch (this) { - IntensityFillMode.fillCity => '市区町村', - IntensityFillMode.fillRegion => '細分化地域', - IntensityFillMode.none => '塗りつぶしなし', - }; + IntensityFillMode.fillCity => '市区町村', + IntensityFillMode.fillRegion => '細分化地域', + IntensityFillMode.none => '塗りつぶしなし', + }; } Future showEarthquakeHistoryDetailConfigDialog( @@ -156,10 +144,11 @@ Future showEarthquakeHistoryDetailConfigDialog( final result = await showModalBottomSheet( context: context, clipBehavior: Clip.antiAlias, - builder: (context) => _EarthquakeHistoryDetailConfigBody( - showCitySelector: showCitySelector, - hasLpgmIntensity: hasLpgmIntensity, - ), + builder: + (context) => _EarthquakeHistoryDetailConfigBody( + showCitySelector: showCitySelector, + hasLpgmIntensity: hasLpgmIntensity, + ), ); return result; } @@ -176,8 +165,9 @@ class _EarthquakeHistoryDetailConfigBody extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final showingLpgmIntensity = ref.watch( - earthquakeHistoryConfigProvider - .select((value) => value.detail.showingLpgmIntensity), + earthquakeHistoryConfigProvider.select( + (value) => value.detail.showingLpgmIntensity, + ), ); final theme = Theme.of(context); final sheetBar = Container( @@ -220,26 +210,27 @@ class _EarthquakeHistoryDetailConfigBody extends HookConsumerWidget { if (hasLpgmIntensity) ...[ const Padding( padding: EdgeInsets.symmetric(vertical: 8), - child: SettingsSectionHeader( - text: '震度・長周期地震動階級の表示切り替え', - ), + child: SettingsSectionHeader(text: '震度・長周期地震動階級の表示切り替え'), ), Padding( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), child: _IntensityModeSegmentedControl( - selected: showingLpgmIntensity - ? _IntensityMode.lpgm - : _IntensityMode.intensity, - onSelected: (value) async => ref - .read(earthquakeHistoryConfigProvider.notifier) - .updateDetailConfig( - ref - .watch(earthquakeHistoryConfigProvider) - .detail - .copyWith( - showingLpgmIntensity: value == _IntensityMode.lpgm, - ), - ), + selected: + showingLpgmIntensity + ? _IntensityMode.lpgm + : _IntensityMode.intensity, + onSelected: + (value) async => ref + .read(earthquakeHistoryConfigProvider.notifier) + .updateDetailConfig( + ref + .watch(earthquakeHistoryConfigProvider) + .detail + .copyWith( + showingLpgmIntensity: + value == _IntensityMode.lpgm, + ), + ), ), ), ], @@ -250,9 +241,7 @@ class _EarthquakeHistoryDetailConfigBody extends HookConsumerWidget { } class _IntensityFillModeSegmentedControl extends ConsumerStatefulWidget { - const _IntensityFillModeSegmentedControl({ - required this.showCitySelector, - }); + const _IntensityFillModeSegmentedControl({required this.showCitySelector}); final bool showCitySelector; @@ -265,8 +254,9 @@ class __IntensityFillModeSegmentedControlState extends ConsumerState<_IntensityFillModeSegmentedControl> { @override Widget build(BuildContext context) { - final state = ref - .watch(earthquakeHistoryConfigProvider.select((value) => value.detail)); + final state = ref.watch( + earthquakeHistoryConfigProvider.select((value) => value.detail), + ); final showCitySelector = widget.showCitySelector; const choices = IntensityFillMode.values; @@ -278,9 +268,10 @@ class __IntensityFillModeSegmentedControlState for (final mode in choices) mode: Text( mode.name, - style: showCitySelector || mode != IntensityFillMode.fillCity - ? null - : const TextStyle(color: Colors.grey), + style: + showCitySelector || mode != IntensityFillMode.fillCity + ? null + : const TextStyle(color: Colors.grey), ), }, onValueChanged: (value) async { @@ -297,20 +288,19 @@ class __IntensityFillModeSegmentedControlState } await ref .read(earthquakeHistoryConfigProvider.notifier) - .updateDetailConfig( - state.copyWith(intensityFillMode: value), - ); + .updateDetailConfig(state.copyWith(intensityFillMode: value)); } }, ); } else { return SegmentedButton( selected: {state.intensityFillMode}, - onSelectionChanged: (p0) async => ref - .read(earthquakeHistoryConfigProvider.notifier) - .updateDetailConfig( - state.copyWith(intensityFillMode: p0.first), - ), + onSelectionChanged: + (p0) async => ref + .read(earthquakeHistoryConfigProvider.notifier) + .updateDetailConfig( + state.copyWith(intensityFillMode: p0.first), + ), segments: [ for (final mode in choices) ButtonSegment( @@ -326,8 +316,7 @@ class __IntensityFillModeSegmentedControlState enum _IntensityMode { intensity('震度'), - lpgm('長周期地震動階級'), - ; + lpgm('長周期地震動階級'); const _IntensityMode(this.name); final String name; @@ -362,10 +351,7 @@ class _IntensityModeSegmentedControl extends StatelessWidget { onSelectionChanged: (p0) => onSelected(p0.first), segments: [ for (final mode in _IntensityMode.values) - ButtonSegment( - label: Text(mode.name), - value: mode, - ), + ButtonSegment(label: Text(mode.name), value: mode), ], ); } @@ -377,16 +363,17 @@ class _IntensityStationIconModeSegmentedButton extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final state = ref - .watch(earthquakeHistoryConfigProvider.select((value) => value.detail)); + final state = ref.watch( + earthquakeHistoryConfigProvider.select((value) => value.detail), + ); final isShowingLpgmIntensity = state.showingLpgmIntensity; return SwitchListTile.adaptive( title: Text(isShowingLpgmIntensity ? '長周期地震動階級アイコンを表示する' : '震度アイコンを表示する'), value: state.showIntensityIcon, - onChanged: (value) async => - ref.read(earthquakeHistoryConfigProvider.notifier).updateDetailConfig( - state.copyWith(showIntensityIcon: value), - ), + onChanged: + (value) async => ref + .read(earthquakeHistoryConfigProvider.notifier) + .updateDetailConfig(state.copyWith(showIntensityIcon: value)), ); } } diff --git a/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.dart b/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.dart index 273b09de..df14b2f6 100644 --- a/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.dart +++ b/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.dart @@ -23,8 +23,7 @@ class EarthquakeNotificationSettingsViewModel static List choices = [ const FcmEarthquakeTopic(null), - ...([...JmaIntensity.values]..remove(JmaIntensity.fiveUpperNoInput)).map( - FcmEarthquakeTopic.new, - ), + ...([...JmaIntensity.values] + ..remove(JmaIntensity.fiveUpperNoInput)).map(FcmEarthquakeTopic.new), ]; } diff --git a/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.g.dart b/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.g.dart index bce59833..e2b50f3f 100644 --- a/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.g.dart +++ b/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.g.dart @@ -14,18 +14,21 @@ String _$earthquakeNotificationSettingsViewModelHash() => /// See also [EarthquakeNotificationSettingsViewModel]. @ProviderFor(EarthquakeNotificationSettingsViewModel) final earthquakeNotificationSettingsViewModelProvider = - AutoDisposeNotifierProvider.internal( - EarthquakeNotificationSettingsViewModel.new, - name: r'earthquakeNotificationSettingsViewModelProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$earthquakeNotificationSettingsViewModelHash, - dependencies: null, - allTransitiveDependencies: null, -); + AutoDisposeNotifierProvider< + EarthquakeNotificationSettingsViewModel, + FcmEarthquakeTopic? + >.internal( + EarthquakeNotificationSettingsViewModel.new, + name: r'earthquakeNotificationSettingsViewModelProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$earthquakeNotificationSettingsViewModelHash, + dependencies: null, + allTransitiveDependencies: null, + ); -typedef _$EarthquakeNotificationSettingsViewModel - = AutoDisposeNotifier; +typedef _$EarthquakeNotificationSettingsViewModel = + AutoDisposeNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.dart b/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.dart index 99d660fb..e1c95178 100644 --- a/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.dart +++ b/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.dart @@ -24,8 +24,7 @@ class EewNotificationsSettingsViewModel static List choices = [ const FcmEewAllTopic(), - ...([...JmaIntensity.values]..remove(JmaIntensity.fiveUpperNoInput)).map( - FcmEewIntensityTopic.new, - ), + ...([...JmaIntensity.values] + ..remove(JmaIntensity.fiveUpperNoInput)).map(FcmEewIntensityTopic.new), ]; } diff --git a/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.g.dart b/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.g.dart index eb9552e2..52ed56a0 100644 --- a/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.g.dart +++ b/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.g.dart @@ -14,12 +14,15 @@ String _$eewNotificationsSettingsViewModelHash() => /// See also [EewNotificationsSettingsViewModel]. @ProviderFor(EewNotificationsSettingsViewModel) final eewNotificationsSettingsViewModelProvider = AutoDisposeNotifierProvider< - EewNotificationsSettingsViewModel, FcmEewTopic?>.internal( + EewNotificationsSettingsViewModel, + FcmEewTopic? +>.internal( EewNotificationsSettingsViewModel.new, name: r'eewNotificationsSettingsViewModelProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$eewNotificationsSettingsViewModelHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$eewNotificationsSettingsViewModelHash, dependencies: null, allTransitiveDependencies: null, ); diff --git a/app/lib/feature/settings/component/settings_section_header.dart b/app/lib/feature/settings/component/settings_section_header.dart index cf64db85..a4980bbe 100644 --- a/app/lib/feature/settings/component/settings_section_header.dart +++ b/app/lib/feature/settings/component/settings_section_header.dart @@ -1,10 +1,7 @@ import 'package:flutter/material.dart'; class SettingsSectionHeader extends StatelessWidget { - const SettingsSectionHeader({ - required this.text, - super.key, - }); + const SettingsSectionHeader({required this.text, super.key}); final String text; @@ -13,10 +10,7 @@ class SettingsSectionHeader extends StatelessWidget { final theme = Theme.of(context); final textTheme = theme.textTheme; return Padding( - padding: const EdgeInsets.only( - top: 8, - left: 16, - ), + padding: const EdgeInsets.only(top: 8, left: 16), child: Text( text, style: textTheme.titleSmall?.copyWith( diff --git a/app/lib/feature/settings/features/debug/debug_provider.dart b/app/lib/feature/settings/features/debug/debug_provider.dart index 4cf3fff5..85b24876 100644 --- a/app/lib/feature/settings/features/debug/debug_provider.dart +++ b/app/lib/feature/settings/features/debug/debug_provider.dart @@ -22,9 +22,7 @@ class Debug extends _$Debug { return prefs.getBool(_key); } - Future save({ - required bool isEnabled, - }) async { + Future save({required bool isEnabled}) async { state = isEnabled; final prefs = ref.read(sharedPreferencesProvider); diff --git a/app/lib/feature/settings/features/display_settings/color_scheme/color_scheme_config_page.dart b/app/lib/feature/settings/features/display_settings/color_scheme/color_scheme_config_page.dart index 19a2c663..b0519463 100644 --- a/app/lib/feature/settings/features/display_settings/color_scheme/color_scheme_config_page.dart +++ b/app/lib/feature/settings/features/display_settings/color_scheme/color_scheme_config_page.dart @@ -12,18 +12,17 @@ class ColorSchemeConfigPage extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final state = ref.watch(intensityColorProvider); return Scaffold( - appBar: AppBar( - title: const Text('震度配色設定'), - ), + appBar: AppBar(title: const Text('震度配色設定')), body: SingleChildScrollView( child: Column( children: [ RadioListTile.adaptive( value: IntensityColorModel.eqmonitor(), groupValue: state, - onChanged: (value) async => ref - .read(intensityColorProvider.notifier) - .update(IntensityColorModel.eqmonitor()), + onChanged: + (value) async => ref + .read(intensityColorProvider.notifier) + .update(IntensityColorModel.eqmonitor()), title: const Text('EQMonitor'), subtitle: Padding( padding: const EdgeInsets.all(4), @@ -35,9 +34,10 @@ class ColorSchemeConfigPage extends ConsumerWidget { RadioListTile.adaptive( value: IntensityColorModel.jma(), groupValue: state, - onChanged: (value) async => ref - .read(intensityColorProvider.notifier) - .update(IntensityColorModel.jma()), + onChanged: + (value) async => ref + .read(intensityColorProvider.notifier) + .update(IntensityColorModel.jma()), title: const Text('気象庁配色'), subtitle: Padding( padding: const EdgeInsets.all(4), @@ -47,10 +47,10 @@ class ColorSchemeConfigPage extends ConsumerWidget { RadioListTile.adaptive( value: IntensityColorModel.earthQuickly(), groupValue: state, - onChanged: (value) async => - ref.read(intensityColorProvider.notifier).update( - IntensityColorModel.earthQuickly(), - ), + onChanged: + (value) async => ref + .read(intensityColorProvider.notifier) + .update(IntensityColorModel.earthQuickly()), title: const Text('EarthQuickly'), subtitle: Padding( padding: const EdgeInsets.all(4), @@ -59,9 +59,7 @@ class ColorSchemeConfigPage extends ConsumerWidget { ), ), ), - const SizedBox( - height: kFloatingActionButtonMargin * 4, - ), + const SizedBox(height: kFloatingActionButtonMargin * 4), ], ), ), @@ -70,9 +68,7 @@ class ColorSchemeConfigPage extends ConsumerWidget { } class _IntensityWidgets extends StatelessWidget { - const _IntensityWidgets({ - required this.colorModel, - }); + const _IntensityWidgets({required this.colorModel}); final IntensityColorModel colorModel; diff --git a/app/lib/feature/settings/features/display_settings/ui/display_settings.dart b/app/lib/feature/settings/features/display_settings/ui/display_settings.dart index 72a7da27..7843ca67 100644 --- a/app/lib/feature/settings/features/display_settings/ui/display_settings.dart +++ b/app/lib/feature/settings/features/display_settings/ui/display_settings.dart @@ -13,9 +13,7 @@ class DisplaySettingsScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('表示設定'), - ), + appBar: AppBar(title: const Text('表示設定')), body: const _Body(), ); } @@ -31,16 +29,15 @@ class _Body extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SettingsSectionHeader( - text: '配色設定', - ), + const SettingsSectionHeader(text: '配色設定'), const _ThemeSelector(), const Divider(), ListTile( title: const Text('震度配色設定'), leading: const Icon(Icons.color_lens), - onTap: () async => - const ColorSchemeConfigRoute().push(context), + onTap: + () async => + const ColorSchemeConfigRoute().push(context), ), ], ), @@ -63,8 +60,9 @@ class _ThemeSelector extends ConsumerWidget { mode == ThemeMode.light ? Brightness.light : Brightness.dark; return Expanded( child: GestureDetector( - onTap: () async => - ref.read(themeModeNotifierProvider.notifier).update(mode), + onTap: + () async => + ref.read(themeModeNotifierProvider.notifier).update(mode), child: Column( children: [ SizedBox( @@ -73,35 +71,32 @@ class _ThemeSelector extends ConsumerWidget { borderRadius: BorderRadius.circular(24), child: switch (mode) { ThemeMode.light => Assets.images.theme.light.image( - fit: BoxFit.contain, - ), + fit: BoxFit.contain, + ), ThemeMode.dark => Assets.images.theme.dark.image(), _ => throw UnimplementedError(), }, ), ), - const SizedBox( - height: 8, - ), - Text( - switch (mode) { - ThemeMode.light => 'ライト', - ThemeMode.dark => 'ダーク', - _ => throw UnimplementedError(), - }, - ), - const SizedBox( - height: 4, - ), + const SizedBox(height: 8), + Text(switch (mode) { + ThemeMode.light => 'ライト', + ThemeMode.dark => 'ダーク', + _ => throw UnimplementedError(), + }), + const SizedBox(height: 4), Radio.adaptive( - value: state == ThemeMode.system - ? brightness == modeBrightness - ? ThemeMode.system - : null - : mode, + value: + state == ThemeMode.system + ? brightness == modeBrightness + ? ThemeMode.system + : null + : mode, groupValue: state, - onChanged: (value) async => - ref.read(themeModeNotifierProvider.notifier).update(mode), + onChanged: + (value) async => ref + .read(themeModeNotifierProvider.notifier) + .update(mode), ), ], ), @@ -142,14 +137,16 @@ class _ThemeSelector extends ConsumerWidget { visualDensity: VisualDensity.compact, title: const Text('システム設定に従う'), value: state == ThemeMode.system, - onChanged: (value) async => - ref.read(themeModeNotifierProvider.notifier).update( + onChanged: + (value) async => ref + .read(themeModeNotifierProvider.notifier) + .update( value ? ThemeMode.system : PlatformDispatcher.instance.platformBrightness == - Brightness.light - ? ThemeMode.light - : ThemeMode.dark, + Brightness.light + ? ThemeMode.light + : ThemeMode.dark, ), ), ], diff --git a/app/lib/feature/settings/features/feedback/data/custom_feedback.dart b/app/lib/feature/settings/features/feedback/data/custom_feedback.dart index 27a263ff..4937f6fa 100644 --- a/app/lib/feature/settings/features/feedback/data/custom_feedback.dart +++ b/app/lib/feature/settings/features/feedback/data/custom_feedback.dart @@ -22,8 +22,7 @@ class CustomFeedback with _$CustomFeedback { enum FeedbackType { bugReport('バグ報告'), featureRequest('機能リクエスト'), - other('その他'), - ; + other('その他'); const FeedbackType(this.label); final String label; diff --git a/app/lib/feature/settings/features/feedback/data/custom_feedback.freezed.dart b/app/lib/feature/settings/features/feedback/data/custom_feedback.freezed.dart index 2955c36a..d5a7ab6a 100644 --- a/app/lib/feature/settings/features/feedback/data/custom_feedback.freezed.dart +++ b/app/lib/feature/settings/features/feedback/data/custom_feedback.freezed.dart @@ -12,7 +12,8 @@ part of 'custom_feedback.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); CustomFeedback _$CustomFeedbackFromJson(Map json) { return _CustomFeedback.fromJson(json); @@ -41,13 +42,15 @@ mixin _$CustomFeedback { /// @nodoc abstract class $CustomFeedbackCopyWith<$Res> { factory $CustomFeedbackCopyWith( - CustomFeedback value, $Res Function(CustomFeedback) then) = - _$CustomFeedbackCopyWithImpl<$Res, CustomFeedback>; + CustomFeedback value, + $Res Function(CustomFeedback) then, + ) = _$CustomFeedbackCopyWithImpl<$Res, CustomFeedback>; @useResult - $Res call( - {FeedbackType? feedbackType, - bool? isReplyRequested, - bool isScreenshotAttached}); + $Res call({ + FeedbackType? feedbackType, + bool? isReplyRequested, + bool isScreenshotAttached, + }); } /// @nodoc @@ -69,35 +72,43 @@ class _$CustomFeedbackCopyWithImpl<$Res, $Val extends CustomFeedback> Object? isReplyRequested = freezed, Object? isScreenshotAttached = null, }) { - return _then(_value.copyWith( - feedbackType: freezed == feedbackType - ? _value.feedbackType - : feedbackType // ignore: cast_nullable_to_non_nullable - as FeedbackType?, - isReplyRequested: freezed == isReplyRequested - ? _value.isReplyRequested - : isReplyRequested // ignore: cast_nullable_to_non_nullable - as bool?, - isScreenshotAttached: null == isScreenshotAttached - ? _value.isScreenshotAttached - : isScreenshotAttached // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + feedbackType: + freezed == feedbackType + ? _value.feedbackType + : feedbackType // ignore: cast_nullable_to_non_nullable + as FeedbackType?, + isReplyRequested: + freezed == isReplyRequested + ? _value.isReplyRequested + : isReplyRequested // ignore: cast_nullable_to_non_nullable + as bool?, + isScreenshotAttached: + null == isScreenshotAttached + ? _value.isScreenshotAttached + : isScreenshotAttached // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } /// @nodoc abstract class _$$CustomFeedbackImplCopyWith<$Res> implements $CustomFeedbackCopyWith<$Res> { - factory _$$CustomFeedbackImplCopyWith(_$CustomFeedbackImpl value, - $Res Function(_$CustomFeedbackImpl) then) = - __$$CustomFeedbackImplCopyWithImpl<$Res>; + factory _$$CustomFeedbackImplCopyWith( + _$CustomFeedbackImpl value, + $Res Function(_$CustomFeedbackImpl) then, + ) = __$$CustomFeedbackImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {FeedbackType? feedbackType, - bool? isReplyRequested, - bool isScreenshotAttached}); + $Res call({ + FeedbackType? feedbackType, + bool? isReplyRequested, + bool isScreenshotAttached, + }); } /// @nodoc @@ -105,8 +116,9 @@ class __$$CustomFeedbackImplCopyWithImpl<$Res> extends _$CustomFeedbackCopyWithImpl<$Res, _$CustomFeedbackImpl> implements _$$CustomFeedbackImplCopyWith<$Res> { __$$CustomFeedbackImplCopyWithImpl( - _$CustomFeedbackImpl _value, $Res Function(_$CustomFeedbackImpl) _then) - : super(_value, _then); + _$CustomFeedbackImpl _value, + $Res Function(_$CustomFeedbackImpl) _then, + ) : super(_value, _then); /// Create a copy of CustomFeedback /// with the given fields replaced by the non-null parameter values. @@ -117,30 +129,36 @@ class __$$CustomFeedbackImplCopyWithImpl<$Res> Object? isReplyRequested = freezed, Object? isScreenshotAttached = null, }) { - return _then(_$CustomFeedbackImpl( - feedbackType: freezed == feedbackType - ? _value.feedbackType - : feedbackType // ignore: cast_nullable_to_non_nullable - as FeedbackType?, - isReplyRequested: freezed == isReplyRequested - ? _value.isReplyRequested - : isReplyRequested // ignore: cast_nullable_to_non_nullable - as bool?, - isScreenshotAttached: null == isScreenshotAttached - ? _value.isScreenshotAttached - : isScreenshotAttached // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$CustomFeedbackImpl( + feedbackType: + freezed == feedbackType + ? _value.feedbackType + : feedbackType // ignore: cast_nullable_to_non_nullable + as FeedbackType?, + isReplyRequested: + freezed == isReplyRequested + ? _value.isReplyRequested + : isReplyRequested // ignore: cast_nullable_to_non_nullable + as bool?, + isScreenshotAttached: + null == isScreenshotAttached + ? _value.isScreenshotAttached + : isScreenshotAttached // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } /// @nodoc @JsonSerializable() class _$CustomFeedbackImpl implements _CustomFeedback { - const _$CustomFeedbackImpl( - {this.feedbackType, - this.isReplyRequested, - this.isScreenshotAttached = true}); + const _$CustomFeedbackImpl({ + this.feedbackType, + this.isReplyRequested, + this.isScreenshotAttached = true, + }); factory _$CustomFeedbackImpl.fromJson(Map json) => _$$CustomFeedbackImplFromJson(json); @@ -178,7 +196,11 @@ class _$CustomFeedbackImpl implements _CustomFeedback { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, feedbackType, isReplyRequested, isScreenshotAttached); + runtimeType, + feedbackType, + isReplyRequested, + isScreenshotAttached, + ); /// Create a copy of CustomFeedback /// with the given fields replaced by the non-null parameter values. @@ -187,21 +209,22 @@ class _$CustomFeedbackImpl implements _CustomFeedback { @pragma('vm:prefer-inline') _$$CustomFeedbackImplCopyWith<_$CustomFeedbackImpl> get copyWith => __$$CustomFeedbackImplCopyWithImpl<_$CustomFeedbackImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$CustomFeedbackImplToJson( - this, - ); + return _$$CustomFeedbackImplToJson(this); } } abstract class _CustomFeedback implements CustomFeedback { - const factory _CustomFeedback( - {final FeedbackType? feedbackType, - final bool? isReplyRequested, - final bool isScreenshotAttached}) = _$CustomFeedbackImpl; + const factory _CustomFeedback({ + final FeedbackType? feedbackType, + final bool? isReplyRequested, + final bool isScreenshotAttached, + }) = _$CustomFeedbackImpl; factory _CustomFeedback.fromJson(Map json) = _$CustomFeedbackImpl.fromJson; diff --git a/app/lib/feature/settings/features/feedback/data/custom_feedback.g.dart b/app/lib/feature/settings/features/feedback/data/custom_feedback.g.dart index 2b7bb037..618a48e2 100644 --- a/app/lib/feature/settings/features/feedback/data/custom_feedback.g.dart +++ b/app/lib/feature/settings/features/feedback/data/custom_feedback.g.dart @@ -14,29 +14,35 @@ _$CustomFeedbackImpl _$$CustomFeedbackImplFromJson(Map json) => json, ($checkedConvert) { final val = _$CustomFeedbackImpl( - feedbackType: $checkedConvert('feedback_type', - (v) => $enumDecodeNullable(_$FeedbackTypeEnumMap, v)), - isReplyRequested: - $checkedConvert('is_reply_requested', (v) => v as bool?), + feedbackType: $checkedConvert( + 'feedback_type', + (v) => $enumDecodeNullable(_$FeedbackTypeEnumMap, v), + ), + isReplyRequested: $checkedConvert( + 'is_reply_requested', + (v) => v as bool?, + ), isScreenshotAttached: $checkedConvert( - 'is_screenshot_attached', (v) => v as bool? ?? true), + 'is_screenshot_attached', + (v) => v as bool? ?? true, + ), ); return val; }, fieldKeyMap: const { 'feedbackType': 'feedback_type', 'isReplyRequested': 'is_reply_requested', - 'isScreenshotAttached': 'is_screenshot_attached' + 'isScreenshotAttached': 'is_screenshot_attached', }, ); Map _$$CustomFeedbackImplToJson( - _$CustomFeedbackImpl instance) => - { - 'feedback_type': _$FeedbackTypeEnumMap[instance.feedbackType], - 'is_reply_requested': instance.isReplyRequested, - 'is_screenshot_attached': instance.isScreenshotAttached, - }; + _$CustomFeedbackImpl instance, +) => { + 'feedback_type': _$FeedbackTypeEnumMap[instance.feedbackType], + 'is_reply_requested': instance.isReplyRequested, + 'is_screenshot_attached': instance.isScreenshotAttached, +}; const _$FeedbackTypeEnumMap = { FeedbackType.bugReport: 'bugReport', diff --git a/app/lib/feature/settings/features/feedback/feedback_screen.dart b/app/lib/feature/settings/features/feedback/feedback_screen.dart index 05ba7b6e..189dbcc8 100644 --- a/app/lib/feature/settings/features/feedback/feedback_screen.dart +++ b/app/lib/feature/settings/features/feedback/feedback_screen.dart @@ -55,18 +55,19 @@ class CustomFeedbackForm extends HookConsumerWidget { Padding( padding: const EdgeInsets.all(8), child: DropdownMenu( - dropdownMenuEntries: FeedbackType.values - .map( - (type) => DropdownMenuEntry( - value: type, - label: type.label, - ), - ) - .toList(), - onSelected: (type) => customFeedback.value = - customFeedback.value.copyWith( - feedbackType: type, - ), + dropdownMenuEntries: + FeedbackType.values + .map( + (type) => DropdownMenuEntry( + value: type, + label: type.label, + ), + ) + .toList(), + onSelected: + (type) => + customFeedback.value = customFeedback.value + .copyWith(feedbackType: type), ), ), const SizedBox(height: 16), @@ -82,10 +83,10 @@ class CustomFeedbackForm extends HookConsumerWidget { const SizedBox(height: 16), CheckboxListTile( value: customFeedback.value.isReplyRequested ?? false, - onChanged: (value) => - customFeedback.value = customFeedback.value.copyWith( - isReplyRequested: value, - ), + onChanged: + (value) => + customFeedback.value = customFeedback.value + .copyWith(isReplyRequested: value), title: const Text('返信を希望する'), visualDensity: VisualDensity.compact, ), @@ -110,12 +111,13 @@ class CustomFeedbackForm extends HookConsumerWidget { ), FilledButton.tonalIcon( // disable this button until the user has specified a feedback type - onPressed: customFeedback.value.feedbackType != null - ? () async => onSubmit( + onPressed: + customFeedback.value.feedbackType != null + ? () async => onSubmit( feedbackText.value, extras: customFeedback.value.toJson(), ) - : null, + : null, label: const Text('メール送信画面を開く'), icon: Icon( (customFeedback.value.isScreenshotAttached) @@ -124,9 +126,7 @@ class CustomFeedbackForm extends HookConsumerWidget { ), ), const SizedBox(height: 8), - SizedBox( - height: MediaQuery.paddingOf(context).bottom, - ), + SizedBox(height: MediaQuery.paddingOf(context).bottom), ], ), ); diff --git a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.freezed.dart b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.freezed.dart index d6439b12..8b530c0c 100644 --- a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.freezed.dart +++ b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.freezed.dart @@ -12,10 +12,12 @@ part of 'notification_local_settings_model.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NotificationLocalSettingsModel _$NotificationLocalSettingsModelFromJson( - Map json) { + Map json, +) { return _NotificationLocalSettingsModel.fromJson(json); } @@ -31,16 +33,19 @@ mixin _$NotificationLocalSettingsModel { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationLocalSettingsModelCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationLocalSettingsModelCopyWith<$Res> { factory $NotificationLocalSettingsModelCopyWith( - NotificationLocalSettingsModel value, - $Res Function(NotificationLocalSettingsModel) then) = - _$NotificationLocalSettingsModelCopyWithImpl<$Res, - NotificationLocalSettingsModel>; + NotificationLocalSettingsModel value, + $Res Function(NotificationLocalSettingsModel) then, + ) = + _$NotificationLocalSettingsModelCopyWithImpl< + $Res, + NotificationLocalSettingsModel + >; @useResult $Res call({EewSettings eew, EarthquakeSettings earthquake}); @@ -49,8 +54,10 @@ abstract class $NotificationLocalSettingsModelCopyWith<$Res> { } /// @nodoc -class _$NotificationLocalSettingsModelCopyWithImpl<$Res, - $Val extends NotificationLocalSettingsModel> +class _$NotificationLocalSettingsModelCopyWithImpl< + $Res, + $Val extends NotificationLocalSettingsModel +> implements $NotificationLocalSettingsModelCopyWith<$Res> { _$NotificationLocalSettingsModelCopyWithImpl(this._value, this._then); @@ -63,20 +70,22 @@ class _$NotificationLocalSettingsModelCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? eew = null, - Object? earthquake = null, - }) { - return _then(_value.copyWith( - eew: null == eew - ? _value.eew - : eew // ignore: cast_nullable_to_non_nullable - as EewSettings, - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as EarthquakeSettings, - ) as $Val); + $Res call({Object? eew = null, Object? earthquake = null}) { + return _then( + _value.copyWith( + eew: + null == eew + ? _value.eew + : eew // ignore: cast_nullable_to_non_nullable + as EewSettings, + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as EarthquakeSettings, + ) + as $Val, + ); } /// Create a copy of NotificationLocalSettingsModel @@ -104,9 +113,9 @@ class _$NotificationLocalSettingsModelCopyWithImpl<$Res, abstract class _$$NotificationLocalSettingsModelImplCopyWith<$Res> implements $NotificationLocalSettingsModelCopyWith<$Res> { factory _$$NotificationLocalSettingsModelImplCopyWith( - _$NotificationLocalSettingsModelImpl value, - $Res Function(_$NotificationLocalSettingsModelImpl) then) = - __$$NotificationLocalSettingsModelImplCopyWithImpl<$Res>; + _$NotificationLocalSettingsModelImpl value, + $Res Function(_$NotificationLocalSettingsModelImpl) then, + ) = __$$NotificationLocalSettingsModelImplCopyWithImpl<$Res>; @override @useResult $Res call({EewSettings eew, EarthquakeSettings earthquake}); @@ -119,32 +128,36 @@ abstract class _$$NotificationLocalSettingsModelImplCopyWith<$Res> /// @nodoc class __$$NotificationLocalSettingsModelImplCopyWithImpl<$Res> - extends _$NotificationLocalSettingsModelCopyWithImpl<$Res, - _$NotificationLocalSettingsModelImpl> + extends + _$NotificationLocalSettingsModelCopyWithImpl< + $Res, + _$NotificationLocalSettingsModelImpl + > implements _$$NotificationLocalSettingsModelImplCopyWith<$Res> { __$$NotificationLocalSettingsModelImplCopyWithImpl( - _$NotificationLocalSettingsModelImpl _value, - $Res Function(_$NotificationLocalSettingsModelImpl) _then) - : super(_value, _then); + _$NotificationLocalSettingsModelImpl _value, + $Res Function(_$NotificationLocalSettingsModelImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationLocalSettingsModel /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? eew = null, - Object? earthquake = null, - }) { - return _then(_$NotificationLocalSettingsModelImpl( - eew: null == eew - ? _value.eew - : eew // ignore: cast_nullable_to_non_nullable - as EewSettings, - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as EarthquakeSettings, - )); + $Res call({Object? eew = null, Object? earthquake = null}) { + return _then( + _$NotificationLocalSettingsModelImpl( + eew: + null == eew + ? _value.eew + : eew // ignore: cast_nullable_to_non_nullable + as EewSettings, + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as EarthquakeSettings, + ), + ); } } @@ -152,13 +165,14 @@ class __$$NotificationLocalSettingsModelImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationLocalSettingsModelImpl implements _NotificationLocalSettingsModel { - const _$NotificationLocalSettingsModelImpl( - {this.eew = const EewSettings(), - this.earthquake = const EarthquakeSettings()}); + const _$NotificationLocalSettingsModelImpl({ + this.eew = const EewSettings(), + this.earthquake = const EarthquakeSettings(), + }); factory _$NotificationLocalSettingsModelImpl.fromJson( - Map json) => - _$$NotificationLocalSettingsModelImplFromJson(json); + Map json, + ) => _$$NotificationLocalSettingsModelImplFromJson(json); @override @JsonKey() @@ -192,23 +206,24 @@ class _$NotificationLocalSettingsModelImpl @override @pragma('vm:prefer-inline') _$$NotificationLocalSettingsModelImplCopyWith< - _$NotificationLocalSettingsModelImpl> - get copyWith => __$$NotificationLocalSettingsModelImplCopyWithImpl< - _$NotificationLocalSettingsModelImpl>(this, _$identity); + _$NotificationLocalSettingsModelImpl + > + get copyWith => __$$NotificationLocalSettingsModelImplCopyWithImpl< + _$NotificationLocalSettingsModelImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationLocalSettingsModelImplToJson( - this, - ); + return _$$NotificationLocalSettingsModelImplToJson(this); } } abstract class _NotificationLocalSettingsModel implements NotificationLocalSettingsModel { - const factory _NotificationLocalSettingsModel( - {final EewSettings eew, final EarthquakeSettings earthquake}) = - _$NotificationLocalSettingsModelImpl; + const factory _NotificationLocalSettingsModel({ + final EewSettings eew, + final EarthquakeSettings earthquake, + }) = _$NotificationLocalSettingsModelImpl; factory _NotificationLocalSettingsModel.fromJson(Map json) = _$NotificationLocalSettingsModelImpl.fromJson; @@ -223,8 +238,9 @@ abstract class _NotificationLocalSettingsModel @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationLocalSettingsModelImplCopyWith< - _$NotificationLocalSettingsModelImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationLocalSettingsModelImpl + > + get copyWith => throw _privateConstructorUsedError; } EewSettings _$EewSettingsFromJson(Map json) { @@ -252,13 +268,15 @@ mixin _$EewSettings { /// @nodoc abstract class $EewSettingsCopyWith<$Res> { factory $EewSettingsCopyWith( - EewSettings value, $Res Function(EewSettings) then) = - _$EewSettingsCopyWithImpl<$Res, EewSettings>; + EewSettings value, + $Res Function(EewSettings) then, + ) = _$EewSettingsCopyWithImpl<$Res, EewSettings>; @useResult - $Res call( - {JmaForecastIntensity? emergencyIntensity, - JmaForecastIntensity? silentIntensity, - List regions}); + $Res call({ + JmaForecastIntensity? emergencyIntensity, + JmaForecastIntensity? silentIntensity, + List regions, + }); } /// @nodoc @@ -280,20 +298,26 @@ class _$EewSettingsCopyWithImpl<$Res, $Val extends EewSettings> Object? silentIntensity = freezed, Object? regions = null, }) { - return _then(_value.copyWith( - emergencyIntensity: freezed == emergencyIntensity - ? _value.emergencyIntensity - : emergencyIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - silentIntensity: freezed == silentIntensity - ? _value.silentIntensity - : silentIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + emergencyIntensity: + freezed == emergencyIntensity + ? _value.emergencyIntensity + : emergencyIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + silentIntensity: + freezed == silentIntensity + ? _value.silentIntensity + : silentIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -301,14 +325,16 @@ class _$EewSettingsCopyWithImpl<$Res, $Val extends EewSettings> abstract class _$$EewSettingsImplCopyWith<$Res> implements $EewSettingsCopyWith<$Res> { factory _$$EewSettingsImplCopyWith( - _$EewSettingsImpl value, $Res Function(_$EewSettingsImpl) then) = - __$$EewSettingsImplCopyWithImpl<$Res>; + _$EewSettingsImpl value, + $Res Function(_$EewSettingsImpl) then, + ) = __$$EewSettingsImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {JmaForecastIntensity? emergencyIntensity, - JmaForecastIntensity? silentIntensity, - List regions}); + $Res call({ + JmaForecastIntensity? emergencyIntensity, + JmaForecastIntensity? silentIntensity, + List regions, + }); } /// @nodoc @@ -316,8 +342,9 @@ class __$$EewSettingsImplCopyWithImpl<$Res> extends _$EewSettingsCopyWithImpl<$Res, _$EewSettingsImpl> implements _$$EewSettingsImplCopyWith<$Res> { __$$EewSettingsImplCopyWithImpl( - _$EewSettingsImpl _value, $Res Function(_$EewSettingsImpl) _then) - : super(_value, _then); + _$EewSettingsImpl _value, + $Res Function(_$EewSettingsImpl) _then, + ) : super(_value, _then); /// Create a copy of EewSettings /// with the given fields replaced by the non-null parameter values. @@ -328,31 +355,36 @@ class __$$EewSettingsImplCopyWithImpl<$Res> Object? silentIntensity = freezed, Object? regions = null, }) { - return _then(_$EewSettingsImpl( - emergencyIntensity: freezed == emergencyIntensity - ? _value.emergencyIntensity - : emergencyIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - silentIntensity: freezed == silentIntensity - ? _value.silentIntensity - : silentIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$EewSettingsImpl( + emergencyIntensity: + freezed == emergencyIntensity + ? _value.emergencyIntensity + : emergencyIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + silentIntensity: + freezed == silentIntensity + ? _value.silentIntensity + : silentIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$EewSettingsImpl implements _EewSettings { - const _$EewSettingsImpl( - {this.emergencyIntensity = null, - this.silentIntensity = null, - final List regions = const []}) - : _regions = regions; + const _$EewSettingsImpl({ + this.emergencyIntensity = null, + this.silentIntensity = null, + final List regions = const [], + }) : _regions = regions; factory _$EewSettingsImpl.fromJson(Map json) => _$$EewSettingsImplFromJson(json); @@ -391,8 +423,12 @@ class _$EewSettingsImpl implements _EewSettings { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, emergencyIntensity, - silentIntensity, const DeepCollectionEquality().hash(_regions)); + int get hashCode => Object.hash( + runtimeType, + emergencyIntensity, + silentIntensity, + const DeepCollectionEquality().hash(_regions), + ); /// Create a copy of EewSettings /// with the given fields replaced by the non-null parameter values. @@ -404,17 +440,16 @@ class _$EewSettingsImpl implements _EewSettings { @override Map toJson() { - return _$$EewSettingsImplToJson( - this, - ); + return _$$EewSettingsImplToJson(this); } } abstract class _EewSettings implements EewSettings { - const factory _EewSettings( - {final JmaForecastIntensity? emergencyIntensity, - final JmaForecastIntensity? silentIntensity, - final List regions}) = _$EewSettingsImpl; + const factory _EewSettings({ + final JmaForecastIntensity? emergencyIntensity, + final JmaForecastIntensity? silentIntensity, + final List regions, + }) = _$EewSettingsImpl; factory _EewSettings.fromJson(Map json) = _$EewSettingsImpl.fromJson; @@ -459,13 +494,15 @@ mixin _$EarthquakeSettings { /// @nodoc abstract class $EarthquakeSettingsCopyWith<$Res> { factory $EarthquakeSettingsCopyWith( - EarthquakeSettings value, $Res Function(EarthquakeSettings) then) = - _$EarthquakeSettingsCopyWithImpl<$Res, EarthquakeSettings>; + EarthquakeSettings value, + $Res Function(EarthquakeSettings) then, + ) = _$EarthquakeSettingsCopyWithImpl<$Res, EarthquakeSettings>; @useResult - $Res call( - {JmaForecastIntensity? emergencyIntensity, - JmaForecastIntensity? silentIntensity, - List regions}); + $Res call({ + JmaForecastIntensity? emergencyIntensity, + JmaForecastIntensity? silentIntensity, + List regions, + }); } /// @nodoc @@ -487,44 +524,53 @@ class _$EarthquakeSettingsCopyWithImpl<$Res, $Val extends EarthquakeSettings> Object? silentIntensity = freezed, Object? regions = null, }) { - return _then(_value.copyWith( - emergencyIntensity: freezed == emergencyIntensity - ? _value.emergencyIntensity - : emergencyIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - silentIntensity: freezed == silentIntensity - ? _value.silentIntensity - : silentIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + emergencyIntensity: + freezed == emergencyIntensity + ? _value.emergencyIntensity + : emergencyIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + silentIntensity: + freezed == silentIntensity + ? _value.silentIntensity + : silentIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeSettingsImplCopyWith<$Res> implements $EarthquakeSettingsCopyWith<$Res> { - factory _$$EarthquakeSettingsImplCopyWith(_$EarthquakeSettingsImpl value, - $Res Function(_$EarthquakeSettingsImpl) then) = - __$$EarthquakeSettingsImplCopyWithImpl<$Res>; + factory _$$EarthquakeSettingsImplCopyWith( + _$EarthquakeSettingsImpl value, + $Res Function(_$EarthquakeSettingsImpl) then, + ) = __$$EarthquakeSettingsImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {JmaForecastIntensity? emergencyIntensity, - JmaForecastIntensity? silentIntensity, - List regions}); + $Res call({ + JmaForecastIntensity? emergencyIntensity, + JmaForecastIntensity? silentIntensity, + List regions, + }); } /// @nodoc class __$$EarthquakeSettingsImplCopyWithImpl<$Res> extends _$EarthquakeSettingsCopyWithImpl<$Res, _$EarthquakeSettingsImpl> implements _$$EarthquakeSettingsImplCopyWith<$Res> { - __$$EarthquakeSettingsImplCopyWithImpl(_$EarthquakeSettingsImpl _value, - $Res Function(_$EarthquakeSettingsImpl) _then) - : super(_value, _then); + __$$EarthquakeSettingsImplCopyWithImpl( + _$EarthquakeSettingsImpl _value, + $Res Function(_$EarthquakeSettingsImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeSettings /// with the given fields replaced by the non-null parameter values. @@ -535,31 +581,36 @@ class __$$EarthquakeSettingsImplCopyWithImpl<$Res> Object? silentIntensity = freezed, Object? regions = null, }) { - return _then(_$EarthquakeSettingsImpl( - emergencyIntensity: freezed == emergencyIntensity - ? _value.emergencyIntensity - : emergencyIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - silentIntensity: freezed == silentIntensity - ? _value.silentIntensity - : silentIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$EarthquakeSettingsImpl( + emergencyIntensity: + freezed == emergencyIntensity + ? _value.emergencyIntensity + : emergencyIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + silentIntensity: + freezed == silentIntensity + ? _value.silentIntensity + : silentIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeSettingsImpl implements _EarthquakeSettings { - const _$EarthquakeSettingsImpl( - {this.emergencyIntensity = null, - this.silentIntensity = null, - final List regions = const []}) - : _regions = regions; + const _$EarthquakeSettingsImpl({ + this.emergencyIntensity = null, + this.silentIntensity = null, + final List regions = const [], + }) : _regions = regions; factory _$EarthquakeSettingsImpl.fromJson(Map json) => _$$EarthquakeSettingsImplFromJson(json); @@ -598,8 +649,12 @@ class _$EarthquakeSettingsImpl implements _EarthquakeSettings { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, emergencyIntensity, - silentIntensity, const DeepCollectionEquality().hash(_regions)); + int get hashCode => Object.hash( + runtimeType, + emergencyIntensity, + silentIntensity, + const DeepCollectionEquality().hash(_regions), + ); /// Create a copy of EarthquakeSettings /// with the given fields replaced by the non-null parameter values. @@ -608,21 +663,22 @@ class _$EarthquakeSettingsImpl implements _EarthquakeSettings { @pragma('vm:prefer-inline') _$$EarthquakeSettingsImplCopyWith<_$EarthquakeSettingsImpl> get copyWith => __$$EarthquakeSettingsImplCopyWithImpl<_$EarthquakeSettingsImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeSettingsImplToJson( - this, - ); + return _$$EarthquakeSettingsImplToJson(this); } } abstract class _EarthquakeSettings implements EarthquakeSettings { - const factory _EarthquakeSettings( - {final JmaForecastIntensity? emergencyIntensity, - final JmaForecastIntensity? silentIntensity, - final List regions}) = _$EarthquakeSettingsImpl; + const factory _EarthquakeSettings({ + final JmaForecastIntensity? emergencyIntensity, + final JmaForecastIntensity? silentIntensity, + final List regions, + }) = _$EarthquakeSettingsImpl; factory _EarthquakeSettings.fromJson(Map json) = _$EarthquakeSettingsImpl.fromJson; @@ -670,12 +726,13 @@ abstract class $RegionCopyWith<$Res> { factory $RegionCopyWith(Region value, $Res Function(Region) then) = _$RegionCopyWithImpl<$Res, Region>; @useResult - $Res call( - {String code, - String name, - JmaForecastIntensity emergencyIntensity, - JmaForecastIntensity silentIntensity, - bool isMain}); + $Res call({ + String code, + String name, + JmaForecastIntensity emergencyIntensity, + JmaForecastIntensity silentIntensity, + bool isMain, + }); } /// @nodoc @@ -699,44 +756,54 @@ class _$RegionCopyWithImpl<$Res, $Val extends Region> Object? silentIntensity = null, Object? isMain = null, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - emergencyIntensity: null == emergencyIntensity - ? _value.emergencyIntensity - : emergencyIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - silentIntensity: null == silentIntensity - ? _value.silentIntensity - : silentIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - isMain: null == isMain - ? _value.isMain - : isMain // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + emergencyIntensity: + null == emergencyIntensity + ? _value.emergencyIntensity + : emergencyIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + silentIntensity: + null == silentIntensity + ? _value.silentIntensity + : silentIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + isMain: + null == isMain + ? _value.isMain + : isMain // ignore: cast_nullable_to_non_nullable + as bool, + ) + as $Val, + ); } } /// @nodoc abstract class _$$RegionImplCopyWith<$Res> implements $RegionCopyWith<$Res> { factory _$$RegionImplCopyWith( - _$RegionImpl value, $Res Function(_$RegionImpl) then) = - __$$RegionImplCopyWithImpl<$Res>; + _$RegionImpl value, + $Res Function(_$RegionImpl) then, + ) = __$$RegionImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - JmaForecastIntensity emergencyIntensity, - JmaForecastIntensity silentIntensity, - bool isMain}); + $Res call({ + String code, + String name, + JmaForecastIntensity emergencyIntensity, + JmaForecastIntensity silentIntensity, + bool isMain, + }); } /// @nodoc @@ -744,8 +811,9 @@ class __$$RegionImplCopyWithImpl<$Res> extends _$RegionCopyWithImpl<$Res, _$RegionImpl> implements _$$RegionImplCopyWith<$Res> { __$$RegionImplCopyWithImpl( - _$RegionImpl _value, $Res Function(_$RegionImpl) _then) - : super(_value, _then); + _$RegionImpl _value, + $Res Function(_$RegionImpl) _then, + ) : super(_value, _then); /// Create a copy of Region /// with the given fields replaced by the non-null parameter values. @@ -758,40 +826,48 @@ class __$$RegionImplCopyWithImpl<$Res> Object? silentIntensity = null, Object? isMain = null, }) { - return _then(_$RegionImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - emergencyIntensity: null == emergencyIntensity - ? _value.emergencyIntensity - : emergencyIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - silentIntensity: null == silentIntensity - ? _value.silentIntensity - : silentIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - isMain: null == isMain - ? _value.isMain - : isMain // ignore: cast_nullable_to_non_nullable - as bool, - )); + return _then( + _$RegionImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + emergencyIntensity: + null == emergencyIntensity + ? _value.emergencyIntensity + : emergencyIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + silentIntensity: + null == silentIntensity + ? _value.silentIntensity + : silentIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + isMain: + null == isMain + ? _value.isMain + : isMain // ignore: cast_nullable_to_non_nullable + as bool, + ), + ); } } /// @nodoc @JsonSerializable() class _$RegionImpl implements _Region { - const _$RegionImpl( - {required this.code, - required this.name, - required this.emergencyIntensity, - required this.silentIntensity, - required this.isMain}); + const _$RegionImpl({ + required this.code, + required this.name, + required this.emergencyIntensity, + required this.silentIntensity, + required this.isMain, + }); factory _$RegionImpl.fromJson(Map json) => _$$RegionImplFromJson(json); @@ -829,7 +905,13 @@ class _$RegionImpl implements _Region { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, code, name, emergencyIntensity, silentIntensity, isMain); + runtimeType, + code, + name, + emergencyIntensity, + silentIntensity, + isMain, + ); /// Create a copy of Region /// with the given fields replaced by the non-null parameter values. @@ -841,19 +923,18 @@ class _$RegionImpl implements _Region { @override Map toJson() { - return _$$RegionImplToJson( - this, - ); + return _$$RegionImplToJson(this); } } abstract class _Region implements Region { - const factory _Region( - {required final String code, - required final String name, - required final JmaForecastIntensity emergencyIntensity, - required final JmaForecastIntensity silentIntensity, - required final bool isMain}) = _$RegionImpl; + const factory _Region({ + required final String code, + required final String name, + required final JmaForecastIntensity emergencyIntensity, + required final JmaForecastIntensity silentIntensity, + required final bool isMain, + }) = _$RegionImpl; factory _Region.fromJson(Map json) = _$RegionImpl.fromJson; diff --git a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.g.dart b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.g.dart index 49a23d86..ef03cf03 100644 --- a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.g.dart +++ b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_model.g.dart @@ -9,74 +9,73 @@ part of 'notification_local_settings_model.dart'; // ************************************************************************** _$NotificationLocalSettingsModelImpl - _$$NotificationLocalSettingsModelImplFromJson(Map json) => - $checkedCreate( - r'_$NotificationLocalSettingsModelImpl', - json, - ($checkedConvert) { - final val = _$NotificationLocalSettingsModelImpl( - eew: $checkedConvert( - 'eew', - (v) => v == null - ? const EewSettings() - : EewSettings.fromJson(v as Map)), - earthquake: $checkedConvert( - 'earthquake', - (v) => v == null - ? const EarthquakeSettings() - : EarthquakeSettings.fromJson(v as Map)), - ); - return val; - }, - ); +_$$NotificationLocalSettingsModelImplFromJson(Map json) => + $checkedCreate(r'_$NotificationLocalSettingsModelImpl', json, ( + $checkedConvert, + ) { + final val = _$NotificationLocalSettingsModelImpl( + eew: $checkedConvert( + 'eew', + (v) => + v == null + ? const EewSettings() + : EewSettings.fromJson(v as Map), + ), + earthquake: $checkedConvert( + 'earthquake', + (v) => + v == null + ? const EarthquakeSettings() + : EarthquakeSettings.fromJson(v as Map), + ), + ); + return val; + }); Map _$$NotificationLocalSettingsModelImplToJson( - _$NotificationLocalSettingsModelImpl instance) => - { - 'eew': instance.eew, - 'earthquake': instance.earthquake, - }; + _$NotificationLocalSettingsModelImpl instance, +) => {'eew': instance.eew, 'earthquake': instance.earthquake}; -_$EewSettingsImpl _$$EewSettingsImplFromJson(Map json) => - $checkedCreate( - r'_$EewSettingsImpl', - json, - ($checkedConvert) { - final val = _$EewSettingsImpl( - emergencyIntensity: $checkedConvert( - 'emergency_intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? - null), - silentIntensity: $checkedConvert( - 'silent_intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? - null), - regions: $checkedConvert( - 'regions', - (v) => - (v as List?) - ?.map((e) => Region.fromJson(e as Map)) - .toList() ?? - const []), - ); - return val; - }, - fieldKeyMap: const { - 'emergencyIntensity': 'emergency_intensity', - 'silentIntensity': 'silent_intensity' - }, +_$EewSettingsImpl _$$EewSettingsImplFromJson( + Map json, +) => $checkedCreate( + r'_$EewSettingsImpl', + json, + ($checkedConvert) { + final val = _$EewSettingsImpl( + emergencyIntensity: $checkedConvert( + 'emergency_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? null, + ), + silentIntensity: $checkedConvert( + 'silent_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? null, + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List?) + ?.map((e) => Region.fromJson(e as Map)) + .toList() ?? + const [], + ), ); + return val; + }, + fieldKeyMap: const { + 'emergencyIntensity': 'emergency_intensity', + 'silentIntensity': 'silent_intensity', + }, +); -Map _$$EewSettingsImplToJson(_$EewSettingsImpl instance) => - { - 'emergency_intensity': - _$JmaForecastIntensityEnumMap[instance.emergencyIntensity], - 'silent_intensity': - _$JmaForecastIntensityEnumMap[instance.silentIntensity], - 'regions': instance.regions, - }; +Map _$$EewSettingsImplToJson( + _$EewSettingsImpl instance, +) => { + 'emergency_intensity': + _$JmaForecastIntensityEnumMap[instance.emergencyIntensity], + 'silent_intensity': _$JmaForecastIntensityEnumMap[instance.silentIntensity], + 'regions': instance.regions, +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', @@ -93,77 +92,79 @@ const _$JmaForecastIntensityEnumMap = { }; _$EarthquakeSettingsImpl _$$EarthquakeSettingsImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeSettingsImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeSettingsImpl( - emergencyIntensity: $checkedConvert( - 'emergency_intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? - null), - silentIntensity: $checkedConvert( - 'silent_intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? - null), - regions: $checkedConvert( - 'regions', - (v) => - (v as List?) - ?.map((e) => Region.fromJson(e as Map)) - .toList() ?? - const []), - ); - return val; - }, - fieldKeyMap: const { - 'emergencyIntensity': 'emergency_intensity', - 'silentIntensity': 'silent_intensity' - }, + Map json, +) => $checkedCreate( + r'_$EarthquakeSettingsImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeSettingsImpl( + emergencyIntensity: $checkedConvert( + 'emergency_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? null, + ), + silentIntensity: $checkedConvert( + 'silent_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v) ?? null, + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List?) + ?.map((e) => Region.fromJson(e as Map)) + .toList() ?? + const [], + ), ); + return val; + }, + fieldKeyMap: const { + 'emergencyIntensity': 'emergency_intensity', + 'silentIntensity': 'silent_intensity', + }, +); Map _$$EarthquakeSettingsImplToJson( - _$EarthquakeSettingsImpl instance) => - { - 'emergency_intensity': - _$JmaForecastIntensityEnumMap[instance.emergencyIntensity], - 'silent_intensity': - _$JmaForecastIntensityEnumMap[instance.silentIntensity], - 'regions': instance.regions, - }; + _$EarthquakeSettingsImpl instance, +) => { + 'emergency_intensity': + _$JmaForecastIntensityEnumMap[instance.emergencyIntensity], + 'silent_intensity': _$JmaForecastIntensityEnumMap[instance.silentIntensity], + 'regions': instance.regions, +}; _$RegionImpl _$$RegionImplFromJson(Map json) => $checkedCreate( - r'_$RegionImpl', - json, - ($checkedConvert) { - final val = _$RegionImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - emergencyIntensity: $checkedConvert('emergency_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - silentIntensity: $checkedConvert('silent_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - isMain: $checkedConvert('is_main', (v) => v as bool), - ); - return val; - }, - fieldKeyMap: const { - 'emergencyIntensity': 'emergency_intensity', - 'silentIntensity': 'silent_intensity', - 'isMain': 'is_main' - }, + r'_$RegionImpl', + json, + ($checkedConvert) { + final val = _$RegionImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + emergencyIntensity: $checkedConvert( + 'emergency_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + silentIntensity: $checkedConvert( + 'silent_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + isMain: $checkedConvert('is_main', (v) => v as bool), ); + return val; + }, + fieldKeyMap: const { + 'emergencyIntensity': 'emergency_intensity', + 'silentIntensity': 'silent_intensity', + 'isMain': 'is_main', + }, +); -Map _$$RegionImplToJson(_$RegionImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'emergency_intensity': - _$JmaForecastIntensityEnumMap[instance.emergencyIntensity]!, - 'silent_intensity': - _$JmaForecastIntensityEnumMap[instance.silentIntensity]!, - 'is_main': instance.isMain, - }; +Map _$$RegionImplToJson( + _$RegionImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'emergency_intensity': + _$JmaForecastIntensityEnumMap[instance.emergencyIntensity]!, + 'silent_intensity': _$JmaForecastIntensityEnumMap[instance.silentIntensity]!, + 'is_main': instance.isMain, +}; diff --git a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.dart b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.dart index 48009a43..d4bdf923 100644 --- a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.dart +++ b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.dart @@ -15,8 +15,9 @@ class NotificationLocalSettingsNotifier extends _$NotificationLocalSettingsNotifier { @override Future build() async { - final value = - await SharedPreferenceAppGroup.getString('notification_settings'); + final value = await SharedPreferenceAppGroup.getString( + 'notification_settings', + ); if (value == null) { return const NotificationLocalSettingsModel(); } @@ -29,33 +30,35 @@ class NotificationLocalSettingsNotifier savedState.earthquakeSettings.emergencyIntensity.jmaIntensity, silentIntensity: savedState.earthquakeSettings.silentIntensity.jmaIntensity, - regions: savedState.earthquakeSettings.regions - .map( - (e) => Region( - code: e.code, - name: e.name, - emergencyIntensity: e.emergencyIntensity.jmaIntensity, - silentIntensity: e.silentIntensity.jmaIntensity, - isMain: e.isMain, - ), - ) - .toList(), + regions: + savedState.earthquakeSettings.regions + .map( + (e) => Region( + code: e.code, + name: e.name, + emergencyIntensity: e.emergencyIntensity.jmaIntensity, + silentIntensity: e.silentIntensity.jmaIntensity, + isMain: e.isMain, + ), + ) + .toList(), ), eew: EewSettings( emergencyIntensity: savedState.eewSettings.emergencyIntensity.jmaIntensity, silentIntensity: savedState.eewSettings.silentIntensity.jmaIntensity, - regions: savedState.eewSettings.regions - .map( - (e) => Region( - code: e.code, - name: e.name, - emergencyIntensity: e.emergencyIntensity.jmaIntensity, - silentIntensity: e.silentIntensity.jmaIntensity, - isMain: e.isMain, - ), - ) - .toList(), + regions: + savedState.eewSettings.regions + .map( + (e) => Region( + code: e.code, + name: e.name, + emergencyIntensity: e.emergencyIntensity.jmaIntensity, + silentIntensity: e.silentIntensity.jmaIntensity, + isMain: e.isMain, + ), + ) + .toList(), ), ); } @@ -65,32 +68,34 @@ class NotificationLocalSettingsNotifier earthquakeSettings: NotificationSettings_EarthquakeSettings( emergencyIntensity: state.earthquake.emergencyIntensity?.toPb, silentIntensity: state.earthquake.silentIntensity?.toPb, - regions: state.earthquake.regions - .map( - (e) => NotificationSettings_EarthquakeSettings_Region( - code: e.code, - name: e.name, - emergencyIntensity: e.emergencyIntensity.toPb, - silentIntensity: e.silentIntensity.toPb, - isMain: e.isMain, - ), - ) - .toList(), + regions: + state.earthquake.regions + .map( + (e) => NotificationSettings_EarthquakeSettings_Region( + code: e.code, + name: e.name, + emergencyIntensity: e.emergencyIntensity.toPb, + silentIntensity: e.silentIntensity.toPb, + isMain: e.isMain, + ), + ) + .toList(), ), eewSettings: NotificationSettings_EewSettings( emergencyIntensity: state.eew.emergencyIntensity?.toPb, silentIntensity: state.eew.silentIntensity?.toPb, - regions: state.eew.regions - .map( - (e) => NotificationSettings_EewSettings_Region( - code: e.code, - name: e.name, - emergencyIntensity: e.emergencyIntensity.toPb, - silentIntensity: e.silentIntensity.toPb, - isMain: e.isMain, - ), - ) - .toList(), + regions: + state.eew.regions + .map( + (e) => NotificationSettings_EewSettings_Region( + code: e.code, + name: e.name, + emergencyIntensity: e.emergencyIntensity.toPb, + silentIntensity: e.silentIntensity.toPb, + isMain: e.isMain, + ), + ) + .toList(), ), ); final buffer = pb.writeToBuffer(); @@ -102,43 +107,37 @@ class NotificationLocalSettingsNotifier extension PbEnumEx on pb_enum.JmaIntensity { JmaForecastIntensity get jmaIntensity => switch (this) { - pb_enum.JmaIntensity.JMA_INTENSITY_0 => JmaForecastIntensity.zero, - pb_enum.JmaIntensity.JMA_INTENSITY_1 => JmaForecastIntensity.one, - pb_enum.JmaIntensity.JMA_INTENSITY_2 => JmaForecastIntensity.two, - pb_enum.JmaIntensity.JMA_INTENSITY_3 => JmaForecastIntensity.three, - pb_enum.JmaIntensity.JMA_INTENSITY_4 => JmaForecastIntensity.four, - pb_enum.JmaIntensity.JMA_INTENSITY_5_MINUS => - JmaForecastIntensity.fiveLower, - pb_enum.JmaIntensity.JMA_INTENSITY_5_PLUS => - JmaForecastIntensity.fiveUpper, - pb_enum.JmaIntensity.JMA_INTENSITY_6_MINUS => - JmaForecastIntensity.sixLower, - pb_enum.JmaIntensity.JMA_INTENSITY_6_PLUS => - JmaForecastIntensity.sixUpper, - pb_enum.JmaIntensity.JMA_INTENSITY_7 => JmaForecastIntensity.seven, - pb_enum.JmaIntensity.JMA_INTENSITY_UNSPECIFIED => - JmaForecastIntensity.unknown, - pb_enum.JmaIntensity() => throw UnimplementedError(), - }; + pb_enum.JmaIntensity.JMA_INTENSITY_0 => JmaForecastIntensity.zero, + pb_enum.JmaIntensity.JMA_INTENSITY_1 => JmaForecastIntensity.one, + pb_enum.JmaIntensity.JMA_INTENSITY_2 => JmaForecastIntensity.two, + pb_enum.JmaIntensity.JMA_INTENSITY_3 => JmaForecastIntensity.three, + pb_enum.JmaIntensity.JMA_INTENSITY_4 => JmaForecastIntensity.four, + pb_enum.JmaIntensity.JMA_INTENSITY_5_MINUS => + JmaForecastIntensity.fiveLower, + pb_enum.JmaIntensity.JMA_INTENSITY_5_PLUS => JmaForecastIntensity.fiveUpper, + pb_enum.JmaIntensity.JMA_INTENSITY_6_MINUS => JmaForecastIntensity.sixLower, + pb_enum.JmaIntensity.JMA_INTENSITY_6_PLUS => JmaForecastIntensity.sixUpper, + pb_enum.JmaIntensity.JMA_INTENSITY_7 => JmaForecastIntensity.seven, + pb_enum.JmaIntensity.JMA_INTENSITY_UNSPECIFIED => + JmaForecastIntensity.unknown, + pb_enum.JmaIntensity() => throw UnimplementedError(), + }; } extension JmaIntensity on JmaForecastIntensity { pb_enum.JmaIntensity get toPb => switch (this) { - JmaForecastIntensity.zero => pb_enum.JmaIntensity.JMA_INTENSITY_0, - JmaForecastIntensity.one => pb_enum.JmaIntensity.JMA_INTENSITY_1, - JmaForecastIntensity.two => pb_enum.JmaIntensity.JMA_INTENSITY_2, - JmaForecastIntensity.three => pb_enum.JmaIntensity.JMA_INTENSITY_3, - JmaForecastIntensity.four => pb_enum.JmaIntensity.JMA_INTENSITY_4, - JmaForecastIntensity.fiveLower => - pb_enum.JmaIntensity.JMA_INTENSITY_5_MINUS, - JmaForecastIntensity.fiveUpper => - pb_enum.JmaIntensity.JMA_INTENSITY_5_PLUS, - JmaForecastIntensity.sixLower => - pb_enum.JmaIntensity.JMA_INTENSITY_6_MINUS, - JmaForecastIntensity.sixUpper => - pb_enum.JmaIntensity.JMA_INTENSITY_6_PLUS, - JmaForecastIntensity.seven => pb_enum.JmaIntensity.JMA_INTENSITY_7, - JmaForecastIntensity.unknown => - pb_enum.JmaIntensity.JMA_INTENSITY_UNSPECIFIED, - }; + JmaForecastIntensity.zero => pb_enum.JmaIntensity.JMA_INTENSITY_0, + JmaForecastIntensity.one => pb_enum.JmaIntensity.JMA_INTENSITY_1, + JmaForecastIntensity.two => pb_enum.JmaIntensity.JMA_INTENSITY_2, + JmaForecastIntensity.three => pb_enum.JmaIntensity.JMA_INTENSITY_3, + JmaForecastIntensity.four => pb_enum.JmaIntensity.JMA_INTENSITY_4, + JmaForecastIntensity.fiveLower => + pb_enum.JmaIntensity.JMA_INTENSITY_5_MINUS, + JmaForecastIntensity.fiveUpper => pb_enum.JmaIntensity.JMA_INTENSITY_5_PLUS, + JmaForecastIntensity.sixLower => pb_enum.JmaIntensity.JMA_INTENSITY_6_MINUS, + JmaForecastIntensity.sixUpper => pb_enum.JmaIntensity.JMA_INTENSITY_6_PLUS, + JmaForecastIntensity.seven => pb_enum.JmaIntensity.JMA_INTENSITY_7, + JmaForecastIntensity.unknown => + pb_enum.JmaIntensity.JMA_INTENSITY_UNSPECIFIED, + }; } diff --git a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.g.dart b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.g.dart index aaa2f965..c9d15eb4 100644 --- a/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.g.dart +++ b/app/lib/feature/settings/features/notification_local_settings/data/notification_local_settings_notifier.g.dart @@ -14,17 +14,20 @@ String _$notificationLocalSettingsNotifierHash() => /// See also [NotificationLocalSettingsNotifier]. @ProviderFor(NotificationLocalSettingsNotifier) final notificationLocalSettingsNotifierProvider = AsyncNotifierProvider< - NotificationLocalSettingsNotifier, NotificationLocalSettingsModel>.internal( + NotificationLocalSettingsNotifier, + NotificationLocalSettingsModel +>.internal( NotificationLocalSettingsNotifier.new, name: r'notificationLocalSettingsNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationLocalSettingsNotifierHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationLocalSettingsNotifierHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$NotificationLocalSettingsNotifier - = AsyncNotifier; +typedef _$NotificationLocalSettingsNotifier = + AsyncNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/features/notification_local_settings/ui/notification_local_settings_page.dart b/app/lib/feature/settings/features/notification_local_settings/ui/notification_local_settings_page.dart index 43001f74..2c6536b8 100644 --- a/app/lib/feature/settings/features/notification_local_settings/ui/notification_local_settings_page.dart +++ b/app/lib/feature/settings/features/notification_local_settings/ui/notification_local_settings_page.dart @@ -7,9 +7,7 @@ class NotificationLocalSettingsPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( - title: const Text('通知音・表示設定'), - ), + appBar: AppBar(title: const Text('通知音・表示設定')), body: const _Body(), ); } diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.dart b/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.dart index 71ee0a38..ad55989b 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.dart @@ -22,9 +22,7 @@ class NotificationRemoteSettingsEew with _$NotificationRemoteSettingsEew { required List regions, }) = _NotificationRemoteSettingsEew; - factory NotificationRemoteSettingsEew.fromJson( - Map json, - ) => + factory NotificationRemoteSettingsEew.fromJson(Map json) => _$NotificationRemoteSettingsEewFromJson(json); } @@ -39,8 +37,7 @@ class NotificationRemoteSettingsEewRegion factory NotificationRemoteSettingsEewRegion.fromJson( Map json, - ) => - _$NotificationRemoteSettingsEewRegionFromJson(json); + ) => _$NotificationRemoteSettingsEewRegionFromJson(json); } @freezed @@ -53,8 +50,7 @@ class NotificationRemoteSettingsEarthquake factory NotificationRemoteSettingsEarthquake.fromJson( Map json, - ) => - _$NotificationRemoteSettingsEarthquakeFromJson(json); + ) => _$NotificationRemoteSettingsEarthquakeFromJson(json); } @freezed @@ -68,6 +64,5 @@ class NotificationRemoteSettingsEarthquakeRegion factory NotificationRemoteSettingsEarthquakeRegion.fromJson( Map json, - ) => - _$NotificationRemoteSettingsEarthquakeRegionFromJson(json); + ) => _$NotificationRemoteSettingsEarthquakeRegionFromJson(json); } diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.freezed.dart b/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.freezed.dart index 8ad59c29..dcc50238 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.freezed.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.freezed.dart @@ -12,10 +12,12 @@ part of 'notification_remote_settings_state.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NotificationRemoteSettingsState _$NotificationRemoteSettingsStateFromJson( - Map json) { + Map json, +) { return _NotificationRemoteSettingsState.fromJson(json); } @@ -32,28 +34,34 @@ mixin _$NotificationRemoteSettingsState { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationRemoteSettingsStateCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationRemoteSettingsStateCopyWith<$Res> { factory $NotificationRemoteSettingsStateCopyWith( - NotificationRemoteSettingsState value, - $Res Function(NotificationRemoteSettingsState) then) = - _$NotificationRemoteSettingsStateCopyWithImpl<$Res, - NotificationRemoteSettingsState>; + NotificationRemoteSettingsState value, + $Res Function(NotificationRemoteSettingsState) then, + ) = + _$NotificationRemoteSettingsStateCopyWithImpl< + $Res, + NotificationRemoteSettingsState + >; @useResult - $Res call( - {NotificationRemoteSettingsEew eew, - NotificationRemoteSettingsEarthquake earthquake}); + $Res call({ + NotificationRemoteSettingsEew eew, + NotificationRemoteSettingsEarthquake earthquake, + }); $NotificationRemoteSettingsEewCopyWith<$Res> get eew; $NotificationRemoteSettingsEarthquakeCopyWith<$Res> get earthquake; } /// @nodoc -class _$NotificationRemoteSettingsStateCopyWithImpl<$Res, - $Val extends NotificationRemoteSettingsState> +class _$NotificationRemoteSettingsStateCopyWithImpl< + $Res, + $Val extends NotificationRemoteSettingsState +> implements $NotificationRemoteSettingsStateCopyWith<$Res> { _$NotificationRemoteSettingsStateCopyWithImpl(this._value, this._then); @@ -66,20 +74,22 @@ class _$NotificationRemoteSettingsStateCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? eew = null, - Object? earthquake = null, - }) { - return _then(_value.copyWith( - eew: null == eew - ? _value.eew - : eew // ignore: cast_nullable_to_non_nullable - as NotificationRemoteSettingsEew, - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as NotificationRemoteSettingsEarthquake, - ) as $Val); + $Res call({Object? eew = null, Object? earthquake = null}) { + return _then( + _value.copyWith( + eew: + null == eew + ? _value.eew + : eew // ignore: cast_nullable_to_non_nullable + as NotificationRemoteSettingsEew, + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as NotificationRemoteSettingsEarthquake, + ) + as $Val, + ); } /// Create a copy of NotificationRemoteSettingsState @@ -98,9 +108,11 @@ class _$NotificationRemoteSettingsStateCopyWithImpl<$Res, @pragma('vm:prefer-inline') $NotificationRemoteSettingsEarthquakeCopyWith<$Res> get earthquake { return $NotificationRemoteSettingsEarthquakeCopyWith<$Res>( - _value.earthquake, (value) { - return _then(_value.copyWith(earthquake: value) as $Val); - }); + _value.earthquake, + (value) { + return _then(_value.copyWith(earthquake: value) as $Val); + }, + ); } } @@ -108,14 +120,15 @@ class _$NotificationRemoteSettingsStateCopyWithImpl<$Res, abstract class _$$NotificationRemoteSettingsStateImplCopyWith<$Res> implements $NotificationRemoteSettingsStateCopyWith<$Res> { factory _$$NotificationRemoteSettingsStateImplCopyWith( - _$NotificationRemoteSettingsStateImpl value, - $Res Function(_$NotificationRemoteSettingsStateImpl) then) = - __$$NotificationRemoteSettingsStateImplCopyWithImpl<$Res>; + _$NotificationRemoteSettingsStateImpl value, + $Res Function(_$NotificationRemoteSettingsStateImpl) then, + ) = __$$NotificationRemoteSettingsStateImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {NotificationRemoteSettingsEew eew, - NotificationRemoteSettingsEarthquake earthquake}); + $Res call({ + NotificationRemoteSettingsEew eew, + NotificationRemoteSettingsEarthquake earthquake, + }); @override $NotificationRemoteSettingsEewCopyWith<$Res> get eew; @@ -125,32 +138,36 @@ abstract class _$$NotificationRemoteSettingsStateImplCopyWith<$Res> /// @nodoc class __$$NotificationRemoteSettingsStateImplCopyWithImpl<$Res> - extends _$NotificationRemoteSettingsStateCopyWithImpl<$Res, - _$NotificationRemoteSettingsStateImpl> + extends + _$NotificationRemoteSettingsStateCopyWithImpl< + $Res, + _$NotificationRemoteSettingsStateImpl + > implements _$$NotificationRemoteSettingsStateImplCopyWith<$Res> { __$$NotificationRemoteSettingsStateImplCopyWithImpl( - _$NotificationRemoteSettingsStateImpl _value, - $Res Function(_$NotificationRemoteSettingsStateImpl) _then) - : super(_value, _then); + _$NotificationRemoteSettingsStateImpl _value, + $Res Function(_$NotificationRemoteSettingsStateImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationRemoteSettingsState /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? eew = null, - Object? earthquake = null, - }) { - return _then(_$NotificationRemoteSettingsStateImpl( - eew: null == eew - ? _value.eew - : eew // ignore: cast_nullable_to_non_nullable - as NotificationRemoteSettingsEew, - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as NotificationRemoteSettingsEarthquake, - )); + $Res call({Object? eew = null, Object? earthquake = null}) { + return _then( + _$NotificationRemoteSettingsStateImpl( + eew: + null == eew + ? _value.eew + : eew // ignore: cast_nullable_to_non_nullable + as NotificationRemoteSettingsEew, + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as NotificationRemoteSettingsEarthquake, + ), + ); } } @@ -158,12 +175,14 @@ class __$$NotificationRemoteSettingsStateImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationRemoteSettingsStateImpl implements _NotificationRemoteSettingsState { - const _$NotificationRemoteSettingsStateImpl( - {required this.eew, required this.earthquake}); + const _$NotificationRemoteSettingsStateImpl({ + required this.eew, + required this.earthquake, + }); factory _$NotificationRemoteSettingsStateImpl.fromJson( - Map json) => - _$$NotificationRemoteSettingsStateImplFromJson(json); + Map json, + ) => _$$NotificationRemoteSettingsStateImplFromJson(json); @override final NotificationRemoteSettingsEew eew; @@ -195,24 +214,24 @@ class _$NotificationRemoteSettingsStateImpl @override @pragma('vm:prefer-inline') _$$NotificationRemoteSettingsStateImplCopyWith< - _$NotificationRemoteSettingsStateImpl> - get copyWith => __$$NotificationRemoteSettingsStateImplCopyWithImpl< - _$NotificationRemoteSettingsStateImpl>(this, _$identity); + _$NotificationRemoteSettingsStateImpl + > + get copyWith => __$$NotificationRemoteSettingsStateImplCopyWithImpl< + _$NotificationRemoteSettingsStateImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationRemoteSettingsStateImplToJson( - this, - ); + return _$$NotificationRemoteSettingsStateImplToJson(this); } } abstract class _NotificationRemoteSettingsState implements NotificationRemoteSettingsState { - const factory _NotificationRemoteSettingsState( - {required final NotificationRemoteSettingsEew eew, - required final NotificationRemoteSettingsEarthquake earthquake}) = - _$NotificationRemoteSettingsStateImpl; + const factory _NotificationRemoteSettingsState({ + required final NotificationRemoteSettingsEew eew, + required final NotificationRemoteSettingsEarthquake earthquake, + }) = _$NotificationRemoteSettingsStateImpl; factory _NotificationRemoteSettingsState.fromJson(Map json) = _$NotificationRemoteSettingsStateImpl.fromJson; @@ -227,12 +246,14 @@ abstract class _NotificationRemoteSettingsState @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationRemoteSettingsStateImplCopyWith< - _$NotificationRemoteSettingsStateImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationRemoteSettingsStateImpl + > + get copyWith => throw _privateConstructorUsedError; } NotificationRemoteSettingsEew _$NotificationRemoteSettingsEewFromJson( - Map json) { + Map json, +) { return _NotificationRemoteSettingsEew.fromJson(json); } @@ -249,25 +270,31 @@ mixin _$NotificationRemoteSettingsEew { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationRemoteSettingsEewCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationRemoteSettingsEewCopyWith<$Res> { factory $NotificationRemoteSettingsEewCopyWith( - NotificationRemoteSettingsEew value, - $Res Function(NotificationRemoteSettingsEew) then) = - _$NotificationRemoteSettingsEewCopyWithImpl<$Res, - NotificationRemoteSettingsEew>; + NotificationRemoteSettingsEew value, + $Res Function(NotificationRemoteSettingsEew) then, + ) = + _$NotificationRemoteSettingsEewCopyWithImpl< + $Res, + NotificationRemoteSettingsEew + >; @useResult - $Res call( - {JmaForecastIntensity? global, - List regions}); + $Res call({ + JmaForecastIntensity? global, + List regions, + }); } /// @nodoc -class _$NotificationRemoteSettingsEewCopyWithImpl<$Res, - $Val extends NotificationRemoteSettingsEew> +class _$NotificationRemoteSettingsEewCopyWithImpl< + $Res, + $Val extends NotificationRemoteSettingsEew +> implements $NotificationRemoteSettingsEewCopyWith<$Res> { _$NotificationRemoteSettingsEewCopyWithImpl(this._value, this._then); @@ -280,20 +307,22 @@ class _$NotificationRemoteSettingsEewCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? global = freezed, - Object? regions = null, - }) { - return _then(_value.copyWith( - global: freezed == global - ? _value.global - : global // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? global = freezed, Object? regions = null}) { + return _then( + _value.copyWith( + global: + freezed == global + ? _value.global + : global // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -301,44 +330,49 @@ class _$NotificationRemoteSettingsEewCopyWithImpl<$Res, abstract class _$$NotificationRemoteSettingsEewImplCopyWith<$Res> implements $NotificationRemoteSettingsEewCopyWith<$Res> { factory _$$NotificationRemoteSettingsEewImplCopyWith( - _$NotificationRemoteSettingsEewImpl value, - $Res Function(_$NotificationRemoteSettingsEewImpl) then) = - __$$NotificationRemoteSettingsEewImplCopyWithImpl<$Res>; + _$NotificationRemoteSettingsEewImpl value, + $Res Function(_$NotificationRemoteSettingsEewImpl) then, + ) = __$$NotificationRemoteSettingsEewImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {JmaForecastIntensity? global, - List regions}); + $Res call({ + JmaForecastIntensity? global, + List regions, + }); } /// @nodoc class __$$NotificationRemoteSettingsEewImplCopyWithImpl<$Res> - extends _$NotificationRemoteSettingsEewCopyWithImpl<$Res, - _$NotificationRemoteSettingsEewImpl> + extends + _$NotificationRemoteSettingsEewCopyWithImpl< + $Res, + _$NotificationRemoteSettingsEewImpl + > implements _$$NotificationRemoteSettingsEewImplCopyWith<$Res> { __$$NotificationRemoteSettingsEewImplCopyWithImpl( - _$NotificationRemoteSettingsEewImpl _value, - $Res Function(_$NotificationRemoteSettingsEewImpl) _then) - : super(_value, _then); + _$NotificationRemoteSettingsEewImpl _value, + $Res Function(_$NotificationRemoteSettingsEewImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationRemoteSettingsEew /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? global = freezed, - Object? regions = null, - }) { - return _then(_$NotificationRemoteSettingsEewImpl( - global: freezed == global - ? _value.global - : global // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? global = freezed, Object? regions = null}) { + return _then( + _$NotificationRemoteSettingsEewImpl( + global: + freezed == global + ? _value.global + : global // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -346,14 +380,14 @@ class __$$NotificationRemoteSettingsEewImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationRemoteSettingsEewImpl implements _NotificationRemoteSettingsEew { - const _$NotificationRemoteSettingsEewImpl( - {required this.global, - required final List regions}) - : _regions = regions; + const _$NotificationRemoteSettingsEewImpl({ + required this.global, + required final List regions, + }) : _regions = regions; factory _$NotificationRemoteSettingsEewImpl.fromJson( - Map json) => - _$$NotificationRemoteSettingsEewImplFromJson(json); + Map json, + ) => _$$NotificationRemoteSettingsEewImplFromJson(json); @override final JmaForecastIntensity? global; @@ -382,7 +416,10 @@ class _$NotificationRemoteSettingsEewImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, global, const DeepCollectionEquality().hash(_regions)); + runtimeType, + global, + const DeepCollectionEquality().hash(_regions), + ); /// Create a copy of NotificationRemoteSettingsEew /// with the given fields replaced by the non-null parameter values. @@ -390,24 +427,24 @@ class _$NotificationRemoteSettingsEewImpl @override @pragma('vm:prefer-inline') _$$NotificationRemoteSettingsEewImplCopyWith< - _$NotificationRemoteSettingsEewImpl> - get copyWith => __$$NotificationRemoteSettingsEewImplCopyWithImpl< - _$NotificationRemoteSettingsEewImpl>(this, _$identity); + _$NotificationRemoteSettingsEewImpl + > + get copyWith => __$$NotificationRemoteSettingsEewImplCopyWithImpl< + _$NotificationRemoteSettingsEewImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationRemoteSettingsEewImplToJson( - this, - ); + return _$$NotificationRemoteSettingsEewImplToJson(this); } } abstract class _NotificationRemoteSettingsEew implements NotificationRemoteSettingsEew { - const factory _NotificationRemoteSettingsEew( - {required final JmaForecastIntensity? global, - required final List regions}) = - _$NotificationRemoteSettingsEewImpl; + const factory _NotificationRemoteSettingsEew({ + required final JmaForecastIntensity? global, + required final List regions, + }) = _$NotificationRemoteSettingsEewImpl; factory _NotificationRemoteSettingsEew.fromJson(Map json) = _$NotificationRemoteSettingsEewImpl.fromJson; @@ -422,12 +459,13 @@ abstract class _NotificationRemoteSettingsEew @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationRemoteSettingsEewImplCopyWith< - _$NotificationRemoteSettingsEewImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationRemoteSettingsEewImpl + > + get copyWith => throw _privateConstructorUsedError; } NotificationRemoteSettingsEewRegion - _$NotificationRemoteSettingsEewRegionFromJson(Map json) { +_$NotificationRemoteSettingsEewRegionFromJson(Map json) { return _NotificationRemoteSettingsEewRegion.fromJson(json); } @@ -445,24 +483,30 @@ mixin _$NotificationRemoteSettingsEewRegion { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationRemoteSettingsEewRegionCopyWith< - NotificationRemoteSettingsEewRegion> - get copyWith => throw _privateConstructorUsedError; + NotificationRemoteSettingsEewRegion + > + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationRemoteSettingsEewRegionCopyWith<$Res> { factory $NotificationRemoteSettingsEewRegionCopyWith( - NotificationRemoteSettingsEewRegion value, - $Res Function(NotificationRemoteSettingsEewRegion) then) = - _$NotificationRemoteSettingsEewRegionCopyWithImpl<$Res, - NotificationRemoteSettingsEewRegion>; + NotificationRemoteSettingsEewRegion value, + $Res Function(NotificationRemoteSettingsEewRegion) then, + ) = + _$NotificationRemoteSettingsEewRegionCopyWithImpl< + $Res, + NotificationRemoteSettingsEewRegion + >; @useResult $Res call({int regionId, JmaForecastIntensity minJmaIntensity, String name}); } /// @nodoc -class _$NotificationRemoteSettingsEewRegionCopyWithImpl<$Res, - $Val extends NotificationRemoteSettingsEewRegion> +class _$NotificationRemoteSettingsEewRegionCopyWithImpl< + $Res, + $Val extends NotificationRemoteSettingsEewRegion +> implements $NotificationRemoteSettingsEewRegionCopyWith<$Res> { _$NotificationRemoteSettingsEewRegionCopyWithImpl(this._value, this._then); @@ -480,20 +524,26 @@ class _$NotificationRemoteSettingsEewRegionCopyWithImpl<$Res, Object? minJmaIntensity = null, Object? name = null, }) { - return _then(_value.copyWith( - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + return _then( + _value.copyWith( + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -501,9 +551,9 @@ class _$NotificationRemoteSettingsEewRegionCopyWithImpl<$Res, abstract class _$$NotificationRemoteSettingsEewRegionImplCopyWith<$Res> implements $NotificationRemoteSettingsEewRegionCopyWith<$Res> { factory _$$NotificationRemoteSettingsEewRegionImplCopyWith( - _$NotificationRemoteSettingsEewRegionImpl value, - $Res Function(_$NotificationRemoteSettingsEewRegionImpl) then) = - __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl<$Res>; + _$NotificationRemoteSettingsEewRegionImpl value, + $Res Function(_$NotificationRemoteSettingsEewRegionImpl) then, + ) = __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl<$Res>; @override @useResult $Res call({int regionId, JmaForecastIntensity minJmaIntensity, String name}); @@ -511,13 +561,16 @@ abstract class _$$NotificationRemoteSettingsEewRegionImplCopyWith<$Res> /// @nodoc class __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl<$Res> - extends _$NotificationRemoteSettingsEewRegionCopyWithImpl<$Res, - _$NotificationRemoteSettingsEewRegionImpl> + extends + _$NotificationRemoteSettingsEewRegionCopyWithImpl< + $Res, + _$NotificationRemoteSettingsEewRegionImpl + > implements _$$NotificationRemoteSettingsEewRegionImplCopyWith<$Res> { __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl( - _$NotificationRemoteSettingsEewRegionImpl _value, - $Res Function(_$NotificationRemoteSettingsEewRegionImpl) _then) - : super(_value, _then); + _$NotificationRemoteSettingsEewRegionImpl _value, + $Res Function(_$NotificationRemoteSettingsEewRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationRemoteSettingsEewRegion /// with the given fields replaced by the non-null parameter values. @@ -528,20 +581,25 @@ class __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl<$Res> Object? minJmaIntensity = null, Object? name = null, }) { - return _then(_$NotificationRemoteSettingsEewRegionImpl( - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - )); + return _then( + _$NotificationRemoteSettingsEewRegionImpl( + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } @@ -549,14 +607,15 @@ class __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationRemoteSettingsEewRegionImpl implements _NotificationRemoteSettingsEewRegion { - const _$NotificationRemoteSettingsEewRegionImpl( - {required this.regionId, - required this.minJmaIntensity, - required this.name}); + const _$NotificationRemoteSettingsEewRegionImpl({ + required this.regionId, + required this.minJmaIntensity, + required this.name, + }); factory _$NotificationRemoteSettingsEewRegionImpl.fromJson( - Map json) => - _$$NotificationRemoteSettingsEewRegionImplFromJson(json); + Map json, + ) => _$$NotificationRemoteSettingsEewRegionImplFromJson(json); @override final int regionId; @@ -592,28 +651,29 @@ class _$NotificationRemoteSettingsEewRegionImpl @override @pragma('vm:prefer-inline') _$$NotificationRemoteSettingsEewRegionImplCopyWith< - _$NotificationRemoteSettingsEewRegionImpl> - get copyWith => __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl< - _$NotificationRemoteSettingsEewRegionImpl>(this, _$identity); + _$NotificationRemoteSettingsEewRegionImpl + > + get copyWith => __$$NotificationRemoteSettingsEewRegionImplCopyWithImpl< + _$NotificationRemoteSettingsEewRegionImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationRemoteSettingsEewRegionImplToJson( - this, - ); + return _$$NotificationRemoteSettingsEewRegionImplToJson(this); } } abstract class _NotificationRemoteSettingsEewRegion implements NotificationRemoteSettingsEewRegion { - const factory _NotificationRemoteSettingsEewRegion( - {required final int regionId, - required final JmaForecastIntensity minJmaIntensity, - required final String name}) = _$NotificationRemoteSettingsEewRegionImpl; + const factory _NotificationRemoteSettingsEewRegion({ + required final int regionId, + required final JmaForecastIntensity minJmaIntensity, + required final String name, + }) = _$NotificationRemoteSettingsEewRegionImpl; factory _NotificationRemoteSettingsEewRegion.fromJson( - Map json) = - _$NotificationRemoteSettingsEewRegionImpl.fromJson; + Map json, + ) = _$NotificationRemoteSettingsEewRegionImpl.fromJson; @override int get regionId; @@ -627,12 +687,13 @@ abstract class _NotificationRemoteSettingsEewRegion @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationRemoteSettingsEewRegionImplCopyWith< - _$NotificationRemoteSettingsEewRegionImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationRemoteSettingsEewRegionImpl + > + get copyWith => throw _privateConstructorUsedError; } NotificationRemoteSettingsEarthquake - _$NotificationRemoteSettingsEarthquakeFromJson(Map json) { +_$NotificationRemoteSettingsEarthquakeFromJson(Map json) { return _NotificationRemoteSettingsEarthquake.fromJson(json); } @@ -649,26 +710,33 @@ mixin _$NotificationRemoteSettingsEarthquake { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationRemoteSettingsEarthquakeCopyWith< - NotificationRemoteSettingsEarthquake> - get copyWith => throw _privateConstructorUsedError; + NotificationRemoteSettingsEarthquake + > + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationRemoteSettingsEarthquakeCopyWith<$Res> { factory $NotificationRemoteSettingsEarthquakeCopyWith( - NotificationRemoteSettingsEarthquake value, - $Res Function(NotificationRemoteSettingsEarthquake) then) = - _$NotificationRemoteSettingsEarthquakeCopyWithImpl<$Res, - NotificationRemoteSettingsEarthquake>; + NotificationRemoteSettingsEarthquake value, + $Res Function(NotificationRemoteSettingsEarthquake) then, + ) = + _$NotificationRemoteSettingsEarthquakeCopyWithImpl< + $Res, + NotificationRemoteSettingsEarthquake + >; @useResult - $Res call( - {JmaForecastIntensity? global, - List regions}); + $Res call({ + JmaForecastIntensity? global, + List regions, + }); } /// @nodoc -class _$NotificationRemoteSettingsEarthquakeCopyWithImpl<$Res, - $Val extends NotificationRemoteSettingsEarthquake> +class _$NotificationRemoteSettingsEarthquakeCopyWithImpl< + $Res, + $Val extends NotificationRemoteSettingsEarthquake +> implements $NotificationRemoteSettingsEarthquakeCopyWith<$Res> { _$NotificationRemoteSettingsEarthquakeCopyWithImpl(this._value, this._then); @@ -681,20 +749,22 @@ class _$NotificationRemoteSettingsEarthquakeCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? global = freezed, - Object? regions = null, - }) { - return _then(_value.copyWith( - global: freezed == global - ? _value.global - : global // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? global = freezed, Object? regions = null}) { + return _then( + _value.copyWith( + global: + freezed == global + ? _value.global + : global // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -702,44 +772,49 @@ class _$NotificationRemoteSettingsEarthquakeCopyWithImpl<$Res, abstract class _$$NotificationRemoteSettingsEarthquakeImplCopyWith<$Res> implements $NotificationRemoteSettingsEarthquakeCopyWith<$Res> { factory _$$NotificationRemoteSettingsEarthquakeImplCopyWith( - _$NotificationRemoteSettingsEarthquakeImpl value, - $Res Function(_$NotificationRemoteSettingsEarthquakeImpl) then) = - __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl<$Res>; + _$NotificationRemoteSettingsEarthquakeImpl value, + $Res Function(_$NotificationRemoteSettingsEarthquakeImpl) then, + ) = __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {JmaForecastIntensity? global, - List regions}); + $Res call({ + JmaForecastIntensity? global, + List regions, + }); } /// @nodoc class __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl<$Res> - extends _$NotificationRemoteSettingsEarthquakeCopyWithImpl<$Res, - _$NotificationRemoteSettingsEarthquakeImpl> + extends + _$NotificationRemoteSettingsEarthquakeCopyWithImpl< + $Res, + _$NotificationRemoteSettingsEarthquakeImpl + > implements _$$NotificationRemoteSettingsEarthquakeImplCopyWith<$Res> { __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl( - _$NotificationRemoteSettingsEarthquakeImpl _value, - $Res Function(_$NotificationRemoteSettingsEarthquakeImpl) _then) - : super(_value, _then); + _$NotificationRemoteSettingsEarthquakeImpl _value, + $Res Function(_$NotificationRemoteSettingsEarthquakeImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationRemoteSettingsEarthquake /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? global = freezed, - Object? regions = null, - }) { - return _then(_$NotificationRemoteSettingsEarthquakeImpl( - global: freezed == global - ? _value.global - : global // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? global = freezed, Object? regions = null}) { + return _then( + _$NotificationRemoteSettingsEarthquakeImpl( + global: + freezed == global + ? _value.global + : global // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -747,14 +822,14 @@ class __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationRemoteSettingsEarthquakeImpl implements _NotificationRemoteSettingsEarthquake { - const _$NotificationRemoteSettingsEarthquakeImpl( - {required this.global, - required final List regions}) - : _regions = regions; + const _$NotificationRemoteSettingsEarthquakeImpl({ + required this.global, + required final List regions, + }) : _regions = regions; factory _$NotificationRemoteSettingsEarthquakeImpl.fromJson( - Map json) => - _$$NotificationRemoteSettingsEarthquakeImplFromJson(json); + Map json, + ) => _$$NotificationRemoteSettingsEarthquakeImplFromJson(json); @override final JmaForecastIntensity? global; @@ -783,7 +858,10 @@ class _$NotificationRemoteSettingsEarthquakeImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, global, const DeepCollectionEquality().hash(_regions)); + runtimeType, + global, + const DeepCollectionEquality().hash(_regions), + ); /// Create a copy of NotificationRemoteSettingsEarthquake /// with the given fields replaced by the non-null parameter values. @@ -791,28 +869,28 @@ class _$NotificationRemoteSettingsEarthquakeImpl @override @pragma('vm:prefer-inline') _$$NotificationRemoteSettingsEarthquakeImplCopyWith< - _$NotificationRemoteSettingsEarthquakeImpl> - get copyWith => __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl< - _$NotificationRemoteSettingsEarthquakeImpl>(this, _$identity); + _$NotificationRemoteSettingsEarthquakeImpl + > + get copyWith => __$$NotificationRemoteSettingsEarthquakeImplCopyWithImpl< + _$NotificationRemoteSettingsEarthquakeImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationRemoteSettingsEarthquakeImplToJson( - this, - ); + return _$$NotificationRemoteSettingsEarthquakeImplToJson(this); } } abstract class _NotificationRemoteSettingsEarthquake implements NotificationRemoteSettingsEarthquake { - const factory _NotificationRemoteSettingsEarthquake( - {required final JmaForecastIntensity? global, - required final List - regions}) = _$NotificationRemoteSettingsEarthquakeImpl; + const factory _NotificationRemoteSettingsEarthquake({ + required final JmaForecastIntensity? global, + required final List regions, + }) = _$NotificationRemoteSettingsEarthquakeImpl; factory _NotificationRemoteSettingsEarthquake.fromJson( - Map json) = - _$NotificationRemoteSettingsEarthquakeImpl.fromJson; + Map json, + ) = _$NotificationRemoteSettingsEarthquakeImpl.fromJson; @override JmaForecastIntensity? get global; @@ -824,13 +902,15 @@ abstract class _NotificationRemoteSettingsEarthquake @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationRemoteSettingsEarthquakeImplCopyWith< - _$NotificationRemoteSettingsEarthquakeImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationRemoteSettingsEarthquakeImpl + > + get copyWith => throw _privateConstructorUsedError; } NotificationRemoteSettingsEarthquakeRegion - _$NotificationRemoteSettingsEarthquakeRegionFromJson( - Map json) { +_$NotificationRemoteSettingsEarthquakeRegionFromJson( + Map json, +) { return _NotificationRemoteSettingsEarthquakeRegion.fromJson(json); } @@ -848,27 +928,35 @@ mixin _$NotificationRemoteSettingsEarthquakeRegion { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationRemoteSettingsEarthquakeRegionCopyWith< - NotificationRemoteSettingsEarthquakeRegion> - get copyWith => throw _privateConstructorUsedError; + NotificationRemoteSettingsEarthquakeRegion + > + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationRemoteSettingsEarthquakeRegionCopyWith<$Res> { factory $NotificationRemoteSettingsEarthquakeRegionCopyWith( - NotificationRemoteSettingsEarthquakeRegion value, - $Res Function(NotificationRemoteSettingsEarthquakeRegion) then) = - _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl<$Res, - NotificationRemoteSettingsEarthquakeRegion>; + NotificationRemoteSettingsEarthquakeRegion value, + $Res Function(NotificationRemoteSettingsEarthquakeRegion) then, + ) = + _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl< + $Res, + NotificationRemoteSettingsEarthquakeRegion + >; @useResult $Res call({int regionId, JmaForecastIntensity minJmaIntensity, String name}); } /// @nodoc -class _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl<$Res, - $Val extends NotificationRemoteSettingsEarthquakeRegion> +class _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl< + $Res, + $Val extends NotificationRemoteSettingsEarthquakeRegion +> implements $NotificationRemoteSettingsEarthquakeRegionCopyWith<$Res> { _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl( - this._value, this._then); + this._value, + this._then, + ); // ignore: unused_field final $Val _value; @@ -884,20 +972,26 @@ class _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl<$Res, Object? minJmaIntensity = null, Object? name = null, }) { - return _then(_value.copyWith( - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + return _then( + _value.copyWith( + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -905,10 +999,9 @@ class _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl<$Res, abstract class _$$NotificationRemoteSettingsEarthquakeRegionImplCopyWith<$Res> implements $NotificationRemoteSettingsEarthquakeRegionCopyWith<$Res> { factory _$$NotificationRemoteSettingsEarthquakeRegionImplCopyWith( - _$NotificationRemoteSettingsEarthquakeRegionImpl value, - $Res Function(_$NotificationRemoteSettingsEarthquakeRegionImpl) - then) = - __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl<$Res>; + _$NotificationRemoteSettingsEarthquakeRegionImpl value, + $Res Function(_$NotificationRemoteSettingsEarthquakeRegionImpl) then, + ) = __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl<$Res>; @override @useResult $Res call({int regionId, JmaForecastIntensity minJmaIntensity, String name}); @@ -916,13 +1009,16 @@ abstract class _$$NotificationRemoteSettingsEarthquakeRegionImplCopyWith<$Res> /// @nodoc class __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl<$Res> - extends _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl<$Res, - _$NotificationRemoteSettingsEarthquakeRegionImpl> + extends + _$NotificationRemoteSettingsEarthquakeRegionCopyWithImpl< + $Res, + _$NotificationRemoteSettingsEarthquakeRegionImpl + > implements _$$NotificationRemoteSettingsEarthquakeRegionImplCopyWith<$Res> { __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl( - _$NotificationRemoteSettingsEarthquakeRegionImpl _value, - $Res Function(_$NotificationRemoteSettingsEarthquakeRegionImpl) _then) - : super(_value, _then); + _$NotificationRemoteSettingsEarthquakeRegionImpl _value, + $Res Function(_$NotificationRemoteSettingsEarthquakeRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationRemoteSettingsEarthquakeRegion /// with the given fields replaced by the non-null parameter values. @@ -933,20 +1029,25 @@ class __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl<$Res> Object? minJmaIntensity = null, Object? name = null, }) { - return _then(_$NotificationRemoteSettingsEarthquakeRegionImpl( - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - )); + return _then( + _$NotificationRemoteSettingsEarthquakeRegionImpl( + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } @@ -954,14 +1055,15 @@ class __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationRemoteSettingsEarthquakeRegionImpl implements _NotificationRemoteSettingsEarthquakeRegion { - const _$NotificationRemoteSettingsEarthquakeRegionImpl( - {required this.regionId, - required this.minJmaIntensity, - required this.name}); + const _$NotificationRemoteSettingsEarthquakeRegionImpl({ + required this.regionId, + required this.minJmaIntensity, + required this.name, + }); factory _$NotificationRemoteSettingsEarthquakeRegionImpl.fromJson( - Map json) => - _$$NotificationRemoteSettingsEarthquakeRegionImplFromJson(json); + Map json, + ) => _$$NotificationRemoteSettingsEarthquakeRegionImplFromJson(json); @override final int regionId; @@ -997,31 +1099,30 @@ class _$NotificationRemoteSettingsEarthquakeRegionImpl @override @pragma('vm:prefer-inline') _$$NotificationRemoteSettingsEarthquakeRegionImplCopyWith< - _$NotificationRemoteSettingsEarthquakeRegionImpl> - get copyWith => - __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl< - _$NotificationRemoteSettingsEarthquakeRegionImpl>( - this, _$identity); + _$NotificationRemoteSettingsEarthquakeRegionImpl + > + get copyWith => + __$$NotificationRemoteSettingsEarthquakeRegionImplCopyWithImpl< + _$NotificationRemoteSettingsEarthquakeRegionImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationRemoteSettingsEarthquakeRegionImplToJson( - this, - ); + return _$$NotificationRemoteSettingsEarthquakeRegionImplToJson(this); } } abstract class _NotificationRemoteSettingsEarthquakeRegion implements NotificationRemoteSettingsEarthquakeRegion { - const factory _NotificationRemoteSettingsEarthquakeRegion( - {required final int regionId, - required final JmaForecastIntensity minJmaIntensity, - required final String name}) = - _$NotificationRemoteSettingsEarthquakeRegionImpl; + const factory _NotificationRemoteSettingsEarthquakeRegion({ + required final int regionId, + required final JmaForecastIntensity minJmaIntensity, + required final String name, + }) = _$NotificationRemoteSettingsEarthquakeRegionImpl; factory _NotificationRemoteSettingsEarthquakeRegion.fromJson( - Map json) = - _$NotificationRemoteSettingsEarthquakeRegionImpl.fromJson; + Map json, + ) = _$NotificationRemoteSettingsEarthquakeRegionImpl.fromJson; @override int get regionId; @@ -1035,6 +1136,7 @@ abstract class _NotificationRemoteSettingsEarthquakeRegion @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationRemoteSettingsEarthquakeRegionImplCopyWith< - _$NotificationRemoteSettingsEarthquakeRegionImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationRemoteSettingsEarthquakeRegionImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.g.dart index 0cfe11d9..745036e6 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.g.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.g.dart @@ -9,58 +9,61 @@ part of 'notification_remote_settings_state.dart'; // ************************************************************************** _$NotificationRemoteSettingsStateImpl - _$$NotificationRemoteSettingsStateImplFromJson(Map json) => - $checkedCreate( - r'_$NotificationRemoteSettingsStateImpl', - json, - ($checkedConvert) { - final val = _$NotificationRemoteSettingsStateImpl( - eew: $checkedConvert( - 'eew', - (v) => NotificationRemoteSettingsEew.fromJson( - v as Map)), - earthquake: $checkedConvert( - 'earthquake', - (v) => NotificationRemoteSettingsEarthquake.fromJson( - v as Map)), - ); - return val; - }, - ); +_$$NotificationRemoteSettingsStateImplFromJson(Map json) => + $checkedCreate(r'_$NotificationRemoteSettingsStateImpl', json, ( + $checkedConvert, + ) { + final val = _$NotificationRemoteSettingsStateImpl( + eew: $checkedConvert( + 'eew', + (v) => + NotificationRemoteSettingsEew.fromJson(v as Map), + ), + earthquake: $checkedConvert( + 'earthquake', + (v) => NotificationRemoteSettingsEarthquake.fromJson( + v as Map, + ), + ), + ); + return val; + }); Map _$$NotificationRemoteSettingsStateImplToJson( - _$NotificationRemoteSettingsStateImpl instance) => - { - 'eew': instance.eew, - 'earthquake': instance.earthquake, - }; + _$NotificationRemoteSettingsStateImpl instance, +) => {'eew': instance.eew, 'earthquake': instance.earthquake}; _$NotificationRemoteSettingsEewImpl - _$$NotificationRemoteSettingsEewImplFromJson(Map json) => - $checkedCreate( - r'_$NotificationRemoteSettingsEewImpl', - json, - ($checkedConvert) { - final val = _$NotificationRemoteSettingsEewImpl( - global: $checkedConvert('global', - (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v)), - regions: $checkedConvert( - 'regions', - (v) => (v as List) - .map((e) => NotificationRemoteSettingsEewRegion.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); +_$$NotificationRemoteSettingsEewImplFromJson(Map json) => + $checkedCreate(r'_$NotificationRemoteSettingsEewImpl', json, ( + $checkedConvert, + ) { + final val = _$NotificationRemoteSettingsEewImpl( + global: $checkedConvert( + 'global', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v), + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List) + .map( + (e) => NotificationRemoteSettingsEewRegion.fromJson( + e as Map, + ), + ) + .toList(), + ), + ); + return val; + }); Map _$$NotificationRemoteSettingsEewImplToJson( - _$NotificationRemoteSettingsEewImpl instance) => - { - 'global': _$JmaForecastIntensityEnumMap[instance.global], - 'regions': instance.regions, - }; + _$NotificationRemoteSettingsEewImpl instance, +) => { + 'global': _$JmaForecastIntensityEnumMap[instance.global], + 'regions': instance.regions, +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', @@ -77,90 +80,95 @@ const _$JmaForecastIntensityEnumMap = { }; _$NotificationRemoteSettingsEewRegionImpl - _$$NotificationRemoteSettingsEewRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationRemoteSettingsEewRegionImpl', - json, - ($checkedConvert) { - final val = _$NotificationRemoteSettingsEewRegionImpl( - regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), - minJmaIntensity: $checkedConvert('min_jma_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - name: $checkedConvert('name', (v) => v as String), - ); - return val; - }, - fieldKeyMap: const { - 'regionId': 'region_id', - 'minJmaIntensity': 'min_jma_intensity' - }, +_$$NotificationRemoteSettingsEewRegionImplFromJson(Map json) => + $checkedCreate( + r'_$NotificationRemoteSettingsEewRegionImpl', + json, + ($checkedConvert) { + final val = _$NotificationRemoteSettingsEewRegionImpl( + regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), + minJmaIntensity: $checkedConvert( + 'min_jma_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + name: $checkedConvert('name', (v) => v as String), ); + return val; + }, + fieldKeyMap: const { + 'regionId': 'region_id', + 'minJmaIntensity': 'min_jma_intensity', + }, + ); Map _$$NotificationRemoteSettingsEewRegionImplToJson( - _$NotificationRemoteSettingsEewRegionImpl instance) => - { - 'region_id': instance.regionId, - 'min_jma_intensity': - _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, - 'name': instance.name, - }; + _$NotificationRemoteSettingsEewRegionImpl instance, +) => { + 'region_id': instance.regionId, + 'min_jma_intensity': _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, + 'name': instance.name, +}; _$NotificationRemoteSettingsEarthquakeImpl - _$$NotificationRemoteSettingsEarthquakeImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationRemoteSettingsEarthquakeImpl', - json, - ($checkedConvert) { - final val = _$NotificationRemoteSettingsEarthquakeImpl( - global: $checkedConvert('global', - (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v)), - regions: $checkedConvert( - 'regions', - (v) => (v as List) - .map((e) => - NotificationRemoteSettingsEarthquakeRegion.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); +_$$NotificationRemoteSettingsEarthquakeImplFromJson( + Map json, +) => $checkedCreate(r'_$NotificationRemoteSettingsEarthquakeImpl', json, ( + $checkedConvert, +) { + final val = _$NotificationRemoteSettingsEarthquakeImpl( + global: $checkedConvert( + 'global', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v), + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List) + .map( + (e) => NotificationRemoteSettingsEarthquakeRegion.fromJson( + e as Map, + ), + ) + .toList(), + ), + ); + return val; +}); Map _$$NotificationRemoteSettingsEarthquakeImplToJson( - _$NotificationRemoteSettingsEarthquakeImpl instance) => - { - 'global': _$JmaForecastIntensityEnumMap[instance.global], - 'regions': instance.regions, - }; + _$NotificationRemoteSettingsEarthquakeImpl instance, +) => { + 'global': _$JmaForecastIntensityEnumMap[instance.global], + 'regions': instance.regions, +}; _$NotificationRemoteSettingsEarthquakeRegionImpl - _$$NotificationRemoteSettingsEarthquakeRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationRemoteSettingsEarthquakeRegionImpl', - json, - ($checkedConvert) { - final val = _$NotificationRemoteSettingsEarthquakeRegionImpl( - regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), - minJmaIntensity: $checkedConvert('min_jma_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - name: $checkedConvert('name', (v) => v as String), - ); - return val; - }, - fieldKeyMap: const { - 'regionId': 'region_id', - 'minJmaIntensity': 'min_jma_intensity' - }, - ); +_$$NotificationRemoteSettingsEarthquakeRegionImplFromJson( + Map json, +) => $checkedCreate( + r'_$NotificationRemoteSettingsEarthquakeRegionImpl', + json, + ($checkedConvert) { + final val = _$NotificationRemoteSettingsEarthquakeRegionImpl( + regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), + minJmaIntensity: $checkedConvert( + 'min_jma_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + name: $checkedConvert('name', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'regionId': 'region_id', + 'minJmaIntensity': 'min_jma_intensity', + }, +); Map _$$NotificationRemoteSettingsEarthquakeRegionImplToJson( - _$NotificationRemoteSettingsEarthquakeRegionImpl instance) => - { - 'region_id': instance.regionId, - 'min_jma_intensity': - _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, - 'name': instance.name, - }; + _$NotificationRemoteSettingsEarthquakeRegionImpl instance, +) => { + 'region_id': instance.regionId, + 'min_jma_intensity': _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, + 'name': instance.name, +}; diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.dart b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.dart index ae04dafe..9219d2b8 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.dart @@ -12,8 +12,9 @@ class NotificationRemoteSettingsNotifier extends _$NotificationRemoteSettingsNotifier { @override Future build() async { - final savedState = - ref.watch(notificationRemoteSettingsSavedStateNotifierProvider.future); + final savedState = ref.watch( + notificationRemoteSettingsSavedStateNotifierProvider.future, + ); return savedState; } @@ -80,9 +81,10 @@ class NotificationRemoteSettingsNotifier } Future save() async { - final savedState = ref - .read(notificationRemoteSettingsSavedStateNotifierProvider) - .valueOrNull; + final savedState = + ref + .read(notificationRemoteSettingsSavedStateNotifierProvider) + .valueOrNull; if (savedState == null) { throw Exception('Saved state is null'); } @@ -94,22 +96,22 @@ class NotificationRemoteSettingsNotifier .read(notificationRemoteSettingsSavedStateNotifierProvider.notifier) .updateEarthquake( request: NotificationSettingsRequest( - global: global != null - ? NotificationSettingsGlobal( - minJmaIntensity: global, - ) - : null, - regions: value.earthquake.regions - .where( - (r) => global == null || r.minJmaIntensity < global, - ) - .map( - (r) => NotificationSettingsRegion( - code: r.regionId, - minIntensity: r.minJmaIntensity, - ), - ) - .toList(), + global: + global != null + ? NotificationSettingsGlobal(minJmaIntensity: global) + : null, + regions: + value.earthquake.regions + .where( + (r) => global == null || r.minJmaIntensity < global, + ) + .map( + (r) => NotificationSettingsRegion( + code: r.regionId, + minIntensity: r.minJmaIntensity, + ), + ) + .toList(), ), ); } else { @@ -125,19 +127,19 @@ class NotificationRemoteSettingsNotifier .read(notificationRemoteSettingsSavedStateNotifierProvider.notifier) .updateEew( request: NotificationSettingsRequest( - global: global != null - ? NotificationSettingsGlobal( - minJmaIntensity: global, - ) - : null, - regions: value.eew.regions - .map( - (r) => NotificationSettingsRegion( - code: r.regionId, - minIntensity: r.minJmaIntensity, - ), - ) - .toList(), + global: + global != null + ? NotificationSettingsGlobal(minJmaIntensity: global) + : null, + regions: + value.eew.regions + .map( + (r) => NotificationSettingsRegion( + code: r.regionId, + minIntensity: r.minJmaIntensity, + ), + ) + .toList(), ), ); } else { diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.g.dart index a4e70536..cde54eb3 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.g.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.g.dart @@ -14,18 +14,20 @@ String _$notificationRemoteSettingsNotifierHash() => /// See also [NotificationRemoteSettingsNotifier]. @ProviderFor(NotificationRemoteSettingsNotifier) final notificationRemoteSettingsNotifierProvider = AsyncNotifierProvider< - NotificationRemoteSettingsNotifier, - NotificationRemoteSettingsState>.internal( + NotificationRemoteSettingsNotifier, + NotificationRemoteSettingsState +>.internal( NotificationRemoteSettingsNotifier.new, name: r'notificationRemoteSettingsNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationRemoteSettingsNotifierHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationRemoteSettingsNotifierHash, dependencies: null, allTransitiveDependencies: null, ); -typedef _$NotificationRemoteSettingsNotifier - = AsyncNotifier; +typedef _$NotificationRemoteSettingsNotifier = + AsyncNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart index ccb86449..f386cbd9 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart @@ -12,9 +12,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'notification_remote_settings_saved_state.g.dart'; @riverpod -bool notificationRemoteSettingsHasChangedFromSavedState( - Ref ref, -) => +bool notificationRemoteSettingsHasChangedFromSavedState(Ref ref) => ref.watch(notificationRemoteSettingsSavedStateNotifierProvider) != ref.watch(notificationRemoteSettingsNotifierProvider); @@ -28,9 +26,7 @@ class NotificationRemoteSettingsSavedStateNotifier try { token = await ref.read(apiAuthenticationNotifierProvider.future); } on Exception catch (e) { - throw UnauthorizedException( - innerException: e, - ); + throw UnauthorizedException(innerException: e); } final response = await api.auth.getNotificationSettings( authorization: 'Bearer $token', @@ -61,23 +57,20 @@ class NotificationRemoteSettingsSavedStateNotifier value.copyWith( earthquake: NotificationRemoteSettingsEarthquake( global: request.global?.minJmaIntensity, - regions: request.regions - ?.map( - (r) { - final prefectureName = - areaInformationPrefectureEarthquake.nameFindByCode( - r.code, - ); - if (prefectureName == null) { - return null; - } - return NotificationRemoteSettingsEarthquakeRegion( - minJmaIntensity: r.minIntensity, - regionId: r.code, - name: prefectureName, - ); - }, - ) + regions: + request.regions + ?.map((r) { + final prefectureName = areaInformationPrefectureEarthquake + .nameFindByCode(r.code); + if (prefectureName == null) { + return null; + } + return NotificationRemoteSettingsEarthquakeRegion( + minJmaIntensity: r.minIntensity, + regionId: r.code, + name: prefectureName, + ); + }) .nonNulls .toList() ?? [], @@ -87,9 +80,7 @@ class NotificationRemoteSettingsSavedStateNotifier } } - Future updateEew({ - required NotificationSettingsRequest request, - }) async { + Future updateEew({required NotificationSettingsRequest request}) async { final token = await ref.read(apiAuthenticationNotifierProvider.future); if (token == null) { throw UnauthorizedException(); @@ -109,22 +100,21 @@ class NotificationRemoteSettingsSavedStateNotifier value.copyWith( eew: NotificationRemoteSettingsEew( global: request.global?.minJmaIntensity, - regions: request.regions - ?.map( - (r) { - final regionName = areaForecastLocalEew.nameFindByCode( - r.code, - ); - if (regionName == null) { - return null; - } - return NotificationRemoteSettingsEewRegion( - minJmaIntensity: r.minIntensity, - regionId: r.code, - name: regionName, - ); - }, - ) + regions: + request.regions + ?.map((r) { + final regionName = areaForecastLocalEew.nameFindByCode( + r.code, + ); + if (regionName == null) { + return null; + } + return NotificationRemoteSettingsEewRegion( + minJmaIntensity: r.minIntensity, + regionId: r.code, + name: regionName, + ); + }) .nonNulls .toList() ?? [], @@ -144,59 +134,59 @@ class NotificationRemoteSettingsSavedStateNotifier return NotificationRemoteSettingsState( earthquake: NotificationRemoteSettingsEarthquake( - global: response.earthquake - .firstWhereOrNull((r) => r.regionId == 0) - ?.minJmaIntensity, - regions: response.earthquake - .where((r) => r.regionId != 0) - .map( - (r) { - final prefecture = areaInformationPrefectureEarthquake - .nameFindByCode(r.regionId); - if (prefecture == null) { - return null; - } - return NotificationRemoteSettingsEarthquakeRegion( - regionId: r.regionId, - minJmaIntensity: r.minJmaIntensity, - name: prefecture, - ); - }, - ) - .nonNulls - .toList(), + global: + response.earthquake + .firstWhereOrNull((r) => r.regionId == 0) + ?.minJmaIntensity, + regions: + response.earthquake + .where((r) => r.regionId != 0) + .map((r) { + final prefecture = areaInformationPrefectureEarthquake + .nameFindByCode(r.regionId); + if (prefecture == null) { + return null; + } + return NotificationRemoteSettingsEarthquakeRegion( + regionId: r.regionId, + minJmaIntensity: r.minJmaIntensity, + name: prefecture, + ); + }) + .nonNulls + .toList(), ), eew: NotificationRemoteSettingsEew( - global: response.eew - .firstWhereOrNull((r) => r.regionId == 0) - ?.minJmaIntensity, - regions: response.eew - .where((r) => r.regionId != 0) - .map( - (r) { - final region = areaForecastLocalEew.nameFindByCode(r.regionId); - if (region == null) { - return null; - } - - return NotificationRemoteSettingsEewRegion( - regionId: r.regionId, - minJmaIntensity: r.minJmaIntensity, - name: region, - ); - }, - ) - .nonNulls - .toList(), + global: + response.eew + .firstWhereOrNull((r) => r.regionId == 0) + ?.minJmaIntensity, + regions: + response.eew + .where((r) => r.regionId != 0) + .map((r) { + final region = areaForecastLocalEew.nameFindByCode( + r.regionId, + ); + if (region == null) { + return null; + } + + return NotificationRemoteSettingsEewRegion( + regionId: r.regionId, + minJmaIntensity: r.minJmaIntensity, + name: region, + ); + }) + .nonNulls + .toList(), ), ); } } class UnauthorizedException implements Exception { - UnauthorizedException({ - this.innerException, - }); + UnauthorizedException({this.innerException}); final Exception? innerException; } diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.g.dart index c7cc7daf..8288ba25 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.g.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.g.dart @@ -15,37 +15,41 @@ String _$notificationRemoteSettingsHasChangedFromSavedStateHash() => @ProviderFor(notificationRemoteSettingsHasChangedFromSavedState) final notificationRemoteSettingsHasChangedFromSavedStateProvider = AutoDisposeProvider.internal( - notificationRemoteSettingsHasChangedFromSavedState, - name: r'notificationRemoteSettingsHasChangedFromSavedStateProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationRemoteSettingsHasChangedFromSavedStateHash, - dependencies: null, - allTransitiveDependencies: null, -); + notificationRemoteSettingsHasChangedFromSavedState, + name: r'notificationRemoteSettingsHasChangedFromSavedStateProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationRemoteSettingsHasChangedFromSavedStateHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef NotificationRemoteSettingsHasChangedFromSavedStateRef - = AutoDisposeProviderRef; +typedef NotificationRemoteSettingsHasChangedFromSavedStateRef = + AutoDisposeProviderRef; String _$notificationRemoteSettingsSavedStateNotifierHash() => r'025f0ceee184a458195f2fc5ed2a87e8c80efea4'; /// See also [NotificationRemoteSettingsSavedStateNotifier]. @ProviderFor(NotificationRemoteSettingsSavedStateNotifier) final notificationRemoteSettingsSavedStateNotifierProvider = - AsyncNotifierProvider.internal( - NotificationRemoteSettingsSavedStateNotifier.new, - name: r'notificationRemoteSettingsSavedStateNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationRemoteSettingsSavedStateNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$NotificationRemoteSettingsSavedStateNotifier - = AsyncNotifier; + AsyncNotifierProvider< + NotificationRemoteSettingsSavedStateNotifier, + NotificationRemoteSettingsState + >.internal( + NotificationRemoteSettingsSavedStateNotifier.new, + name: r'notificationRemoteSettingsSavedStateNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationRemoteSettingsSavedStateNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); + +typedef _$NotificationRemoteSettingsSavedStateNotifier = + AsyncNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/service/fcm_token_change_detector.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/service/fcm_token_change_detector.g.dart index b2520e22..21e8cfcf 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/service/fcm_token_change_detector.g.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/service/fcm_token_change_detector.g.dart @@ -15,14 +15,15 @@ String _$fcmTokenChangeDetectorHash() => @ProviderFor(FcmTokenChangeDetector) final fcmTokenChangeDetectorProvider = AsyncNotifierProvider.internal( - FcmTokenChangeDetector.new, - name: r'fcmTokenChangeDetectorProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$fcmTokenChangeDetectorHash, - dependencies: null, - allTransitiveDependencies: null, -); + FcmTokenChangeDetector.new, + name: r'fcmTokenChangeDetectorProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$fcmTokenChangeDetectorHash, + dependencies: null, + allTransitiveDependencies: null, + ); typedef _$FcmTokenChangeDetector = AsyncNotifier; // ignore_for_file: type=lint diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.dart b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.dart index 5c75aeb6..4808bf4d 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.dart @@ -11,30 +11,28 @@ part 'notification_remote_authentication_service.g.dart'; @Riverpod(keepAlive: true) NotificationRemoteAuthenticationService notificationRemoteAuthenticateService( Ref ref, -) => - NotificationRemoteAuthenticationService( - api: ref.watch(eqApiProvider), - apiAuthenticationService: - ref.watch(apiAuthenticationNotifierProvider.notifier), - ref: ref, - ); +) => NotificationRemoteAuthenticationService( + api: ref.watch(eqApiProvider), + apiAuthenticationService: ref.watch( + apiAuthenticationNotifierProvider.notifier, + ), + ref: ref, +); class NotificationRemoteAuthenticationService { NotificationRemoteAuthenticationService({ required EqApi api, required ApiAuthenticationNotifier apiAuthenticationService, required Ref ref, - }) : _api = api, - _apiAuthenticationService = apiAuthenticationService, - _ref = ref; + }) : _api = api, + _apiAuthenticationService = apiAuthenticationService, + _ref = ref; final EqApi _api; final ApiAuthenticationNotifier _apiAuthenticationService; final Ref _ref; - Future authenticate({ - required String fcmToken, - }) async { + Future authenticate({required String fcmToken}) async { final result = await _api.auth.register( request: FcmTokenRequest(fcmToken: fcmToken), ); @@ -47,18 +45,15 @@ class NotificationRemoteAuthenticationService { return; } - Future updateToken({ - required String fcmToken, - }) async { - final authorization = - await _ref.read(apiAuthenticationNotifierProvider.future); + Future updateToken({required String fcmToken}) async { + final authorization = await _ref.read( + apiAuthenticationNotifierProvider.future, + ); if (authorization == null) { throw UnauthorizedException(); } final result = await _api.auth.update( - request: FcmTokenRequest( - fcmToken: fcmToken, - ), + request: FcmTokenRequest(fcmToken: fcmToken), authorization: authorization, ); return result.data; diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.g.dart index 39cd040b..37c7905f 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.g.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.g.dart @@ -15,18 +15,19 @@ String _$notificationRemoteAuthenticateServiceHash() => @ProviderFor(notificationRemoteAuthenticateService) final notificationRemoteAuthenticateServiceProvider = Provider.internal( - notificationRemoteAuthenticateService, - name: r'notificationRemoteAuthenticateServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationRemoteAuthenticateServiceHash, - dependencies: null, - allTransitiveDependencies: null, -); + notificationRemoteAuthenticateService, + name: r'notificationRemoteAuthenticateServiceProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationRemoteAuthenticateServiceHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef NotificationRemoteAuthenticateServiceRef - = ProviderRef; +typedef NotificationRemoteAuthenticateServiceRef = + ProviderRef; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.dart b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.dart index e4eb5462..3fbe1948 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.dart @@ -20,8 +20,9 @@ class NotificationRemoteSettingsInitialSetupNotifier // 既にmigrate済みかどうかを確認 final isMigrated = _getIsMigrated(); // Tokenを持っているかどうか確認 - final authorization = - await ref.read(apiAuthenticationNotifierProvider.future); + final authorization = await ref.read( + apiAuthenticationNotifierProvider.future, + ); if (isMigrated && authorization != null) { yield NotificationRemoteSettingsSetupState.completed; log( @@ -41,8 +42,9 @@ class NotificationRemoteSettingsInitialSetupNotifier ); } yield NotificationRemoteSettingsSetupState.registering; - final authenticateService = - ref.watch(notificationRemoteAuthenticateServiceProvider); + final authenticateService = ref.watch( + notificationRemoteAuthenticateServiceProvider, + ); await authenticateService.authenticate(fcmToken: fcmToken); yield NotificationRemoteSettingsSetupState.migrating; @@ -94,7 +96,6 @@ enum NotificationRemoteSettingsSetupState { unsubscribingOldTopics, completing, completed, - ; } class NotificationRemoteSettingsSetupException implements Exception { diff --git a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.g.dart index a3982e23..a5c57a6c 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.g.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_settings_migrate_service.g.dart @@ -14,18 +14,21 @@ String _$notificationRemoteSettingsInitialSetupNotifierHash() => /// See also [NotificationRemoteSettingsInitialSetupNotifier]. @ProviderFor(NotificationRemoteSettingsInitialSetupNotifier) final notificationRemoteSettingsInitialSetupNotifierProvider = - StreamNotifierProvider.internal( - NotificationRemoteSettingsInitialSetupNotifier.new, - name: r'notificationRemoteSettingsInitialSetupNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$notificationRemoteSettingsInitialSetupNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); + StreamNotifierProvider< + NotificationRemoteSettingsInitialSetupNotifier, + NotificationRemoteSettingsSetupState + >.internal( + NotificationRemoteSettingsInitialSetupNotifier.new, + name: r'notificationRemoteSettingsInitialSetupNotifierProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$notificationRemoteSettingsInitialSetupNotifierHash, + dependencies: null, + allTransitiveDependencies: null, + ); -typedef _$NotificationRemoteSettingsInitialSetupNotifier - = StreamNotifier; +typedef _$NotificationRemoteSettingsInitialSetupNotifier = + StreamNotifier; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/settings/features/notification_remote_settings/ui/components/earthquake_status_widget.dart b/app/lib/feature/settings/features/notification_remote_settings/ui/components/earthquake_status_widget.dart index 45335c56..1083c46e 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/ui/components/earthquake_status_widget.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/ui/components/earthquake_status_widget.dart @@ -52,10 +52,7 @@ class EarthquakeStatusWidget extends StatelessWidget { } class EarthquakeNotificationStatusText extends StatelessWidget { - const EarthquakeNotificationStatusText({ - required this.earthquake, - super.key, - }); + const EarthquakeNotificationStatusText({required this.earthquake, super.key}); final NotificationRemoteSettingsEarthquake earthquake; @@ -71,58 +68,48 @@ class EarthquakeNotificationStatusText extends StatelessWidget { } return Text.rich( TextSpan( - children: (earthquake.global == JmaForecastIntensity.zero) - ? [ - const TextSpan( - text: 'すべての地震情報を通知します', - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ] - : [ - const TextSpan( - text: '以下の条件のいずれかを満たした時に通知します\n', - style: TextStyle(fontWeight: FontWeight.bold), - ), - if (earthquake.global != null) ...[ + children: + (earthquake.global == JmaForecastIntensity.zero) + ? [ const TextSpan( - text: '・任意の地域で', - ), - TextSpan( - text: '震度' - '${earthquake.global!.type.fromPlusMinus}' - '${earthquake.global != JmaForecastIntensity.seven ? "以上" : ""}', - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + text: 'すべての地震情報を通知します', + style: TextStyle(fontWeight: FontWeight.bold), ), + ] + : [ const TextSpan( - text: 'を観測', + text: '以下の条件のいずれかを満たした時に通知します\n', + style: TextStyle(fontWeight: FontWeight.bold), ), - ], - if (enabledRegions.isNotEmpty) - ...enabledRegions - .mapIndexed( - (index, region) => [ - TextSpan( - text: '\n・${region.name}で', - ), - TextSpan( - text: - '震度${region.minJmaIntensity.type.fromPlusMinus}' - '${region.minJmaIntensity != JmaForecastIntensity.seven ? "以上" : ""}', - style: const TextStyle( - fontWeight: FontWeight.bold, + if (earthquake.global != null) ...[ + const TextSpan(text: '・任意の地域で'), + TextSpan( + text: + '震度' + '${earthquake.global!.type.fromPlusMinus}' + '${earthquake.global != JmaForecastIntensity.seven ? "以上" : ""}', + style: const TextStyle(fontWeight: FontWeight.bold), + ), + const TextSpan(text: 'を観測'), + ], + if (enabledRegions.isNotEmpty) + ...enabledRegions + .mapIndexed( + (index, region) => [ + TextSpan(text: '\n・${region.name}で'), + TextSpan( + text: + '震度${region.minJmaIntensity.type.fromPlusMinus}' + '${region.minJmaIntensity != JmaForecastIntensity.seven ? "以上" : ""}', + style: const TextStyle( + fontWeight: FontWeight.bold, + ), ), - ), - const TextSpan( - text: 'を観測', - ), - ], - ) - .flattened, - ], + const TextSpan(text: 'を観測'), + ], + ) + .flattened, + ], ), ); } diff --git a/app/lib/feature/settings/features/notification_remote_settings/ui/components/eew_status_widget.dart b/app/lib/feature/settings/features/notification_remote_settings/ui/components/eew_status_widget.dart index 8d0e375a..6369b90e 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/ui/components/eew_status_widget.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/ui/components/eew_status_widget.dart @@ -6,11 +6,7 @@ import 'package:eqmonitor/feature/settings/features/notification_remote_settings import 'package:flutter/material.dart'; class EewStatusWidget extends StatelessWidget { - const EewStatusWidget({ - required this.eew, - required this.action, - super.key, - }); + const EewStatusWidget({required this.eew, required this.action, super.key}); final NotificationRemoteSettingsEew eew; final void Function() action; @@ -52,10 +48,7 @@ class EewStatusWidget extends StatelessWidget { } class EewNotificationStatusWidget extends StatelessWidget { - const EewNotificationStatusWidget({ - required this.eew, - super.key, - }); + const EewNotificationStatusWidget({required this.eew, super.key}); final NotificationRemoteSettingsEew eew; @@ -70,58 +63,48 @@ class EewNotificationStatusWidget extends StatelessWidget { } return Text.rich( TextSpan( - children: (eew.global == JmaForecastIntensity.zero) - ? [ - const TextSpan( - text: 'すべての緊急地震速報を通知します', - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ] - : [ - const TextSpan( - text: '以下の条件のいずれかを満たした時に通知します\n', - style: TextStyle(fontWeight: FontWeight.bold), - ), - if (eew.global != null) ...[ + children: + (eew.global == JmaForecastIntensity.zero) + ? [ const TextSpan( - text: '・任意の地域で', - ), - TextSpan( - text: '震度' - '${eew.global!.type.fromPlusMinus}' - '${eew.global != JmaForecastIntensity.seven ? "以上" : ""}', - style: const TextStyle( - fontWeight: FontWeight.bold, - ), + text: 'すべての緊急地震速報を通知します', + style: TextStyle(fontWeight: FontWeight.bold), ), + ] + : [ const TextSpan( - text: 'が予想', + text: '以下の条件のいずれかを満たした時に通知します\n', + style: TextStyle(fontWeight: FontWeight.bold), ), - ], - if (enabledRegions.isNotEmpty) - ...enabledRegions - .mapIndexed( - (index, region) => [ - TextSpan( - text: '\n・${region.name}で', - ), - TextSpan( - text: - '震度${region.minJmaIntensity.type.fromPlusMinus}' - '${region.minJmaIntensity != JmaForecastIntensity.seven ? "以上" : ""}', - style: const TextStyle( - fontWeight: FontWeight.bold, + if (eew.global != null) ...[ + const TextSpan(text: '・任意の地域で'), + TextSpan( + text: + '震度' + '${eew.global!.type.fromPlusMinus}' + '${eew.global != JmaForecastIntensity.seven ? "以上" : ""}', + style: const TextStyle(fontWeight: FontWeight.bold), + ), + const TextSpan(text: 'が予想'), + ], + if (enabledRegions.isNotEmpty) + ...enabledRegions + .mapIndexed( + (index, region) => [ + TextSpan(text: '\n・${region.name}で'), + TextSpan( + text: + '震度${region.minJmaIntensity.type.fromPlusMinus}' + '${region.minJmaIntensity != JmaForecastIntensity.seven ? "以上" : ""}', + style: const TextStyle( + fontWeight: FontWeight.bold, + ), ), - ), - const TextSpan( - text: 'が予想', - ), - ], - ) - .flattened, - ], + const TextSpan(text: 'が予想'), + ], + ) + .flattened, + ], ), ); } diff --git a/app/lib/feature/settings/features/notification_remote_settings/ui/notification_remote_settings_page.dart b/app/lib/feature/settings/features/notification_remote_settings/ui/notification_remote_settings_page.dart index 51e20a7d..150ff9e4 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/ui/notification_remote_settings_page.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/ui/notification_remote_settings_page.dart @@ -22,11 +22,9 @@ Future _save( () async => notifier.save(), ); if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('通知条件を保存しました'), - ), - ); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('通知条件を保存しました'))); } } @@ -35,27 +33,27 @@ class NotificationRemoteSettingsPage extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final hasChanged = - ref.watch(notificationRemoteSettingsHasChangedFromSavedStateProvider); - final initialSetup = - ref.watch(notificationRemoteSettingsInitialSetupNotifierProvider); + final hasChanged = ref.watch( + notificationRemoteSettingsHasChangedFromSavedStateProvider, + ); + final initialSetup = ref.watch( + notificationRemoteSettingsInitialSetupNotifierProvider, + ); if (initialSetup case AsyncLoading()) { return const Scaffold( - body: Center( - child: CircularProgressIndicator.adaptive(), - ), + body: Center(child: CircularProgressIndicator.adaptive()), ); } if (initialSetup case AsyncError(:final error)) { return Scaffold( - appBar: AppBar( - title: const Text('通知条件設定'), - ), + appBar: AppBar(title: const Text('通知条件設定')), body: ErrorCard( error: error, - onReload: () async => ref - .refresh(notificationRemoteSettingsInitialSetupNotifierProvider), + onReload: + () async => ref.refresh( + notificationRemoteSettingsInitialSetupNotifierProvider, + ), ), ); } @@ -74,42 +72,42 @@ class NotificationRemoteSettingsPage extends HookConsumerWidget { ); final _ = switch (result) { OkCancelResult.cancel => () { - if (context.mounted) { - ref.invalidate(notificationRemoteSettingsNotifierProvider); - Navigator.of(context).pop(); - } - }(), + if (context.mounted) { + ref.invalidate(notificationRemoteSettingsNotifierProvider); + Navigator.of(context).pop(); + } + }(), OkCancelResult.ok => () async { - final notifier = ref - .read(notificationRemoteSettingsNotifierProvider.notifier); - await _save(context, notifier); - if (context.mounted) { - ref.invalidate(notificationRemoteSettingsNotifierProvider); - Navigator.of(context).pop(); - } - }(), + final notifier = ref.read( + notificationRemoteSettingsNotifierProvider.notifier, + ); + await _save(context, notifier); + if (context.mounted) { + ref.invalidate(notificationRemoteSettingsNotifierProvider); + Navigator.of(context).pop(); + } + }(), }; } }, child: Scaffold( - appBar: AppBar( - title: const Text('通知条件設定'), - ), + appBar: AppBar(title: const Text('通知条件設定')), body: const _Body(), - floatingActionButton: hasChanged - ? FloatingActionButton.extended( - heroTag: 'save', - onPressed: () async { - final notifier = ref.read( - notificationRemoteSettingsNotifierProvider.notifier, - ); - await _save(context, notifier); - ref.invalidate(notificationRemoteSettingsNotifierProvider); - }, - label: const Text('保存する'), - icon: const Icon(Icons.save), - ) - : null, + floatingActionButton: + hasChanged + ? FloatingActionButton.extended( + heroTag: 'save', + onPressed: () async { + final notifier = ref.read( + notificationRemoteSettingsNotifierProvider.notifier, + ); + await _save(context, notifier); + ref.invalidate(notificationRemoteSettingsNotifierProvider); + }, + label: const Text('保存する'), + icon: const Icon(Icons.save), + ) + : null, ), ); } @@ -124,39 +122,31 @@ class _Body extends ConsumerWidget { return switch (state) { AsyncError(:final error) => ErrorCard( - error: error, - onReload: () async => - ref.refresh(notificationRemoteSettingsNotifierProvider), - ), - AsyncData(:final value) => _Data( - state: value, - ), + error: error, + onReload: + () async => ref.refresh(notificationRemoteSettingsNotifierProvider), + ), + AsyncData(:final value) => _Data(state: value), _ => const Center( - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Center( - child: CircularProgressIndicator.adaptive(), - ), - SizedBox(height: 16), - Text( - '設定を読み込んでいます...', - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ], - ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center(child: CircularProgressIndicator.adaptive()), + SizedBox(height: 16), + Text( + '設定を読み込んでいます...', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], ), + ), }; } } class _Data extends StatelessWidget { - const _Data({ - required this.state, - }); + const _Data({required this.state}); final NotificationRemoteSettingsState state; @@ -168,14 +158,15 @@ class _Data extends StatelessWidget { children: [ EarthquakeStatusWidget( earthquake: state.earthquake, - action: () async => - const NotificationEarthquakeRoute().push(context), + action: + () async => + const NotificationEarthquakeRoute().push(context), ), const SizedBox(height: 16), EewStatusWidget( eew: state.eew, - action: () async => - const NotificationEewRoute().push(context), + action: + () async => const NotificationEewRoute().push(context), ), ], ), diff --git a/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_earthquake_page.dart b/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_earthquake_page.dart index c19c309d..447e52d4 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_earthquake_page.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_earthquake_page.dart @@ -17,35 +17,27 @@ class NotificationRemoteSettingsEarthquakePage extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final state = ref - .watch(notificationRemoteSettingsNotifierProvider) - .valueOrNull - ?.earthquake; + final state = + ref + .watch(notificationRemoteSettingsNotifierProvider) + .valueOrNull + ?.earthquake; if (state == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); + return const Center(child: CircularProgressIndicator.adaptive()); } return Scaffold( - appBar: AppBar( - title: const Text('地震情報の通知条件設定'), - ), - body: _Body( - state: state, - ), - floatingActionButton: (state.global != JmaForecastIntensity.zero) - ? _AddRegionFloatingActionButton( - regions: state.regions, - ) - : null, + appBar: AppBar(title: const Text('地震情報の通知条件設定')), + body: _Body(state: state), + floatingActionButton: + (state.global != JmaForecastIntensity.zero) + ? _AddRegionFloatingActionButton(regions: state.regions) + : null, ); } } class _Body extends HookConsumerWidget { - const _Body({ - required this.state, - }); + const _Body({required this.state}); final NotificationRemoteSettingsEarthquake state; @@ -54,43 +46,35 @@ class _Body extends HookConsumerWidget { final colorScheme = Theme.of(context).colorScheme; final statusWidget = switch ((state.global, state.regions)) { (null, []) => BorderedContainer( - accentColor: colorScheme.errorContainer, - child: Row( - children: [ - Icon( - Icons.error, - color: colorScheme.onErrorContainer, - ), - const SizedBox(width: 8), - Expanded( - child: Text( - '地震情報の通知は行いません', - style: TextStyle( - fontWeight: FontWeight.bold, - color: colorScheme.onErrorContainer, - ), + accentColor: colorScheme.errorContainer, + child: Row( + children: [ + Icon(Icons.error, color: colorScheme.onErrorContainer), + const SizedBox(width: 8), + Expanded( + child: Text( + '地震情報の通知は行いません', + style: TextStyle( + fontWeight: FontWeight.bold, + color: colorScheme.onErrorContainer, ), ), - ], - ), + ), + ], ), + ), (_, _) => BorderedContainer( - accentColor: colorScheme.secondaryContainer, - child: Row( - children: [ - Icon( - Icons.check_circle, - color: colorScheme.onSecondaryContainer, - ), - const SizedBox(width: 8), - Expanded( - child: EarthquakeNotificationStatusText( - earthquake: state, - ), - ), - ], - ), + accentColor: colorScheme.secondaryContainer, + child: Row( + children: [ + Icon(Icons.check_circle, color: colorScheme.onSecondaryContainer), + const SizedBox(width: 8), + Expanded( + child: EarthquakeNotificationStatusText(earthquake: state), + ), + ], ), + ), }; return SingleChildScrollView( @@ -103,19 +87,21 @@ class _Body extends HookConsumerWidget { AnimatedSwitcher( duration: const Duration(milliseconds: 200), - child: (state.global != JmaForecastIntensity.zero) - ? KeyedSubtree( - key: ValueKey(state.global == JmaForecastIntensity.zero), - child: _RegionsChoiceView( - regions: state.regions - .sorted((a, b) => a.regionId.compareTo(b.regionId)) - .toList(), - global: state.global, - ), - ) - : const SizedBox.shrink( - key: ValueKey(true), - ), + child: + (state.global != JmaForecastIntensity.zero) + ? KeyedSubtree( + key: ValueKey(state.global == JmaForecastIntensity.zero), + child: _RegionsChoiceView( + regions: + state.regions + .sorted( + (a, b) => a.regionId.compareTo(b.regionId), + ) + .toList(), + global: state.global, + ), + ) + : const SizedBox.shrink(key: ValueKey(true)), ), // FABと重ならないようにするため const SizedBox(height: 120), @@ -126,9 +112,7 @@ class _Body extends HookConsumerWidget { } class _GlobalChoiceTile extends ConsumerWidget { - const _GlobalChoiceTile({ - required this.global, - }); + const _GlobalChoiceTile({required this.global}); final JmaForecastIntensity? global; @@ -137,24 +121,20 @@ class _GlobalChoiceTile extends ConsumerWidget { return ListTile( title: const Text( '全国の地震情報', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), subtitle: const Text('いずれかの地域で指定した震度を観測した場合に通知します'), trailing: DropdownButton( borderRadius: BorderRadius.circular(16), elevation: 1, value: global, - onChanged: (value) => ref - .read(notificationRemoteSettingsNotifierProvider.notifier) - .updateEarthquakeGlobal(value), - items: JmaForecastIntensity.values - .whereNot( - (e) => [ - JmaForecastIntensity.unknown, - ].contains(e), - ) + onChanged: + (value) => ref + .read(notificationRemoteSettingsNotifierProvider.notifier) + .updateEarthquakeGlobal(value), + items: + JmaForecastIntensity.values + .whereNot((e) => [JmaForecastIntensity.unknown].contains(e)) .map( (e) => DropdownMenuItem( value: e, @@ -167,21 +147,14 @@ class _GlobalChoiceTile extends ConsumerWidget { ), ) .toList() + - [ - const DropdownMenuItem( - child: Text('通知しない'), - ), - ], + [const DropdownMenuItem(child: Text('通知しない'))], ), ); } } class _RegionsChoiceView extends ConsumerWidget { - const _RegionsChoiceView({ - required this.regions, - required this.global, - }); + const _RegionsChoiceView({required this.regions, required this.global}); final List regions; final JmaForecastIntensity? global; @@ -194,9 +167,7 @@ class _RegionsChoiceView extends ConsumerWidget { visualDensity: VisualDensity.compact, title: Text( '地域ごとの地震情報', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), subtitle: Text('各地域で指定した震度を観測した場合に通知します'), ), @@ -207,9 +178,10 @@ class _RegionsChoiceView extends ConsumerWidget { .updateEarthquakeRegions( regions .map( - (e) => e.regionId == region.regionId - ? e.copyWith(minJmaIntensity: intensity) - : e, + (e) => + e.regionId == region.regionId + ? e.copyWith(minJmaIntensity: intensity) + : e, ) .toList(), ); @@ -223,9 +195,7 @@ class _RegionsChoiceView extends ConsumerWidget { final child = Dismissible( key: ValueKey(region.regionId), onDismissed: (direction) async { - unawaited( - HapticFeedback.mediumImpact(), - ); + unawaited(HapticFeedback.mediumImpact()); ref .read(notificationRemoteSettingsNotifierProvider.notifier) .updateEarthquakeRegions( @@ -258,51 +228,47 @@ class _RegionsChoiceView extends ConsumerWidget { ), DropdownButton( value: region.minJmaIntensity, - onChanged: (value) => - value != null ? update(value) : null, - items: JmaForecastIntensity.values - .whereNot( - (e) => [ - JmaForecastIntensity.zero, - JmaForecastIntensity.unknown, - ].contains(e), - ) - .map( - (e) => DropdownMenuItem( - value: e, - child: Text( - '震度${e.type.fromPlusMinus}' - "${e == JmaForecastIntensity.seven ? "" : " 以上"}", - ), - ), - ) - .toList(), + onChanged: + (value) => value != null ? update(value) : null, + items: + JmaForecastIntensity.values + .whereNot( + (e) => [ + JmaForecastIntensity.zero, + JmaForecastIntensity.unknown, + ].contains(e), + ) + .map( + (e) => DropdownMenuItem( + value: e, + child: Text( + '震度${e.type.fromPlusMinus}' + "${e == JmaForecastIntensity.seven ? "" : " 以上"}", + ), + ), + ) + .toList(), ), ], ), - subtitle: isNotificationEnabled - ? null - : const Row( - children: [ - Icon( - Icons.warning, - color: Colors.orange, - ), - SizedBox(width: 8), - Expanded( - child: Text( - ' (この震度は全国の地震情報に含まれています)', - ), - ), - ], - ), + subtitle: + isNotificationEnabled + ? null + : const Row( + children: [ + Icon(Icons.warning, color: Colors.orange), + SizedBox(width: 8), + Expanded(child: Text(' (この震度は全国の地震情報に含まれています)')), + ], + ), onTap: () async { await showDialog( context: context, builder: (context) { return SimpleDialog( title: Text(region.name), - children: JmaForecastIntensity.values + children: + JmaForecastIntensity.values .whereNot( (e) => [ JmaForecastIntensity.zero, @@ -351,9 +317,7 @@ class _RegionsChoiceView extends ConsumerWidget { } class _AddRegionFloatingActionButton extends StatelessWidget { - const _AddRegionFloatingActionButton({ - required this.regions, - }); + const _AddRegionFloatingActionButton({required this.regions}); final List regions; @@ -364,8 +328,9 @@ class _AddRegionFloatingActionButton extends StatelessWidget { heroTag: 'add_region', label: const Text('地域を追加'), icon: const Icon(Icons.add), - onPressed: canAddRegion - ? () async => showDialog( + onPressed: + canAddRegion + ? () async => showDialog( context: context, builder: (context) { return _AddRegionChoiceDialog( @@ -373,7 +338,7 @@ class _AddRegionFloatingActionButton extends StatelessWidget { ); }, ) - : () async => showDialog( + : () async => showDialog( context: context, builder: (context) { return DefaultTextStyle( @@ -402,18 +367,17 @@ class _AddRegionFloatingActionButton extends StatelessWidget { } class _AddRegionChoiceDialog extends ConsumerWidget { - const _AddRegionChoiceDialog({ - required this.alreadySelectedRegions, - }); + const _AddRegionChoiceDialog({required this.alreadySelectedRegions}); final List alreadySelectedRegions; @override Widget build(BuildContext context, WidgetRef ref) { - final tableRegions = ref - .watch(jmaCodeTableProvider) - .areaInformationPrefectureEarthquake - .items; + final tableRegions = + ref + .watch(jmaCodeTableProvider) + .areaInformationPrefectureEarthquake + .items; return AlertDialog( actions: [ TextButton( @@ -427,75 +391,80 @@ class _AddRegionChoiceDialog extends ConsumerWidget { content: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: tableRegions.map( - (region) { - final isSelected = alreadySelectedRegions - .any((e) => e.regionId == int.parse(region.code)); - return SimpleDialogOption( - onPressed: isSelected - ? null - : () async { - final intensity = - await showDialog( - context: context, - builder: (context) { - return SimpleDialog( - title: Text(region.name), - children: JmaForecastIntensity.values - .whereNot( - (e) => [ - JmaForecastIntensity.zero, - JmaForecastIntensity.unknown, - ].contains(e), - ) - .map( - (e) => SimpleDialogOption( - onPressed: () => - Navigator.pop(context, e), - child: Text( - '震度${e.type.fromPlusMinus}' - "${e == JmaForecastIntensity.seven ? "" : " 以上"}", - style: const TextStyle(), - ), - ), - ) - .toList(), + children: + tableRegions.map((region) { + final isSelected = alreadySelectedRegions.any( + (e) => e.regionId == int.parse(region.code), + ); + return SimpleDialogOption( + onPressed: + isSelected + ? null + : () async { + final intensity = await showDialog< + JmaForecastIntensity + >( + context: context, + builder: (context) { + return SimpleDialog( + title: Text(region.name), + children: + JmaForecastIntensity.values + .whereNot( + (e) => [ + JmaForecastIntensity.zero, + JmaForecastIntensity.unknown, + ].contains(e), + ) + .map( + (e) => SimpleDialogOption( + onPressed: + () => + Navigator.pop(context, e), + child: Text( + '震度${e.type.fromPlusMinus}' + "${e == JmaForecastIntensity.seven ? "" : " 以上"}", + style: const TextStyle(), + ), + ), + ) + .toList(), + ); + }, ); + if (intensity == null) { + return; + } + ref + .read( + notificationRemoteSettingsNotifierProvider + .notifier, + ) + .updateEarthquakeRegions([ + ...alreadySelectedRegions, + NotificationRemoteSettingsEarthquakeRegion( + regionId: int.parse(region.code), + minJmaIntensity: intensity, + name: region.name, + ), + ]); + if (context.mounted) { + Navigator.pop(context); + } }, - ); - if (intensity == null) { - return; - } - ref - .read( - notificationRemoteSettingsNotifierProvider.notifier, - ) - .updateEarthquakeRegions([ - ...alreadySelectedRegions, - NotificationRemoteSettingsEarthquakeRegion( - regionId: int.parse(region.code), - minJmaIntensity: intensity, - name: region.name, - ), - ]); - if (context.mounted) { - Navigator.pop(context); - } - }, - child: isSelected - ? Text( - '${region.name} (選択済み)', - style: TextStyle( - color: Theme.of(context) - .colorScheme - .onSurface - .withValues(alpha: 0.7), - ), - ) - : Text(region.name), - ); - }, - ).toList(), + child: + isSelected + ? Text( + '${region.name} (選択済み)', + style: TextStyle( + color: Theme.of( + context, + ).colorScheme.onSurface.withValues(alpha: 0.7), + ), + ) + : Text(region.name), + ); + }).toList(), ), ), ); diff --git a/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_eew_page.dart b/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_eew_page.dart index 8df92b2a..59eb4d24 100644 --- a/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_eew_page.dart +++ b/app/lib/feature/settings/features/notification_remote_settings/ui/pages/notification_remote_settings_eew_page.dart @@ -20,30 +20,21 @@ class NotificationRemoteSettingsEewPage extends ConsumerWidget { final state = ref.watch(notificationRemoteSettingsNotifierProvider).valueOrNull?.eew; if (state == null) { - return const Center( - child: CircularProgressIndicator.adaptive(), - ); + return const Center(child: CircularProgressIndicator.adaptive()); } return Scaffold( - appBar: AppBar( - title: const Text('緊急地震速報の通知条件設定'), - ), - body: _Body( - state: state, - ), - floatingActionButton: (state.global != JmaForecastIntensity.zero) - ? _AddRegionFloatingActionButton( - regions: state.regions, - ) - : null, + appBar: AppBar(title: const Text('緊急地震速報の通知条件設定')), + body: _Body(state: state), + floatingActionButton: + (state.global != JmaForecastIntensity.zero) + ? _AddRegionFloatingActionButton(regions: state.regions) + : null, ); } } class _Body extends HookConsumerWidget { - const _Body({ - required this.state, - }); + const _Body({required this.state}); final NotificationRemoteSettingsEew state; @@ -52,43 +43,33 @@ class _Body extends HookConsumerWidget { final colorScheme = Theme.of(context).colorScheme; final statusWidget = switch ((state.global, state.regions)) { (null, []) => BorderedContainer( - accentColor: colorScheme.errorContainer, - child: Row( - children: [ - Icon( - Icons.error, - color: colorScheme.onErrorContainer, - ), - const SizedBox(width: 8), - Expanded( - child: Text( - '緊急地震速報の通知は行いません', - style: TextStyle( - fontWeight: FontWeight.bold, - color: colorScheme.onErrorContainer, - ), + accentColor: colorScheme.errorContainer, + child: Row( + children: [ + Icon(Icons.error, color: colorScheme.onErrorContainer), + const SizedBox(width: 8), + Expanded( + child: Text( + '緊急地震速報の通知は行いません', + style: TextStyle( + fontWeight: FontWeight.bold, + color: colorScheme.onErrorContainer, ), ), - ], - ), + ), + ], ), + ), (_, _) => BorderedContainer( - accentColor: colorScheme.secondaryContainer, - child: Row( - children: [ - Icon( - Icons.check_circle, - color: colorScheme.onSecondaryContainer, - ), - const SizedBox(width: 8), - Expanded( - child: EewNotificationStatusWidget( - eew: state, - ), - ), - ], - ), + accentColor: colorScheme.secondaryContainer, + child: Row( + children: [ + Icon(Icons.check_circle, color: colorScheme.onSecondaryContainer), + const SizedBox(width: 8), + Expanded(child: EewNotificationStatusWidget(eew: state)), + ], ), + ), }; return SingleChildScrollView( @@ -101,19 +82,21 @@ class _Body extends HookConsumerWidget { AnimatedSwitcher( duration: const Duration(milliseconds: 200), - child: (state.global != JmaForecastIntensity.zero) - ? KeyedSubtree( - key: ValueKey(state.global == JmaForecastIntensity.zero), - child: _RegionsChoiceView( - regions: state.regions - .sorted((a, b) => a.regionId.compareTo(b.regionId)) - .toList(), - global: state.global, - ), - ) - : const SizedBox.shrink( - key: ValueKey(true), - ), + child: + (state.global != JmaForecastIntensity.zero) + ? KeyedSubtree( + key: ValueKey(state.global == JmaForecastIntensity.zero), + child: _RegionsChoiceView( + regions: + state.regions + .sorted( + (a, b) => a.regionId.compareTo(b.regionId), + ) + .toList(), + global: state.global, + ), + ) + : const SizedBox.shrink(key: ValueKey(true)), ), // FABと重ならないようにするため const SizedBox(height: 120), @@ -124,9 +107,7 @@ class _Body extends HookConsumerWidget { } class _GlobalChoiceTile extends ConsumerWidget { - const _GlobalChoiceTile({ - required this.global, - }); + const _GlobalChoiceTile({required this.global}); final JmaForecastIntensity? global; @@ -135,19 +116,19 @@ class _GlobalChoiceTile extends ConsumerWidget { return ListTile( title: const Text( '全国の緊急地震速報', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), subtitle: const Text('いずれかの地域で指定した震度が予測された場合に通知します'), trailing: DropdownButton( borderRadius: BorderRadius.circular(16), elevation: 1, value: global, - onChanged: (value) => ref - .read(notificationRemoteSettingsNotifierProvider.notifier) - .updateEewGlobal(value), - items: JmaForecastIntensity.values + onChanged: + (value) => ref + .read(notificationRemoteSettingsNotifierProvider.notifier) + .updateEewGlobal(value), + items: + JmaForecastIntensity.values .whereNot( (e) => [ JmaForecastIntensity.unknown, @@ -168,21 +149,14 @@ class _GlobalChoiceTile extends ConsumerWidget { ), ) .toList() + - [ - const DropdownMenuItem( - child: Text('指定しない'), - ), - ], + [const DropdownMenuItem(child: Text('指定しない'))], ), ); } } class _RegionsChoiceView extends ConsumerWidget { - const _RegionsChoiceView({ - required this.regions, - required this.global, - }); + const _RegionsChoiceView({required this.regions, required this.global}); final List regions; final JmaForecastIntensity? global; @@ -195,9 +169,7 @@ class _RegionsChoiceView extends ConsumerWidget { visualDensity: VisualDensity.compact, title: Text( '地域ごとの緊急地震速報', - style: TextStyle( - fontWeight: FontWeight.bold, - ), + style: TextStyle(fontWeight: FontWeight.bold), ), subtitle: Text('各地域で指定した震度を観測した場合に通知します'), ), @@ -208,9 +180,10 @@ class _RegionsChoiceView extends ConsumerWidget { .updateEewRegions( regions .map( - (e) => e.regionId == region.regionId - ? e.copyWith(minJmaIntensity: intensity) - : e, + (e) => + e.regionId == region.regionId + ? e.copyWith(minJmaIntensity: intensity) + : e, ) .toList(), ); @@ -224,9 +197,7 @@ class _RegionsChoiceView extends ConsumerWidget { final child = Dismissible( key: ValueKey(region.regionId), onDismissed: (direction) async { - unawaited( - HapticFeedback.mediumImpact(), - ); + unawaited(HapticFeedback.mediumImpact()); ref .read(notificationRemoteSettingsNotifierProvider.notifier) .updateEewRegions( @@ -259,47 +230,42 @@ class _RegionsChoiceView extends ConsumerWidget { ), DropdownButton( value: region.minJmaIntensity, - onChanged: (value) => - value != null ? update(value) : null, - items: JmaForecastIntensity.values - .whereNot( - (e) => [ - JmaForecastIntensity.zero, - JmaForecastIntensity.unknown, - JmaForecastIntensity.one, - JmaForecastIntensity.two, - JmaForecastIntensity.three, - ].contains(e), - ) - .map( - (e) => DropdownMenuItem( - value: e, - child: Text( - '震度${e.type.fromPlusMinus}' - "${e == JmaForecastIntensity.seven ? "" : " 以上"}", - ), - ), - ) - .toList(), + onChanged: + (value) => value != null ? update(value) : null, + items: + JmaForecastIntensity.values + .whereNot( + (e) => [ + JmaForecastIntensity.zero, + JmaForecastIntensity.unknown, + JmaForecastIntensity.one, + JmaForecastIntensity.two, + JmaForecastIntensity.three, + ].contains(e), + ) + .map( + (e) => DropdownMenuItem( + value: e, + child: Text( + '震度${e.type.fromPlusMinus}' + "${e == JmaForecastIntensity.seven ? "" : " 以上"}", + ), + ), + ) + .toList(), ), ], ), - subtitle: isNotificationEnabled - ? null - : const Row( - children: [ - Icon( - Icons.warning, - color: Colors.orange, - ), - SizedBox(width: 8), - Expanded( - child: Text( - ' (この震度は全国の緊急地震速報に含まれています)', - ), - ), - ], - ), + subtitle: + isNotificationEnabled + ? null + : const Row( + children: [ + Icon(Icons.warning, color: Colors.orange), + SizedBox(width: 8), + Expanded(child: Text(' (この震度は全国の緊急地震速報に含まれています)')), + ], + ), ), ); return child; @@ -310,9 +276,7 @@ class _RegionsChoiceView extends ConsumerWidget { } class _AddRegionFloatingActionButton extends StatelessWidget { - const _AddRegionFloatingActionButton({ - required this.regions, - }); + const _AddRegionFloatingActionButton({required this.regions}); final List regions; @@ -323,8 +287,9 @@ class _AddRegionFloatingActionButton extends StatelessWidget { heroTag: 'add_region', label: const Text('地域を追加'), icon: const Icon(Icons.add), - onPressed: canAddRegion - ? () async => showDialog( + onPressed: + canAddRegion + ? () async => showDialog( context: context, builder: (context) { return _AddRegionChoiceDialog( @@ -332,7 +297,7 @@ class _AddRegionFloatingActionButton extends StatelessWidget { ); }, ) - : () async => showDialog( + : () async => showDialog( context: context, builder: (context) { return DefaultTextStyle( @@ -361,9 +326,7 @@ class _AddRegionFloatingActionButton extends StatelessWidget { } class _AddRegionChoiceDialog extends ConsumerWidget { - const _AddRegionChoiceDialog({ - required this.alreadySelectedRegions, - }); + const _AddRegionChoiceDialog({required this.alreadySelectedRegions}); final List alreadySelectedRegions; @@ -384,78 +347,83 @@ class _AddRegionChoiceDialog extends ConsumerWidget { content: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: tableRegions.map( - (region) { - final isSelected = alreadySelectedRegions - .any((e) => e.regionId == int.parse(region.code)); - return SimpleDialogOption( - onPressed: isSelected - ? null - : () async { - final intensity = - await showDialog( - context: context, - builder: (context) { - return SimpleDialog( - title: Text(region.name), - children: JmaForecastIntensity.values - .whereNot( - (e) => [ - JmaForecastIntensity.zero, - JmaForecastIntensity.unknown, - JmaForecastIntensity.one, - JmaForecastIntensity.two, - JmaForecastIntensity.three, - ].contains(e), - ) - .map( - (e) => SimpleDialogOption( - onPressed: () => - Navigator.pop(context, e), - child: Text( - '震度${e.type.fromPlusMinus}' - "${e == JmaForecastIntensity.seven ? "" : " 以上"}", - style: const TextStyle(), - ), - ), - ) - .toList(), + children: + tableRegions.map((region) { + final isSelected = alreadySelectedRegions.any( + (e) => e.regionId == int.parse(region.code), + ); + return SimpleDialogOption( + onPressed: + isSelected + ? null + : () async { + final intensity = await showDialog< + JmaForecastIntensity + >( + context: context, + builder: (context) { + return SimpleDialog( + title: Text(region.name), + children: + JmaForecastIntensity.values + .whereNot( + (e) => [ + JmaForecastIntensity.zero, + JmaForecastIntensity.unknown, + JmaForecastIntensity.one, + JmaForecastIntensity.two, + JmaForecastIntensity.three, + ].contains(e), + ) + .map( + (e) => SimpleDialogOption( + onPressed: + () => + Navigator.pop(context, e), + child: Text( + '震度${e.type.fromPlusMinus}' + "${e == JmaForecastIntensity.seven ? "" : " 以上"}", + style: const TextStyle(), + ), + ), + ) + .toList(), + ); + }, ); + if (intensity == null) { + return; + } + ref + .read( + notificationRemoteSettingsNotifierProvider + .notifier, + ) + .updateEewRegions([ + ...alreadySelectedRegions, + NotificationRemoteSettingsEewRegion( + regionId: int.parse(region.code), + minJmaIntensity: intensity, + name: region.name, + ), + ]); + if (context.mounted) { + Navigator.pop(context); + } }, - ); - if (intensity == null) { - return; - } - ref - .read( - notificationRemoteSettingsNotifierProvider.notifier, - ) - .updateEewRegions([ - ...alreadySelectedRegions, - NotificationRemoteSettingsEewRegion( - regionId: int.parse(region.code), - minJmaIntensity: intensity, - name: region.name, - ), - ]); - if (context.mounted) { - Navigator.pop(context); - } - }, - child: isSelected - ? Text( - '${region.name} (選択済み)', - style: TextStyle( - color: Theme.of(context) - .colorScheme - .onSurface - .withValues(alpha: 0.7), - ), - ) - : Text(region.name), - ); - }, - ).toList(), + child: + isSelected + ? Text( + '${region.name} (選択済み)', + style: TextStyle( + color: Theme.of( + context, + ).colorScheme.onSurface.withValues(alpha: 0.7), + ), + ) + : Text(region.name), + ); + }).toList(), ), ), ); diff --git a/app/lib/feature/settings/settings_screen.dart b/app/lib/feature/settings/settings_screen.dart index 110433c9..e03cca8d 100644 --- a/app/lib/feature/settings/settings_screen.dart +++ b/app/lib/feature/settings/settings_screen.dart @@ -29,9 +29,7 @@ class SettingsScreen extends ConsumerWidget { final textTheme = theme.textTheme; return Scaffold( - appBar: AppBar( - title: const Text('設定'), - ), + appBar: AppBar(title: const Text('設定')), body: ListView( children: [ Center( @@ -44,9 +42,7 @@ class SettingsScreen extends ConsumerWidget { borderRadius: BorderRadius.circular(16), clipBehavior: Clip.antiAlias, elevation: 4, - child: Assets.images.icon.image( - fit: BoxFit.contain, - ), + child: Assets.images.icon.image(fit: BoxFit.contain), ), ), ), @@ -57,9 +53,7 @@ class SettingsScreen extends ConsumerWidget { padding: EdgeInsets.zero, child: ListTile( title: const Text('EQMonitorを応援する'), - subtitle: const Text( - '開発者に寄付することで、アプリの開発を支援できます', - ), + subtitle: const Text('開発者に寄付することで、アプリの開発を支援できます'), leading: const Icon(Icons.lightbulb), onTap: () async => const DonationRoute().push(context), ), @@ -78,9 +72,9 @@ class SettingsScreen extends ConsumerWidget { ListTile( title: const Text('地震履歴設定'), leading: const Icon(Icons.history), - onTap: () async => context.push( - const EarthquakeHistoryConfigRoute().location, - ), + onTap: + () async => + context.push(const EarthquakeHistoryConfigRoute().location), ), const SettingsSectionHeader(text: 'アプリの情報と問い合わせ'), ListTile( @@ -99,10 +93,11 @@ class SettingsScreen extends ConsumerWidget { title: const Text('サーバの稼働状況'), subtitle: const Text('外部Webサイトへ遷移します'), leading: const Icon(Icons.network_ping), - onTap: () async => launchUrlString( - 'https://status.eqmonitor.app/', - mode: LaunchMode.externalApplication, - ), + onTap: + () async => launchUrlString( + 'https://status.eqmonitor.app/', + mode: LaunchMode.externalApplication, + ), ), Center( child: Text( @@ -143,58 +138,52 @@ class _AppVersionInformation extends HookConsumerWidget { final theme = Theme.of(context); final textTheme = theme.textTheme; - final text = 'EQMonitor v${packageInfo.version} ' + final text = + 'EQMonitor v${packageInfo.version} ' '(${packageInfo.buildNumber})'; return Center( child: Padding( padding: const EdgeInsets.only(bottom: 16), - child: Text( - text, - style: textTheme.bodyMedium, - ), + child: Text(text, style: textTheme.bodyMedium), ), ); } } Future _onInquiryTap(BuildContext context, WidgetRef ref) async { - BetterFeedback.of(context).show( - (feedback) async { - final packageInfo = ref.read(packageInfoProvider); - final payload = await ref - .read(apiAuthenticationNotifierProvider.notifier) - .extractPayload(); + BetterFeedback.of(context).show((feedback) async { + final packageInfo = ref.read(packageInfoProvider); + final payload = + await ref + .read(apiAuthenticationNotifierProvider.notifier) + .extractPayload(); - final base = '--------------------------\n' - 'EQMonitor v${packageInfo.version}+${packageInfo.buildNumber}\n' - 'Payload: $payload\n' - '--------------------------'; - // draft an email and send to developer - final screenshotFilePath = await writeImageToStorage(feedback.screenshot); - final extra = CustomFeedback.fromJson(feedback.extra!); + final base = + '--------------------------\n' + 'EQMonitor v${packageInfo.version}+${packageInfo.buildNumber}\n' + 'Payload: $payload\n' + '--------------------------'; + // draft an email and send to developer + final screenshotFilePath = await writeImageToStorage(feedback.screenshot); + final extra = CustomFeedback.fromJson(feedback.extra!); - final email = Email( - body: '${feedback.text}\n\n$base\n\n${jsonEncode(extra.toJson())}', - subject: 'EQMonitor Feedback', - recipients: ['feedback@eqmonitor.app'], - attachmentPaths: [ - if (extra.isScreenshotAttached) screenshotFilePath, - ], - ); - try { - await FlutterEmailSender.send(email); - } on PlatformException catch (e) { - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text('エラーが発生しました: ${e.message}'), - ), - ); - } + final email = Email( + body: '${feedback.text}\n\n$base\n\n${jsonEncode(extra.toJson())}', + subject: 'EQMonitor Feedback', + recipients: ['feedback@eqmonitor.app'], + attachmentPaths: [if (extra.isScreenshotAttached) screenshotFilePath], + ); + try { + await FlutterEmailSender.send(email); + } on PlatformException catch (e) { + if (context.mounted) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('エラーが発生しました: ${e.message}'))); } - }, - ); + } + }); } Future writeImageToStorage(Uint8List feedbackScreenshot) async { diff --git a/app/lib/feature/setup/component/background_image.dart b/app/lib/feature/setup/component/background_image.dart index 347f2dfa..890fe5b5 100644 --- a/app/lib/feature/setup/component/background_image.dart +++ b/app/lib/feature/setup/component/background_image.dart @@ -5,10 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; class SetupBackgroundImageWidget extends HookWidget { - const SetupBackgroundImageWidget({ - required this.child, - super.key, - }); + const SetupBackgroundImageWidget({required this.child, super.key}); final Widget child; @@ -17,31 +14,23 @@ class SetupBackgroundImageWidget extends HookWidget { final startTime = useState(0); if (kIsWeb) { - return ColoredBox( - color: const Color(0xFF05052F), - child: child, - ); + return ColoredBox(color: const Color(0xFF05052F), child: child); } double elapsedTimeInSeconds() => (DateTime.now().millisecondsSinceEpoch - startTime.value) / 1000; final shader = useFuture( // ignore: discarded_futures - FragmentProgram.fromAsset( - 'shaders/introduction.frag', - ), + FragmentProgram.fromAsset('shaders/introduction.frag'), ); final animationController = useAnimationController( duration: const Duration(seconds: 1), )..repeat(); useAnimation(animationController); - useEffect( - () { - startTime.value = DateTime.now().millisecondsSinceEpoch; - return null; - }, - [context], - ); + useEffect(() { + startTime.value = DateTime.now().millisecondsSinceEpoch; + return null; + }, [context]); if (shader.hasData) { return AnimatedBuilder( animation: animationController, @@ -49,10 +38,7 @@ class SetupBackgroundImageWidget extends HookWidget { final data = shader.data!.fragmentShader(); return CustomPaint( painter: _ShaderPainter(data, elapsedTimeInSeconds()), - child: Scaffold( - backgroundColor: Colors.transparent, - body: child, - ), + child: Scaffold(backgroundColor: Colors.transparent, body: child), ); }, ); @@ -63,10 +49,7 @@ class SetupBackgroundImageWidget extends HookWidget { } class _ShaderPainter extends CustomPainter { - const _ShaderPainter( - this.shader, - this.elapsedSeconds, - ); + const _ShaderPainter(this.shader, this.elapsedSeconds); final FragmentShader shader; final double elapsedSeconds; @@ -76,10 +59,11 @@ class _ShaderPainter extends CustomPainter { canvas.drawRect( Rect.fromLTWH(0, 0, size.width, size.height), Paint() - ..shader = (shader - ..setFloat(0, elapsedSeconds) - ..setFloat(1, size.width) - ..setFloat(2, size.height)), + ..shader = + (shader + ..setFloat(0, elapsedSeconds) + ..setFloat(1, size.width) + ..setFloat(2, size.height)), ); } diff --git a/app/lib/feature/setup/component/earthquake_restriction.dart b/app/lib/feature/setup/component/earthquake_restriction.dart index 311cdc85..b3d97d79 100644 --- a/app/lib/feature/setup/component/earthquake_restriction.dart +++ b/app/lib/feature/setup/component/earthquake_restriction.dart @@ -11,40 +11,38 @@ class EarthquakeRestrictionWidget extends StatelessWidget { return Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 'デバイスの状態、アプリケーションの状態、ネットワークの状態によっては、通知が届かない場合があります。', - '通知が強い揺れの到達に間に合わない可能性があります', - '予想に大きな誤差が発生する場合があります', - '予想には誤差が伴います', - ] - .mapIndexed( - (index, e) => BorderedContainer( - child: Row( - children: [ - DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: theme.colorScheme.onPrimaryContainer, - ), - child: const SizedBox( - width: 8, - height: 8, - ), - ), - const SizedBox(width: 16), - Flexible( - child: Text( - e, - style: theme.textTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.bold, + children: + [ + 'デバイスの状態、アプリケーションの状態、ネットワークの状態によっては、通知が届かない場合があります。', + '通知が強い揺れの到達に間に合わない可能性があります', + '予想に大きな誤差が発生する場合があります', + '予想には誤差が伴います', + ] + .mapIndexed( + (index, e) => BorderedContainer( + child: Row( + children: [ + DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: theme.colorScheme.onPrimaryContainer, + ), + child: const SizedBox(width: 8, height: 8), + ), + const SizedBox(width: 16), + Flexible( + child: Text( + e, + style: theme.textTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.bold, + ), + ), ), - ), + ], ), - ], - ), - ), - ) - .toList(), + ), + ) + .toList(), ); } } diff --git a/app/lib/feature/setup/pages/introduction_page.dart b/app/lib/feature/setup/pages/introduction_page.dart index c0a1cc65..4b72f9bd 100644 --- a/app/lib/feature/setup/pages/introduction_page.dart +++ b/app/lib/feature/setup/pages/introduction_page.dart @@ -5,10 +5,7 @@ import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class IntroductionPage extends StatelessWidget { - const IntroductionPage({ - required this.onNext, - super.key, - }); + const IntroductionPage({required this.onNext, super.key}); final void Function() onNext; @@ -26,9 +23,7 @@ class IntroductionPage extends StatelessWidget { height: 100, child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(800)), - child: Image( - image: AssetImage('assets/images/icon.png'), - ), + child: Image(image: AssetImage('assets/images/icon.png')), ), ), ), @@ -44,8 +39,8 @@ class IntroductionPage extends StatelessWidget { ), ), const Spacer(), - // 画面下部のボタン + // 画面下部のボタン Padding( padding: const EdgeInsets.all(16), child: ActionButton.text( @@ -56,45 +51,39 @@ class IntroductionPage extends StatelessWidget { ), // このボタンを押して、利用規約とプライバシーポリシーに同意したものとみなします。 Card( - margin: const EdgeInsets.only( - left: 8, - right: 8, - bottom: 8, - ), + margin: const EdgeInsets.only(left: 8, right: 8, bottom: 8), child: Padding( padding: const EdgeInsets.all(8), child: Text.rich( TextSpan( children: [ - const TextSpan( - text: 'はじめるをタップすることで、 ', - ), + const TextSpan(text: 'はじめるをタップすることで、 '), TextSpan( text: '利用規約', style: const TextStyle( decoration: TextDecoration.underline, ), - recognizer: TapGestureRecognizer() - ..onTap = () async => context.push( - const TermOfServiceRoute($extra: null).location, - ), - ), - const TextSpan( - text: ' と ', + recognizer: + TapGestureRecognizer() + ..onTap = + () async => context.push( + const TermOfServiceRoute($extra: null).location, + ), ), + const TextSpan(text: ' と '), TextSpan( text: 'プライバシーポリシー', style: const TextStyle( decoration: TextDecoration.underline, ), - recognizer: TapGestureRecognizer() - ..onTap = () async => context.push( - const PrivacyPolicyRoute($extra: null).location, - ), - ), - const TextSpan( - text: ' に同意したものとみなします。', + recognizer: + TapGestureRecognizer() + ..onTap = + () async => context.push( + const PrivacyPolicyRoute($extra: null).location, + ), ), + const TextSpan(text: ' に同意したものとみなします。'), ], ), ), @@ -103,8 +92,6 @@ class IntroductionPage extends StatelessWidget { ], ); - return SafeArea( - child: body, - ); + return SafeArea(child: body); } } diff --git a/app/lib/feature/setup/pages/notification_setting.dart b/app/lib/feature/setup/pages/notification_setting.dart index f337745a..302ad77f 100644 --- a/app/lib/feature/setup/pages/notification_setting.dart +++ b/app/lib/feature/setup/pages/notification_setting.dart @@ -7,10 +7,7 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; class NotificationSettingIntroPage extends HookConsumerWidget { - const NotificationSettingIntroPage({ - required this.onNext, - super.key, - }); + const NotificationSettingIntroPage({required this.onNext, super.key}); final void Function() onNext; @@ -80,12 +77,7 @@ class NotificationSettingIntroPage extends HookConsumerWidget { const SizedBox(height: 16), TextButton( onPressed: onNext, - child: const Text( - '拒否する', - style: TextStyle( - color: Colors.white, - ), - ), + child: const Text('拒否する', style: TextStyle(color: Colors.white)), ), ], ), diff --git a/app/lib/feature/setup/pages/quick_guide_about_eew.dart b/app/lib/feature/setup/pages/quick_guide_about_eew.dart index 3a6b6a67..81f19d60 100644 --- a/app/lib/feature/setup/pages/quick_guide_about_eew.dart +++ b/app/lib/feature/setup/pages/quick_guide_about_eew.dart @@ -3,10 +3,7 @@ import 'package:eqmonitor/feature/setup/component/earthquake_restriction.dart'; import 'package:flutter/material.dart'; class QuickGuideAboutEewPage extends StatelessWidget { - const QuickGuideAboutEewPage({ - required this.onNext, - super.key, - }); + const QuickGuideAboutEewPage({required this.onNext, super.key}); final void Function() onNext; diff --git a/app/lib/feature/setup/screen/setup_screen.dart b/app/lib/feature/setup/screen/setup_screen.dart index 73e5d983..31f430ea 100644 --- a/app/lib/feature/setup/screen/setup_screen.dart +++ b/app/lib/feature/setup/screen/setup_screen.dart @@ -13,15 +13,11 @@ class SetupScreen extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final pageController = usePageController(); Future next() async => pageController.nextPage( - duration: const Duration(milliseconds: 200), - curve: Curves.easeInOut, - ); + duration: const Duration(milliseconds: 200), + curve: Curves.easeInOut, + ); - final pages = [ - IntroductionPage( - onNext: next, - ), - ]; + final pages = [IntroductionPage(onNext: next)]; return SetupBackgroundImageWidget( child: Scaffold( backgroundColor: Colors.transparent, diff --git a/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.dart b/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.dart index 2f14ac45..31106ac6 100644 --- a/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.dart +++ b/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.dart @@ -42,10 +42,7 @@ class ShakeDetectionKmoniMergedPoint with _$ShakeDetectionKmoniMergedPoint { ) required JmaForecastIntensity intensity, required String code, - @JsonKey( - fromJson: KyoshinObservationPoint.fromJson, - toJson: _pointToJson, - ) + @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) required KyoshinObservationPoint point, }) = _ShakeDetectionKmoniMergedPoint; diff --git a/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.freezed.dart b/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.freezed.dart index a11c555c..5ce02d3c 100644 --- a/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.freezed.dart +++ b/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.freezed.dart @@ -12,10 +12,12 @@ part of 'shake_detection_kmoni_merged_event.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); ShakeDetectionKmoniMergedEvent _$ShakeDetectionKmoniMergedEventFromJson( - Map json) { + Map json, +) { return _ShakeDetectionKmoniMergedEvent.fromJson(json); } @@ -32,27 +34,33 @@ mixin _$ShakeDetectionKmoniMergedEvent { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $ShakeDetectionKmoniMergedEventCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ShakeDetectionKmoniMergedEventCopyWith<$Res> { factory $ShakeDetectionKmoniMergedEventCopyWith( - ShakeDetectionKmoniMergedEvent value, - $Res Function(ShakeDetectionKmoniMergedEvent) then) = - _$ShakeDetectionKmoniMergedEventCopyWithImpl<$Res, - ShakeDetectionKmoniMergedEvent>; + ShakeDetectionKmoniMergedEvent value, + $Res Function(ShakeDetectionKmoniMergedEvent) then, + ) = + _$ShakeDetectionKmoniMergedEventCopyWithImpl< + $Res, + ShakeDetectionKmoniMergedEvent + >; @useResult - $Res call( - {ShakeDetectionEvent event, - List regions}); + $Res call({ + ShakeDetectionEvent event, + List regions, + }); $ShakeDetectionEventCopyWith<$Res> get event; } /// @nodoc -class _$ShakeDetectionKmoniMergedEventCopyWithImpl<$Res, - $Val extends ShakeDetectionKmoniMergedEvent> +class _$ShakeDetectionKmoniMergedEventCopyWithImpl< + $Res, + $Val extends ShakeDetectionKmoniMergedEvent +> implements $ShakeDetectionKmoniMergedEventCopyWith<$Res> { _$ShakeDetectionKmoniMergedEventCopyWithImpl(this._value, this._then); @@ -65,20 +73,22 @@ class _$ShakeDetectionKmoniMergedEventCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? event = null, - Object? regions = null, - }) { - return _then(_value.copyWith( - event: null == event - ? _value.event - : event // ignore: cast_nullable_to_non_nullable - as ShakeDetectionEvent, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? event = null, Object? regions = null}) { + return _then( + _value.copyWith( + event: + null == event + ? _value.event + : event // ignore: cast_nullable_to_non_nullable + as ShakeDetectionEvent, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } /// Create a copy of ShakeDetectionKmoniMergedEvent @@ -96,14 +106,15 @@ class _$ShakeDetectionKmoniMergedEventCopyWithImpl<$Res, abstract class _$$ShakeDetectionKmoniMergedEventImplCopyWith<$Res> implements $ShakeDetectionKmoniMergedEventCopyWith<$Res> { factory _$$ShakeDetectionKmoniMergedEventImplCopyWith( - _$ShakeDetectionKmoniMergedEventImpl value, - $Res Function(_$ShakeDetectionKmoniMergedEventImpl) then) = - __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl<$Res>; + _$ShakeDetectionKmoniMergedEventImpl value, + $Res Function(_$ShakeDetectionKmoniMergedEventImpl) then, + ) = __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ShakeDetectionEvent event, - List regions}); + $Res call({ + ShakeDetectionEvent event, + List regions, + }); @override $ShakeDetectionEventCopyWith<$Res> get event; @@ -111,32 +122,36 @@ abstract class _$$ShakeDetectionKmoniMergedEventImplCopyWith<$Res> /// @nodoc class __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl<$Res> - extends _$ShakeDetectionKmoniMergedEventCopyWithImpl<$Res, - _$ShakeDetectionKmoniMergedEventImpl> + extends + _$ShakeDetectionKmoniMergedEventCopyWithImpl< + $Res, + _$ShakeDetectionKmoniMergedEventImpl + > implements _$$ShakeDetectionKmoniMergedEventImplCopyWith<$Res> { __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl( - _$ShakeDetectionKmoniMergedEventImpl _value, - $Res Function(_$ShakeDetectionKmoniMergedEventImpl) _then) - : super(_value, _then); + _$ShakeDetectionKmoniMergedEventImpl _value, + $Res Function(_$ShakeDetectionKmoniMergedEventImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionKmoniMergedEvent /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? event = null, - Object? regions = null, - }) { - return _then(_$ShakeDetectionKmoniMergedEventImpl( - event: null == event - ? _value.event - : event // ignore: cast_nullable_to_non_nullable - as ShakeDetectionEvent, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? event = null, Object? regions = null}) { + return _then( + _$ShakeDetectionKmoniMergedEventImpl( + event: + null == event + ? _value.event + : event // ignore: cast_nullable_to_non_nullable + as ShakeDetectionEvent, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -144,14 +159,14 @@ class __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl<$Res> @JsonSerializable() class _$ShakeDetectionKmoniMergedEventImpl implements _ShakeDetectionKmoniMergedEvent { - const _$ShakeDetectionKmoniMergedEventImpl( - {required this.event, - required final List regions}) - : _regions = regions; + const _$ShakeDetectionKmoniMergedEventImpl({ + required this.event, + required final List regions, + }) : _regions = regions; factory _$ShakeDetectionKmoniMergedEventImpl.fromJson( - Map json) => - _$$ShakeDetectionKmoniMergedEventImplFromJson(json); + Map json, + ) => _$$ShakeDetectionKmoniMergedEventImplFromJson(json); @override final ShakeDetectionEvent event; @@ -180,7 +195,10 @@ class _$ShakeDetectionKmoniMergedEventImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, event, const DeepCollectionEquality().hash(_regions)); + runtimeType, + event, + const DeepCollectionEquality().hash(_regions), + ); /// Create a copy of ShakeDetectionKmoniMergedEvent /// with the given fields replaced by the non-null parameter values. @@ -188,24 +206,24 @@ class _$ShakeDetectionKmoniMergedEventImpl @override @pragma('vm:prefer-inline') _$$ShakeDetectionKmoniMergedEventImplCopyWith< - _$ShakeDetectionKmoniMergedEventImpl> - get copyWith => __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl< - _$ShakeDetectionKmoniMergedEventImpl>(this, _$identity); + _$ShakeDetectionKmoniMergedEventImpl + > + get copyWith => __$$ShakeDetectionKmoniMergedEventImplCopyWithImpl< + _$ShakeDetectionKmoniMergedEventImpl + >(this, _$identity); @override Map toJson() { - return _$$ShakeDetectionKmoniMergedEventImplToJson( - this, - ); + return _$$ShakeDetectionKmoniMergedEventImplToJson(this); } } abstract class _ShakeDetectionKmoniMergedEvent implements ShakeDetectionKmoniMergedEvent { - const factory _ShakeDetectionKmoniMergedEvent( - {required final ShakeDetectionEvent event, - required final List regions}) = - _$ShakeDetectionKmoniMergedEventImpl; + const factory _ShakeDetectionKmoniMergedEvent({ + required final ShakeDetectionEvent event, + required final List regions, + }) = _$ShakeDetectionKmoniMergedEventImpl; factory _ShakeDetectionKmoniMergedEvent.fromJson(Map json) = _$ShakeDetectionKmoniMergedEventImpl.fromJson; @@ -220,12 +238,14 @@ abstract class _ShakeDetectionKmoniMergedEvent @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ShakeDetectionKmoniMergedEventImplCopyWith< - _$ShakeDetectionKmoniMergedEventImpl> - get copyWith => throw _privateConstructorUsedError; + _$ShakeDetectionKmoniMergedEventImpl + > + get copyWith => throw _privateConstructorUsedError; } ShakeDetectionKmoniMergedRegion _$ShakeDetectionKmoniMergedRegionFromJson( - Map json) { + Map json, +) { return _ShakeDetectionKmoniMergedRegion.fromJson(json); } @@ -233,9 +253,10 @@ ShakeDetectionKmoniMergedRegion _$ShakeDetectionKmoniMergedRegionFromJson( mixin _$ShakeDetectionKmoniMergedRegion { String get name => throw _privateConstructorUsedError; @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get maxIntensity => throw _privateConstructorUsedError; List get points => throw _privateConstructorUsedError; @@ -247,30 +268,37 @@ mixin _$ShakeDetectionKmoniMergedRegion { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $ShakeDetectionKmoniMergedRegionCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ShakeDetectionKmoniMergedRegionCopyWith<$Res> { factory $ShakeDetectionKmoniMergedRegionCopyWith( - ShakeDetectionKmoniMergedRegion value, - $Res Function(ShakeDetectionKmoniMergedRegion) then) = - _$ShakeDetectionKmoniMergedRegionCopyWithImpl<$Res, - ShakeDetectionKmoniMergedRegion>; + ShakeDetectionKmoniMergedRegion value, + $Res Function(ShakeDetectionKmoniMergedRegion) then, + ) = + _$ShakeDetectionKmoniMergedRegionCopyWithImpl< + $Res, + ShakeDetectionKmoniMergedRegion + >; @useResult - $Res call( - {String name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity maxIntensity, - List points}); + $Res call({ + String name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity maxIntensity, + List points, + }); } /// @nodoc -class _$ShakeDetectionKmoniMergedRegionCopyWithImpl<$Res, - $Val extends ShakeDetectionKmoniMergedRegion> +class _$ShakeDetectionKmoniMergedRegionCopyWithImpl< + $Res, + $Val extends ShakeDetectionKmoniMergedRegion +> implements $ShakeDetectionKmoniMergedRegionCopyWith<$Res> { _$ShakeDetectionKmoniMergedRegionCopyWithImpl(this._value, this._then); @@ -288,20 +316,26 @@ class _$ShakeDetectionKmoniMergedRegionCopyWithImpl<$Res, Object? maxIntensity = null, Object? points = null, }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - points: null == points - ? _value.points - : points // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + points: + null == points + ? _value.points + : points // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -309,30 +343,35 @@ class _$ShakeDetectionKmoniMergedRegionCopyWithImpl<$Res, abstract class _$$ShakeDetectionKmoniMergedRegionImplCopyWith<$Res> implements $ShakeDetectionKmoniMergedRegionCopyWith<$Res> { factory _$$ShakeDetectionKmoniMergedRegionImplCopyWith( - _$ShakeDetectionKmoniMergedRegionImpl value, - $Res Function(_$ShakeDetectionKmoniMergedRegionImpl) then) = - __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl<$Res>; + _$ShakeDetectionKmoniMergedRegionImpl value, + $Res Function(_$ShakeDetectionKmoniMergedRegionImpl) then, + ) = __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity maxIntensity, - List points}); + $Res call({ + String name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity maxIntensity, + List points, + }); } /// @nodoc class __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl<$Res> - extends _$ShakeDetectionKmoniMergedRegionCopyWithImpl<$Res, - _$ShakeDetectionKmoniMergedRegionImpl> + extends + _$ShakeDetectionKmoniMergedRegionCopyWithImpl< + $Res, + _$ShakeDetectionKmoniMergedRegionImpl + > implements _$$ShakeDetectionKmoniMergedRegionImplCopyWith<$Res> { __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl( - _$ShakeDetectionKmoniMergedRegionImpl _value, - $Res Function(_$ShakeDetectionKmoniMergedRegionImpl) _then) - : super(_value, _then); + _$ShakeDetectionKmoniMergedRegionImpl _value, + $Res Function(_$ShakeDetectionKmoniMergedRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionKmoniMergedRegion /// with the given fields replaced by the non-null parameter values. @@ -343,20 +382,25 @@ class __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl<$Res> Object? maxIntensity = null, Object? points = null, }) { - return _then(_$ShakeDetectionKmoniMergedRegionImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - points: null == points - ? _value._points - : points // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$ShakeDetectionKmoniMergedRegionImpl( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + points: + null == points + ? _value._points + : points // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -364,27 +408,29 @@ class __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl<$Res> @JsonSerializable() class _$ShakeDetectionKmoniMergedRegionImpl implements _ShakeDetectionKmoniMergedRegion { - const _$ShakeDetectionKmoniMergedRegionImpl( - {required this.name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required this.maxIntensity, - required final List points}) - : _points = points; + const _$ShakeDetectionKmoniMergedRegionImpl({ + required this.name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required this.maxIntensity, + required final List points, + }) : _points = points; factory _$ShakeDetectionKmoniMergedRegionImpl.fromJson( - Map json) => - _$$ShakeDetectionKmoniMergedRegionImplFromJson(json); + Map json, + ) => _$$ShakeDetectionKmoniMergedRegionImplFromJson(json); @override final String name; @override @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) final JmaForecastIntensity maxIntensity; final List _points; @override @@ -412,8 +458,12 @@ class _$ShakeDetectionKmoniMergedRegionImpl @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, name, maxIntensity, - const DeepCollectionEquality().hash(_points)); + int get hashCode => Object.hash( + runtimeType, + name, + maxIntensity, + const DeepCollectionEquality().hash(_points), + ); /// Create a copy of ShakeDetectionKmoniMergedRegion /// with the given fields replaced by the non-null parameter values. @@ -421,29 +471,30 @@ class _$ShakeDetectionKmoniMergedRegionImpl @override @pragma('vm:prefer-inline') _$$ShakeDetectionKmoniMergedRegionImplCopyWith< - _$ShakeDetectionKmoniMergedRegionImpl> - get copyWith => __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl< - _$ShakeDetectionKmoniMergedRegionImpl>(this, _$identity); + _$ShakeDetectionKmoniMergedRegionImpl + > + get copyWith => __$$ShakeDetectionKmoniMergedRegionImplCopyWithImpl< + _$ShakeDetectionKmoniMergedRegionImpl + >(this, _$identity); @override Map toJson() { - return _$$ShakeDetectionKmoniMergedRegionImplToJson( - this, - ); + return _$$ShakeDetectionKmoniMergedRegionImplToJson(this); } } abstract class _ShakeDetectionKmoniMergedRegion implements ShakeDetectionKmoniMergedRegion { - const factory _ShakeDetectionKmoniMergedRegion( - {required final String name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required final JmaForecastIntensity maxIntensity, - required final List points}) = - _$ShakeDetectionKmoniMergedRegionImpl; + const factory _ShakeDetectionKmoniMergedRegion({ + required final String name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required final JmaForecastIntensity maxIntensity, + required final List points, + }) = _$ShakeDetectionKmoniMergedRegionImpl; factory _ShakeDetectionKmoniMergedRegion.fromJson(Map json) = _$ShakeDetectionKmoniMergedRegionImpl.fromJson; @@ -452,9 +503,10 @@ abstract class _ShakeDetectionKmoniMergedRegion String get name; @override @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get maxIntensity; @override List get points; @@ -464,20 +516,23 @@ abstract class _ShakeDetectionKmoniMergedRegion @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ShakeDetectionKmoniMergedRegionImplCopyWith< - _$ShakeDetectionKmoniMergedRegionImpl> - get copyWith => throw _privateConstructorUsedError; + _$ShakeDetectionKmoniMergedRegionImpl + > + get copyWith => throw _privateConstructorUsedError; } ShakeDetectionKmoniMergedPoint _$ShakeDetectionKmoniMergedPointFromJson( - Map json) { + Map json, +) { return _ShakeDetectionKmoniMergedPoint.fromJson(json); } /// @nodoc mixin _$ShakeDetectionKmoniMergedPoint { @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get intensity => throw _privateConstructorUsedError; String get code => throw _privateConstructorUsedError; @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) @@ -490,30 +545,37 @@ mixin _$ShakeDetectionKmoniMergedPoint { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $ShakeDetectionKmoniMergedPointCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ShakeDetectionKmoniMergedPointCopyWith<$Res> { factory $ShakeDetectionKmoniMergedPointCopyWith( - ShakeDetectionKmoniMergedPoint value, - $Res Function(ShakeDetectionKmoniMergedPoint) then) = - _$ShakeDetectionKmoniMergedPointCopyWithImpl<$Res, - ShakeDetectionKmoniMergedPoint>; + ShakeDetectionKmoniMergedPoint value, + $Res Function(ShakeDetectionKmoniMergedPoint) then, + ) = + _$ShakeDetectionKmoniMergedPointCopyWithImpl< + $Res, + ShakeDetectionKmoniMergedPoint + >; @useResult - $Res call( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity intensity, - String code, - @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) - KyoshinObservationPoint point}); + $Res call({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity intensity, + String code, + @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) + KyoshinObservationPoint point, + }); } /// @nodoc -class _$ShakeDetectionKmoniMergedPointCopyWithImpl<$Res, - $Val extends ShakeDetectionKmoniMergedPoint> +class _$ShakeDetectionKmoniMergedPointCopyWithImpl< + $Res, + $Val extends ShakeDetectionKmoniMergedPoint +> implements $ShakeDetectionKmoniMergedPointCopyWith<$Res> { _$ShakeDetectionKmoniMergedPointCopyWithImpl(this._value, this._then); @@ -531,20 +593,26 @@ class _$ShakeDetectionKmoniMergedPointCopyWithImpl<$Res, Object? code = null, Object? point = null, }) { - return _then(_value.copyWith( - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinObservationPoint, - ) as $Val); + return _then( + _value.copyWith( + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinObservationPoint, + ) + as $Val, + ); } } @@ -552,30 +620,35 @@ class _$ShakeDetectionKmoniMergedPointCopyWithImpl<$Res, abstract class _$$ShakeDetectionKmoniMergedPointImplCopyWith<$Res> implements $ShakeDetectionKmoniMergedPointCopyWith<$Res> { factory _$$ShakeDetectionKmoniMergedPointImplCopyWith( - _$ShakeDetectionKmoniMergedPointImpl value, - $Res Function(_$ShakeDetectionKmoniMergedPointImpl) then) = - __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl<$Res>; + _$ShakeDetectionKmoniMergedPointImpl value, + $Res Function(_$ShakeDetectionKmoniMergedPointImpl) then, + ) = __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity intensity, - String code, - @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) - KyoshinObservationPoint point}); + $Res call({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity intensity, + String code, + @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) + KyoshinObservationPoint point, + }); } /// @nodoc class __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl<$Res> - extends _$ShakeDetectionKmoniMergedPointCopyWithImpl<$Res, - _$ShakeDetectionKmoniMergedPointImpl> + extends + _$ShakeDetectionKmoniMergedPointCopyWithImpl< + $Res, + _$ShakeDetectionKmoniMergedPointImpl + > implements _$$ShakeDetectionKmoniMergedPointImplCopyWith<$Res> { __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl( - _$ShakeDetectionKmoniMergedPointImpl _value, - $Res Function(_$ShakeDetectionKmoniMergedPointImpl) _then) - : super(_value, _then); + _$ShakeDetectionKmoniMergedPointImpl _value, + $Res Function(_$ShakeDetectionKmoniMergedPointImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionKmoniMergedPoint /// with the given fields replaced by the non-null parameter values. @@ -586,20 +659,25 @@ class __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl<$Res> Object? code = null, Object? point = null, }) { - return _then(_$ShakeDetectionKmoniMergedPointImpl( - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinObservationPoint, - )); + return _then( + _$ShakeDetectionKmoniMergedPointImpl( + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinObservationPoint, + ), + ); } } @@ -607,23 +685,26 @@ class __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl<$Res> @JsonSerializable() class _$ShakeDetectionKmoniMergedPointImpl implements _ShakeDetectionKmoniMergedPoint { - const _$ShakeDetectionKmoniMergedPointImpl( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required this.intensity, - required this.code, - @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) - required this.point}); + const _$ShakeDetectionKmoniMergedPointImpl({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required this.intensity, + required this.code, + @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) + required this.point, + }); factory _$ShakeDetectionKmoniMergedPointImpl.fromJson( - Map json) => - _$$ShakeDetectionKmoniMergedPointImplFromJson(json); + Map json, + ) => _$$ShakeDetectionKmoniMergedPointImplFromJson(json); @override @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) final JmaForecastIntensity intensity; @override final String code; @@ -657,38 +738,39 @@ class _$ShakeDetectionKmoniMergedPointImpl @override @pragma('vm:prefer-inline') _$$ShakeDetectionKmoniMergedPointImplCopyWith< - _$ShakeDetectionKmoniMergedPointImpl> - get copyWith => __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl< - _$ShakeDetectionKmoniMergedPointImpl>(this, _$identity); + _$ShakeDetectionKmoniMergedPointImpl + > + get copyWith => __$$ShakeDetectionKmoniMergedPointImplCopyWithImpl< + _$ShakeDetectionKmoniMergedPointImpl + >(this, _$identity); @override Map toJson() { - return _$$ShakeDetectionKmoniMergedPointImplToJson( - this, - ); + return _$$ShakeDetectionKmoniMergedPointImplToJson(this); } } abstract class _ShakeDetectionKmoniMergedPoint implements ShakeDetectionKmoniMergedPoint { - const factory _ShakeDetectionKmoniMergedPoint( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required final JmaForecastIntensity intensity, - required final String code, - @JsonKey( - fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) - required final KyoshinObservationPoint point}) = - _$ShakeDetectionKmoniMergedPointImpl; + const factory _ShakeDetectionKmoniMergedPoint({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required final JmaForecastIntensity intensity, + required final String code, + @JsonKey(fromJson: KyoshinObservationPoint.fromJson, toJson: _pointToJson) + required final KyoshinObservationPoint point, + }) = _$ShakeDetectionKmoniMergedPointImpl; factory _ShakeDetectionKmoniMergedPoint.fromJson(Map json) = _$ShakeDetectionKmoniMergedPointImpl.fromJson; @override @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get intensity; @override String get code; @@ -701,6 +783,7 @@ abstract class _ShakeDetectionKmoniMergedPoint @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ShakeDetectionKmoniMergedPointImplCopyWith< - _$ShakeDetectionKmoniMergedPointImpl> - get copyWith => throw _privateConstructorUsedError; + _$ShakeDetectionKmoniMergedPointImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.g.dart b/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.g.dart index 03c79da6..114367b3 100644 --- a/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.g.dart +++ b/app/lib/feature/shake_detection/model/shake_detection_kmoni_merged_event.g.dart @@ -9,66 +9,73 @@ part of 'shake_detection_kmoni_merged_event.dart'; // ************************************************************************** _$ShakeDetectionKmoniMergedEventImpl - _$$ShakeDetectionKmoniMergedEventImplFromJson(Map json) => - $checkedCreate( - r'_$ShakeDetectionKmoniMergedEventImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionKmoniMergedEventImpl( - event: $checkedConvert( - 'event', - (v) => - ShakeDetectionEvent.fromJson(v as Map)), - regions: $checkedConvert( - 'regions', - (v) => (v as List) - .map((e) => ShakeDetectionKmoniMergedRegion.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); +_$$ShakeDetectionKmoniMergedEventImplFromJson(Map json) => + $checkedCreate(r'_$ShakeDetectionKmoniMergedEventImpl', json, ( + $checkedConvert, + ) { + final val = _$ShakeDetectionKmoniMergedEventImpl( + event: $checkedConvert( + 'event', + (v) => ShakeDetectionEvent.fromJson(v as Map), + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List) + .map( + (e) => ShakeDetectionKmoniMergedRegion.fromJson( + e as Map, + ), + ) + .toList(), + ), + ); + return val; + }); Map _$$ShakeDetectionKmoniMergedEventImplToJson( - _$ShakeDetectionKmoniMergedEventImpl instance) => - { - 'event': instance.event, - 'regions': instance.regions, - }; + _$ShakeDetectionKmoniMergedEventImpl instance, +) => {'event': instance.event, 'regions': instance.regions}; _$ShakeDetectionKmoniMergedRegionImpl - _$$ShakeDetectionKmoniMergedRegionImplFromJson(Map json) => - $checkedCreate( - r'_$ShakeDetectionKmoniMergedRegionImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionKmoniMergedRegionImpl( - name: $checkedConvert('name', (v) => v as String), - maxIntensity: $checkedConvert( - 'maxIntensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v, - unknownValue: JmaForecastIntensity.unknown) ?? - JmaForecastIntensity.unknown), - points: $checkedConvert( - 'points', - (v) => (v as List) - .map((e) => ShakeDetectionKmoniMergedPoint.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); +_$$ShakeDetectionKmoniMergedRegionImplFromJson(Map json) => + $checkedCreate(r'_$ShakeDetectionKmoniMergedRegionImpl', json, ( + $checkedConvert, + ) { + final val = _$ShakeDetectionKmoniMergedRegionImpl( + name: $checkedConvert('name', (v) => v as String), + maxIntensity: $checkedConvert( + 'maxIntensity', + (v) => + $enumDecodeNullable( + _$JmaForecastIntensityEnumMap, + v, + unknownValue: JmaForecastIntensity.unknown, + ) ?? + JmaForecastIntensity.unknown, + ), + points: $checkedConvert( + 'points', + (v) => + (v as List) + .map( + (e) => ShakeDetectionKmoniMergedPoint.fromJson( + e as Map, + ), + ) + .toList(), + ), + ); + return val; + }); Map _$$ShakeDetectionKmoniMergedRegionImplToJson( - _$ShakeDetectionKmoniMergedRegionImpl instance) => - { - 'name': instance.name, - 'maxIntensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, - 'points': instance.points, - }; + _$ShakeDetectionKmoniMergedRegionImpl instance, +) => { + 'name': instance.name, + 'maxIntensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, + 'points': instance.points, +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', @@ -85,30 +92,34 @@ const _$JmaForecastIntensityEnumMap = { }; _$ShakeDetectionKmoniMergedPointImpl - _$$ShakeDetectionKmoniMergedPointImplFromJson(Map json) => - $checkedCreate( - r'_$ShakeDetectionKmoniMergedPointImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionKmoniMergedPointImpl( - intensity: $checkedConvert( - 'intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v, - unknownValue: JmaForecastIntensity.unknown) ?? - JmaForecastIntensity.unknown), - code: $checkedConvert('code', (v) => v as String), - point: $checkedConvert('point', - (v) => KyoshinObservationPoint.fromJson(v as String)), - ); - return val; - }, - ); +_$$ShakeDetectionKmoniMergedPointImplFromJson(Map json) => + $checkedCreate(r'_$ShakeDetectionKmoniMergedPointImpl', json, ( + $checkedConvert, + ) { + final val = _$ShakeDetectionKmoniMergedPointImpl( + intensity: $checkedConvert( + 'intensity', + (v) => + $enumDecodeNullable( + _$JmaForecastIntensityEnumMap, + v, + unknownValue: JmaForecastIntensity.unknown, + ) ?? + JmaForecastIntensity.unknown, + ), + code: $checkedConvert('code', (v) => v as String), + point: $checkedConvert( + 'point', + (v) => KyoshinObservationPoint.fromJson(v as String), + ), + ); + return val; + }); Map _$$ShakeDetectionKmoniMergedPointImplToJson( - _$ShakeDetectionKmoniMergedPointImpl instance) => - { - 'intensity': _$JmaForecastIntensityEnumMap[instance.intensity]!, - 'code': instance.code, - 'point': _pointToJson(instance.point), - }; + _$ShakeDetectionKmoniMergedPointImpl instance, +) => { + 'intensity': _$JmaForecastIntensityEnumMap[instance.intensity]!, + 'code': instance.code, + 'point': _pointToJson(instance.point), +}; diff --git a/app/lib/feature/shake_detection/provider/shake_detection_provider.dart b/app/lib/feature/shake_detection/provider/shake_detection_provider.dart index cad5301e..20ba52a7 100644 --- a/app/lib/feature/shake_detection/provider/shake_detection_provider.dart +++ b/app/lib/feature/shake_detection/provider/shake_detection_provider.dart @@ -18,40 +18,35 @@ part 'shake_detection_provider.g.dart'; class ShakeDetection extends _$ShakeDetection { @override Future> build() async { - final apiResult = - await ref.watch(_fetchShakeDetectionEventsProvider.future); + final apiResult = await ref.watch( + _fetchShakeDetectionEventsProvider.future, + ); ref - ..listen( - websocketTableMessagesProvider, - (_, next) { - if (next case AsyncData(value: final value)) { - if (value - case RealtimePostgresInsertPayload< - ShakeDetectionWebSocketTelegram>()) { - for (final event in value.newData.events) { - _upsertShakeDetectionEvents([event]); - } - } else if (value - case RealtimePostgresDeletePayload< - ShakeDetectionWebSocketTelegram>()) { - state = const AsyncData([]); - } else { - log('unknown value: $value'); + ..listen(websocketTableMessagesProvider, (_, next) { + if (next case AsyncData(value: final value)) { + if (value + case RealtimePostgresInsertPayload< + ShakeDetectionWebSocketTelegram + >()) { + for (final event in value.newData.events) { + _upsertShakeDetectionEvents([event]); } + } else if (value + case RealtimePostgresDeletePayload< + ShakeDetectionWebSocketTelegram + >()) { + state = const AsyncData([]); + } else { + log('unknown value: $value'); } - }, - ) - ..listen( - timeTickerProvider(), - (_, __) { - if (state case AsyncData(:final value)) { - state = AsyncData(_pruneOldEvents(value)); - } - }, - ); - return _pruneOldEvents([ - ...apiResult, - ]); + } + }) + ..listen(timeTickerProvider(), (_, __) { + if (state case AsyncData(:final value)) { + state = AsyncData(_pruneOldEvents(value)); + } + }); + return _pruneOldEvents([...apiResult]); } /// 古くなったイベントを破棄 @@ -59,16 +54,13 @@ class ShakeDetection extends _$ShakeDetection { const duration = Duration(seconds: 30); return events .where( - (event) => event.insertedAt.isAfter( - DateTime.now().subtract(duration), - ), + (event) => + event.insertedAt.isAfter(DateTime.now().subtract(duration)), ) .toList(); } - void _upsertShakeDetectionEvents( - List events, - ) { + void _upsertShakeDetectionEvents(List events) { final currentEvents = state.valueOrNull ?? []; final data = [...currentEvents]; for (final event in events) { @@ -112,31 +104,27 @@ class ShakeDetectionKmoniPointsMerged (e) => ShakeDetectionKmoniMergedRegion( name: e.name, maxIntensity: e.maxIntensity, - points: e.points - .map( - (p) { - final point = points.points.firstWhereOrNull( - (e) => e.code == p.code, - ); - if (point == null) { - return null; - } - return ShakeDetectionKmoniMergedPoint( - intensity: p.intensity, - code: p.code, - point: point, - ); - }, - ) - .nonNulls - .toList(), + points: + e.points + .map((p) { + final point = points.points.firstWhereOrNull( + (e) => e.code == p.code, + ); + if (point == null) { + return null; + } + return ShakeDetectionKmoniMergedPoint( + intensity: p.intensity, + code: p.code, + point: point, + ); + }) + .nonNulls + .toList(), ), ); merged.add( - ShakeDetectionKmoniMergedEvent( - event: event, - regions: regions.toList(), - ), + ShakeDetectionKmoniMergedEvent(event: event, regions: regions.toList()), ); } return merged; @@ -144,41 +132,34 @@ class ShakeDetectionKmoniPointsMerged } @Riverpod(keepAlive: true) -Future> _fetchShakeDetectionEvents( - Ref ref, -) async => +Future> _fetchShakeDetectionEvents(Ref ref) async => ref.watch(eqApiProvider).v1.getLatestShakeDetectionEvents(); enum ShakeDetectionLevel { low(Colors.green), middle(Colors.yellow), high(Colors.red), - highest(Colors.purple), - ; + highest(Colors.purple); const ShakeDetectionLevel(this.color); final Color color; static ShakeDetectionLevel fromJmaForecastIntensity( JmaForecastIntensity intensity, - ) => - switch (intensity) { - JmaForecastIntensity.zero => ShakeDetectionLevel.low, - JmaForecastIntensity.one || - JmaForecastIntensity.two || - JmaForecastIntensity.three => - ShakeDetectionLevel.middle, - JmaForecastIntensity.four || - JmaForecastIntensity.fiveLower || - JmaForecastIntensity.fiveUpper => - ShakeDetectionLevel.high, - JmaForecastIntensity.sixLower || - JmaForecastIntensity.sixUpper || - JmaForecastIntensity.seven => - ShakeDetectionLevel.highest, - JmaForecastIntensity.unknown => - throw ArgumentError('unsupported JmaForecastIntensity: $intensity'), - }; + ) => switch (intensity) { + JmaForecastIntensity.zero => ShakeDetectionLevel.low, + JmaForecastIntensity.one || + JmaForecastIntensity.two || + JmaForecastIntensity.three => ShakeDetectionLevel.middle, + JmaForecastIntensity.four || + JmaForecastIntensity.fiveLower || + JmaForecastIntensity.fiveUpper => ShakeDetectionLevel.high, + JmaForecastIntensity.sixLower || + JmaForecastIntensity.sixUpper || + JmaForecastIntensity.seven => ShakeDetectionLevel.highest, + JmaForecastIntensity.unknown => + throw ArgumentError('unsupported JmaForecastIntensity: $intensity'), + }; bool operator <(ShakeDetectionLevel other) => index < other.index; } diff --git a/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart b/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart index d15a9f39..eef009a8 100644 --- a/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart +++ b/app/lib/feature/shake_detection/provider/shake_detection_provider.g.dart @@ -15,36 +15,38 @@ String _$fetchShakeDetectionEventsHash() => @ProviderFor(_fetchShakeDetectionEvents) final _fetchShakeDetectionEventsProvider = FutureProvider>.internal( - _fetchShakeDetectionEvents, - name: r'_fetchShakeDetectionEventsProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$fetchShakeDetectionEventsHash, - dependencies: null, - allTransitiveDependencies: null, -); + _fetchShakeDetectionEvents, + name: r'_fetchShakeDetectionEventsProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$fetchShakeDetectionEventsHash, + dependencies: null, + allTransitiveDependencies: null, + ); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -typedef _FetchShakeDetectionEventsRef - = FutureProviderRef>; +typedef _FetchShakeDetectionEventsRef = + FutureProviderRef>; String _$shakeDetectionHash() => r'3cbc2b6a6d3312d20de99ca4512ff627577f3dcd'; /// See also [ShakeDetection]. @ProviderFor(ShakeDetection) final shakeDetectionProvider = AsyncNotifierProvider>.internal( - ShakeDetection.new, - name: r'shakeDetectionProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$shakeDetectionHash, - dependencies: [timeTickerProvider], - allTransitiveDependencies: { - timeTickerProvider, - ...?timeTickerProvider.allTransitiveDependencies - }, -); + ShakeDetection.new, + name: r'shakeDetectionProvider', + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$shakeDetectionHash, + dependencies: [timeTickerProvider], + allTransitiveDependencies: { + timeTickerProvider, + ...?timeTickerProvider.allTransitiveDependencies, + }, + ); typedef _$ShakeDetection = AsyncNotifier>; String _$shakeDetectionKmoniPointsMergedHash() => @@ -53,21 +55,23 @@ String _$shakeDetectionKmoniPointsMergedHash() => /// See also [ShakeDetectionKmoniPointsMerged]. @ProviderFor(ShakeDetectionKmoniPointsMerged) final shakeDetectionKmoniPointsMergedProvider = AsyncNotifierProvider< - ShakeDetectionKmoniPointsMerged, - List>.internal( + ShakeDetectionKmoniPointsMerged, + List +>.internal( ShakeDetectionKmoniPointsMerged.new, name: r'shakeDetectionKmoniPointsMergedProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$shakeDetectionKmoniPointsMergedHash, + debugGetCreateSourceHash: + const bool.fromEnvironment('dart.vm.product') + ? null + : _$shakeDetectionKmoniPointsMergedHash, dependencies: [shakeDetectionProvider], allTransitiveDependencies: { shakeDetectionProvider, - ...?shakeDetectionProvider.allTransitiveDependencies + ...?shakeDetectionProvider.allTransitiveDependencies, }, ); -typedef _$ShakeDetectionKmoniPointsMerged - = AsyncNotifier>; +typedef _$ShakeDetectionKmoniPointsMerged = + AsyncNotifier>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/app/lib/feature/talker/talker_page.dart b/app/lib/feature/talker/talker_page.dart index 1d5b1ea2..23859cb3 100644 --- a/app/lib/feature/talker/talker_page.dart +++ b/app/lib/feature/talker/talker_page.dart @@ -7,7 +7,6 @@ class TalkerPage extends ConsumerWidget { const TalkerPage({super.key}); @override - Widget build(BuildContext context, WidgetRef ref) => TalkerScreen( - talker: talker, - ); + Widget build(BuildContext context, WidgetRef ref) => + TalkerScreen(talker: talker); } diff --git a/app/lib/gen/assets.gen.dart b/app/lib/gen/assets.gen.dart index 52f56c61..175f6a51 100644 --- a/app/lib/gen/assets.gen.dart +++ b/app/lib/gen/assets.gen.dart @@ -52,14 +52,14 @@ class $AssetsFontsGen { /// List of all assets List get values => [ - jetBrainsMonoBold, - jetBrainsMonoExtraBold, - jetBrainsMonoMedium, - notoSansJPBlack, - notoSansJPBold, - notoSansJPMedium, - notoSansJPRegular - ]; + jetBrainsMonoBold, + jetBrainsMonoExtraBold, + jetBrainsMonoMedium, + notoSansJPBlack, + notoSansJPBold, + notoSansJPMedium, + notoSansJPRegular, + ]; } class $AssetsImagesGen { @@ -130,23 +130,19 @@ class Assets { /// List of all assets static List get values => [ - kyoshinShindoColorMap, - header, - jmaCodeTable, - jmaMap, - kyoshinMonitorScale, - kyoshinObservationPoint, - tjma2001, - shorebird - ]; + kyoshinShindoColorMap, + header, + jmaCodeTable, + jmaMap, + kyoshinMonitorScale, + kyoshinObservationPoint, + tjma2001, + shorebird, + ]; } class AssetGenImage { - const AssetGenImage( - this._assetName, { - this.size, - this.flavors = const {}, - }); + const AssetGenImage(this._assetName, {this.size, this.flavors = const {}}); final String _assetName; @@ -206,15 +202,8 @@ class AssetGenImage { ); } - ImageProvider provider({ - AssetBundle? bundle, - String? package, - }) { - return AssetImage( - _assetName, - bundle: bundle, - package: package, - ); + ImageProvider provider({AssetBundle? bundle, String? package}) { + return AssetImage(_assetName, bundle: bundle, package: package); } String get path => _assetName; diff --git a/app/lib/main.dart b/app/lib/main.dart index 730b8202..95e4e054 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -51,9 +51,7 @@ Future main() async { ), ); - await Firebase.initializeApp( - options: DefaultFirebaseOptions.currentPlatform, - ); + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); talker = TalkerFlutter.init( settings: TalkerSettings( @@ -62,9 +60,7 @@ Future main() async { ), ); if (!kIsWeb) { - talker.configure( - observer: CrashlyticsTalkerObserver(), - ); + talker.configure(observer: CrashlyticsTalkerObserver()); } FlutterError.onError = (error) { @@ -97,44 +93,51 @@ Future main() async { final deviceInfo = DeviceInfoPlugin(); - final results = await ( - ( - SharedPreferences.getInstance(), - PackageInfo.fromPlatform(), - (!kIsWeb && Platform.isAndroid - ? deviceInfo.androidInfo - : Future.value()), - (!kIsWeb && Platform.isIOS ? deviceInfo.iosInfo : Future.value()), - kIsWeb ? Future.value() : _registerNotificationChannelIfNeeded(), - kIsWeb ? Future.value() : getApplicationDocumentsDirectory(), - loadJmaCodeTable(), - kIsWeb - ? Future.value() - : FlutterLocalNotificationsPlugin().initialize( - const InitializationSettings( - iOS: DarwinInitializationSettings( - requestAlertPermission: false, - requestSoundPermission: false, - requestBadgePermission: false, - ), - android: AndroidInitializationSettings('mipmap/ic_launcher'), - macOS: DarwinInitializationSettings( - requestAlertPermission: false, - requestSoundPermission: false, - requestBadgePermission: false, + final results = + await ( + ( + SharedPreferences.getInstance(), + PackageInfo.fromPlatform(), + (!kIsWeb && Platform.isAndroid + ? deviceInfo.androidInfo + : Future.value()), + (!kIsWeb && Platform.isIOS + ? deviceInfo.iosInfo + : Future.value()), + kIsWeb + ? Future.value() + : _registerNotificationChannelIfNeeded(), + kIsWeb ? Future.value() : getApplicationDocumentsDirectory(), + loadJmaCodeTable(), + kIsWeb + ? Future.value() + : FlutterLocalNotificationsPlugin().initialize( + const InitializationSettings( + iOS: DarwinInitializationSettings( + requestAlertPermission: false, + requestSoundPermission: false, + requestBadgePermission: false, + ), + android: AndroidInitializationSettings('mipmap/ic_launcher'), + macOS: DarwinInitializationSettings( + requestAlertPermission: false, + requestSoundPermission: false, + requestBadgePermission: false, + ), ), ), - ), - ).wait, - ( - initInAppPurchase(), - initLicenses(), - kIsWeb ? Future.value() : getKyoshinColorMap(), - !kIsWeb && Platform.isIOS - ? SharedPreferenceAppGroup.setAppGroup('group.net.yumnumm.eqmonitor') - : Future.value(), - ).wait, - ).wait; + ).wait, + ( + initInAppPurchase(), + initLicenses(), + kIsWeb ? Future.value() : getKyoshinColorMap(), + !kIsWeb && Platform.isIOS + ? SharedPreferenceAppGroup.setAppGroup( + 'group.net.yumnumm.eqmonitor', + ) + : Future.value(), + ).wait, + ).wait; FirebaseMessaging.onBackgroundMessage(onBackgroundMessage); if (!kIsWeb) { @@ -156,33 +159,26 @@ Future main() async { if (results.$2.$3 != null) kyoshinColorMapProvider.overrideWithValue(results.$2.$3!), ], - observers: [ - if (kDebugMode) - CustomProviderObserver( - talker, - ), - ], + observers: [if (kDebugMode) CustomProviderObserver(talker)], ); await ( - container - .read(kyoshinMonitorInternalObservationPointsConvertedProvider.future), + container.read( + kyoshinMonitorInternalObservationPointsConvertedProvider.future, + ), container.read(travelTimeInternalProvider.future), container.read(permissionNotifierProvider.notifier).initialize(), ).wait; - runApp( - UncontrolledProviderScope( - container: container, - child: const App(), - ), - ); + runApp(UncontrolledProviderScope(container: container, child: const App())); } Future _registerNotificationChannelIfNeeded() async { - final androidNotificationPlugin = FlutterLocalNotificationsPlugin() - .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin>(); + final androidNotificationPlugin = + FlutterLocalNotificationsPlugin() + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin + >(); if (androidNotificationPlugin == null) { return; } diff --git a/app/test/core/provider/periodic_timer_test.dart b/app/test/core/provider/periodic_timer_test.dart index 1e765260..ed273ab9 100644 --- a/app/test/core/provider/periodic_timer_test.dart +++ b/app/test/core/provider/periodic_timer_test.dart @@ -13,14 +13,11 @@ void main() { final key = UniqueKey(); final events = []; - container.listen( - periodicTimerProvider(key), - (previous, next) { - if (next is AsyncData) { - events.add(null); - } - }, - ); + container.listen(periodicTimerProvider(key), (previous, next) { + if (next is AsyncData) { + events.add(null); + } + }); // Providerの初期化を待つ async.flushMicrotasks(); @@ -45,14 +42,11 @@ void main() { final key = UniqueKey(); final events = []; - container.listen( - periodicTimerProvider(key), - (previous, next) { - if (next is AsyncData) { - events.add(null); - } - }, - ); + container.listen(periodicTimerProvider(key), (previous, next) { + if (next is AsyncData) { + events.add(null); + } + }); async.flushMicrotasks(); @@ -75,78 +69,68 @@ void main() { test( 'setInterval - インターバルの変更 途中でインターバルが短くなる', - () => fakeAsync( - (async) { - final container = ProviderContainer(); - addTearDown(container.dispose); - - final key = UniqueKey(); - final events = []; - container.listen( - periodicTimerProvider(key), - (previous, next) { - if (next is AsyncData) { - events.add(null); - } - }, - ); - - async.flushMicrotasks(); - - final notifier = container.read(periodicTimerProvider(key).notifier); - - // 最初のインターバル設定 - notifier.setInterval(const Duration(seconds: 5)); - // 2秒進める - async.elapse(const Duration(seconds: 2)); - - // インターバルを変更 - notifier.setInterval(const Duration(seconds: 3)); - - expect(events, isEmpty); - // NOTE: 1秒後にイベントが発火することを確認 - async.elapse(const Duration(seconds: 1)); - - // イベントが発火することを確認 - expect(events, isNotEmpty); - }, - ), + () => fakeAsync((async) { + final container = ProviderContainer(); + addTearDown(container.dispose); + + final key = UniqueKey(); + final events = []; + container.listen(periodicTimerProvider(key), (previous, next) { + if (next is AsyncData) { + events.add(null); + } + }); + + async.flushMicrotasks(); + + final notifier = container.read(periodicTimerProvider(key).notifier); + + // 最初のインターバル設定 + notifier.setInterval(const Duration(seconds: 5)); + // 2秒進める + async.elapse(const Duration(seconds: 2)); + + // インターバルを変更 + notifier.setInterval(const Duration(seconds: 3)); + + expect(events, isEmpty); + // NOTE: 1秒後にイベントが発火することを確認 + async.elapse(const Duration(seconds: 1)); + + // イベントが発火することを確認 + expect(events, isNotEmpty); + }), ); test( 'setInterval - インターバルの変更 途中でインターバルが短くなる (既に経過)', - () => fakeAsync( - (async) { - final container = ProviderContainer(); - addTearDown(container.dispose); - - final key = UniqueKey(); - final events = []; - container.listen( - periodicTimerProvider(key), - (previous, next) { - if (next is AsyncData) { - events.add(null); - } - }, - ); - - async.flushMicrotasks(); - - final notifier = container.read(periodicTimerProvider(key).notifier); - - // 最初のインターバル設定 - notifier.setInterval(const Duration(seconds: 5)); - // 3秒進める - async.elapse(const Duration(seconds: 3)); - - // インターバルを変更 - notifier.setInterval(const Duration(seconds: 2)); - async.flushMicrotasks(); - - expect(events, isNotEmpty); - }, - ), + () => fakeAsync((async) { + final container = ProviderContainer(); + addTearDown(container.dispose); + + final key = UniqueKey(); + final events = []; + container.listen(periodicTimerProvider(key), (previous, next) { + if (next is AsyncData) { + events.add(null); + } + }); + + async.flushMicrotasks(); + + final notifier = container.read(periodicTimerProvider(key).notifier); + + // 最初のインターバル設定 + notifier.setInterval(const Duration(seconds: 5)); + // 3秒進める + async.elapse(const Duration(seconds: 3)); + + // インターバルを変更 + notifier.setInterval(const Duration(seconds: 2)); + async.flushMicrotasks(); + + expect(events, isNotEmpty); + }), ); test( @@ -157,14 +141,11 @@ void main() { final key = UniqueKey(); final events = []; - container.listen( - periodicTimerProvider(key), - (previous, next) { - if (next is AsyncData) { - events.add(null); - } - }, - ); + container.listen(periodicTimerProvider(key), (previous, next) { + if (next is AsyncData) { + events.add(null); + } + }); async.flushMicrotasks(); diff --git a/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart b/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart index 957f6d67..9ad5d9de 100644 --- a/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart +++ b/app/test/core/provider/travel_time/provider/travel_time_provider_test.dart @@ -16,46 +16,31 @@ void main() { expect(travelTimeDepthMap, isNotNull); }); - group( - 'TravelTimeDepthMapCalc', - () { - // https://zenn.dev/boocsan/articles/travel-time-table-converter-adcal2020?#%E5%8B%95%E4%BD%9C%E7%A2%BA%E8%AA%8D より - test( - '20km 20sec', - () { - final travelMap = container.read(travelTimeDepthMapProvider); - final result = travelMap.getTravelTime(20, 20); - expect(result.pDistance, 122.35900962861072); - expect(result.sDistance, 67.68853695324285); - }, - ); - test( - '100km 200sec', - () { - final travelMap = container.read(travelTimeDepthMapProvider); - final result = travelMap.getTravelTime(100, 200); - expect(result.pDistance, 1603.2552083333333); - expect(result.sDistance, 868.2417083144026); - }, - ); - test( - '200km 200sec', - () { - final travelMap = container.read(travelTimeDepthMapProvider); - final result = travelMap.getTravelTime(200, 200); - expect(result.pDistance, 1639.8745519713261); - expect(result.sDistance, 874.7576045627376); - }, - ); - test( - '300km 200sec', - () { - final travelMap = container.read(travelTimeDepthMapProvider); - final result = travelMap.getTravelTime(300, 200); - expect(result.pDistance, 1672.7323943661972); - expect(result.sDistance, 869.2659627953747); - }, - ); - }, - ); + group('TravelTimeDepthMapCalc', () { + // https://zenn.dev/boocsan/articles/travel-time-table-converter-adcal2020?#%E5%8B%95%E4%BD%9C%E7%A2%BA%E8%AA%8D より + test('20km 20sec', () { + final travelMap = container.read(travelTimeDepthMapProvider); + final result = travelMap.getTravelTime(20, 20); + expect(result.pDistance, 122.35900962861072); + expect(result.sDistance, 67.68853695324285); + }); + test('100km 200sec', () { + final travelMap = container.read(travelTimeDepthMapProvider); + final result = travelMap.getTravelTime(100, 200); + expect(result.pDistance, 1603.2552083333333); + expect(result.sDistance, 868.2417083144026); + }); + test('200km 200sec', () { + final travelMap = container.read(travelTimeDepthMapProvider); + final result = travelMap.getTravelTime(200, 200); + expect(result.pDistance, 1639.8745519713261); + expect(result.sDistance, 874.7576045627376); + }); + test('300km 200sec', () { + final travelMap = container.read(travelTimeDepthMapProvider); + final result = travelMap.getTravelTime(300, 200); + expect(result.pDistance, 1672.7323943661972); + expect(result.sDistance, 869.2659627953747); + }); + }); } diff --git a/app/test/core/util/event_id_test.dart b/app/test/core/util/event_id_test.dart index 3c749d66..fdaa21fd 100644 --- a/app/test/core/util/event_id_test.dart +++ b/app/test/core/util/event_id_test.dart @@ -2,22 +2,16 @@ import 'package:eqmonitor/core/util/event_id.dart'; import 'package:test/test.dart'; void main() { - test( - 'intをEventIdへ変換できること', - () { - const target = 20240101235959; - final _ = EventId(target); - }, - ); + test('intをEventIdへ変換できること', () { + const target = 20240101235959; + final _ = EventId(target); + }); group('EventIdの桁数が不正の場合', () { - test( - 'EventIdの桁数が足りない場合、nullを返すこと', - () { - const target = 202401012359; // ssがない - final result = EventId(target); - expect(result.toCreationDate(), isNull); - }, - ); + test('EventIdの桁数が足りない場合、nullを返すこと', () { + const target = 202401012359; // ssがない + final result = EventId(target); + expect(result.toCreationDate(), isNull); + }); test('EventIdの桁数が多い場合、nullを返すこと', () { const target = 202401012359599; // 1桁多い final result = EventId(target); @@ -31,13 +25,10 @@ void main() { 20240131010203: DateTime(2024, 1, 31, 1, 2, 3), }; for (final entry in map.entries) { - test( - 'EventId: ${entry.key} -> DateTime: ${entry.value}', - () { - final result = EventId(entry.key); - expect(result.toCreationDate(), entry.value); - }, - ); + test('EventId: ${entry.key} -> DateTime: ${entry.value}', () { + final result = EventId(entry.key); + expect(result.toCreationDate(), entry.value); + }); } }); } diff --git a/app/test/core/util/provider/websocket/websocket_provider_test.dart b/app/test/core/util/provider/websocket/websocket_provider_test.dart index a1ebd868..abb2002c 100644 --- a/app/test/core/util/provider/websocket/websocket_provider_test.dart +++ b/app/test/core/util/provider/websocket/websocket_provider_test.dart @@ -3,50 +3,47 @@ import 'package:flutter_test/flutter_test.dart'; void main() { group('realtimePostgresChangesPayloadTableMessageProvider', () { - test( - '上流からEewV1-Insertが流れてきた時に、正しくパースすること', - () { - // arrange - final demoPayload = { - 'commit_timestamp': '2024-04-01T12:10:32.747Z', - 'eventType': 'INSERT', - 'new': { - 'id': -1, - 'event_id': 20240401210952, - 'info_type': '発表', - 'schema_type': 'eew-information', - 'status': '通常', - 'type': '緊急地震速報(地震動予報)', - 'headline': null, - 'serial_no': 1, - 'is_canceled': false, - 'is_last_info': false, - 'arrival_time': '2024-04-01T21:09:52+09:00', - 'depth': 40, - 'forecast_max_intensity': '1', - 'forecast_max_intensity_is_over': false, - 'forecast_max_lpgm_intensity': '0', - 'forecast_max_lpgm_intensity_is_over': false, - 'hypo_name': '石垣島北西沖', - 'is_warning': false, - 'latitude': 25.2, - 'longitude': 123.6, - 'magnitude': 3.6, - 'origin_time': '2024-04-01T21:09:37+09:00', - 'regions': [], - 'report_time': '2024-04-01T21:09:37+09:00', - }, - 'old': {}, - 'schema': 'public', - 'table': 'eew', - 'errors': null, - }; - // act - final result = RealtimePostgresChangesPayloadBase.fromJson(demoPayload); - // assert - expect(result, isA>()); - }, - ); + test('上流からEewV1-Insertが流れてきた時に、正しくパースすること', () { + // arrange + final demoPayload = { + 'commit_timestamp': '2024-04-01T12:10:32.747Z', + 'eventType': 'INSERT', + 'new': { + 'id': -1, + 'event_id': 20240401210952, + 'info_type': '発表', + 'schema_type': 'eew-information', + 'status': '通常', + 'type': '緊急地震速報(地震動予報)', + 'headline': null, + 'serial_no': 1, + 'is_canceled': false, + 'is_last_info': false, + 'arrival_time': '2024-04-01T21:09:52+09:00', + 'depth': 40, + 'forecast_max_intensity': '1', + 'forecast_max_intensity_is_over': false, + 'forecast_max_lpgm_intensity': '0', + 'forecast_max_lpgm_intensity_is_over': false, + 'hypo_name': '石垣島北西沖', + 'is_warning': false, + 'latitude': 25.2, + 'longitude': 123.6, + 'magnitude': 3.6, + 'origin_time': '2024-04-01T21:09:37+09:00', + 'regions': [], + 'report_time': '2024-04-01T21:09:37+09:00', + }, + 'old': {}, + 'schema': 'public', + 'table': 'eew', + 'errors': null, + }; + // act + final result = RealtimePostgresChangesPayloadBase.fromJson(demoPayload); + // assert + expect(result, isA>()); + }); test('上流からEarthquakeV1-Insertが流れてきた時に、正しくパースすること`', () { // arrange final demoData = { diff --git a/app/test/feature/earthquake_history/data/earthquake_history_notifier_test.dart b/app/test/feature/earthquake_history/data/earthquake_history_notifier_test.dart index f69316d5..8b1ced6b 100644 --- a/app/test/feature/earthquake_history/data/earthquake_history_notifier_test.dart +++ b/app/test/feature/earthquake_history/data/earthquake_history_notifier_test.dart @@ -4,105 +4,46 @@ import 'package:eqmonitor/feature/earthquake_history/data/model/earthquake_histo import 'package:flutter_test/flutter_test.dart'; void main() { - group( - 'EarthquakeHistoryParameterMatch Extension', - () { - group( - 'isRealtimeDataMatch', + group('EarthquakeHistoryParameterMatch Extension', () { + group('isRealtimeDataMatch', () { + test( + 'RealtimePostgresInsertPayload は、isEarthquakeV1Matchの結果を返すこと', () { - test( - 'RealtimePostgresInsertPayload は、isEarthquakeV1Matchの結果を返すこと', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.fiveLower, - ); - final data = EarthquakeV1( - eventId: 20220101000000, - status: '通常', - arrivalTime: DateTime(2022), - depth: 10, - magnitude: 5.5, - maxIntensity: JmaIntensity.fiveLower, - ); - final payload = RealtimePostgresInsertPayload( - newData: data, - schema: 'public', - table: 'earthquake', - commitTimestamp: DateTime(2002), - errors: null, - ); - - // Act - final result = parameter.isRealtimeDataMatch(payload); - - // Assert - expect(result, parameter.isEarthquakeV1Match(data)); - }, + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.fiveLower, ); - test( - 'RealtimePostgresUpdatePayload は、isEarthquakeV1Matchの結果を返すこと', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.fiveLower, - ); - final data = EarthquakeV1( - eventId: 20220101000000, - status: '通常', - arrivalTime: DateTime(2022), - depth: 10, - magnitude: 5.5, - maxIntensity: JmaIntensity.fiveLower, - ); - final payload = RealtimePostgresUpdatePayload( - old: { - 'eventId': 20220101000000, - }, - newData: data, - schema: 'public', - table: 'earthquake', - commitTimestamp: DateTime(2002), - errors: null, - ); - - // Act - final result = parameter.isRealtimeDataMatch(payload); - - // Assert - expect(result, parameter.isEarthquakeV1Match(data)); - }, + final data = EarthquakeV1( + eventId: 20220101000000, + status: '通常', + arrivalTime: DateTime(2022), + depth: 10, + magnitude: 5.5, + maxIntensity: JmaIntensity.fiveLower, ); - test( - 'RealtimePostgresDeletePayload は、falseを返すこと', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.fiveLower, - ); - final payload = RealtimePostgresDeletePayload( - old: { - 'eventId': 20220101000000, - }, - schema: 'public', - table: 'earthquake', - commitTimestamp: DateTime(2002), - errors: null, - ); - - // Act - final result = parameter.isRealtimeDataMatch(payload); - - // Assert - expect(result, false); - }, + final payload = RealtimePostgresInsertPayload( + newData: data, + schema: 'public', + table: 'earthquake', + commitTimestamp: DateTime(2002), + errors: null, ); + + // Act + final result = parameter.isRealtimeDataMatch(payload); + + // Assert + expect(result, parameter.isEarthquakeV1Match(data)); }, ); - group( - 'isEarthquakeV1Match', + test( + 'RealtimePostgresUpdatePayload は、isEarthquakeV1Matchの結果を返すこと', () { - final base = EarthquakeV1( + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.fiveLower, + ); + final data = EarthquakeV1( eventId: 20220101000000, status: '通常', arrivalTime: DateTime(2022), @@ -110,334 +51,274 @@ void main() { magnitude: 5.5, maxIntensity: JmaIntensity.fiveLower, ); - group( - 'maxIntensity', - () { - test( - '最大震度がnullの場合はfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.fiveLower, - ); - final data = base.copyWith( - maxIntensity: null, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'maxIntensity < intensityGteはfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.sixLower, - ); - final data = base.copyWith( - maxIntensity: JmaIntensity.fiveLower, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'intesityLte < maxIntensityはfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityLte: JmaIntensity.fiveLower, - ); - final data = base.copyWith( - maxIntensity: JmaIntensity.sixLower, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'intensityGte <= maxIntensity <= intensityLteの場合はtrueを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.fiveLower, - intensityLte: JmaIntensity.fiveLower, - ); - final data = base.copyWith( - maxIntensity: JmaIntensity.fiveLower, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }, - ); - test('intensityGteがnullでintensityLte < maxIntensityの場合はtrueを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityLte: JmaIntensity.fiveLower, - ); - final data = base.copyWith( - maxIntensity: JmaIntensity.fiveLower, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }); - test('intensityLteがnullでintensityGte < maxIntensityの場合はtrueを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - intensityGte: JmaIntensity.fiveLower, - ); - final data = base.copyWith( - maxIntensity: JmaIntensity.fiveLower, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }); - }, - ); - group( - 'magnitude', - () { - test( - 'magnitudeがnullの場合はfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - magnitudeGte: 5.5, - ); - final data = base.copyWith( - magnitude: null, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'magnitude < magnitudeGteはfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - magnitudeGte: 6, - ); - final data = base.copyWith( - magnitude: 5.5, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'magnitudeLte < magnitudeはfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - magnitudeLte: 5, - ); - final data = base.copyWith( - magnitude: 5.5, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'magnitudeGte <= magnitude <= magnitudeLteの場合はtrueを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - magnitudeGte: 5.5, - magnitudeLte: 5.5, - ); - final data = base.copyWith( - magnitude: 5.5, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }, - ); - test('magnitudeGteがnullでmagnitudeLte < magnitudeの場合はtrueを返す', () { - // Arrange - const parameter = EarthquakeHistoryParameter( - magnitudeLte: 5.5, - ); - final data = base.copyWith( - magnitude: 5.5, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }); - test('magnitudeLteがnullでmagnitudeGte < magnitudeの場合はtrueを返す', () { - // Arrange - const parameter = EarthquakeHistoryParameter( - magnitudeGte: 5.5, - ); - final data = base.copyWith( - magnitude: 5.5, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }); - }, - ); - group( - 'depth', - () { - test( - 'depthがnullの場合はfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - depthGte: 10, - ); - final data = base.copyWith( - depth: null, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'depth < depthGteはfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - depthGte: 11, - ); - final data = base.copyWith( - depth: 10, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'depthLte < depthはfalseを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - depthLte: 9, - ); - final data = base.copyWith( - depth: 10, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, false); - }, - ); - test( - 'depthGte <= depth <= depthLteの場合はtrueを返す', - () { - // Arrange - const parameter = EarthquakeHistoryParameter( - depthGte: 10, - depthLte: 10, - ); - final data = base.copyWith( - depth: 10, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }, - ); - test('depthGteがnullでdepthLte < depthの場合はtrueを返す', () { - // Arrange - const parameter = EarthquakeHistoryParameter( - depthLte: 10, - ); - final data = base.copyWith( - depth: 10, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }); - test('depthLteがnullでdepthGte < depthの場合はtrueを返す', () { - // Arrange - const parameter = EarthquakeHistoryParameter( - depthGte: 10, - ); - final data = base.copyWith( - depth: 10, - ); - - // Act - final result = parameter.isEarthquakeV1Match(data); - - // Assert - expect(result, true); - }); - }, + final payload = RealtimePostgresUpdatePayload( + old: {'eventId': 20220101000000}, + newData: data, + schema: 'public', + table: 'earthquake', + commitTimestamp: DateTime(2002), + errors: null, ); + + // Act + final result = parameter.isRealtimeDataMatch(payload); + + // Assert + expect(result, parameter.isEarthquakeV1Match(data)); }, ); - }, - ); + test('RealtimePostgresDeletePayload は、falseを返すこと', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.fiveLower, + ); + final payload = RealtimePostgresDeletePayload( + old: {'eventId': 20220101000000}, + schema: 'public', + table: 'earthquake', + commitTimestamp: DateTime(2002), + errors: null, + ); + + // Act + final result = parameter.isRealtimeDataMatch(payload); + + // Assert + expect(result, false); + }); + }); + group('isEarthquakeV1Match', () { + final base = EarthquakeV1( + eventId: 20220101000000, + status: '通常', + arrivalTime: DateTime(2022), + depth: 10, + magnitude: 5.5, + maxIntensity: JmaIntensity.fiveLower, + ); + group('maxIntensity', () { + test('最大震度がnullの場合はfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.fiveLower, + ); + final data = base.copyWith(maxIntensity: null); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('maxIntensity < intensityGteはfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.sixLower, + ); + final data = base.copyWith(maxIntensity: JmaIntensity.fiveLower); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('intesityLte < maxIntensityはfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityLte: JmaIntensity.fiveLower, + ); + final data = base.copyWith(maxIntensity: JmaIntensity.sixLower); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('intensityGte <= maxIntensity <= intensityLteの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.fiveLower, + intensityLte: JmaIntensity.fiveLower, + ); + final data = base.copyWith(maxIntensity: JmaIntensity.fiveLower); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + test('intensityGteがnullでintensityLte < maxIntensityの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityLte: JmaIntensity.fiveLower, + ); + final data = base.copyWith(maxIntensity: JmaIntensity.fiveLower); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + test('intensityLteがnullでintensityGte < maxIntensityの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + intensityGte: JmaIntensity.fiveLower, + ); + final data = base.copyWith(maxIntensity: JmaIntensity.fiveLower); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + }); + group('magnitude', () { + test('magnitudeがnullの場合はfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(magnitudeGte: 5.5); + final data = base.copyWith(magnitude: null); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('magnitude < magnitudeGteはfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(magnitudeGte: 6); + final data = base.copyWith(magnitude: 5.5); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('magnitudeLte < magnitudeはfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(magnitudeLte: 5); + final data = base.copyWith(magnitude: 5.5); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('magnitudeGte <= magnitude <= magnitudeLteの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + magnitudeGte: 5.5, + magnitudeLte: 5.5, + ); + final data = base.copyWith(magnitude: 5.5); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + test('magnitudeGteがnullでmagnitudeLte < magnitudeの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(magnitudeLte: 5.5); + final data = base.copyWith(magnitude: 5.5); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + test('magnitudeLteがnullでmagnitudeGte < magnitudeの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(magnitudeGte: 5.5); + final data = base.copyWith(magnitude: 5.5); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + }); + group('depth', () { + test('depthがnullの場合はfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(depthGte: 10); + final data = base.copyWith(depth: null); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('depth < depthGteはfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(depthGte: 11); + final data = base.copyWith(depth: 10); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('depthLte < depthはfalseを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(depthLte: 9); + final data = base.copyWith(depth: 10); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, false); + }); + test('depthGte <= depth <= depthLteの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter( + depthGte: 10, + depthLte: 10, + ); + final data = base.copyWith(depth: 10); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + test('depthGteがnullでdepthLte < depthの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(depthLte: 10); + final data = base.copyWith(depth: 10); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + test('depthLteがnullでdepthGte < depthの場合はtrueを返す', () { + // Arrange + const parameter = EarthquakeHistoryParameter(depthGte: 10); + final data = base.copyWith(depth: 10); + + // Act + final result = parameter.isEarthquakeV1Match(data); + + // Assert + expect(result, true); + }); + }); + }); + }); } diff --git a/app/test/feature/earthquake_history/ui/components/earthquake_history_list_tile_test.dart b/app/test/feature/earthquake_history/ui/components/earthquake_history_list_tile_test.dart index e133b953..f6c11ab9 100644 --- a/app/test/feature/earthquake_history/ui/components/earthquake_history_list_tile_test.dart +++ b/app/test/feature/earthquake_history/ui/components/earthquake_history_list_tile_test.dart @@ -11,40 +11,30 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_code_table_types/jma_code_table.pb.dart'; void main() async { - const baseV1 = EarthquakeV1( - eventId: 20240102235959, - status: '通常', - ); + const baseV1 = EarthquakeV1(eventId: 20240102235959, status: '通常'); Widget buildWidget(Widget child) => ProviderScope( - overrides: [ - jmaCodeTableProvider.overrideWithValue( - JmaCodeTable( - areaEpicenter: AreaEpicenter( - items: [ - AreaEpicenter_AreaEpicenterItem( - code: '100', - name: '石狩地方北部', - ), - ], - ), - areaEpicenterDetail: AreaEpicenterDetail( - items: [ - AreaEpicenterDetail_AreaEpicenterDetailItem( - code: '1001', - name: '米国、アラスカ州中央部', - ), - ], - ), - ), + overrides: [ + jmaCodeTableProvider.overrideWithValue( + JmaCodeTable( + areaEpicenter: AreaEpicenter( + items: [ + AreaEpicenter_AreaEpicenterItem(code: '100', name: '石狩地方北部'), + ], ), - intensityColorProvider.overrideWith(_FakeIntensityColor.new), - ], - child: MaterialApp( - home: Scaffold( - body: child, + areaEpicenterDetail: AreaEpicenterDetail( + items: [ + AreaEpicenterDetail_AreaEpicenterDetailItem( + code: '1001', + name: '米国、アラスカ州中央部', + ), + ], ), ), - ); + ), + intensityColorProvider.overrideWith(_FakeIntensityColor.new), + ], + child: MaterialApp(home: Scaffold(body: child)), + ); testWidgets("遠地地震の場合、'遠地地震'が表示されること(20210121212726)", (tester) async { // Arrange @@ -56,609 +46,393 @@ void main() async { ); // Act await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), ); // Assert expect(find.text('遠地\n地震'), findsOneWidget); }); - testWidgets( - "大規模な噴火の場合、'大規模な噴火'が表示されること(20210813033300)", - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - text: ''' + testWidgets("大規模な噴火の場合、'大規模な噴火'が表示されること(20210813033300)", (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith( + text: ''' この地震による日本への津波の影響はありません。 令和4年3月8日18時50分頃(日本時間)にマナム火山で大規模な噴火が発生しました(ダーウィン航空路火山灰情報センター(VAAC)による)。 (注1)本情報の冒頭に「海外で規模の大きな地震がありました。」や「震源地」とありますが、これは「遠地地震に関する情報」を作成する際に自動的に付与される文言です。実際には、規模の大きな地震は発生していない点に留意してください。 (注2)火山噴火に伴う潮位変化の呼称については、今後検討していきますが、当面は防災対応の呼びかけとして「津波」と表記します。''', - ), + ), + maxIntensityRegionNames: null, + ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); + // Assert + expect(find.text('大規模な噴火'), findsOneWidget); + }); + group('ListTile.trailing(マグニチュード)', () { + testWidgets('マグニチュードがある場合、マグニチュードが表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(magnitude: 5.1), maxIntensityRegionNames: null, ); // Act await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), ); // Assert - expect(find.text('大規模な噴火'), findsOneWidget); - }, - ); - group( - 'ListTile.trailing(マグニチュード)', - () { - testWidgets( - 'マグニチュードがある場合、マグニチュードが表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - magnitude: 5.1, - ), - maxIntensityRegionNames: null, - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final trailingText = listTile.trailing; - expect(trailingText, isA()); - expect( - (trailingText! as Text).data, - 'M5.1', - ); - }, + final listTile = tester.widget(find.byType(ListTile)); + final trailingText = listTile.trailing; + expect(trailingText, isA()); + expect((trailingText! as Text).data, 'M5.1'); + }); + testWidgets('マグニチュードが整数の場合、小数第1位まで表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(magnitude: 5), + maxIntensityRegionNames: null, ); - testWidgets( - 'マグニチュードが整数の場合、小数第1位まで表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - magnitude: 5, - ), - maxIntensityRegionNames: null, - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final trailingText = listTile.trailing; - expect(trailingText, isA()); - expect( - (trailingText! as Text).data, - 'M5.0', - ); - }, + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), ); - testWidgets( - 'マグニチュードが小数第2位以降ある場合、四捨五入されて小数第1位まで表示されること(繰り下げケース)', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - magnitude: 5.123, - ), - maxIntensityRegionNames: null, - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final trailingText = listTile.trailing; - expect(trailingText, isA()); - expect( - (trailingText! as Text).data, - 'M5.1', - ); - }, + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final trailingText = listTile.trailing; + expect(trailingText, isA()); + expect((trailingText! as Text).data, 'M5.0'); + }); + testWidgets('マグニチュードが小数第2位以降ある場合、四捨五入されて小数第1位まで表示されること(繰り下げケース)', ( + tester, + ) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(magnitude: 5.123), + maxIntensityRegionNames: null, ); - testWidgets( - 'マグニチュードが小数第2位以降ある場合、四捨五入されて小数第1位まで表示されること(繰り上げケース)', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - magnitude: 5.162, - ), - maxIntensityRegionNames: null, - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final trailingText = listTile.trailing; - expect(trailingText, isA()); - expect( - (trailingText! as Text).data, - 'M5.2', - ); - }, + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), ); - }, - ); + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final trailingText = listTile.trailing; + expect(trailingText, isA()); + expect((trailingText! as Text).data, 'M5.1'); + }); + testWidgets('マグニチュードが小数第2位以降ある場合、四捨五入されて小数第1位まで表示されること(繰り上げケース)', ( + tester, + ) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(magnitude: 5.162), + maxIntensityRegionNames: null, + ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final trailingText = listTile.trailing; + expect(trailingText, isA()); + expect((trailingText! as Text).data, 'M5.2'); + }); + }); group('ListTileの背景', () { - testWidgets( - '背景色塗りつぶし無効の場合、背景色が塗りつぶされないこと', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - maxIntensity: JmaIntensity.fiveLower, - ), - maxIntensityRegionNames: null, - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - showBackgroundColor: false, - ), + testWidgets('背景色塗りつぶし無効の場合、背景色が塗りつぶされないこと', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(maxIntensity: JmaIntensity.fiveLower), + maxIntensityRegionNames: null, + ); + // Act + await tester.pumpWidget( + buildWidget( + EarthquakeHistoryListTile( + item: v1Extended, + showBackgroundColor: false, ), - ); + ), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - expect(listTile.tileColor, null); - }, - ); + // Assert + final listTile = tester.widget(find.byType(ListTile)); + expect(listTile.tileColor, null); + }); group('背景色塗りつぶし有効の場合、背景色が透明度40%で塗りつぶされること', () { for (final maxIntensity in JmaIntensity.values) { final expectedColor = IntensityColorModel.eqmonitor() .fromJmaIntensity(maxIntensity) .background .withValues(alpha: 0.4); - testWidgets( - '最大震度$maxIntensityの場合', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - maxIntensity: maxIntensity, - ), - maxIntensityRegionNames: null, - ); - - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - expect(listTile.tileColor, expectedColor); - }, - ); - } - }); - }); - group( - 'ListTile.title部分', - () { - testWidgets('震源地名がある場合、震源地名が表示されること', (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - epicenterCode: 100, - ), - maxIntensityRegionNames: [], - ); - - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - - // Assert - expect(find.text('石狩地方北部'), findsOneWidget); - }); - testWidgets( - '補助震源地名がある場合、補助震源地名も表示されること', - (tester) async { + testWidgets('最大震度$maxIntensityの場合', (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - epicenterCode: 100, - epicenterDetailCode: 1001, - ), - maxIntensityRegionNames: [], + earthquake: baseV1.copyWith(maxIntensity: maxIntensity), + maxIntensityRegionNames: null, ); // Act await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), ); // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final titleText = listTile.title; - expect(titleText, isA()); - expect( - (titleText! as Text).data, - '石狩地方北部(米国、アラスカ州中央部)', - ); - }, + final listTile = tester.widget(find.byType(ListTile)); + expect(listTile.tileColor, expectedColor); + }); + } + }); + }); + group('ListTile.title部分', () { + testWidgets('震源地名がある場合、震源地名が表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(epicenterCode: 100), + maxIntensityRegionNames: [], ); - testWidgets('震源地名が無いが、最大震度とその観測地域(複数)がある場合、最大震度とその観測地域が表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - epicenterCode: null, - maxIntensity: JmaIntensity.fiveLower, - ), - maxIntensityRegionNames: ['静岡県伊豆', '神奈川県西部'], - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final titleText = listTile.title; - expect(titleText, isA()); - expect( - (titleText! as Text).data, - '最大震度5弱を静岡県伊豆などで観測', - ); - }); - testWidgets('震源地名が無いが、最大震度とその観測地域(1つ)がある場合、最大震度とその観測地域が表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - epicenterCode: null, - maxIntensity: JmaIntensity.fiveLower, - ), - maxIntensityRegionNames: ['静岡県伊豆'], - ); + // Assert + expect(find.text('石狩地方北部'), findsOneWidget); + }); + testWidgets('補助震源地名がある場合、補助震源地名も表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith( + epicenterCode: 100, + epicenterDetailCode: 1001, + ), + maxIntensityRegionNames: [], + ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final titleText = listTile.title; - expect(titleText, isA()); - expect( - (titleText! as Text).data, - '最大震度5弱を静岡県伊豆で観測', - ); - }); - }, - ); - group( - 'ListTile.subtitle部分', - () { - testWidgets( - '地震発生時刻がある場合、地震発生時刻が表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - eventId: 20240102235959, - originTime: DateTime(2024, 1, 2, 23, 59, 59), - ), - maxIntensityRegionNames: [], - ); + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final titleText = listTile.title; + expect(titleText, isA()); + expect((titleText! as Text).data, '石狩地方北部(米国、アラスカ州中央部)'); + }); + testWidgets('震源地名が無いが、最大震度とその観測地域(複数)がある場合、最大震度とその観測地域が表示されること', ( + tester, + ) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith( + epicenterCode: null, + maxIntensity: JmaIntensity.fiveLower, + ), + maxIntensityRegionNames: ['静岡県伊豆', '神奈川県西部'], + ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final subTitle = listTile.subtitle; - expect(subTitle, isA()); - final wrap = subTitle! as Wrap; - // subTitleの文字要素は1つ目である - expect(wrap.children[0], isA()); - final text = wrap.children[0] as Text; - expect( - text.data, - startsWith('2024/01/02 23:59頃発生'), - ); - }, + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final titleText = listTile.title; + expect(titleText, isA()); + expect((titleText! as Text).data, '最大震度5弱を静岡県伊豆などで観測'); + }); + testWidgets('震源地名が無いが、最大震度とその観測地域(1つ)がある場合、最大震度とその観測地域が表示されること', ( + tester, + ) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith( + epicenterCode: null, + maxIntensity: JmaIntensity.fiveLower, + ), + maxIntensityRegionNames: ['静岡県伊豆'], ); - testWidgets( - '地震発生時刻がなく、検知時刻がある場合、検知時刻が表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - eventId: 20240102235959, - arrivalTime: DateTime(2024, 1, 2, 23, 59, 59), - ), - maxIntensityRegionNames: [], - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final subTitle = listTile.subtitle; - expect(subTitle, isA()); - final wrap = subTitle! as Wrap; - // subTitleの文字要素は1つ目である - expect(wrap.children[0], isA()); - final text = wrap.children[0] as Text; - expect( - text.data, - startsWith('2024/01/02 23:59頃検知'), - ); - }, + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final titleText = listTile.title; + expect(titleText, isA()); + expect((titleText! as Text).data, '最大震度5弱を静岡県伊豆で観測'); + }); + }); + group('ListTile.subtitle部分', () { + testWidgets('地震発生時刻がある場合、地震発生時刻が表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith( + eventId: 20240102235959, + originTime: DateTime(2024, 1, 2, 23, 59, 59), + ), + maxIntensityRegionNames: [], ); - testWidgets( - "深さ0kmの時、'深さ ごく浅い'が表示されること", - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - depth: 0, - ), - maxIntensityRegionNames: [], - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final subTitle = listTile.subtitle; - expect(subTitle, isA()); - final wrap = subTitle! as Wrap; - // subTitleの文字要素は1つ目である - expect(wrap.children[0], isA()); - final text = wrap.children[0] as Text; - expect( - text.data, - endsWith('深さ ごく浅い'), - ); - }, + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final subTitle = listTile.subtitle; + expect(subTitle, isA()); + final wrap = subTitle! as Wrap; + // subTitleの文字要素は1つ目である + expect(wrap.children[0], isA()); + final text = wrap.children[0] as Text; + expect(text.data, startsWith('2024/01/02 23:59頃発生')); + }); + testWidgets('地震発生時刻がなく、検知時刻がある場合、検知時刻が表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith( + eventId: 20240102235959, + arrivalTime: DateTime(2024, 1, 2, 23, 59, 59), + ), + maxIntensityRegionNames: [], ); - testWidgets( - '深さ10kmの時、深さ 10kmが表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - depth: 10, - ), - maxIntensityRegionNames: [], - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final subTitle = listTile.subtitle; - expect(subTitle, isA()); - final wrap = subTitle! as Wrap; - // subTitleの文字要素は1つ目である - expect(wrap.children[0], isA()); - final text = wrap.children[0] as Text; - expect( - text.data, - endsWith('深さ 10km'), - ); - }, + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final subTitle = listTile.subtitle; + expect(subTitle, isA()); + final wrap = subTitle! as Wrap; + // subTitleの文字要素は1つ目である + expect(wrap.children[0], isA()); + final text = wrap.children[0] as Text; + expect(text.data, startsWith('2024/01/02 23:59頃検知')); + }); + testWidgets("深さ0kmの時、'深さ ごく浅い'が表示されること", (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(depth: 0), + maxIntensityRegionNames: [], ); - testWidgets( - '深さ700kmの時、深さ 700km以上が表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - depth: 700, - ), - maxIntensityRegionNames: [], - ); - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); - // Assert - final listTile = tester.widget( - find.byType(ListTile), - ); - final subTitle = listTile.subtitle; - expect(subTitle, isA()); - final wrap = subTitle! as Wrap; - // subTitleの文字要素は1つ目である - expect(wrap.children[0], isA()); - final text = wrap.children[0] as Text; - expect( - text.data, - endsWith('深さ 700km以上'), - ); - }, + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final subTitle = listTile.subtitle; + expect(subTitle, isA()); + final wrap = subTitle! as Wrap; + // subTitleの文字要素は1つ目である + expect(wrap.children[0], isA()); + final text = wrap.children[0] as Text; + expect(text.data, endsWith('深さ ごく浅い')); + }); + testWidgets('深さ10kmの時、深さ 10kmが表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(depth: 10), + maxIntensityRegionNames: [], ); - testWidgets( - '最大長周期地震動階級が0の場合、Chipが表示されないこと', - (tester) async { + + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); + + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final subTitle = listTile.subtitle; + expect(subTitle, isA()); + final wrap = subTitle! as Wrap; + // subTitleの文字要素は1つ目である + expect(wrap.children[0], isA()); + final text = wrap.children[0] as Text; + expect(text.data, endsWith('深さ 10km')); + }); + testWidgets('深さ700kmの時、深さ 700km以上が表示されること', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(depth: 700), + maxIntensityRegionNames: [], + ); + + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); + + // Assert + final listTile = tester.widget(find.byType(ListTile)); + final subTitle = listTile.subtitle; + expect(subTitle, isA()); + final wrap = subTitle! as Wrap; + // subTitleの文字要素は1つ目である + expect(wrap.children[0], isA()); + final text = wrap.children[0] as Text; + expect(text.data, endsWith('深さ 700km以上')); + }); + testWidgets('最大長周期地震動階級が0の場合、Chipが表示されないこと', (tester) async { + // Arrange + final v1Extended = EarthquakeV1Extended( + earthquake: baseV1.copyWith(maxLpgmIntensity: JmaLgIntensity.zero), + maxIntensityRegionNames: [], + ); + + // Act + await tester.pumpWidget( + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), + ); + + // Assert + expect(find.byType(Chip), findsNothing); + }); + group('最大長周期地震動階級が0以外の場合', () { + for (final intensity in [...JmaLgIntensity.values] + ..remove(JmaLgIntensity.zero)) { + testWidgets('最大長周期地震動階級が$intensityの場合、Chipとそのラベルが表示されること', ( + tester, + ) async { // Arrange final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - maxLpgmIntensity: JmaLgIntensity.zero, - ), + earthquake: baseV1.copyWith(maxLpgmIntensity: intensity), maxIntensityRegionNames: [], ); // Act await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), + buildWidget(EarthquakeHistoryListTile(item: v1Extended)), ); // Assert - expect(find.byType(Chip), findsNothing); - }, - ); - group( - '最大長周期地震動階級が0以外の場合', - () { - for (final intensity in [...JmaLgIntensity.values] - ..remove(JmaLgIntensity.zero)) { - testWidgets( - '最大長周期地震動階級が$intensityの場合、Chipとそのラベルが表示されること', - (tester) async { - // Arrange - final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - maxLpgmIntensity: intensity, - ), - maxIntensityRegionNames: [], - ); - - // Act - await tester.pumpWidget( - buildWidget( - EarthquakeHistoryListTile( - item: v1Extended, - ), - ), - ); - - // Assert - expect(find.byType(Chip), findsOneWidget); - final chip = tester.widget( - find.byType(Chip), - ); - expect(chip.label, isA()); - final label = chip.label as Text; - expect( - label.data, - '最大長周期地震動階級 $intensity', - ); - }, - ); - } - }, - ); - }, - ); + expect(find.byType(Chip), findsOneWidget); + final chip = tester.widget(find.byType(Chip)); + expect(chip.label, isA()); + final label = chip.label as Text; + expect(label.data, '最大長周期地震動階級 $intensity'); + }); + } + }); + }); testWidgets('タップ時にonTapが呼ばれること', (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( - earthquake: baseV1.copyWith( - eventId: 20240102235959, - ), + earthquake: baseV1.copyWith(eventId: 20240102235959), maxIntensityRegionNames: [], ); var isTapped = false; diff --git a/packages/earthquake_replay/lib/src/model/replay_data.dart b/packages/earthquake_replay/lib/src/model/replay_data.dart index 6598f354..8e7598f7 100644 --- a/packages/earthquake_replay/lib/src/model/replay_data.dart +++ b/packages/earthquake_replay/lib/src/model/replay_data.dart @@ -4,19 +4,18 @@ part 'replay_data.freezed.dart'; part 'replay_data.g.dart'; sealed class ReplayData { - const ReplayData({ - required this.type, - required this.time, - }); + const ReplayData({required this.type, required this.time}); factory ReplayData.fromMsgPack(List data) { final type = data[0] as int; final body = data[1] as List; - final replayDataType = - ReplayDataType.values.firstWhere((e) => e.value == type); + final replayDataType = ReplayDataType.values.firstWhere( + (e) => e.value == type, + ); return switch (replayDataType) { - ReplayDataType.jmaXmlTelegram => - JmaXmlTelegramReplayData.fromMsgPack(body), + ReplayDataType.jmaXmlTelegram => JmaXmlTelegramReplayData.fromMsgPack( + body, + ), ReplayDataType.jmaBinaryTelegram => JmaBinaryTelegramReplayData.fromMsgPack(body), ReplayDataType.kyoshinMonitorImage => @@ -119,7 +118,8 @@ class KyoshinMonitorImageReplayData ); @override - String toString() => 'KyoshinMonitorImageReplayData(time: $time, ' + String toString() => + 'KyoshinMonitorImageReplayData(time: $time, ' 'images: ${images.entries.map((e) => '${e.key}: ${e.value.length} bytes').join(', ')})'; } @@ -239,8 +239,7 @@ enum ReplayDataType { kyoshinMonitorEewJson(101), keviJson(1000), snpLogEntry(1001), - axisJson(1002), - ; + axisJson(1002); const ReplayDataType(this.value); final int value; @@ -251,8 +250,7 @@ enum ImageType { pga(1), pgv(2), psWave(3), - estShindo(4), - ; + estShindo(4); const ImageType(this.value); final int value; @@ -260,8 +258,7 @@ enum ImageType { enum JsonType { eew(0), - eewWarning(1), - ; + eewWarning(1); const JsonType(this.value); final int value; diff --git a/packages/earthquake_replay/lib/src/model/replay_data.freezed.dart b/packages/earthquake_replay/lib/src/model/replay_data.freezed.dart index dc7fc298..311ef0d2 100644 --- a/packages/earthquake_replay/lib/src/model/replay_data.freezed.dart +++ b/packages/earthquake_replay/lib/src/model/replay_data.freezed.dart @@ -12,10 +12,12 @@ part of 'replay_data.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); JmaXmlTelegramReplayData _$JmaXmlTelegramReplayDataFromJson( - Map json) { + Map json, +) { return _JmaXmlTelegramReplayData.fromJson(json); } @@ -38,17 +40,24 @@ mixin _$JmaXmlTelegramReplayData { /// @nodoc abstract class $JmaXmlTelegramReplayDataCopyWith<$Res> { - factory $JmaXmlTelegramReplayDataCopyWith(JmaXmlTelegramReplayData value, - $Res Function(JmaXmlTelegramReplayData) then) = - _$JmaXmlTelegramReplayDataCopyWithImpl<$Res, JmaXmlTelegramReplayData>; + factory $JmaXmlTelegramReplayDataCopyWith( + JmaXmlTelegramReplayData value, + $Res Function(JmaXmlTelegramReplayData) then, + ) = _$JmaXmlTelegramReplayDataCopyWithImpl<$Res, JmaXmlTelegramReplayData>; @useResult - $Res call( - {ReplayDataType type, DateTime time, String title, String telegram}); + $Res call({ + ReplayDataType type, + DateTime time, + String title, + String telegram, + }); } /// @nodoc -class _$JmaXmlTelegramReplayDataCopyWithImpl<$Res, - $Val extends JmaXmlTelegramReplayData> +class _$JmaXmlTelegramReplayDataCopyWithImpl< + $Res, + $Val extends JmaXmlTelegramReplayData +> implements $JmaXmlTelegramReplayDataCopyWith<$Res> { _$JmaXmlTelegramReplayDataCopyWithImpl(this._value, this._then); @@ -67,24 +76,31 @@ class _$JmaXmlTelegramReplayDataCopyWithImpl<$Res, Object? title = null, Object? telegram = null, }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - telegram: null == telegram - ? _value.telegram - : telegram // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + telegram: + null == telegram + ? _value.telegram + : telegram // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -92,24 +108,31 @@ class _$JmaXmlTelegramReplayDataCopyWithImpl<$Res, abstract class _$$JmaXmlTelegramReplayDataImplCopyWith<$Res> implements $JmaXmlTelegramReplayDataCopyWith<$Res> { factory _$$JmaXmlTelegramReplayDataImplCopyWith( - _$JmaXmlTelegramReplayDataImpl value, - $Res Function(_$JmaXmlTelegramReplayDataImpl) then) = - __$$JmaXmlTelegramReplayDataImplCopyWithImpl<$Res>; + _$JmaXmlTelegramReplayDataImpl value, + $Res Function(_$JmaXmlTelegramReplayDataImpl) then, + ) = __$$JmaXmlTelegramReplayDataImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ReplayDataType type, DateTime time, String title, String telegram}); + $Res call({ + ReplayDataType type, + DateTime time, + String title, + String telegram, + }); } /// @nodoc class __$$JmaXmlTelegramReplayDataImplCopyWithImpl<$Res> - extends _$JmaXmlTelegramReplayDataCopyWithImpl<$Res, - _$JmaXmlTelegramReplayDataImpl> + extends + _$JmaXmlTelegramReplayDataCopyWithImpl< + $Res, + _$JmaXmlTelegramReplayDataImpl + > implements _$$JmaXmlTelegramReplayDataImplCopyWith<$Res> { __$$JmaXmlTelegramReplayDataImplCopyWithImpl( - _$JmaXmlTelegramReplayDataImpl _value, - $Res Function(_$JmaXmlTelegramReplayDataImpl) _then) - : super(_value, _then); + _$JmaXmlTelegramReplayDataImpl _value, + $Res Function(_$JmaXmlTelegramReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of JmaXmlTelegramReplayData /// with the given fields replaced by the non-null parameter values. @@ -121,36 +144,42 @@ class __$$JmaXmlTelegramReplayDataImplCopyWithImpl<$Res> Object? title = null, Object? telegram = null, }) { - return _then(_$JmaXmlTelegramReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - telegram: null == telegram - ? _value.telegram - : telegram // ignore: cast_nullable_to_non_nullable - as String, - )); + return _then( + _$JmaXmlTelegramReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + telegram: + null == telegram + ? _value.telegram + : telegram // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$JmaXmlTelegramReplayDataImpl extends _JmaXmlTelegramReplayData { - const _$JmaXmlTelegramReplayDataImpl( - {required this.type, - required this.time, - required this.title, - required this.telegram}) - : super._(); + const _$JmaXmlTelegramReplayDataImpl({ + required this.type, + required this.time, + required this.title, + required this.telegram, + }) : super._(); factory _$JmaXmlTelegramReplayDataImpl.fromJson(Map json) => _$$JmaXmlTelegramReplayDataImplFromJson(json); @@ -186,23 +215,23 @@ class _$JmaXmlTelegramReplayDataImpl extends _JmaXmlTelegramReplayData { @override @pragma('vm:prefer-inline') _$$JmaXmlTelegramReplayDataImplCopyWith<_$JmaXmlTelegramReplayDataImpl> - get copyWith => __$$JmaXmlTelegramReplayDataImplCopyWithImpl< - _$JmaXmlTelegramReplayDataImpl>(this, _$identity); + get copyWith => __$$JmaXmlTelegramReplayDataImplCopyWithImpl< + _$JmaXmlTelegramReplayDataImpl + >(this, _$identity); @override Map toJson() { - return _$$JmaXmlTelegramReplayDataImplToJson( - this, - ); + return _$$JmaXmlTelegramReplayDataImplToJson(this); } } abstract class _JmaXmlTelegramReplayData extends JmaXmlTelegramReplayData { - const factory _JmaXmlTelegramReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final String title, - required final String telegram}) = _$JmaXmlTelegramReplayDataImpl; + const factory _JmaXmlTelegramReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final String title, + required final String telegram, + }) = _$JmaXmlTelegramReplayDataImpl; const _JmaXmlTelegramReplayData._() : super._(); factory _JmaXmlTelegramReplayData.fromJson(Map json) = @@ -222,11 +251,12 @@ abstract class _JmaXmlTelegramReplayData extends JmaXmlTelegramReplayData { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$JmaXmlTelegramReplayDataImplCopyWith<_$JmaXmlTelegramReplayDataImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } JmaBinaryTelegramReplayData _$JmaBinaryTelegramReplayDataFromJson( - Map json) { + Map json, +) { return _JmaBinaryTelegramReplayData.fromJson(json); } @@ -244,27 +274,33 @@ mixin _$JmaBinaryTelegramReplayData { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $JmaBinaryTelegramReplayDataCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $JmaBinaryTelegramReplayDataCopyWith<$Res> { factory $JmaBinaryTelegramReplayDataCopyWith( - JmaBinaryTelegramReplayData value, - $Res Function(JmaBinaryTelegramReplayData) then) = - _$JmaBinaryTelegramReplayDataCopyWithImpl<$Res, - JmaBinaryTelegramReplayData>; + JmaBinaryTelegramReplayData value, + $Res Function(JmaBinaryTelegramReplayData) then, + ) = + _$JmaBinaryTelegramReplayDataCopyWithImpl< + $Res, + JmaBinaryTelegramReplayData + >; @useResult - $Res call( - {ReplayDataType type, - DateTime time, - String telegramType, - List data}); + $Res call({ + ReplayDataType type, + DateTime time, + String telegramType, + List data, + }); } /// @nodoc -class _$JmaBinaryTelegramReplayDataCopyWithImpl<$Res, - $Val extends JmaBinaryTelegramReplayData> +class _$JmaBinaryTelegramReplayDataCopyWithImpl< + $Res, + $Val extends JmaBinaryTelegramReplayData +> implements $JmaBinaryTelegramReplayDataCopyWith<$Res> { _$JmaBinaryTelegramReplayDataCopyWithImpl(this._value, this._then); @@ -283,24 +319,31 @@ class _$JmaBinaryTelegramReplayDataCopyWithImpl<$Res, Object? telegramType = null, Object? data = null, }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - telegramType: null == telegramType - ? _value.telegramType - : telegramType // ignore: cast_nullable_to_non_nullable - as String, - data: null == data - ? _value.data - : data // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + telegramType: + null == telegramType + ? _value.telegramType + : telegramType // ignore: cast_nullable_to_non_nullable + as String, + data: + null == data + ? _value.data + : data // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -308,27 +351,31 @@ class _$JmaBinaryTelegramReplayDataCopyWithImpl<$Res, abstract class _$$JmaBinaryTelegramReplayDataImplCopyWith<$Res> implements $JmaBinaryTelegramReplayDataCopyWith<$Res> { factory _$$JmaBinaryTelegramReplayDataImplCopyWith( - _$JmaBinaryTelegramReplayDataImpl value, - $Res Function(_$JmaBinaryTelegramReplayDataImpl) then) = - __$$JmaBinaryTelegramReplayDataImplCopyWithImpl<$Res>; + _$JmaBinaryTelegramReplayDataImpl value, + $Res Function(_$JmaBinaryTelegramReplayDataImpl) then, + ) = __$$JmaBinaryTelegramReplayDataImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ReplayDataType type, - DateTime time, - String telegramType, - List data}); + $Res call({ + ReplayDataType type, + DateTime time, + String telegramType, + List data, + }); } /// @nodoc class __$$JmaBinaryTelegramReplayDataImplCopyWithImpl<$Res> - extends _$JmaBinaryTelegramReplayDataCopyWithImpl<$Res, - _$JmaBinaryTelegramReplayDataImpl> + extends + _$JmaBinaryTelegramReplayDataCopyWithImpl< + $Res, + _$JmaBinaryTelegramReplayDataImpl + > implements _$$JmaBinaryTelegramReplayDataImplCopyWith<$Res> { __$$JmaBinaryTelegramReplayDataImplCopyWithImpl( - _$JmaBinaryTelegramReplayDataImpl _value, - $Res Function(_$JmaBinaryTelegramReplayDataImpl) _then) - : super(_value, _then); + _$JmaBinaryTelegramReplayDataImpl _value, + $Res Function(_$JmaBinaryTelegramReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of JmaBinaryTelegramReplayData /// with the given fields replaced by the non-null parameter values. @@ -340,41 +387,47 @@ class __$$JmaBinaryTelegramReplayDataImplCopyWithImpl<$Res> Object? telegramType = null, Object? data = null, }) { - return _then(_$JmaBinaryTelegramReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - telegramType: null == telegramType - ? _value.telegramType - : telegramType // ignore: cast_nullable_to_non_nullable - as String, - data: null == data - ? _value._data - : data // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$JmaBinaryTelegramReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + telegramType: + null == telegramType + ? _value.telegramType + : telegramType // ignore: cast_nullable_to_non_nullable + as String, + data: + null == data + ? _value._data + : data // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$JmaBinaryTelegramReplayDataImpl extends _JmaBinaryTelegramReplayData { - const _$JmaBinaryTelegramReplayDataImpl( - {required this.type, - required this.time, - required this.telegramType, - required final List data}) - : _data = data, - super._(); + const _$JmaBinaryTelegramReplayDataImpl({ + required this.type, + required this.time, + required this.telegramType, + required final List data, + }) : _data = data, + super._(); factory _$JmaBinaryTelegramReplayDataImpl.fromJson( - Map json) => - _$$JmaBinaryTelegramReplayDataImplFromJson(json); + Map json, + ) => _$$JmaBinaryTelegramReplayDataImplFromJson(json); @override final ReplayDataType type; @@ -404,8 +457,13 @@ class _$JmaBinaryTelegramReplayDataImpl extends _JmaBinaryTelegramReplayData { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, type, time, telegramType, - const DeepCollectionEquality().hash(_data)); + int get hashCode => Object.hash( + runtimeType, + type, + time, + telegramType, + const DeepCollectionEquality().hash(_data), + ); /// Create a copy of JmaBinaryTelegramReplayData /// with the given fields replaced by the non-null parameter values. @@ -413,24 +471,24 @@ class _$JmaBinaryTelegramReplayDataImpl extends _JmaBinaryTelegramReplayData { @override @pragma('vm:prefer-inline') _$$JmaBinaryTelegramReplayDataImplCopyWith<_$JmaBinaryTelegramReplayDataImpl> - get copyWith => __$$JmaBinaryTelegramReplayDataImplCopyWithImpl< - _$JmaBinaryTelegramReplayDataImpl>(this, _$identity); + get copyWith => __$$JmaBinaryTelegramReplayDataImplCopyWithImpl< + _$JmaBinaryTelegramReplayDataImpl + >(this, _$identity); @override Map toJson() { - return _$$JmaBinaryTelegramReplayDataImplToJson( - this, - ); + return _$$JmaBinaryTelegramReplayDataImplToJson(this); } } abstract class _JmaBinaryTelegramReplayData extends JmaBinaryTelegramReplayData { - const factory _JmaBinaryTelegramReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final String telegramType, - required final List data}) = _$JmaBinaryTelegramReplayDataImpl; + const factory _JmaBinaryTelegramReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final String telegramType, + required final List data, + }) = _$JmaBinaryTelegramReplayDataImpl; const _JmaBinaryTelegramReplayData._() : super._(); factory _JmaBinaryTelegramReplayData.fromJson(Map json) = @@ -450,11 +508,12 @@ abstract class _JmaBinaryTelegramReplayData @override @JsonKey(includeFromJson: false, includeToJson: false) _$$JmaBinaryTelegramReplayDataImplCopyWith<_$JmaBinaryTelegramReplayDataImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } KyoshinMonitorImageReplayData _$KyoshinMonitorImageReplayDataFromJson( - Map json) { + Map json, +) { return _KyoshinMonitorImageReplayData.fromJson(json); } @@ -471,24 +530,32 @@ mixin _$KyoshinMonitorImageReplayData { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorImageReplayDataCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorImageReplayDataCopyWith<$Res> { factory $KyoshinMonitorImageReplayDataCopyWith( - KyoshinMonitorImageReplayData value, - $Res Function(KyoshinMonitorImageReplayData) then) = - _$KyoshinMonitorImageReplayDataCopyWithImpl<$Res, - KyoshinMonitorImageReplayData>; + KyoshinMonitorImageReplayData value, + $Res Function(KyoshinMonitorImageReplayData) then, + ) = + _$KyoshinMonitorImageReplayDataCopyWithImpl< + $Res, + KyoshinMonitorImageReplayData + >; @useResult - $Res call( - {ReplayDataType type, DateTime time, Map> images}); + $Res call({ + ReplayDataType type, + DateTime time, + Map> images, + }); } /// @nodoc -class _$KyoshinMonitorImageReplayDataCopyWithImpl<$Res, - $Val extends KyoshinMonitorImageReplayData> +class _$KyoshinMonitorImageReplayDataCopyWithImpl< + $Res, + $Val extends KyoshinMonitorImageReplayData +> implements $KyoshinMonitorImageReplayDataCopyWith<$Res> { _$KyoshinMonitorImageReplayDataCopyWithImpl(this._value, this._then); @@ -501,25 +568,27 @@ class _$KyoshinMonitorImageReplayDataCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? type = null, - Object? time = null, - Object? images = null, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - images: null == images - ? _value.images - : images // ignore: cast_nullable_to_non_nullable - as Map>, - ) as $Val); + $Res call({Object? type = null, Object? time = null, Object? images = null}) { + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + images: + null == images + ? _value.images + : images // ignore: cast_nullable_to_non_nullable + as Map>, + ) + as $Val, + ); } } @@ -527,48 +596,55 @@ class _$KyoshinMonitorImageReplayDataCopyWithImpl<$Res, abstract class _$$KyoshinMonitorImageReplayDataImplCopyWith<$Res> implements $KyoshinMonitorImageReplayDataCopyWith<$Res> { factory _$$KyoshinMonitorImageReplayDataImplCopyWith( - _$KyoshinMonitorImageReplayDataImpl value, - $Res Function(_$KyoshinMonitorImageReplayDataImpl) then) = - __$$KyoshinMonitorImageReplayDataImplCopyWithImpl<$Res>; + _$KyoshinMonitorImageReplayDataImpl value, + $Res Function(_$KyoshinMonitorImageReplayDataImpl) then, + ) = __$$KyoshinMonitorImageReplayDataImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ReplayDataType type, DateTime time, Map> images}); + $Res call({ + ReplayDataType type, + DateTime time, + Map> images, + }); } /// @nodoc class __$$KyoshinMonitorImageReplayDataImplCopyWithImpl<$Res> - extends _$KyoshinMonitorImageReplayDataCopyWithImpl<$Res, - _$KyoshinMonitorImageReplayDataImpl> + extends + _$KyoshinMonitorImageReplayDataCopyWithImpl< + $Res, + _$KyoshinMonitorImageReplayDataImpl + > implements _$$KyoshinMonitorImageReplayDataImplCopyWith<$Res> { __$$KyoshinMonitorImageReplayDataImplCopyWithImpl( - _$KyoshinMonitorImageReplayDataImpl _value, - $Res Function(_$KyoshinMonitorImageReplayDataImpl) _then) - : super(_value, _then); + _$KyoshinMonitorImageReplayDataImpl _value, + $Res Function(_$KyoshinMonitorImageReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorImageReplayData /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? type = null, - Object? time = null, - Object? images = null, - }) { - return _then(_$KyoshinMonitorImageReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - images: null == images - ? _value._images - : images // ignore: cast_nullable_to_non_nullable - as Map>, - )); + $Res call({Object? type = null, Object? time = null, Object? images = null}) { + return _then( + _$KyoshinMonitorImageReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + images: + null == images + ? _value._images + : images // ignore: cast_nullable_to_non_nullable + as Map>, + ), + ); } } @@ -576,16 +652,16 @@ class __$$KyoshinMonitorImageReplayDataImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorImageReplayDataImpl extends _KyoshinMonitorImageReplayData { - const _$KyoshinMonitorImageReplayDataImpl( - {required this.type, - required this.time, - required final Map> images}) - : _images = images, - super._(); + const _$KyoshinMonitorImageReplayDataImpl({ + required this.type, + required this.time, + required final Map> images, + }) : _images = images, + super._(); factory _$KyoshinMonitorImageReplayDataImpl.fromJson( - Map json) => - _$$KyoshinMonitorImageReplayDataImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorImageReplayDataImplFromJson(json); @override final ReplayDataType type; @@ -612,7 +688,11 @@ class _$KyoshinMonitorImageReplayDataImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, type, time, const DeepCollectionEquality().hash(_images)); + runtimeType, + type, + time, + const DeepCollectionEquality().hash(_images), + ); /// Create a copy of KyoshinMonitorImageReplayData /// with the given fields replaced by the non-null parameter values. @@ -620,25 +700,25 @@ class _$KyoshinMonitorImageReplayDataImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorImageReplayDataImplCopyWith< - _$KyoshinMonitorImageReplayDataImpl> - get copyWith => __$$KyoshinMonitorImageReplayDataImplCopyWithImpl< - _$KyoshinMonitorImageReplayDataImpl>(this, _$identity); + _$KyoshinMonitorImageReplayDataImpl + > + get copyWith => __$$KyoshinMonitorImageReplayDataImplCopyWithImpl< + _$KyoshinMonitorImageReplayDataImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorImageReplayDataImplToJson( - this, - ); + return _$$KyoshinMonitorImageReplayDataImplToJson(this); } } abstract class _KyoshinMonitorImageReplayData extends KyoshinMonitorImageReplayData { - const factory _KyoshinMonitorImageReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final Map> images}) = - _$KyoshinMonitorImageReplayDataImpl; + const factory _KyoshinMonitorImageReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final Map> images, + }) = _$KyoshinMonitorImageReplayDataImpl; const _KyoshinMonitorImageReplayData._() : super._(); factory _KyoshinMonitorImageReplayData.fromJson(Map json) = @@ -656,12 +736,14 @@ abstract class _KyoshinMonitorImageReplayData @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorImageReplayDataImplCopyWith< - _$KyoshinMonitorImageReplayDataImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorImageReplayDataImpl + > + get copyWith => throw _privateConstructorUsedError; } KyoshinMonitorEewJsonReplayData _$KyoshinMonitorEewJsonReplayDataFromJson( - Map json) { + Map json, +) { return _KyoshinMonitorEewJsonReplayData.fromJson(json); } @@ -678,23 +760,28 @@ mixin _$KyoshinMonitorEewJsonReplayData { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorEewJsonReplayDataCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorEewJsonReplayDataCopyWith<$Res> { factory $KyoshinMonitorEewJsonReplayDataCopyWith( - KyoshinMonitorEewJsonReplayData value, - $Res Function(KyoshinMonitorEewJsonReplayData) then) = - _$KyoshinMonitorEewJsonReplayDataCopyWithImpl<$Res, - KyoshinMonitorEewJsonReplayData>; + KyoshinMonitorEewJsonReplayData value, + $Res Function(KyoshinMonitorEewJsonReplayData) then, + ) = + _$KyoshinMonitorEewJsonReplayDataCopyWithImpl< + $Res, + KyoshinMonitorEewJsonReplayData + >; @useResult $Res call({ReplayDataType type, DateTime time, String json}); } /// @nodoc -class _$KyoshinMonitorEewJsonReplayDataCopyWithImpl<$Res, - $Val extends KyoshinMonitorEewJsonReplayData> +class _$KyoshinMonitorEewJsonReplayDataCopyWithImpl< + $Res, + $Val extends KyoshinMonitorEewJsonReplayData +> implements $KyoshinMonitorEewJsonReplayDataCopyWith<$Res> { _$KyoshinMonitorEewJsonReplayDataCopyWithImpl(this._value, this._then); @@ -707,25 +794,27 @@ class _$KyoshinMonitorEewJsonReplayDataCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? type = null, - Object? time = null, - Object? json = null, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - json: null == json - ? _value.json - : json // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? type = null, Object? time = null, Object? json = null}) { + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + json: + null == json + ? _value.json + : json // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -733,9 +822,9 @@ class _$KyoshinMonitorEewJsonReplayDataCopyWithImpl<$Res, abstract class _$$KyoshinMonitorEewJsonReplayDataImplCopyWith<$Res> implements $KyoshinMonitorEewJsonReplayDataCopyWith<$Res> { factory _$$KyoshinMonitorEewJsonReplayDataImplCopyWith( - _$KyoshinMonitorEewJsonReplayDataImpl value, - $Res Function(_$KyoshinMonitorEewJsonReplayDataImpl) then) = - __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl<$Res>; + _$KyoshinMonitorEewJsonReplayDataImpl value, + $Res Function(_$KyoshinMonitorEewJsonReplayDataImpl) then, + ) = __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl<$Res>; @override @useResult $Res call({ReplayDataType type, DateTime time, String json}); @@ -743,37 +832,41 @@ abstract class _$$KyoshinMonitorEewJsonReplayDataImplCopyWith<$Res> /// @nodoc class __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl<$Res> - extends _$KyoshinMonitorEewJsonReplayDataCopyWithImpl<$Res, - _$KyoshinMonitorEewJsonReplayDataImpl> + extends + _$KyoshinMonitorEewJsonReplayDataCopyWithImpl< + $Res, + _$KyoshinMonitorEewJsonReplayDataImpl + > implements _$$KyoshinMonitorEewJsonReplayDataImplCopyWith<$Res> { __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl( - _$KyoshinMonitorEewJsonReplayDataImpl _value, - $Res Function(_$KyoshinMonitorEewJsonReplayDataImpl) _then) - : super(_value, _then); + _$KyoshinMonitorEewJsonReplayDataImpl _value, + $Res Function(_$KyoshinMonitorEewJsonReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorEewJsonReplayData /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? type = null, - Object? time = null, - Object? json = null, - }) { - return _then(_$KyoshinMonitorEewJsonReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - json: null == json - ? _value.json - : json // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? type = null, Object? time = null, Object? json = null}) { + return _then( + _$KyoshinMonitorEewJsonReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + json: + null == json + ? _value.json + : json // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } @@ -781,13 +874,15 @@ class __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorEewJsonReplayDataImpl extends _KyoshinMonitorEewJsonReplayData { - const _$KyoshinMonitorEewJsonReplayDataImpl( - {required this.type, required this.time, required this.json}) - : super._(); + const _$KyoshinMonitorEewJsonReplayDataImpl({ + required this.type, + required this.time, + required this.json, + }) : super._(); factory _$KyoshinMonitorEewJsonReplayDataImpl.fromJson( - Map json) => - _$$KyoshinMonitorEewJsonReplayDataImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorEewJsonReplayDataImplFromJson(json); @override final ReplayDataType type; @@ -816,24 +911,25 @@ class _$KyoshinMonitorEewJsonReplayDataImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorEewJsonReplayDataImplCopyWith< - _$KyoshinMonitorEewJsonReplayDataImpl> - get copyWith => __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl< - _$KyoshinMonitorEewJsonReplayDataImpl>(this, _$identity); + _$KyoshinMonitorEewJsonReplayDataImpl + > + get copyWith => __$$KyoshinMonitorEewJsonReplayDataImplCopyWithImpl< + _$KyoshinMonitorEewJsonReplayDataImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorEewJsonReplayDataImplToJson( - this, - ); + return _$$KyoshinMonitorEewJsonReplayDataImplToJson(this); } } abstract class _KyoshinMonitorEewJsonReplayData extends KyoshinMonitorEewJsonReplayData { - const factory _KyoshinMonitorEewJsonReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final String json}) = _$KyoshinMonitorEewJsonReplayDataImpl; + const factory _KyoshinMonitorEewJsonReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final String json, + }) = _$KyoshinMonitorEewJsonReplayDataImpl; const _KyoshinMonitorEewJsonReplayData._() : super._(); factory _KyoshinMonitorEewJsonReplayData.fromJson(Map json) = @@ -851,8 +947,9 @@ abstract class _KyoshinMonitorEewJsonReplayData @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorEewJsonReplayDataImplCopyWith< - _$KyoshinMonitorEewJsonReplayDataImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorEewJsonReplayDataImpl + > + get copyWith => throw _privateConstructorUsedError; } KeviJsonReplayData _$KeviJsonReplayDataFromJson(Map json) { @@ -879,11 +976,16 @@ mixin _$KeviJsonReplayData { /// @nodoc abstract class $KeviJsonReplayDataCopyWith<$Res> { factory $KeviJsonReplayDataCopyWith( - KeviJsonReplayData value, $Res Function(KeviJsonReplayData) then) = - _$KeviJsonReplayDataCopyWithImpl<$Res, KeviJsonReplayData>; + KeviJsonReplayData value, + $Res Function(KeviJsonReplayData) then, + ) = _$KeviJsonReplayDataCopyWithImpl<$Res, KeviJsonReplayData>; @useResult - $Res call( - {ReplayDataType type, DateTime time, JsonType jsonType, String json}); + $Res call({ + ReplayDataType type, + DateTime time, + JsonType jsonType, + String json, + }); } /// @nodoc @@ -906,46 +1008,59 @@ class _$KeviJsonReplayDataCopyWithImpl<$Res, $Val extends KeviJsonReplayData> Object? jsonType = null, Object? json = null, }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - jsonType: null == jsonType - ? _value.jsonType - : jsonType // ignore: cast_nullable_to_non_nullable - as JsonType, - json: null == json - ? _value.json - : json // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + jsonType: + null == jsonType + ? _value.jsonType + : jsonType // ignore: cast_nullable_to_non_nullable + as JsonType, + json: + null == json + ? _value.json + : json // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } /// @nodoc abstract class _$$KeviJsonReplayDataImplCopyWith<$Res> implements $KeviJsonReplayDataCopyWith<$Res> { - factory _$$KeviJsonReplayDataImplCopyWith(_$KeviJsonReplayDataImpl value, - $Res Function(_$KeviJsonReplayDataImpl) then) = - __$$KeviJsonReplayDataImplCopyWithImpl<$Res>; + factory _$$KeviJsonReplayDataImplCopyWith( + _$KeviJsonReplayDataImpl value, + $Res Function(_$KeviJsonReplayDataImpl) then, + ) = __$$KeviJsonReplayDataImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ReplayDataType type, DateTime time, JsonType jsonType, String json}); + $Res call({ + ReplayDataType type, + DateTime time, + JsonType jsonType, + String json, + }); } /// @nodoc class __$$KeviJsonReplayDataImplCopyWithImpl<$Res> extends _$KeviJsonReplayDataCopyWithImpl<$Res, _$KeviJsonReplayDataImpl> implements _$$KeviJsonReplayDataImplCopyWith<$Res> { - __$$KeviJsonReplayDataImplCopyWithImpl(_$KeviJsonReplayDataImpl _value, - $Res Function(_$KeviJsonReplayDataImpl) _then) - : super(_value, _then); + __$$KeviJsonReplayDataImplCopyWithImpl( + _$KeviJsonReplayDataImpl _value, + $Res Function(_$KeviJsonReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of KeviJsonReplayData /// with the given fields replaced by the non-null parameter values. @@ -957,36 +1072,42 @@ class __$$KeviJsonReplayDataImplCopyWithImpl<$Res> Object? jsonType = null, Object? json = null, }) { - return _then(_$KeviJsonReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - jsonType: null == jsonType - ? _value.jsonType - : jsonType // ignore: cast_nullable_to_non_nullable - as JsonType, - json: null == json - ? _value.json - : json // ignore: cast_nullable_to_non_nullable - as String, - )); + return _then( + _$KeviJsonReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + jsonType: + null == jsonType + ? _value.jsonType + : jsonType // ignore: cast_nullable_to_non_nullable + as JsonType, + json: + null == json + ? _value.json + : json // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$KeviJsonReplayDataImpl extends _KeviJsonReplayData { - const _$KeviJsonReplayDataImpl( - {required this.type, - required this.time, - required this.jsonType, - required this.json}) - : super._(); + const _$KeviJsonReplayDataImpl({ + required this.type, + required this.time, + required this.jsonType, + required this.json, + }) : super._(); factory _$KeviJsonReplayDataImpl.fromJson(Map json) => _$$KeviJsonReplayDataImplFromJson(json); @@ -1023,22 +1144,23 @@ class _$KeviJsonReplayDataImpl extends _KeviJsonReplayData { @pragma('vm:prefer-inline') _$$KeviJsonReplayDataImplCopyWith<_$KeviJsonReplayDataImpl> get copyWith => __$$KeviJsonReplayDataImplCopyWithImpl<_$KeviJsonReplayDataImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$KeviJsonReplayDataImplToJson( - this, - ); + return _$$KeviJsonReplayDataImplToJson(this); } } abstract class _KeviJsonReplayData extends KeviJsonReplayData { - const factory _KeviJsonReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final JsonType jsonType, - required final String json}) = _$KeviJsonReplayDataImpl; + const factory _KeviJsonReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final JsonType jsonType, + required final String json, + }) = _$KeviJsonReplayDataImpl; const _KeviJsonReplayData._() : super._(); factory _KeviJsonReplayData.fromJson(Map json) = @@ -1062,7 +1184,8 @@ abstract class _KeviJsonReplayData extends KeviJsonReplayData { } SnpLogEntryReplayData _$SnpLogEntryReplayDataFromJson( - Map json) { + Map json, +) { return _SnpLogEntryReplayData.fromJson(json); } @@ -1084,16 +1207,19 @@ mixin _$SnpLogEntryReplayData { /// @nodoc abstract class $SnpLogEntryReplayDataCopyWith<$Res> { - factory $SnpLogEntryReplayDataCopyWith(SnpLogEntryReplayData value, - $Res Function(SnpLogEntryReplayData) then) = - _$SnpLogEntryReplayDataCopyWithImpl<$Res, SnpLogEntryReplayData>; + factory $SnpLogEntryReplayDataCopyWith( + SnpLogEntryReplayData value, + $Res Function(SnpLogEntryReplayData) then, + ) = _$SnpLogEntryReplayDataCopyWithImpl<$Res, SnpLogEntryReplayData>; @useResult $Res call({ReplayDataType type, DateTime time, String message}); } /// @nodoc -class _$SnpLogEntryReplayDataCopyWithImpl<$Res, - $Val extends SnpLogEntryReplayData> +class _$SnpLogEntryReplayDataCopyWithImpl< + $Res, + $Val extends SnpLogEntryReplayData +> implements $SnpLogEntryReplayDataCopyWith<$Res> { _$SnpLogEntryReplayDataCopyWithImpl(this._value, this._then); @@ -1111,20 +1237,26 @@ class _$SnpLogEntryReplayDataCopyWithImpl<$Res, Object? time = null, Object? message = null, }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + message: + null == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -1132,9 +1264,9 @@ class _$SnpLogEntryReplayDataCopyWithImpl<$Res, abstract class _$$SnpLogEntryReplayDataImplCopyWith<$Res> implements $SnpLogEntryReplayDataCopyWith<$Res> { factory _$$SnpLogEntryReplayDataImplCopyWith( - _$SnpLogEntryReplayDataImpl value, - $Res Function(_$SnpLogEntryReplayDataImpl) then) = - __$$SnpLogEntryReplayDataImplCopyWithImpl<$Res>; + _$SnpLogEntryReplayDataImpl value, + $Res Function(_$SnpLogEntryReplayDataImpl) then, + ) = __$$SnpLogEntryReplayDataImplCopyWithImpl<$Res>; @override @useResult $Res call({ReplayDataType type, DateTime time, String message}); @@ -1142,12 +1274,13 @@ abstract class _$$SnpLogEntryReplayDataImplCopyWith<$Res> /// @nodoc class __$$SnpLogEntryReplayDataImplCopyWithImpl<$Res> - extends _$SnpLogEntryReplayDataCopyWithImpl<$Res, - _$SnpLogEntryReplayDataImpl> + extends + _$SnpLogEntryReplayDataCopyWithImpl<$Res, _$SnpLogEntryReplayDataImpl> implements _$$SnpLogEntryReplayDataImplCopyWith<$Res> { - __$$SnpLogEntryReplayDataImplCopyWithImpl(_$SnpLogEntryReplayDataImpl _value, - $Res Function(_$SnpLogEntryReplayDataImpl) _then) - : super(_value, _then); + __$$SnpLogEntryReplayDataImplCopyWithImpl( + _$SnpLogEntryReplayDataImpl _value, + $Res Function(_$SnpLogEntryReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of SnpLogEntryReplayData /// with the given fields replaced by the non-null parameter values. @@ -1158,29 +1291,36 @@ class __$$SnpLogEntryReplayDataImplCopyWithImpl<$Res> Object? time = null, Object? message = null, }) { - return _then(_$SnpLogEntryReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - message: null == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String, - )); + return _then( + _$SnpLogEntryReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + message: + null == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$SnpLogEntryReplayDataImpl extends _SnpLogEntryReplayData { - const _$SnpLogEntryReplayDataImpl( - {required this.type, required this.time, required this.message}) - : super._(); + const _$SnpLogEntryReplayDataImpl({ + required this.type, + required this.time, + required this.message, + }) : super._(); factory _$SnpLogEntryReplayDataImpl.fromJson(Map json) => _$$SnpLogEntryReplayDataImplFromJson(json); @@ -1212,22 +1352,24 @@ class _$SnpLogEntryReplayDataImpl extends _SnpLogEntryReplayData { @override @pragma('vm:prefer-inline') _$$SnpLogEntryReplayDataImplCopyWith<_$SnpLogEntryReplayDataImpl> - get copyWith => __$$SnpLogEntryReplayDataImplCopyWithImpl< - _$SnpLogEntryReplayDataImpl>(this, _$identity); + get copyWith => + __$$SnpLogEntryReplayDataImplCopyWithImpl<_$SnpLogEntryReplayDataImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$SnpLogEntryReplayDataImplToJson( - this, - ); + return _$$SnpLogEntryReplayDataImplToJson(this); } } abstract class _SnpLogEntryReplayData extends SnpLogEntryReplayData { - const factory _SnpLogEntryReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final String message}) = _$SnpLogEntryReplayDataImpl; + const factory _SnpLogEntryReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final String message, + }) = _$SnpLogEntryReplayDataImpl; const _SnpLogEntryReplayData._() : super._(); factory _SnpLogEntryReplayData.fromJson(Map json) = @@ -1245,7 +1387,7 @@ abstract class _SnpLogEntryReplayData extends SnpLogEntryReplayData { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$SnpLogEntryReplayDataImplCopyWith<_$SnpLogEntryReplayDataImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } AxisJsonReplayData _$AxisJsonReplayDataFromJson(Map json) { @@ -1271,8 +1413,9 @@ mixin _$AxisJsonReplayData { /// @nodoc abstract class $AxisJsonReplayDataCopyWith<$Res> { factory $AxisJsonReplayDataCopyWith( - AxisJsonReplayData value, $Res Function(AxisJsonReplayData) then) = - _$AxisJsonReplayDataCopyWithImpl<$Res, AxisJsonReplayData>; + AxisJsonReplayData value, + $Res Function(AxisJsonReplayData) then, + ) = _$AxisJsonReplayDataCopyWithImpl<$Res, AxisJsonReplayData>; @useResult $Res call({ReplayDataType type, DateTime time, String json}); } @@ -1291,34 +1434,37 @@ class _$AxisJsonReplayDataCopyWithImpl<$Res, $Val extends AxisJsonReplayData> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? type = null, - Object? time = null, - Object? json = null, - }) { - return _then(_value.copyWith( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - json: null == json - ? _value.json - : json // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? type = null, Object? time = null, Object? json = null}) { + return _then( + _value.copyWith( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + json: + null == json + ? _value.json + : json // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } /// @nodoc abstract class _$$AxisJsonReplayDataImplCopyWith<$Res> implements $AxisJsonReplayDataCopyWith<$Res> { - factory _$$AxisJsonReplayDataImplCopyWith(_$AxisJsonReplayDataImpl value, - $Res Function(_$AxisJsonReplayDataImpl) then) = - __$$AxisJsonReplayDataImplCopyWithImpl<$Res>; + factory _$$AxisJsonReplayDataImplCopyWith( + _$AxisJsonReplayDataImpl value, + $Res Function(_$AxisJsonReplayDataImpl) then, + ) = __$$AxisJsonReplayDataImplCopyWithImpl<$Res>; @override @useResult $Res call({ReplayDataType type, DateTime time, String json}); @@ -1328,42 +1474,46 @@ abstract class _$$AxisJsonReplayDataImplCopyWith<$Res> class __$$AxisJsonReplayDataImplCopyWithImpl<$Res> extends _$AxisJsonReplayDataCopyWithImpl<$Res, _$AxisJsonReplayDataImpl> implements _$$AxisJsonReplayDataImplCopyWith<$Res> { - __$$AxisJsonReplayDataImplCopyWithImpl(_$AxisJsonReplayDataImpl _value, - $Res Function(_$AxisJsonReplayDataImpl) _then) - : super(_value, _then); + __$$AxisJsonReplayDataImplCopyWithImpl( + _$AxisJsonReplayDataImpl _value, + $Res Function(_$AxisJsonReplayDataImpl) _then, + ) : super(_value, _then); /// Create a copy of AxisJsonReplayData /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? type = null, - Object? time = null, - Object? json = null, - }) { - return _then(_$AxisJsonReplayDataImpl( - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as ReplayDataType, - time: null == time - ? _value.time - : time // ignore: cast_nullable_to_non_nullable - as DateTime, - json: null == json - ? _value.json - : json // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? type = null, Object? time = null, Object? json = null}) { + return _then( + _$AxisJsonReplayDataImpl( + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as ReplayDataType, + time: + null == time + ? _value.time + : time // ignore: cast_nullable_to_non_nullable + as DateTime, + json: + null == json + ? _value.json + : json // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$AxisJsonReplayDataImpl extends _AxisJsonReplayData { - const _$AxisJsonReplayDataImpl( - {required this.type, required this.time, required this.json}) - : super._(); + const _$AxisJsonReplayDataImpl({ + required this.type, + required this.time, + required this.json, + }) : super._(); factory _$AxisJsonReplayDataImpl.fromJson(Map json) => _$$AxisJsonReplayDataImplFromJson(json); @@ -1396,21 +1546,22 @@ class _$AxisJsonReplayDataImpl extends _AxisJsonReplayData { @pragma('vm:prefer-inline') _$$AxisJsonReplayDataImplCopyWith<_$AxisJsonReplayDataImpl> get copyWith => __$$AxisJsonReplayDataImplCopyWithImpl<_$AxisJsonReplayDataImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$AxisJsonReplayDataImplToJson( - this, - ); + return _$$AxisJsonReplayDataImplToJson(this); } } abstract class _AxisJsonReplayData extends AxisJsonReplayData { - const factory _AxisJsonReplayData( - {required final ReplayDataType type, - required final DateTime time, - required final String json}) = _$AxisJsonReplayDataImpl; + const factory _AxisJsonReplayData({ + required final ReplayDataType type, + required final DateTime time, + required final String json, + }) = _$AxisJsonReplayDataImpl; const _AxisJsonReplayData._() : super._(); factory _AxisJsonReplayData.fromJson(Map json) = diff --git a/packages/earthquake_replay/lib/src/model/replay_data.g.dart b/packages/earthquake_replay/lib/src/model/replay_data.g.dart index c0bcda84..8cd4a976 100644 --- a/packages/earthquake_replay/lib/src/model/replay_data.g.dart +++ b/packages/earthquake_replay/lib/src/model/replay_data.g.dart @@ -9,30 +9,28 @@ part of 'replay_data.dart'; // ************************************************************************** _$JmaXmlTelegramReplayDataImpl _$$JmaXmlTelegramReplayDataImplFromJson( - Map json) => - $checkedCreate( - r'_$JmaXmlTelegramReplayDataImpl', - json, - ($checkedConvert) { - final val = _$JmaXmlTelegramReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - title: $checkedConvert('title', (v) => v as String), - telegram: $checkedConvert('telegram', (v) => v as String), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$JmaXmlTelegramReplayDataImpl', json, ($checkedConvert) { + final val = _$JmaXmlTelegramReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + title: $checkedConvert('title', (v) => v as String), + telegram: $checkedConvert('telegram', (v) => v as String), + ); + return val; +}); Map _$$JmaXmlTelegramReplayDataImplToJson( - _$JmaXmlTelegramReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'title': instance.title, - 'telegram': instance.telegram, - }; + _$JmaXmlTelegramReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'title': instance.title, + 'telegram': instance.telegram, +}; const _$ReplayDataTypeEnumMap = { ReplayDataType.jmaXmlTelegram: 0, @@ -45,67 +43,68 @@ const _$ReplayDataTypeEnumMap = { }; _$JmaBinaryTelegramReplayDataImpl _$$JmaBinaryTelegramReplayDataImplFromJson( - Map json) => - $checkedCreate( - r'_$JmaBinaryTelegramReplayDataImpl', - json, - ($checkedConvert) { - final val = _$JmaBinaryTelegramReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - telegramType: $checkedConvert('telegram_type', (v) => v as String), - data: $checkedConvert( - 'data', - (v) => - (v as List).map((e) => (e as num).toInt()).toList()), - ); - return val; - }, - fieldKeyMap: const {'telegramType': 'telegram_type'}, + Map json, +) => $checkedCreate( + r'_$JmaBinaryTelegramReplayDataImpl', + json, + ($checkedConvert) { + final val = _$JmaBinaryTelegramReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + telegramType: $checkedConvert('telegram_type', (v) => v as String), + data: $checkedConvert( + 'data', + (v) => (v as List).map((e) => (e as num).toInt()).toList(), + ), ); + return val; + }, + fieldKeyMap: const {'telegramType': 'telegram_type'}, +); Map _$$JmaBinaryTelegramReplayDataImplToJson( - _$JmaBinaryTelegramReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'telegram_type': instance.telegramType, - 'data': instance.data, - }; + _$JmaBinaryTelegramReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'telegram_type': instance.telegramType, + 'data': instance.data, +}; _$KyoshinMonitorImageReplayDataImpl - _$$KyoshinMonitorImageReplayDataImplFromJson(Map json) => - $checkedCreate( - r'_$KyoshinMonitorImageReplayDataImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorImageReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - images: $checkedConvert( - 'images', - (v) => (v as Map).map( - (k, e) => MapEntry( - $enumDecode(_$ImageTypeEnumMap, k), - (e as List) - .map((e) => (e as num).toInt()) - .toList()), - )), - ); - return val; - }, - ); +_$$KyoshinMonitorImageReplayDataImplFromJson(Map json) => + $checkedCreate(r'_$KyoshinMonitorImageReplayDataImpl', json, ( + $checkedConvert, + ) { + final val = _$KyoshinMonitorImageReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + images: $checkedConvert( + 'images', + (v) => (v as Map).map( + (k, e) => MapEntry( + $enumDecode(_$ImageTypeEnumMap, k), + (e as List).map((e) => (e as num).toInt()).toList(), + ), + ), + ), + ); + return val; + }); Map _$$KyoshinMonitorImageReplayDataImplToJson( - _$KyoshinMonitorImageReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'images': - instance.images.map((k, e) => MapEntry(_$ImageTypeEnumMap[k]!, e)), - }; + _$KyoshinMonitorImageReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'images': instance.images.map((k, e) => MapEntry(_$ImageTypeEnumMap[k]!, e)), +}; const _$ImageTypeEnumMap = { ImageType.shindo: 'shindo', @@ -116,56 +115,55 @@ const _$ImageTypeEnumMap = { }; _$KyoshinMonitorEewJsonReplayDataImpl - _$$KyoshinMonitorEewJsonReplayDataImplFromJson(Map json) => - $checkedCreate( - r'_$KyoshinMonitorEewJsonReplayDataImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorEewJsonReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - json: $checkedConvert('json', (v) => v as String), - ); - return val; - }, - ); +_$$KyoshinMonitorEewJsonReplayDataImplFromJson(Map json) => + $checkedCreate(r'_$KyoshinMonitorEewJsonReplayDataImpl', json, ( + $checkedConvert, + ) { + final val = _$KyoshinMonitorEewJsonReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + json: $checkedConvert('json', (v) => v as String), + ); + return val; + }); Map _$$KyoshinMonitorEewJsonReplayDataImplToJson( - _$KyoshinMonitorEewJsonReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'json': instance.json, - }; + _$KyoshinMonitorEewJsonReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'json': instance.json, +}; _$KeviJsonReplayDataImpl _$$KeviJsonReplayDataImplFromJson( - Map json) => - $checkedCreate( - r'_$KeviJsonReplayDataImpl', - json, - ($checkedConvert) { - final val = _$KeviJsonReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - jsonType: $checkedConvert( - 'json_type', (v) => $enumDecode(_$JsonTypeEnumMap, v)), - json: $checkedConvert('json', (v) => v as String), - ); - return val; - }, - fieldKeyMap: const {'jsonType': 'json_type'}, - ); + Map json, +) => $checkedCreate(r'_$KeviJsonReplayDataImpl', json, ($checkedConvert) { + final val = _$KeviJsonReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + jsonType: $checkedConvert( + 'json_type', + (v) => $enumDecode(_$JsonTypeEnumMap, v), + ), + json: $checkedConvert('json', (v) => v as String), + ); + return val; +}, fieldKeyMap: const {'jsonType': 'json_type'}); Map _$$KeviJsonReplayDataImplToJson( - _$KeviJsonReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'json_type': _$JsonTypeEnumMap[instance.jsonType]!, - 'json': instance.json, - }; + _$KeviJsonReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'json_type': _$JsonTypeEnumMap[instance.jsonType]!, + 'json': instance.json, +}; const _$JsonTypeEnumMap = { JsonType.eew: 'eew', @@ -173,49 +171,45 @@ const _$JsonTypeEnumMap = { }; _$SnpLogEntryReplayDataImpl _$$SnpLogEntryReplayDataImplFromJson( - Map json) => - $checkedCreate( - r'_$SnpLogEntryReplayDataImpl', - json, - ($checkedConvert) { - final val = _$SnpLogEntryReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - message: $checkedConvert('message', (v) => v as String), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$SnpLogEntryReplayDataImpl', json, ($checkedConvert) { + final val = _$SnpLogEntryReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + message: $checkedConvert('message', (v) => v as String), + ); + return val; +}); Map _$$SnpLogEntryReplayDataImplToJson( - _$SnpLogEntryReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'message': instance.message, - }; + _$SnpLogEntryReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'message': instance.message, +}; _$AxisJsonReplayDataImpl _$$AxisJsonReplayDataImplFromJson( - Map json) => - $checkedCreate( - r'_$AxisJsonReplayDataImpl', - json, - ($checkedConvert) { - final val = _$AxisJsonReplayDataImpl( - type: $checkedConvert( - 'type', (v) => $enumDecode(_$ReplayDataTypeEnumMap, v)), - time: $checkedConvert('time', (v) => DateTime.parse(v as String)), - json: $checkedConvert('json', (v) => v as String), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$AxisJsonReplayDataImpl', json, ($checkedConvert) { + final val = _$AxisJsonReplayDataImpl( + type: $checkedConvert( + 'type', + (v) => $enumDecode(_$ReplayDataTypeEnumMap, v), + ), + time: $checkedConvert('time', (v) => DateTime.parse(v as String)), + json: $checkedConvert('json', (v) => v as String), + ); + return val; +}); Map _$$AxisJsonReplayDataImplToJson( - _$AxisJsonReplayDataImpl instance) => - { - 'type': _$ReplayDataTypeEnumMap[instance.type]!, - 'time': instance.time.toIso8601String(), - 'json': instance.json, - }; + _$AxisJsonReplayDataImpl instance, +) => { + 'type': _$ReplayDataTypeEnumMap[instance.type]!, + 'time': instance.time.toIso8601String(), + 'json': instance.json, +}; diff --git a/packages/earthquake_replay/lib/src/model/replay_file_header.dart b/packages/earthquake_replay/lib/src/model/replay_file_header.dart index 06fad358..52443dd5 100644 --- a/packages/earthquake_replay/lib/src/model/replay_file_header.dart +++ b/packages/earthquake_replay/lib/src/model/replay_file_header.dart @@ -34,8 +34,7 @@ enum ReplayFileCompressionMode { none(0), messagePackCSharpLz4BlockArray(1), gzip(2), - brotli(3), - ; + brotli(3); const ReplayFileCompressionMode(this.value); final int value; diff --git a/packages/earthquake_replay/lib/src/model/replay_file_header.freezed.dart b/packages/earthquake_replay/lib/src/model/replay_file_header.freezed.dart index bb3aaa14..ac8d5731 100644 --- a/packages/earthquake_replay/lib/src/model/replay_file_header.freezed.dart +++ b/packages/earthquake_replay/lib/src/model/replay_file_header.freezed.dart @@ -12,7 +12,8 @@ part of 'replay_file_header.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); ReplayFileHeader _$ReplayFileHeaderFromJson(Map json) { return _ReplayFileHeader.fromJson(json); @@ -40,15 +41,17 @@ mixin _$ReplayFileHeader { /// @nodoc abstract class $ReplayFileHeaderCopyWith<$Res> { factory $ReplayFileHeaderCopyWith( - ReplayFileHeader value, $Res Function(ReplayFileHeader) then) = - _$ReplayFileHeaderCopyWithImpl<$Res, ReplayFileHeader>; + ReplayFileHeader value, + $Res Function(ReplayFileHeader) then, + ) = _$ReplayFileHeaderCopyWithImpl<$Res, ReplayFileHeader>; @useResult - $Res call( - {int version, - String softwareName, - DateTime startTime, - DateTime endTime, - ReplayFileCompressionMode compressionMode}); + $Res call({ + int version, + String softwareName, + DateTime startTime, + DateTime endTime, + ReplayFileCompressionMode compressionMode, + }); } /// @nodoc @@ -72,54 +75,65 @@ class _$ReplayFileHeaderCopyWithImpl<$Res, $Val extends ReplayFileHeader> Object? endTime = null, Object? compressionMode = null, }) { - return _then(_value.copyWith( - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as int, - softwareName: null == softwareName - ? _value.softwareName - : softwareName // ignore: cast_nullable_to_non_nullable - as String, - startTime: null == startTime - ? _value.startTime - : startTime // ignore: cast_nullable_to_non_nullable - as DateTime, - endTime: null == endTime - ? _value.endTime - : endTime // ignore: cast_nullable_to_non_nullable - as DateTime, - compressionMode: null == compressionMode - ? _value.compressionMode - : compressionMode // ignore: cast_nullable_to_non_nullable - as ReplayFileCompressionMode, - ) as $Val); + return _then( + _value.copyWith( + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as int, + softwareName: + null == softwareName + ? _value.softwareName + : softwareName // ignore: cast_nullable_to_non_nullable + as String, + startTime: + null == startTime + ? _value.startTime + : startTime // ignore: cast_nullable_to_non_nullable + as DateTime, + endTime: + null == endTime + ? _value.endTime + : endTime // ignore: cast_nullable_to_non_nullable + as DateTime, + compressionMode: + null == compressionMode + ? _value.compressionMode + : compressionMode // ignore: cast_nullable_to_non_nullable + as ReplayFileCompressionMode, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ReplayFileHeaderImplCopyWith<$Res> implements $ReplayFileHeaderCopyWith<$Res> { - factory _$$ReplayFileHeaderImplCopyWith(_$ReplayFileHeaderImpl value, - $Res Function(_$ReplayFileHeaderImpl) then) = - __$$ReplayFileHeaderImplCopyWithImpl<$Res>; + factory _$$ReplayFileHeaderImplCopyWith( + _$ReplayFileHeaderImpl value, + $Res Function(_$ReplayFileHeaderImpl) then, + ) = __$$ReplayFileHeaderImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int version, - String softwareName, - DateTime startTime, - DateTime endTime, - ReplayFileCompressionMode compressionMode}); + $Res call({ + int version, + String softwareName, + DateTime startTime, + DateTime endTime, + ReplayFileCompressionMode compressionMode, + }); } /// @nodoc class __$$ReplayFileHeaderImplCopyWithImpl<$Res> extends _$ReplayFileHeaderCopyWithImpl<$Res, _$ReplayFileHeaderImpl> implements _$$ReplayFileHeaderImplCopyWith<$Res> { - __$$ReplayFileHeaderImplCopyWithImpl(_$ReplayFileHeaderImpl _value, - $Res Function(_$ReplayFileHeaderImpl) _then) - : super(_value, _then); + __$$ReplayFileHeaderImplCopyWithImpl( + _$ReplayFileHeaderImpl _value, + $Res Function(_$ReplayFileHeaderImpl) _then, + ) : super(_value, _then); /// Create a copy of ReplayFileHeader /// with the given fields replaced by the non-null parameter values. @@ -132,40 +146,48 @@ class __$$ReplayFileHeaderImplCopyWithImpl<$Res> Object? endTime = null, Object? compressionMode = null, }) { - return _then(_$ReplayFileHeaderImpl( - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as int, - softwareName: null == softwareName - ? _value.softwareName - : softwareName // ignore: cast_nullable_to_non_nullable - as String, - startTime: null == startTime - ? _value.startTime - : startTime // ignore: cast_nullable_to_non_nullable - as DateTime, - endTime: null == endTime - ? _value.endTime - : endTime // ignore: cast_nullable_to_non_nullable - as DateTime, - compressionMode: null == compressionMode - ? _value.compressionMode - : compressionMode // ignore: cast_nullable_to_non_nullable - as ReplayFileCompressionMode, - )); + return _then( + _$ReplayFileHeaderImpl( + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as int, + softwareName: + null == softwareName + ? _value.softwareName + : softwareName // ignore: cast_nullable_to_non_nullable + as String, + startTime: + null == startTime + ? _value.startTime + : startTime // ignore: cast_nullable_to_non_nullable + as DateTime, + endTime: + null == endTime + ? _value.endTime + : endTime // ignore: cast_nullable_to_non_nullable + as DateTime, + compressionMode: + null == compressionMode + ? _value.compressionMode + : compressionMode // ignore: cast_nullable_to_non_nullable + as ReplayFileCompressionMode, + ), + ); } } /// @nodoc @JsonSerializable() class _$ReplayFileHeaderImpl implements _ReplayFileHeader { - const _$ReplayFileHeaderImpl( - {required this.version, - required this.softwareName, - required this.startTime, - required this.endTime, - required this.compressionMode}); + const _$ReplayFileHeaderImpl({ + required this.version, + required this.softwareName, + required this.startTime, + required this.endTime, + required this.compressionMode, + }); factory _$ReplayFileHeaderImpl.fromJson(Map json) => _$$ReplayFileHeaderImplFromJson(json); @@ -204,7 +226,13 @@ class _$ReplayFileHeaderImpl implements _ReplayFileHeader { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, version, softwareName, startTime, endTime, compressionMode); + runtimeType, + version, + softwareName, + startTime, + endTime, + compressionMode, + ); /// Create a copy of ReplayFileHeader /// with the given fields replaced by the non-null parameter values. @@ -213,24 +241,24 @@ class _$ReplayFileHeaderImpl implements _ReplayFileHeader { @pragma('vm:prefer-inline') _$$ReplayFileHeaderImplCopyWith<_$ReplayFileHeaderImpl> get copyWith => __$$ReplayFileHeaderImplCopyWithImpl<_$ReplayFileHeaderImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$ReplayFileHeaderImplToJson( - this, - ); + return _$$ReplayFileHeaderImplToJson(this); } } abstract class _ReplayFileHeader implements ReplayFileHeader { - const factory _ReplayFileHeader( - {required final int version, - required final String softwareName, - required final DateTime startTime, - required final DateTime endTime, - required final ReplayFileCompressionMode compressionMode}) = - _$ReplayFileHeaderImpl; + const factory _ReplayFileHeader({ + required final int version, + required final String softwareName, + required final DateTime startTime, + required final DateTime endTime, + required final ReplayFileCompressionMode compressionMode, + }) = _$ReplayFileHeaderImpl; factory _ReplayFileHeader.fromJson(Map json) = _$ReplayFileHeaderImpl.fromJson; diff --git a/packages/earthquake_replay/lib/src/model/replay_file_header.g.dart b/packages/earthquake_replay/lib/src/model/replay_file_header.g.dart index 7a7ec46f..3afedded 100644 --- a/packages/earthquake_replay/lib/src/model/replay_file_header.g.dart +++ b/packages/earthquake_replay/lib/src/model/replay_file_header.g.dart @@ -9,41 +9,44 @@ part of 'replay_file_header.dart'; // ************************************************************************** _$ReplayFileHeaderImpl _$$ReplayFileHeaderImplFromJson( - Map json) => - $checkedCreate( - r'_$ReplayFileHeaderImpl', - json, - ($checkedConvert) { - final val = _$ReplayFileHeaderImpl( - version: $checkedConvert('version', (v) => (v as num).toInt()), - softwareName: $checkedConvert('software_name', (v) => v as String), - startTime: - $checkedConvert('start_time', (v) => DateTime.parse(v as String)), - endTime: - $checkedConvert('end_time', (v) => DateTime.parse(v as String)), - compressionMode: $checkedConvert('compression_mode', - (v) => $enumDecode(_$ReplayFileCompressionModeEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const { - 'softwareName': 'software_name', - 'startTime': 'start_time', - 'endTime': 'end_time', - 'compressionMode': 'compression_mode' - }, + Map json, +) => $checkedCreate( + r'_$ReplayFileHeaderImpl', + json, + ($checkedConvert) { + final val = _$ReplayFileHeaderImpl( + version: $checkedConvert('version', (v) => (v as num).toInt()), + softwareName: $checkedConvert('software_name', (v) => v as String), + startTime: $checkedConvert( + 'start_time', + (v) => DateTime.parse(v as String), + ), + endTime: $checkedConvert('end_time', (v) => DateTime.parse(v as String)), + compressionMode: $checkedConvert( + 'compression_mode', + (v) => $enumDecode(_$ReplayFileCompressionModeEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const { + 'softwareName': 'software_name', + 'startTime': 'start_time', + 'endTime': 'end_time', + 'compressionMode': 'compression_mode', + }, +); Map _$$ReplayFileHeaderImplToJson( - _$ReplayFileHeaderImpl instance) => - { - 'version': instance.version, - 'software_name': instance.softwareName, - 'start_time': instance.startTime.toIso8601String(), - 'end_time': instance.endTime.toIso8601String(), - 'compression_mode': - _$ReplayFileCompressionModeEnumMap[instance.compressionMode]!, - }; + _$ReplayFileHeaderImpl instance, +) => { + 'version': instance.version, + 'software_name': instance.softwareName, + 'start_time': instance.startTime.toIso8601String(), + 'end_time': instance.endTime.toIso8601String(), + 'compression_mode': + _$ReplayFileCompressionModeEnumMap[instance.compressionMode]!, +}; const _$ReplayFileCompressionModeEnumMap = { ReplayFileCompressionMode.none: 'none', diff --git a/packages/earthquake_replay/lib/src/parser/replay_data_parser.dart b/packages/earthquake_replay/lib/src/parser/replay_data_parser.dart index b9354acb..e03b3ac4 100644 --- a/packages/earthquake_replay/lib/src/parser/replay_data_parser.dart +++ b/packages/earthquake_replay/lib/src/parser/replay_data_parser.dart @@ -38,21 +38,16 @@ class ReplayDataParser { ReplayFileCompressionMode.none => dataView, ReplayFileCompressionMode.gzip => gzip.decode(dataView), ReplayFileCompressionMode.brotli => brotli.decode(dataView), - ReplayFileCompressionMode.messagePackCSharpLz4BlockArray => - lz4.decode(dataView), + ReplayFileCompressionMode.messagePackCSharpLz4BlockArray => lz4.decode( + dataView, + ), }; final replayData = _parseReplayData(decompressedData as Uint8List); - return ReplayFile( - header: header, - data: replayData, - ); + return ReplayFile(header: header, data: replayData); } (ReplayFileHeader, int offset) _readHeader(Uint8List data) { - final deserializer = Deserializer( - data, - extDecoder: ExtTimeStampDecoder(), - ); + final deserializer = Deserializer(data, extDecoder: ExtTimeStampDecoder()); final headerData = deserializer.decode(); if (headerData is! List) { throw Exception('Header is invalid: ${headerData.runtimeType}'); @@ -68,10 +63,7 @@ class ReplayDataParser { List _parseReplayData(Uint8List data) { final result = []; - final deserializer = Deserializer( - data, - extDecoder: ExtTimeStampDecoder(), - ); + final deserializer = Deserializer(data, extDecoder: ExtTimeStampDecoder()); final replayData = deserializer.decode() as List; for (final data in replayData) { if (data is List) { @@ -83,16 +75,11 @@ class ReplayDataParser { return result; } - static Uint8List get magicHeader => Uint8List.fromList( - utf8.encode('EQRP'), - ); + static Uint8List get magicHeader => Uint8List.fromList(utf8.encode('EQRP')); } class ReplayFile { - const ReplayFile({ - required this.header, - required this.data, - }); + const ReplayFile({required this.header, required this.data}); final ReplayFileHeader header; final List data; diff --git a/packages/earthquake_replay/lib/test.dart b/packages/earthquake_replay/lib/test.dart index 3a462396..18a4cd01 100644 --- a/packages/earthquake_replay/lib/test.dart +++ b/packages/earthquake_replay/lib/test.dart @@ -4,8 +4,6 @@ import 'package:earthquake_replay/src/parser/replay_data_parser.dart'; Future main() async { final parser = ReplayDataParser(); - final data = parser.parse( - File('test/20240101-能登7.eprp').readAsBytesSync(), - ); + final data = parser.parse(File('test/20240101-能登7.eprp').readAsBytesSync()); print(data); } diff --git a/packages/eqapi_client/lib/src/children/auth.g.dart b/packages/eqapi_client/lib/src/children/auth.g.dart index 52527430..8b7efa32 100644 --- a/packages/eqapi_client/lib/src/children/auth.g.dart +++ b/packages/eqapi_client/lib/src/children/auth.g.dart @@ -11,11 +11,7 @@ part of 'auth.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _AuthApiClient implements AuthApiClient { - _AuthApiClient( - this._dio, { - this.baseUrl, - this.errorLogger, - }); + _AuthApiClient(this._dio, {this.baseUrl, this.errorLogger}); final Dio _dio; @@ -24,30 +20,24 @@ class _AuthApiClient implements AuthApiClient { final ParseErrorLogger? errorLogger; @override - Future> register( - {required FcmTokenRequest request}) async { + Future> register({ + required FcmTokenRequest request, + }) async { final _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(request.toJson()); - final _options = - _setStreamType>(Options( - method: 'PUT', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/auth/register', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'PUT', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/auth/register', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late FcmTokenUpdateResponse _value; try { @@ -71,23 +61,16 @@ class _AuthApiClient implements AuthApiClient { _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(request.toJson()); - final _options = - _setStreamType>(Options( - method: 'PUT', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/auth/update', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'PUT', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/auth/update', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late FcmTokenUpdateResponse _value; try { @@ -111,22 +94,16 @@ class _AuthApiClient implements AuthApiClient { _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(request.toJson()); - final _options = _setStreamType>(Options( - method: 'PUT', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/auth/settings/eew', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'PUT', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/auth/settings/eew', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch(_options); final httpResponse = HttpResponse(null, _result); return httpResponse; @@ -143,52 +120,40 @@ class _AuthApiClient implements AuthApiClient { _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(request.toJson()); - final _options = _setStreamType>(Options( - method: 'PUT', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/auth/settings/earthquake', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'PUT', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/auth/settings/earthquake', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch(_options); final httpResponse = HttpResponse(null, _result); return httpResponse; } @override - Future> getNotificationSettings( - {required String authorization}) async { + Future> getNotificationSettings({ + required String authorization, + }) async { final _extra = {}; final queryParameters = {}; final _headers = {r'Authorization': authorization}; _headers.removeWhere((k, v) => v == null); const Map? _data = null; - final _options = - _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/auth/settings', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/auth/settings', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late NotificationSettingsResponse _value; try { @@ -214,10 +179,7 @@ class _AuthApiClient implements AuthApiClient { return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/eqapi_client/lib/src/children/objects.g.dart b/packages/eqapi_client/lib/src/children/objects.g.dart index 7110890f..fd18f116 100644 --- a/packages/eqapi_client/lib/src/children/objects.g.dart +++ b/packages/eqapi_client/lib/src/children/objects.g.dart @@ -11,11 +11,7 @@ part of 'objects.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _Objects implements Objects { - _Objects( - this._dio, { - this.baseUrl, - this.errorLogger, - }); + _Objects(this._dio, {this.baseUrl, this.errorLogger}); final Dio _dio; @@ -24,28 +20,23 @@ class _Objects implements Objects { final ParseErrorLogger? errorLogger; @override - Future> getEarthquakeEarlyEvent( - {required String id}) async { + Future> getEarthquakeEarlyEvent({ + required String id, + }) async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/earthquake-early/${id}.json', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/earthquake-early/${id}.json', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late EarthquakeEarlyEvent _value; try { @@ -71,10 +62,7 @@ class _Objects implements Objects { return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/eqapi_client/lib/src/children/v1.g.dart b/packages/eqapi_client/lib/src/children/v1.g.dart index 3fba8eb4..36071fc2 100644 --- a/packages/eqapi_client/lib/src/children/v1.g.dart +++ b/packages/eqapi_client/lib/src/children/v1.g.dart @@ -11,11 +11,7 @@ part of 'v1.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _V1 implements V1 { - _V1( - this._dio, { - this.baseUrl, - this.errorLogger, - }); + _V1(this._dio, {this.baseUrl, this.errorLogger}); final Dio _dio; @@ -48,28 +44,25 @@ class _V1 implements V1 { queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/earthquake/list', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/earthquake/list', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => EarthquakeV1.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map( + (dynamic i) => EarthquakeV1.fromJson(i as Map), + ) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -79,28 +72,23 @@ class _V1 implements V1 { } @override - Future> getEarthquakeDetail( - {required String eventId}) async { + Future> getEarthquakeDetail({ + required String eventId, + }) async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/earthquake/detail/${eventId}', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/earthquake/detail/${eventId}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late EarthquakeV1 _value; try { @@ -132,28 +120,25 @@ class _V1 implements V1 { queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/earthquake/region', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/earthquake/region', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => RegionItem.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map( + (dynamic i) => RegionItem.fromJson(i as Map), + ) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -174,28 +159,26 @@ class _V1 implements V1 { }; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/information', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/information', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => InformationV1.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map( + (dynamic i) => + InformationV1.fromJson(i as Map), + ) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -216,28 +199,23 @@ class _V1 implements V1 { }; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/eew', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/eew', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => EewV1.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map((dynamic i) => EewV1.fromJson(i as Map)) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -252,28 +230,23 @@ class _V1 implements V1 { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/eew/latest', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/eew/latest', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => EewV1.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map((dynamic i) => EewV1.fromJson(i as Map)) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -283,34 +256,30 @@ class _V1 implements V1 { } @override - Future>> getEewByEventId( - {required String eventId}) async { + Future>> getEewByEventId({ + required String eventId, + }) async { final _extra = {}; final queryParameters = {r'eventId': eventId}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/eew/search', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/eew/search', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => EewV1.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map((dynamic i) => EewV1.fromJson(i as Map)) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -352,30 +321,26 @@ class _V1 implements V1 { queryParameters.removeWhere((k, v) => v == null); final _headers = {}; const Map? _data = null; - final _options = - _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/earthquake-early/list', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/earthquake-early/list', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => - EarthquakeEarly.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map( + (dynamic i) => + EarthquakeEarly.fromJson(i as Map), + ) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -390,29 +355,26 @@ class _V1 implements V1 { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v1/shake-detection/latest', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v1/shake-detection/latest', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { - _value = _result.data! - .map((dynamic i) => - ShakeDetectionEvent.fromJson(i as Map)) - .toList(); + _value = + _result.data! + .map( + (dynamic i) => + ShakeDetectionEvent.fromJson(i as Map), + ) + .toList(); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; @@ -433,10 +395,7 @@ class _V1 implements V1 { return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/eqapi_client/lib/src/eqapi_client.dart b/packages/eqapi_client/lib/src/eqapi_client.dart index a232b36d..ea311600 100644 --- a/packages/eqapi_client/lib/src/eqapi_client.dart +++ b/packages/eqapi_client/lib/src/eqapi_client.dart @@ -10,10 +10,7 @@ export 'children/v1.dart'; part 'eqapi_client.g.dart'; class EqApi { - EqApi({ - required this.dio, - required this.objectsDio, - }); + EqApi({required this.dio, required this.objectsDio}); final Dio dio; final Dio objectsDio; diff --git a/packages/eqapi_client/lib/src/eqapi_client.g.dart b/packages/eqapi_client/lib/src/eqapi_client.g.dart index 09278d00..0a9dfe15 100644 --- a/packages/eqapi_client/lib/src/eqapi_client.g.dart +++ b/packages/eqapi_client/lib/src/eqapi_client.g.dart @@ -11,11 +11,7 @@ part of 'eqapi_client.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _V3 implements V3 { - _V3( - this._dio, { - this.baseUrl, - this.errorLogger, - }); + _V3(this._dio, {this.baseUrl, this.errorLogger}); final Dio _dio; @@ -35,22 +31,16 @@ class _V3 implements V3 { }; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v3/information', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v3/information', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late InformationV3Result _value; try { @@ -68,22 +58,16 @@ class _V3 implements V3 { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/v3/app_information', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/v3/app_information', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late AppInformation _value; try { @@ -108,10 +92,7 @@ class _V3 implements V3 { return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/eqapi_types/lib/src/enum/area_forecast_local_eew.dart b/packages/eqapi_types/lib/src/enum/area_forecast_local_eew.dart index fcc22d65..3eeb5ec3 100644 --- a/packages/eqapi_types/lib/src/enum/area_forecast_local_eew.dart +++ b/packages/eqapi_types/lib/src/enum/area_forecast_local_eew.dart @@ -55,8 +55,7 @@ enum AreaForecastLocalEew { $9471('9471', '沖縄本島', 'おきなわほんとう'), $9472('9472', '大東島', 'だいとうじま'), $9473('9473', '宮古島', 'みやこじま'), - $9474('9474', '八重山', 'やえやま'), - ; + $9474('9474', '八重山', 'やえやま'); const AreaForecastLocalEew(this.code, this.name, this.kana); final String code; diff --git a/packages/eqapi_types/lib/src/enum/area_information_prefecture_earthquake.dart b/packages/eqapi_types/lib/src/enum/area_information_prefecture_earthquake.dart index bc4bc9af..54f98ddf 100644 --- a/packages/eqapi_types/lib/src/enum/area_information_prefecture_earthquake.dart +++ b/packages/eqapi_types/lib/src/enum/area_information_prefecture_earthquake.dart @@ -46,8 +46,7 @@ enum AreaInformationPrefectureEarthquake { $44('44', '大分県'), $45('45', '宮崎県'), $46('46', '鹿児島県'), - $47('47', '沖縄県'), - ; + $47('47', '沖縄県'); const AreaInformationPrefectureEarthquake(this.code, this.name); final String code; diff --git a/packages/eqapi_types/lib/src/model/core.dart b/packages/eqapi_types/lib/src/model/core.dart index 46268f07..faecfc9d 100644 --- a/packages/eqapi_types/lib/src/model/core.dart +++ b/packages/eqapi_types/lib/src/model/core.dart @@ -135,19 +135,19 @@ enum JmaForecastIntensityOver { /// `over`の場合は`unknown`に変換されます JmaForecastIntensity get toJmaForecastIntensity => switch (this) { - JmaForecastIntensityOver.zero => JmaForecastIntensity.zero, - JmaForecastIntensityOver.one => JmaForecastIntensity.one, - JmaForecastIntensityOver.two => JmaForecastIntensity.two, - JmaForecastIntensityOver.three => JmaForecastIntensity.three, - JmaForecastIntensityOver.four => JmaForecastIntensity.four, - JmaForecastIntensityOver.fiveLower => JmaForecastIntensity.fiveLower, - JmaForecastIntensityOver.fiveUpper => JmaForecastIntensity.fiveUpper, - JmaForecastIntensityOver.sixLower => JmaForecastIntensity.sixLower, - JmaForecastIntensityOver.sixUpper => JmaForecastIntensity.sixUpper, - JmaForecastIntensityOver.seven => JmaForecastIntensity.seven, - JmaForecastIntensityOver.unknown => JmaForecastIntensity.unknown, - JmaForecastIntensityOver.over => JmaForecastIntensity.unknown, - }; + JmaForecastIntensityOver.zero => JmaForecastIntensity.zero, + JmaForecastIntensityOver.one => JmaForecastIntensity.one, + JmaForecastIntensityOver.two => JmaForecastIntensity.two, + JmaForecastIntensityOver.three => JmaForecastIntensity.three, + JmaForecastIntensityOver.four => JmaForecastIntensity.four, + JmaForecastIntensityOver.fiveLower => JmaForecastIntensity.fiveLower, + JmaForecastIntensityOver.fiveUpper => JmaForecastIntensity.fiveUpper, + JmaForecastIntensityOver.sixLower => JmaForecastIntensity.sixLower, + JmaForecastIntensityOver.sixUpper => JmaForecastIntensity.sixUpper, + JmaForecastIntensityOver.seven => JmaForecastIntensity.seven, + JmaForecastIntensityOver.unknown => JmaForecastIntensity.unknown, + JmaForecastIntensityOver.over => JmaForecastIntensity.unknown, + }; } @JsonEnum(valueField: 'type') @@ -212,14 +212,14 @@ enum JmaForecastLgIntensityOver { /// `over`の場合は`unknown`に変換されます JmaForecastLgIntensity get toJmaForecastLgIntensity => switch (this) { - JmaForecastLgIntensityOver.zero => JmaForecastLgIntensity.zero, - JmaForecastLgIntensityOver.one => JmaForecastLgIntensity.one, - JmaForecastLgIntensityOver.two => JmaForecastLgIntensity.two, - JmaForecastLgIntensityOver.three => JmaForecastLgIntensity.three, - JmaForecastLgIntensityOver.four => JmaForecastLgIntensity.four, - JmaForecastLgIntensityOver.unknown => JmaForecastLgIntensity.unknown, - JmaForecastLgIntensityOver.over => JmaForecastLgIntensity.unknown, - }; + JmaForecastLgIntensityOver.zero => JmaForecastLgIntensity.zero, + JmaForecastLgIntensityOver.one => JmaForecastLgIntensity.one, + JmaForecastLgIntensityOver.two => JmaForecastLgIntensity.two, + JmaForecastLgIntensityOver.three => JmaForecastLgIntensity.three, + JmaForecastLgIntensityOver.four => JmaForecastLgIntensity.four, + JmaForecastLgIntensityOver.unknown => JmaForecastLgIntensity.unknown, + JmaForecastLgIntensityOver.over => JmaForecastLgIntensity.unknown, + }; } @JsonEnum(valueField: 'type') diff --git a/packages/eqapi_types/lib/src/model/v1/app_information.freezed.dart b/packages/eqapi_types/lib/src/model/v1/app_information.freezed.dart index daaaa540..8e0439e3 100644 --- a/packages/eqapi_types/lib/src/model/v1/app_information.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/app_information.freezed.dart @@ -12,7 +12,8 @@ part of 'app_information.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); AppInformation _$AppInformationFromJson(Map json) { return _AppInformation.fromJson(json); @@ -36,8 +37,9 @@ mixin _$AppInformation { /// @nodoc abstract class $AppInformationCopyWith<$Res> { factory $AppInformationCopyWith( - AppInformation value, $Res Function(AppInformation) then) = - _$AppInformationCopyWithImpl<$Res, AppInformation>; + AppInformation value, + $Res Function(AppInformation) then, + ) = _$AppInformationCopyWithImpl<$Res, AppInformation>; @useResult $Res call({PlatformAppInformation ios, PlatformAppInformation android}); @@ -59,20 +61,22 @@ class _$AppInformationCopyWithImpl<$Res, $Val extends AppInformation> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? ios = null, - Object? android = null, - }) { - return _then(_value.copyWith( - ios: null == ios - ? _value.ios - : ios // ignore: cast_nullable_to_non_nullable - as PlatformAppInformation, - android: null == android - ? _value.android - : android // ignore: cast_nullable_to_non_nullable - as PlatformAppInformation, - ) as $Val); + $Res call({Object? ios = null, Object? android = null}) { + return _then( + _value.copyWith( + ios: + null == ios + ? _value.ios + : ios // ignore: cast_nullable_to_non_nullable + as PlatformAppInformation, + android: + null == android + ? _value.android + : android // ignore: cast_nullable_to_non_nullable + as PlatformAppInformation, + ) + as $Val, + ); } /// Create a copy of AppInformation @@ -99,9 +103,10 @@ class _$AppInformationCopyWithImpl<$Res, $Val extends AppInformation> /// @nodoc abstract class _$$AppInformationImplCopyWith<$Res> implements $AppInformationCopyWith<$Res> { - factory _$$AppInformationImplCopyWith(_$AppInformationImpl value, - $Res Function(_$AppInformationImpl) then) = - __$$AppInformationImplCopyWithImpl<$Res>; + factory _$$AppInformationImplCopyWith( + _$AppInformationImpl value, + $Res Function(_$AppInformationImpl) then, + ) = __$$AppInformationImplCopyWithImpl<$Res>; @override @useResult $Res call({PlatformAppInformation ios, PlatformAppInformation android}); @@ -117,27 +122,29 @@ class __$$AppInformationImplCopyWithImpl<$Res> extends _$AppInformationCopyWithImpl<$Res, _$AppInformationImpl> implements _$$AppInformationImplCopyWith<$Res> { __$$AppInformationImplCopyWithImpl( - _$AppInformationImpl _value, $Res Function(_$AppInformationImpl) _then) - : super(_value, _then); + _$AppInformationImpl _value, + $Res Function(_$AppInformationImpl) _then, + ) : super(_value, _then); /// Create a copy of AppInformation /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? ios = null, - Object? android = null, - }) { - return _then(_$AppInformationImpl( - ios: null == ios - ? _value.ios - : ios // ignore: cast_nullable_to_non_nullable - as PlatformAppInformation, - android: null == android - ? _value.android - : android // ignore: cast_nullable_to_non_nullable - as PlatformAppInformation, - )); + $Res call({Object? ios = null, Object? android = null}) { + return _then( + _$AppInformationImpl( + ios: + null == ios + ? _value.ios + : ios // ignore: cast_nullable_to_non_nullable + as PlatformAppInformation, + android: + null == android + ? _value.android + : android // ignore: cast_nullable_to_non_nullable + as PlatformAppInformation, + ), + ); } } @@ -179,20 +186,21 @@ class _$AppInformationImpl implements _AppInformation { @pragma('vm:prefer-inline') _$$AppInformationImplCopyWith<_$AppInformationImpl> get copyWith => __$$AppInformationImplCopyWithImpl<_$AppInformationImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$AppInformationImplToJson( - this, - ); + return _$$AppInformationImplToJson(this); } } abstract class _AppInformation implements AppInformation { - const factory _AppInformation( - {required final PlatformAppInformation ios, - required final PlatformAppInformation android}) = _$AppInformationImpl; + const factory _AppInformation({ + required final PlatformAppInformation ios, + required final PlatformAppInformation android, + }) = _$AppInformationImpl; factory _AppInformation.fromJson(Map json) = _$AppInformationImpl.fromJson; @@ -211,7 +219,8 @@ abstract class _AppInformation implements AppInformation { } PlatformAppInformation _$PlatformAppInformationFromJson( - Map json) { + Map json, +) { return _PlatformAppInformation.fromJson(json); } @@ -233,9 +242,10 @@ mixin _$PlatformAppInformation { /// @nodoc abstract class $PlatformAppInformationCopyWith<$Res> { - factory $PlatformAppInformationCopyWith(PlatformAppInformation value, - $Res Function(PlatformAppInformation) then) = - _$PlatformAppInformationCopyWithImpl<$Res, PlatformAppInformation>; + factory $PlatformAppInformationCopyWith( + PlatformAppInformation value, + $Res Function(PlatformAppInformation) then, + ) = _$PlatformAppInformationCopyWithImpl<$Res, PlatformAppInformation>; @useResult $Res call({AppVersion? latest, AppVersion? minimum, String? downloadUrl}); @@ -244,8 +254,10 @@ abstract class $PlatformAppInformationCopyWith<$Res> { } /// @nodoc -class _$PlatformAppInformationCopyWithImpl<$Res, - $Val extends PlatformAppInformation> +class _$PlatformAppInformationCopyWithImpl< + $Res, + $Val extends PlatformAppInformation +> implements $PlatformAppInformationCopyWith<$Res> { _$PlatformAppInformationCopyWithImpl(this._value, this._then); @@ -263,20 +275,26 @@ class _$PlatformAppInformationCopyWithImpl<$Res, Object? minimum = freezed, Object? downloadUrl = freezed, }) { - return _then(_value.copyWith( - latest: freezed == latest - ? _value.latest - : latest // ignore: cast_nullable_to_non_nullable - as AppVersion?, - minimum: freezed == minimum - ? _value.minimum - : minimum // ignore: cast_nullable_to_non_nullable - as AppVersion?, - downloadUrl: freezed == downloadUrl - ? _value.downloadUrl - : downloadUrl // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + latest: + freezed == latest + ? _value.latest + : latest // ignore: cast_nullable_to_non_nullable + as AppVersion?, + minimum: + freezed == minimum + ? _value.minimum + : minimum // ignore: cast_nullable_to_non_nullable + as AppVersion?, + downloadUrl: + freezed == downloadUrl + ? _value.downloadUrl + : downloadUrl // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } /// Create a copy of PlatformAppInformation @@ -312,9 +330,9 @@ class _$PlatformAppInformationCopyWithImpl<$Res, abstract class _$$PlatformAppInformationImplCopyWith<$Res> implements $PlatformAppInformationCopyWith<$Res> { factory _$$PlatformAppInformationImplCopyWith( - _$PlatformAppInformationImpl value, - $Res Function(_$PlatformAppInformationImpl) then) = - __$$PlatformAppInformationImplCopyWithImpl<$Res>; + _$PlatformAppInformationImpl value, + $Res Function(_$PlatformAppInformationImpl) then, + ) = __$$PlatformAppInformationImplCopyWithImpl<$Res>; @override @useResult $Res call({AppVersion? latest, AppVersion? minimum, String? downloadUrl}); @@ -327,13 +345,13 @@ abstract class _$$PlatformAppInformationImplCopyWith<$Res> /// @nodoc class __$$PlatformAppInformationImplCopyWithImpl<$Res> - extends _$PlatformAppInformationCopyWithImpl<$Res, - _$PlatformAppInformationImpl> + extends + _$PlatformAppInformationCopyWithImpl<$Res, _$PlatformAppInformationImpl> implements _$$PlatformAppInformationImplCopyWith<$Res> { __$$PlatformAppInformationImplCopyWithImpl( - _$PlatformAppInformationImpl _value, - $Res Function(_$PlatformAppInformationImpl) _then) - : super(_value, _then); + _$PlatformAppInformationImpl _value, + $Res Function(_$PlatformAppInformationImpl) _then, + ) : super(_value, _then); /// Create a copy of PlatformAppInformation /// with the given fields replaced by the non-null parameter values. @@ -344,28 +362,36 @@ class __$$PlatformAppInformationImplCopyWithImpl<$Res> Object? minimum = freezed, Object? downloadUrl = freezed, }) { - return _then(_$PlatformAppInformationImpl( - latest: freezed == latest - ? _value.latest - : latest // ignore: cast_nullable_to_non_nullable - as AppVersion?, - minimum: freezed == minimum - ? _value.minimum - : minimum // ignore: cast_nullable_to_non_nullable - as AppVersion?, - downloadUrl: freezed == downloadUrl - ? _value.downloadUrl - : downloadUrl // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$PlatformAppInformationImpl( + latest: + freezed == latest + ? _value.latest + : latest // ignore: cast_nullable_to_non_nullable + as AppVersion?, + minimum: + freezed == minimum + ? _value.minimum + : minimum // ignore: cast_nullable_to_non_nullable + as AppVersion?, + downloadUrl: + freezed == downloadUrl + ? _value.downloadUrl + : downloadUrl // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$PlatformAppInformationImpl implements _PlatformAppInformation { - const _$PlatformAppInformationImpl( - {required this.latest, required this.minimum, required this.downloadUrl}); + const _$PlatformAppInformationImpl({ + required this.latest, + required this.minimum, + required this.downloadUrl, + }); factory _$PlatformAppInformationImpl.fromJson(Map json) => _$$PlatformAppInformationImplFromJson(json); @@ -403,22 +429,24 @@ class _$PlatformAppInformationImpl implements _PlatformAppInformation { @override @pragma('vm:prefer-inline') _$$PlatformAppInformationImplCopyWith<_$PlatformAppInformationImpl> - get copyWith => __$$PlatformAppInformationImplCopyWithImpl< - _$PlatformAppInformationImpl>(this, _$identity); + get copyWith => + __$$PlatformAppInformationImplCopyWithImpl<_$PlatformAppInformationImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$PlatformAppInformationImplToJson( - this, - ); + return _$$PlatformAppInformationImplToJson(this); } } abstract class _PlatformAppInformation implements PlatformAppInformation { - const factory _PlatformAppInformation( - {required final AppVersion? latest, - required final AppVersion? minimum, - required final String? downloadUrl}) = _$PlatformAppInformationImpl; + const factory _PlatformAppInformation({ + required final AppVersion? latest, + required final AppVersion? minimum, + required final String? downloadUrl, + }) = _$PlatformAppInformationImpl; factory _PlatformAppInformation.fromJson(Map json) = _$PlatformAppInformationImpl.fromJson; @@ -435,7 +463,7 @@ abstract class _PlatformAppInformation implements PlatformAppInformation { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$PlatformAppInformationImplCopyWith<_$PlatformAppInformationImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } AppVersion _$AppVersionFromJson(Map json) { @@ -460,8 +488,9 @@ mixin _$AppVersion { /// @nodoc abstract class $AppVersionCopyWith<$Res> { factory $AppVersionCopyWith( - AppVersion value, $Res Function(AppVersion) then) = - _$AppVersionCopyWithImpl<$Res, AppVersion>; + AppVersion value, + $Res Function(AppVersion) then, + ) = _$AppVersionCopyWithImpl<$Res, AppVersion>; @useResult $Res call({String version, String? message}); } @@ -480,20 +509,22 @@ class _$AppVersionCopyWithImpl<$Res, $Val extends AppVersion> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? version = null, - Object? message = freezed, - }) { - return _then(_value.copyWith( - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + $Res call({Object? version = null, Object? message = freezed}) { + return _then( + _value.copyWith( + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + message: + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } @@ -501,8 +532,9 @@ class _$AppVersionCopyWithImpl<$Res, $Val extends AppVersion> abstract class _$$AppVersionImplCopyWith<$Res> implements $AppVersionCopyWith<$Res> { factory _$$AppVersionImplCopyWith( - _$AppVersionImpl value, $Res Function(_$AppVersionImpl) then) = - __$$AppVersionImplCopyWithImpl<$Res>; + _$AppVersionImpl value, + $Res Function(_$AppVersionImpl) then, + ) = __$$AppVersionImplCopyWithImpl<$Res>; @override @useResult $Res call({String version, String? message}); @@ -513,27 +545,29 @@ class __$$AppVersionImplCopyWithImpl<$Res> extends _$AppVersionCopyWithImpl<$Res, _$AppVersionImpl> implements _$$AppVersionImplCopyWith<$Res> { __$$AppVersionImplCopyWithImpl( - _$AppVersionImpl _value, $Res Function(_$AppVersionImpl) _then) - : super(_value, _then); + _$AppVersionImpl _value, + $Res Function(_$AppVersionImpl) _then, + ) : super(_value, _then); /// Create a copy of AppVersion /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? version = null, - Object? message = freezed, - }) { - return _then(_$AppVersionImpl( - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); + $Res call({Object? version = null, Object? message = freezed}) { + return _then( + _$AppVersionImpl( + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + message: + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } @@ -578,16 +612,15 @@ class _$AppVersionImpl implements _AppVersion { @override Map toJson() { - return _$$AppVersionImplToJson( - this, - ); + return _$$AppVersionImplToJson(this); } } abstract class _AppVersion implements AppVersion { - const factory _AppVersion( - {required final String version, - required final String? message}) = _$AppVersionImpl; + const factory _AppVersion({ + required final String version, + required final String? message, + }) = _$AppVersionImpl; factory _AppVersion.fromJson(Map json) = _$AppVersionImpl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/app_information.g.dart b/packages/eqapi_types/lib/src/model/v1/app_information.g.dart index 0e286aee..60db14ce 100644 --- a/packages/eqapi_types/lib/src/model/v1/app_information.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/app_information.g.dart @@ -9,78 +9,64 @@ part of 'app_information.dart'; // ************************************************************************** _$AppInformationImpl _$$AppInformationImplFromJson(Map json) => - $checkedCreate( - r'_$AppInformationImpl', - json, - ($checkedConvert) { - final val = _$AppInformationImpl( - ios: $checkedConvert( - 'ios', - (v) => - PlatformAppInformation.fromJson(v as Map)), - android: $checkedConvert( - 'android', - (v) => - PlatformAppInformation.fromJson(v as Map)), - ); - return val; - }, - ); + $checkedCreate(r'_$AppInformationImpl', json, ($checkedConvert) { + final val = _$AppInformationImpl( + ios: $checkedConvert( + 'ios', + (v) => PlatformAppInformation.fromJson(v as Map), + ), + android: $checkedConvert( + 'android', + (v) => PlatformAppInformation.fromJson(v as Map), + ), + ); + return val; + }); Map _$$AppInformationImplToJson( - _$AppInformationImpl instance) => - { - 'ios': instance.ios, - 'android': instance.android, - }; + _$AppInformationImpl instance, +) => {'ios': instance.ios, 'android': instance.android}; _$PlatformAppInformationImpl _$$PlatformAppInformationImplFromJson( - Map json) => - $checkedCreate( - r'_$PlatformAppInformationImpl', - json, - ($checkedConvert) { - final val = _$PlatformAppInformationImpl( - latest: $checkedConvert( - 'latest', - (v) => v == null - ? null - : AppVersion.fromJson(v as Map)), - minimum: $checkedConvert( - 'minimum', - (v) => v == null - ? null - : AppVersion.fromJson(v as Map)), - downloadUrl: $checkedConvert('download_url', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const {'downloadUrl': 'download_url'}, + Map json, +) => $checkedCreate( + r'_$PlatformAppInformationImpl', + json, + ($checkedConvert) { + final val = _$PlatformAppInformationImpl( + latest: $checkedConvert( + 'latest', + (v) => + v == null ? null : AppVersion.fromJson(v as Map), + ), + minimum: $checkedConvert( + 'minimum', + (v) => + v == null ? null : AppVersion.fromJson(v as Map), + ), + downloadUrl: $checkedConvert('download_url', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const {'downloadUrl': 'download_url'}, +); Map _$$PlatformAppInformationImplToJson( - _$PlatformAppInformationImpl instance) => - { - 'latest': instance.latest, - 'minimum': instance.minimum, - 'download_url': instance.downloadUrl, - }; + _$PlatformAppInformationImpl instance, +) => { + 'latest': instance.latest, + 'minimum': instance.minimum, + 'download_url': instance.downloadUrl, +}; _$AppVersionImpl _$$AppVersionImplFromJson(Map json) => - $checkedCreate( - r'_$AppVersionImpl', - json, - ($checkedConvert) { - final val = _$AppVersionImpl( - version: $checkedConvert('version', (v) => v as String), - message: $checkedConvert('message', (v) => v as String?), - ); - return val; - }, - ); + $checkedCreate(r'_$AppVersionImpl', json, ($checkedConvert) { + final val = _$AppVersionImpl( + version: $checkedConvert('version', (v) => v as String), + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }); Map _$$AppVersionImplToJson(_$AppVersionImpl instance) => - { - 'version': instance.version, - 'message': instance.message, - }; + {'version': instance.version, 'message': instance.message}; diff --git a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.dart b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.dart index e41ee844..be1c44d8 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.dart @@ -5,9 +5,7 @@ part 'fcm_token_request.g.dart'; @freezed class FcmTokenRequest with _$FcmTokenRequest { - const factory FcmTokenRequest({ - required String fcmToken, - }) = _FcmTokenRequest; + const factory FcmTokenRequest({required String fcmToken}) = _FcmTokenRequest; factory FcmTokenRequest.fromJson(Map json) => _$FcmTokenRequestFromJson(json); diff --git a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.freezed.dart b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.freezed.dart index 9fc62d3a..ce6d83f0 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.freezed.dart @@ -12,7 +12,8 @@ part of 'fcm_token_request.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); FcmTokenRequest _$FcmTokenRequestFromJson(Map json) { return _FcmTokenRequest.fromJson(json); @@ -35,8 +36,9 @@ mixin _$FcmTokenRequest { /// @nodoc abstract class $FcmTokenRequestCopyWith<$Res> { factory $FcmTokenRequestCopyWith( - FcmTokenRequest value, $Res Function(FcmTokenRequest) then) = - _$FcmTokenRequestCopyWithImpl<$Res, FcmTokenRequest>; + FcmTokenRequest value, + $Res Function(FcmTokenRequest) then, + ) = _$FcmTokenRequestCopyWithImpl<$Res, FcmTokenRequest>; @useResult $Res call({String fcmToken}); } @@ -55,24 +57,27 @@ class _$FcmTokenRequestCopyWithImpl<$Res, $Val extends FcmTokenRequest> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? fcmToken = null, - }) { - return _then(_value.copyWith( - fcmToken: null == fcmToken - ? _value.fcmToken - : fcmToken // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? fcmToken = null}) { + return _then( + _value.copyWith( + fcmToken: + null == fcmToken + ? _value.fcmToken + : fcmToken // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } /// @nodoc abstract class _$$FcmTokenRequestImplCopyWith<$Res> implements $FcmTokenRequestCopyWith<$Res> { - factory _$$FcmTokenRequestImplCopyWith(_$FcmTokenRequestImpl value, - $Res Function(_$FcmTokenRequestImpl) then) = - __$$FcmTokenRequestImplCopyWithImpl<$Res>; + factory _$$FcmTokenRequestImplCopyWith( + _$FcmTokenRequestImpl value, + $Res Function(_$FcmTokenRequestImpl) then, + ) = __$$FcmTokenRequestImplCopyWithImpl<$Res>; @override @useResult $Res call({String fcmToken}); @@ -83,22 +88,24 @@ class __$$FcmTokenRequestImplCopyWithImpl<$Res> extends _$FcmTokenRequestCopyWithImpl<$Res, _$FcmTokenRequestImpl> implements _$$FcmTokenRequestImplCopyWith<$Res> { __$$FcmTokenRequestImplCopyWithImpl( - _$FcmTokenRequestImpl _value, $Res Function(_$FcmTokenRequestImpl) _then) - : super(_value, _then); + _$FcmTokenRequestImpl _value, + $Res Function(_$FcmTokenRequestImpl) _then, + ) : super(_value, _then); /// Create a copy of FcmTokenRequest /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? fcmToken = null, - }) { - return _then(_$FcmTokenRequestImpl( - fcmToken: null == fcmToken - ? _value.fcmToken - : fcmToken // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? fcmToken = null}) { + return _then( + _$FcmTokenRequestImpl( + fcmToken: + null == fcmToken + ? _value.fcmToken + : fcmToken // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } @@ -138,13 +145,13 @@ class _$FcmTokenRequestImpl implements _FcmTokenRequest { @pragma('vm:prefer-inline') _$$FcmTokenRequestImplCopyWith<_$FcmTokenRequestImpl> get copyWith => __$$FcmTokenRequestImplCopyWithImpl<_$FcmTokenRequestImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$FcmTokenRequestImplToJson( - this, - ); + return _$$FcmTokenRequestImplToJson(this); } } diff --git a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.g.dart b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.g.dart index a90ea38d..0cbeeaec 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_request.g.dart @@ -9,21 +9,14 @@ part of 'fcm_token_request.dart'; // ************************************************************************** _$FcmTokenRequestImpl _$$FcmTokenRequestImplFromJson( - Map json) => - $checkedCreate( - r'_$FcmTokenRequestImpl', - json, - ($checkedConvert) { - final val = _$FcmTokenRequestImpl( - fcmToken: $checkedConvert('fcm_token', (v) => v as String), - ); - return val; - }, - fieldKeyMap: const {'fcmToken': 'fcm_token'}, - ); + Map json, +) => $checkedCreate(r'_$FcmTokenRequestImpl', json, ($checkedConvert) { + final val = _$FcmTokenRequestImpl( + fcmToken: $checkedConvert('fcm_token', (v) => v as String), + ); + return val; +}, fieldKeyMap: const {'fcmToken': 'fcm_token'}); Map _$$FcmTokenRequestImplToJson( - _$FcmTokenRequestImpl instance) => - { - 'fcm_token': instance.fcmToken, - }; + _$FcmTokenRequestImpl instance, +) => {'fcm_token': instance.fcmToken}; diff --git a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.freezed.dart b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.freezed.dart index dd4279d5..712ea370 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.freezed.dart @@ -12,10 +12,12 @@ part of 'fcm_token_response.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); FcmTokenUpdateResponse _$FcmTokenUpdateResponseFromJson( - Map json) { + Map json, +) { return _FcmTokenUpdateResponse.fromJson(json); } @@ -36,16 +38,19 @@ mixin _$FcmTokenUpdateResponse { /// @nodoc abstract class $FcmTokenUpdateResponseCopyWith<$Res> { - factory $FcmTokenUpdateResponseCopyWith(FcmTokenUpdateResponse value, - $Res Function(FcmTokenUpdateResponse) then) = - _$FcmTokenUpdateResponseCopyWithImpl<$Res, FcmTokenUpdateResponse>; + factory $FcmTokenUpdateResponseCopyWith( + FcmTokenUpdateResponse value, + $Res Function(FcmTokenUpdateResponse) then, + ) = _$FcmTokenUpdateResponseCopyWithImpl<$Res, FcmTokenUpdateResponse>; @useResult $Res call({String? token, String? fcmVerify}); } /// @nodoc -class _$FcmTokenUpdateResponseCopyWithImpl<$Res, - $Val extends FcmTokenUpdateResponse> +class _$FcmTokenUpdateResponseCopyWithImpl< + $Res, + $Val extends FcmTokenUpdateResponse +> implements $FcmTokenUpdateResponseCopyWith<$Res> { _$FcmTokenUpdateResponseCopyWithImpl(this._value, this._then); @@ -58,20 +63,22 @@ class _$FcmTokenUpdateResponseCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? token = freezed, - Object? fcmVerify = freezed, - }) { - return _then(_value.copyWith( - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String?, - fcmVerify: freezed == fcmVerify - ? _value.fcmVerify - : fcmVerify // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + $Res call({Object? token = freezed, Object? fcmVerify = freezed}) { + return _then( + _value.copyWith( + token: + freezed == token + ? _value.token + : token // ignore: cast_nullable_to_non_nullable + as String?, + fcmVerify: + freezed == fcmVerify + ? _value.fcmVerify + : fcmVerify // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } @@ -79,9 +86,9 @@ class _$FcmTokenUpdateResponseCopyWithImpl<$Res, abstract class _$$FcmTokenUpdateResponseImplCopyWith<$Res> implements $FcmTokenUpdateResponseCopyWith<$Res> { factory _$$FcmTokenUpdateResponseImplCopyWith( - _$FcmTokenUpdateResponseImpl value, - $Res Function(_$FcmTokenUpdateResponseImpl) then) = - __$$FcmTokenUpdateResponseImplCopyWithImpl<$Res>; + _$FcmTokenUpdateResponseImpl value, + $Res Function(_$FcmTokenUpdateResponseImpl) then, + ) = __$$FcmTokenUpdateResponseImplCopyWithImpl<$Res>; @override @useResult $Res call({String? token, String? fcmVerify}); @@ -89,40 +96,43 @@ abstract class _$$FcmTokenUpdateResponseImplCopyWith<$Res> /// @nodoc class __$$FcmTokenUpdateResponseImplCopyWithImpl<$Res> - extends _$FcmTokenUpdateResponseCopyWithImpl<$Res, - _$FcmTokenUpdateResponseImpl> + extends + _$FcmTokenUpdateResponseCopyWithImpl<$Res, _$FcmTokenUpdateResponseImpl> implements _$$FcmTokenUpdateResponseImplCopyWith<$Res> { __$$FcmTokenUpdateResponseImplCopyWithImpl( - _$FcmTokenUpdateResponseImpl _value, - $Res Function(_$FcmTokenUpdateResponseImpl) _then) - : super(_value, _then); + _$FcmTokenUpdateResponseImpl _value, + $Res Function(_$FcmTokenUpdateResponseImpl) _then, + ) : super(_value, _then); /// Create a copy of FcmTokenUpdateResponse /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? token = freezed, - Object? fcmVerify = freezed, - }) { - return _then(_$FcmTokenUpdateResponseImpl( - token: freezed == token - ? _value.token - : token // ignore: cast_nullable_to_non_nullable - as String?, - fcmVerify: freezed == fcmVerify - ? _value.fcmVerify - : fcmVerify // ignore: cast_nullable_to_non_nullable - as String?, - )); + $Res call({Object? token = freezed, Object? fcmVerify = freezed}) { + return _then( + _$FcmTokenUpdateResponseImpl( + token: + freezed == token + ? _value.token + : token // ignore: cast_nullable_to_non_nullable + as String?, + fcmVerify: + freezed == fcmVerify + ? _value.fcmVerify + : fcmVerify // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$FcmTokenUpdateResponseImpl implements _FcmTokenUpdateResponse { - const _$FcmTokenUpdateResponseImpl( - {required this.token, required this.fcmVerify}); + const _$FcmTokenUpdateResponseImpl({ + required this.token, + required this.fcmVerify, + }); factory _$FcmTokenUpdateResponseImpl.fromJson(Map json) => _$$FcmTokenUpdateResponseImplFromJson(json); @@ -157,21 +167,23 @@ class _$FcmTokenUpdateResponseImpl implements _FcmTokenUpdateResponse { @override @pragma('vm:prefer-inline') _$$FcmTokenUpdateResponseImplCopyWith<_$FcmTokenUpdateResponseImpl> - get copyWith => __$$FcmTokenUpdateResponseImplCopyWithImpl< - _$FcmTokenUpdateResponseImpl>(this, _$identity); + get copyWith => + __$$FcmTokenUpdateResponseImplCopyWithImpl<_$FcmTokenUpdateResponseImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$FcmTokenUpdateResponseImplToJson( - this, - ); + return _$$FcmTokenUpdateResponseImplToJson(this); } } abstract class _FcmTokenUpdateResponse implements FcmTokenUpdateResponse { - const factory _FcmTokenUpdateResponse( - {required final String? token, - required final String? fcmVerify}) = _$FcmTokenUpdateResponseImpl; + const factory _FcmTokenUpdateResponse({ + required final String? token, + required final String? fcmVerify, + }) = _$FcmTokenUpdateResponseImpl; factory _FcmTokenUpdateResponse.fromJson(Map json) = _$FcmTokenUpdateResponseImpl.fromJson; @@ -186,5 +198,5 @@ abstract class _FcmTokenUpdateResponse implements FcmTokenUpdateResponse { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$FcmTokenUpdateResponseImplCopyWith<_$FcmTokenUpdateResponseImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.g.dart b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.g.dart index 86c5aeb0..37293ef7 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/fcm_token_response.g.dart @@ -9,23 +9,23 @@ part of 'fcm_token_response.dart'; // ************************************************************************** _$FcmTokenUpdateResponseImpl _$$FcmTokenUpdateResponseImplFromJson( - Map json) => - $checkedCreate( - r'_$FcmTokenUpdateResponseImpl', - json, - ($checkedConvert) { - final val = _$FcmTokenUpdateResponseImpl( - token: $checkedConvert('token', (v) => v as String?), - fcmVerify: $checkedConvert('fcm_verify', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const {'fcmVerify': 'fcm_verify'}, + Map json, +) => $checkedCreate( + r'_$FcmTokenUpdateResponseImpl', + json, + ($checkedConvert) { + final val = _$FcmTokenUpdateResponseImpl( + token: $checkedConvert('token', (v) => v as String?), + fcmVerify: $checkedConvert('fcm_verify', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const {'fcmVerify': 'fcm_verify'}, +); Map _$$FcmTokenUpdateResponseImplToJson( - _$FcmTokenUpdateResponseImpl instance) => - { - 'token': instance.token, - 'fcm_verify': instance.fcmVerify, - }; + _$FcmTokenUpdateResponseImpl instance, +) => { + 'token': instance.token, + 'fcm_verify': instance.fcmVerify, +}; diff --git a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.freezed.dart b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.freezed.dart index 7300ca7f..0e3dd9f7 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.freezed.dart @@ -12,10 +12,12 @@ part of 'notification_settings_request.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NotificationSettingsRequest _$NotificationSettingsRequestFromJson( - Map json) { + Map json, +) { return _NotificationSettingsRequest.fromJson(json); } @@ -32,27 +34,33 @@ mixin _$NotificationSettingsRequest { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationSettingsRequestCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationSettingsRequestCopyWith<$Res> { factory $NotificationSettingsRequestCopyWith( - NotificationSettingsRequest value, - $Res Function(NotificationSettingsRequest) then) = - _$NotificationSettingsRequestCopyWithImpl<$Res, - NotificationSettingsRequest>; + NotificationSettingsRequest value, + $Res Function(NotificationSettingsRequest) then, + ) = + _$NotificationSettingsRequestCopyWithImpl< + $Res, + NotificationSettingsRequest + >; @useResult - $Res call( - {NotificationSettingsGlobal? global, - List? regions}); + $Res call({ + NotificationSettingsGlobal? global, + List? regions, + }); $NotificationSettingsGlobalCopyWith<$Res>? get global; } /// @nodoc -class _$NotificationSettingsRequestCopyWithImpl<$Res, - $Val extends NotificationSettingsRequest> +class _$NotificationSettingsRequestCopyWithImpl< + $Res, + $Val extends NotificationSettingsRequest +> implements $NotificationSettingsRequestCopyWith<$Res> { _$NotificationSettingsRequestCopyWithImpl(this._value, this._then); @@ -65,20 +73,22 @@ class _$NotificationSettingsRequestCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? global = freezed, - Object? regions = freezed, - }) { - return _then(_value.copyWith( - global: freezed == global - ? _value.global - : global // ignore: cast_nullable_to_non_nullable - as NotificationSettingsGlobal?, - regions: freezed == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); + $Res call({Object? global = freezed, Object? regions = freezed}) { + return _then( + _value.copyWith( + global: + freezed == global + ? _value.global + : global // ignore: cast_nullable_to_non_nullable + as NotificationSettingsGlobal?, + regions: + freezed == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); } /// Create a copy of NotificationSettingsRequest @@ -100,14 +110,15 @@ class _$NotificationSettingsRequestCopyWithImpl<$Res, abstract class _$$NotificationSettingsRequestImplCopyWith<$Res> implements $NotificationSettingsRequestCopyWith<$Res> { factory _$$NotificationSettingsRequestImplCopyWith( - _$NotificationSettingsRequestImpl value, - $Res Function(_$NotificationSettingsRequestImpl) then) = - __$$NotificationSettingsRequestImplCopyWithImpl<$Res>; + _$NotificationSettingsRequestImpl value, + $Res Function(_$NotificationSettingsRequestImpl) then, + ) = __$$NotificationSettingsRequestImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {NotificationSettingsGlobal? global, - List? regions}); + $Res call({ + NotificationSettingsGlobal? global, + List? regions, + }); @override $NotificationSettingsGlobalCopyWith<$Res>? get global; @@ -115,32 +126,36 @@ abstract class _$$NotificationSettingsRequestImplCopyWith<$Res> /// @nodoc class __$$NotificationSettingsRequestImplCopyWithImpl<$Res> - extends _$NotificationSettingsRequestCopyWithImpl<$Res, - _$NotificationSettingsRequestImpl> + extends + _$NotificationSettingsRequestCopyWithImpl< + $Res, + _$NotificationSettingsRequestImpl + > implements _$$NotificationSettingsRequestImplCopyWith<$Res> { __$$NotificationSettingsRequestImplCopyWithImpl( - _$NotificationSettingsRequestImpl _value, - $Res Function(_$NotificationSettingsRequestImpl) _then) - : super(_value, _then); + _$NotificationSettingsRequestImpl _value, + $Res Function(_$NotificationSettingsRequestImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationSettingsRequest /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? global = freezed, - Object? regions = freezed, - }) { - return _then(_$NotificationSettingsRequestImpl( - global: freezed == global - ? _value.global - : global // ignore: cast_nullable_to_non_nullable - as NotificationSettingsGlobal?, - regions: freezed == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List?, - )); + $Res call({Object? global = freezed, Object? regions = freezed}) { + return _then( + _$NotificationSettingsRequestImpl( + global: + freezed == global + ? _value.global + : global // ignore: cast_nullable_to_non_nullable + as NotificationSettingsGlobal?, + regions: + freezed == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); } } @@ -148,13 +163,14 @@ class __$$NotificationSettingsRequestImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationSettingsRequestImpl implements _NotificationSettingsRequest { - const _$NotificationSettingsRequestImpl( - {this.global, final List? regions}) - : _regions = regions; + const _$NotificationSettingsRequestImpl({ + this.global, + final List? regions, + }) : _regions = regions; factory _$NotificationSettingsRequestImpl.fromJson( - Map json) => - _$$NotificationSettingsRequestImplFromJson(json); + Map json, + ) => _$$NotificationSettingsRequestImplFromJson(json); @override final NotificationSettingsGlobal? global; @@ -185,7 +201,10 @@ class _$NotificationSettingsRequestImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, global, const DeepCollectionEquality().hash(_regions)); + runtimeType, + global, + const DeepCollectionEquality().hash(_regions), + ); /// Create a copy of NotificationSettingsRequest /// with the given fields replaced by the non-null parameter values. @@ -193,23 +212,22 @@ class _$NotificationSettingsRequestImpl @override @pragma('vm:prefer-inline') _$$NotificationSettingsRequestImplCopyWith<_$NotificationSettingsRequestImpl> - get copyWith => __$$NotificationSettingsRequestImplCopyWithImpl< - _$NotificationSettingsRequestImpl>(this, _$identity); + get copyWith => __$$NotificationSettingsRequestImplCopyWithImpl< + _$NotificationSettingsRequestImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationSettingsRequestImplToJson( - this, - ); + return _$$NotificationSettingsRequestImplToJson(this); } } abstract class _NotificationSettingsRequest implements NotificationSettingsRequest { - const factory _NotificationSettingsRequest( - {final NotificationSettingsGlobal? global, - final List? regions}) = - _$NotificationSettingsRequestImpl; + const factory _NotificationSettingsRequest({ + final NotificationSettingsGlobal? global, + final List? regions, + }) = _$NotificationSettingsRequestImpl; factory _NotificationSettingsRequest.fromJson(Map json) = _$NotificationSettingsRequestImpl.fromJson; @@ -224,11 +242,12 @@ abstract class _NotificationSettingsRequest @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationSettingsRequestImplCopyWith<_$NotificationSettingsRequestImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } NotificationSettingsGlobal _$NotificationSettingsGlobalFromJson( - Map json) { + Map json, +) { return _NotificationSettingsGlobal.fromJson(json); } @@ -244,22 +263,28 @@ mixin _$NotificationSettingsGlobal { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationSettingsGlobalCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationSettingsGlobalCopyWith<$Res> { - factory $NotificationSettingsGlobalCopyWith(NotificationSettingsGlobal value, - $Res Function(NotificationSettingsGlobal) then) = - _$NotificationSettingsGlobalCopyWithImpl<$Res, - NotificationSettingsGlobal>; + factory $NotificationSettingsGlobalCopyWith( + NotificationSettingsGlobal value, + $Res Function(NotificationSettingsGlobal) then, + ) = + _$NotificationSettingsGlobalCopyWithImpl< + $Res, + NotificationSettingsGlobal + >; @useResult $Res call({JmaForecastIntensity minJmaIntensity}); } /// @nodoc -class _$NotificationSettingsGlobalCopyWithImpl<$Res, - $Val extends NotificationSettingsGlobal> +class _$NotificationSettingsGlobalCopyWithImpl< + $Res, + $Val extends NotificationSettingsGlobal +> implements $NotificationSettingsGlobalCopyWith<$Res> { _$NotificationSettingsGlobalCopyWithImpl(this._value, this._then); @@ -272,15 +297,17 @@ class _$NotificationSettingsGlobalCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? minJmaIntensity = null, - }) { - return _then(_value.copyWith( - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - ) as $Val); + $Res call({Object? minJmaIntensity = null}) { + return _then( + _value.copyWith( + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ) + as $Val, + ); } } @@ -288,9 +315,9 @@ class _$NotificationSettingsGlobalCopyWithImpl<$Res, abstract class _$$NotificationSettingsGlobalImplCopyWith<$Res> implements $NotificationSettingsGlobalCopyWith<$Res> { factory _$$NotificationSettingsGlobalImplCopyWith( - _$NotificationSettingsGlobalImpl value, - $Res Function(_$NotificationSettingsGlobalImpl) then) = - __$$NotificationSettingsGlobalImplCopyWithImpl<$Res>; + _$NotificationSettingsGlobalImpl value, + $Res Function(_$NotificationSettingsGlobalImpl) then, + ) = __$$NotificationSettingsGlobalImplCopyWithImpl<$Res>; @override @useResult $Res call({JmaForecastIntensity minJmaIntensity}); @@ -298,27 +325,31 @@ abstract class _$$NotificationSettingsGlobalImplCopyWith<$Res> /// @nodoc class __$$NotificationSettingsGlobalImplCopyWithImpl<$Res> - extends _$NotificationSettingsGlobalCopyWithImpl<$Res, - _$NotificationSettingsGlobalImpl> + extends + _$NotificationSettingsGlobalCopyWithImpl< + $Res, + _$NotificationSettingsGlobalImpl + > implements _$$NotificationSettingsGlobalImplCopyWith<$Res> { __$$NotificationSettingsGlobalImplCopyWithImpl( - _$NotificationSettingsGlobalImpl _value, - $Res Function(_$NotificationSettingsGlobalImpl) _then) - : super(_value, _then); + _$NotificationSettingsGlobalImpl _value, + $Res Function(_$NotificationSettingsGlobalImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationSettingsGlobal /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? minJmaIntensity = null, - }) { - return _then(_$NotificationSettingsGlobalImpl( - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - )); + $Res call({Object? minJmaIntensity = null}) { + return _then( + _$NotificationSettingsGlobalImpl( + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ), + ); } } @@ -328,8 +359,8 @@ class _$NotificationSettingsGlobalImpl implements _NotificationSettingsGlobal { const _$NotificationSettingsGlobalImpl({required this.minJmaIntensity}); factory _$NotificationSettingsGlobalImpl.fromJson( - Map json) => - _$$NotificationSettingsGlobalImplFromJson(json); + Map json, + ) => _$$NotificationSettingsGlobalImplFromJson(json); @override final JmaForecastIntensity minJmaIntensity; @@ -358,22 +389,21 @@ class _$NotificationSettingsGlobalImpl implements _NotificationSettingsGlobal { @override @pragma('vm:prefer-inline') _$$NotificationSettingsGlobalImplCopyWith<_$NotificationSettingsGlobalImpl> - get copyWith => __$$NotificationSettingsGlobalImplCopyWithImpl< - _$NotificationSettingsGlobalImpl>(this, _$identity); + get copyWith => __$$NotificationSettingsGlobalImplCopyWithImpl< + _$NotificationSettingsGlobalImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationSettingsGlobalImplToJson( - this, - ); + return _$$NotificationSettingsGlobalImplToJson(this); } } abstract class _NotificationSettingsGlobal implements NotificationSettingsGlobal { - const factory _NotificationSettingsGlobal( - {required final JmaForecastIntensity minJmaIntensity}) = - _$NotificationSettingsGlobalImpl; + const factory _NotificationSettingsGlobal({ + required final JmaForecastIntensity minJmaIntensity, + }) = _$NotificationSettingsGlobalImpl; factory _NotificationSettingsGlobal.fromJson(Map json) = _$NotificationSettingsGlobalImpl.fromJson; @@ -386,11 +416,12 @@ abstract class _NotificationSettingsGlobal @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationSettingsGlobalImplCopyWith<_$NotificationSettingsGlobalImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } NotificationSettingsRegion _$NotificationSettingsRegionFromJson( - Map json) { + Map json, +) { return _NotificationSettingsRegion.fromJson(json); } @@ -406,22 +437,28 @@ mixin _$NotificationSettingsRegion { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationSettingsRegionCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationSettingsRegionCopyWith<$Res> { - factory $NotificationSettingsRegionCopyWith(NotificationSettingsRegion value, - $Res Function(NotificationSettingsRegion) then) = - _$NotificationSettingsRegionCopyWithImpl<$Res, - NotificationSettingsRegion>; + factory $NotificationSettingsRegionCopyWith( + NotificationSettingsRegion value, + $Res Function(NotificationSettingsRegion) then, + ) = + _$NotificationSettingsRegionCopyWithImpl< + $Res, + NotificationSettingsRegion + >; @useResult $Res call({int code, JmaForecastIntensity minIntensity}); } /// @nodoc -class _$NotificationSettingsRegionCopyWithImpl<$Res, - $Val extends NotificationSettingsRegion> +class _$NotificationSettingsRegionCopyWithImpl< + $Res, + $Val extends NotificationSettingsRegion +> implements $NotificationSettingsRegionCopyWith<$Res> { _$NotificationSettingsRegionCopyWithImpl(this._value, this._then); @@ -434,20 +471,22 @@ class _$NotificationSettingsRegionCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? minIntensity = null, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as int, - minIntensity: null == minIntensity - ? _value.minIntensity - : minIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - ) as $Val); + $Res call({Object? code = null, Object? minIntensity = null}) { + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as int, + minIntensity: + null == minIntensity + ? _value.minIntensity + : minIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ) + as $Val, + ); } } @@ -455,9 +494,9 @@ class _$NotificationSettingsRegionCopyWithImpl<$Res, abstract class _$$NotificationSettingsRegionImplCopyWith<$Res> implements $NotificationSettingsRegionCopyWith<$Res> { factory _$$NotificationSettingsRegionImplCopyWith( - _$NotificationSettingsRegionImpl value, - $Res Function(_$NotificationSettingsRegionImpl) then) = - __$$NotificationSettingsRegionImplCopyWithImpl<$Res>; + _$NotificationSettingsRegionImpl value, + $Res Function(_$NotificationSettingsRegionImpl) then, + ) = __$$NotificationSettingsRegionImplCopyWithImpl<$Res>; @override @useResult $Res call({int code, JmaForecastIntensity minIntensity}); @@ -465,44 +504,50 @@ abstract class _$$NotificationSettingsRegionImplCopyWith<$Res> /// @nodoc class __$$NotificationSettingsRegionImplCopyWithImpl<$Res> - extends _$NotificationSettingsRegionCopyWithImpl<$Res, - _$NotificationSettingsRegionImpl> + extends + _$NotificationSettingsRegionCopyWithImpl< + $Res, + _$NotificationSettingsRegionImpl + > implements _$$NotificationSettingsRegionImplCopyWith<$Res> { __$$NotificationSettingsRegionImplCopyWithImpl( - _$NotificationSettingsRegionImpl _value, - $Res Function(_$NotificationSettingsRegionImpl) _then) - : super(_value, _then); + _$NotificationSettingsRegionImpl _value, + $Res Function(_$NotificationSettingsRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationSettingsRegion /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? minIntensity = null, - }) { - return _then(_$NotificationSettingsRegionImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as int, - minIntensity: null == minIntensity - ? _value.minIntensity - : minIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - )); + $Res call({Object? code = null, Object? minIntensity = null}) { + return _then( + _$NotificationSettingsRegionImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as int, + minIntensity: + null == minIntensity + ? _value.minIntensity + : minIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ), + ); } } /// @nodoc @JsonSerializable() class _$NotificationSettingsRegionImpl implements _NotificationSettingsRegion { - const _$NotificationSettingsRegionImpl( - {required this.code, required this.minIntensity}); + const _$NotificationSettingsRegionImpl({ + required this.code, + required this.minIntensity, + }); factory _$NotificationSettingsRegionImpl.fromJson( - Map json) => - _$$NotificationSettingsRegionImplFromJson(json); + Map json, + ) => _$$NotificationSettingsRegionImplFromJson(json); @override final int code; @@ -534,23 +579,22 @@ class _$NotificationSettingsRegionImpl implements _NotificationSettingsRegion { @override @pragma('vm:prefer-inline') _$$NotificationSettingsRegionImplCopyWith<_$NotificationSettingsRegionImpl> - get copyWith => __$$NotificationSettingsRegionImplCopyWithImpl< - _$NotificationSettingsRegionImpl>(this, _$identity); + get copyWith => __$$NotificationSettingsRegionImplCopyWithImpl< + _$NotificationSettingsRegionImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationSettingsRegionImplToJson( - this, - ); + return _$$NotificationSettingsRegionImplToJson(this); } } abstract class _NotificationSettingsRegion implements NotificationSettingsRegion { - const factory _NotificationSettingsRegion( - {required final int code, - required final JmaForecastIntensity minIntensity}) = - _$NotificationSettingsRegionImpl; + const factory _NotificationSettingsRegion({ + required final int code, + required final JmaForecastIntensity minIntensity, + }) = _$NotificationSettingsRegionImpl; factory _NotificationSettingsRegion.fromJson(Map json) = _$NotificationSettingsRegionImpl.fromJson; @@ -565,5 +609,5 @@ abstract class _NotificationSettingsRegion @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationSettingsRegionImplCopyWith<_$NotificationSettingsRegionImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.g.dart b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.g.dart index 3ffa5346..b035fb69 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_request.g.dart @@ -9,57 +9,59 @@ part of 'notification_settings_request.dart'; // ************************************************************************** _$NotificationSettingsRequestImpl _$$NotificationSettingsRequestImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationSettingsRequestImpl', - json, - ($checkedConvert) { - final val = _$NotificationSettingsRequestImpl( - global: $checkedConvert( - 'global', - (v) => v == null - ? null - : NotificationSettingsGlobal.fromJson( - v as Map)), - regions: $checkedConvert( - 'regions', - (v) => (v as List?) - ?.map((e) => NotificationSettingsRegion.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$NotificationSettingsRequestImpl', json, ( + $checkedConvert, +) { + final val = _$NotificationSettingsRequestImpl( + global: $checkedConvert( + 'global', + (v) => + v == null + ? null + : NotificationSettingsGlobal.fromJson(v as Map), + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List?) + ?.map( + (e) => NotificationSettingsRegion.fromJson( + e as Map, + ), + ) + .toList(), + ), + ); + return val; +}); Map _$$NotificationSettingsRequestImplToJson( - _$NotificationSettingsRequestImpl instance) => - { - 'global': instance.global, - 'regions': instance.regions, - }; + _$NotificationSettingsRequestImpl instance, +) => {'global': instance.global, 'regions': instance.regions}; _$NotificationSettingsGlobalImpl _$$NotificationSettingsGlobalImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationSettingsGlobalImpl', - json, - ($checkedConvert) { - final val = _$NotificationSettingsGlobalImpl( - minJmaIntensity: $checkedConvert('min_jma_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const {'minJmaIntensity': 'min_jma_intensity'}, + Map json, +) => $checkedCreate( + r'_$NotificationSettingsGlobalImpl', + json, + ($checkedConvert) { + final val = _$NotificationSettingsGlobalImpl( + minJmaIntensity: $checkedConvert( + 'min_jma_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const {'minJmaIntensity': 'min_jma_intensity'}, +); Map _$$NotificationSettingsGlobalImplToJson( - _$NotificationSettingsGlobalImpl instance) => - { - 'min_jma_intensity': - _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, - }; + _$NotificationSettingsGlobalImpl instance, +) => { + 'min_jma_intensity': _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', @@ -76,24 +78,26 @@ const _$JmaForecastIntensityEnumMap = { }; _$NotificationSettingsRegionImpl _$$NotificationSettingsRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationSettingsRegionImpl', - json, - ($checkedConvert) { - final val = _$NotificationSettingsRegionImpl( - code: $checkedConvert('code', (v) => (v as num).toInt()), - minIntensity: $checkedConvert('min_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const {'minIntensity': 'min_intensity'}, + Map json, +) => $checkedCreate( + r'_$NotificationSettingsRegionImpl', + json, + ($checkedConvert) { + final val = _$NotificationSettingsRegionImpl( + code: $checkedConvert('code', (v) => (v as num).toInt()), + minIntensity: $checkedConvert( + 'min_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const {'minIntensity': 'min_intensity'}, +); Map _$$NotificationSettingsRegionImplToJson( - _$NotificationSettingsRegionImpl instance) => - { - 'code': instance.code, - 'min_intensity': _$JmaForecastIntensityEnumMap[instance.minIntensity]!, - }; + _$NotificationSettingsRegionImpl instance, +) => { + 'code': instance.code, + 'min_intensity': _$JmaForecastIntensityEnumMap[instance.minIntensity]!, +}; diff --git a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.freezed.dart b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.freezed.dart index fb1be947..05d4045c 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.freezed.dart @@ -12,10 +12,12 @@ part of 'notification_settings_response.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); NotificationSettingsResponse _$NotificationSettingsResponseFromJson( - Map json) { + Map json, +) { return _NotificationSettingsResponse.fromJson(json); } @@ -32,25 +34,31 @@ mixin _$NotificationSettingsResponse { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $NotificationSettingsResponseCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $NotificationSettingsResponseCopyWith<$Res> { factory $NotificationSettingsResponseCopyWith( - NotificationSettingsResponse value, - $Res Function(NotificationSettingsResponse) then) = - _$NotificationSettingsResponseCopyWithImpl<$Res, - NotificationSettingsResponse>; + NotificationSettingsResponse value, + $Res Function(NotificationSettingsResponse) then, + ) = + _$NotificationSettingsResponseCopyWithImpl< + $Res, + NotificationSettingsResponse + >; @useResult - $Res call( - {List earthquake, - List eew}); + $Res call({ + List earthquake, + List eew, + }); } /// @nodoc -class _$NotificationSettingsResponseCopyWithImpl<$Res, - $Val extends NotificationSettingsResponse> +class _$NotificationSettingsResponseCopyWithImpl< + $Res, + $Val extends NotificationSettingsResponse +> implements $NotificationSettingsResponseCopyWith<$Res> { _$NotificationSettingsResponseCopyWithImpl(this._value, this._then); @@ -63,20 +71,22 @@ class _$NotificationSettingsResponseCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? earthquake = null, - Object? eew = null, - }) { - return _then(_value.copyWith( - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as List, - eew: null == eew - ? _value.eew - : eew // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? earthquake = null, Object? eew = null}) { + return _then( + _value.copyWith( + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as List, + eew: + null == eew + ? _value.eew + : eew // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -84,44 +94,49 @@ class _$NotificationSettingsResponseCopyWithImpl<$Res, abstract class _$$NotificationSettingsResponseImplCopyWith<$Res> implements $NotificationSettingsResponseCopyWith<$Res> { factory _$$NotificationSettingsResponseImplCopyWith( - _$NotificationSettingsResponseImpl value, - $Res Function(_$NotificationSettingsResponseImpl) then) = - __$$NotificationSettingsResponseImplCopyWithImpl<$Res>; + _$NotificationSettingsResponseImpl value, + $Res Function(_$NotificationSettingsResponseImpl) then, + ) = __$$NotificationSettingsResponseImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {List earthquake, - List eew}); + $Res call({ + List earthquake, + List eew, + }); } /// @nodoc class __$$NotificationSettingsResponseImplCopyWithImpl<$Res> - extends _$NotificationSettingsResponseCopyWithImpl<$Res, - _$NotificationSettingsResponseImpl> + extends + _$NotificationSettingsResponseCopyWithImpl< + $Res, + _$NotificationSettingsResponseImpl + > implements _$$NotificationSettingsResponseImplCopyWith<$Res> { __$$NotificationSettingsResponseImplCopyWithImpl( - _$NotificationSettingsResponseImpl _value, - $Res Function(_$NotificationSettingsResponseImpl) _then) - : super(_value, _then); + _$NotificationSettingsResponseImpl _value, + $Res Function(_$NotificationSettingsResponseImpl) _then, + ) : super(_value, _then); /// Create a copy of NotificationSettingsResponse /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? earthquake = null, - Object? eew = null, - }) { - return _then(_$NotificationSettingsResponseImpl( - earthquake: null == earthquake - ? _value._earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as List, - eew: null == eew - ? _value._eew - : eew // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? earthquake = null, Object? eew = null}) { + return _then( + _$NotificationSettingsResponseImpl( + earthquake: + null == earthquake + ? _value._earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as List, + eew: + null == eew + ? _value._eew + : eew // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -129,15 +144,15 @@ class __$$NotificationSettingsResponseImplCopyWithImpl<$Res> @JsonSerializable() class _$NotificationSettingsResponseImpl implements _NotificationSettingsResponse { - const _$NotificationSettingsResponseImpl( - {required final List earthquake, - required final List eew}) - : _earthquake = earthquake, - _eew = eew; + const _$NotificationSettingsResponseImpl({ + required final List earthquake, + required final List eew, + }) : _earthquake = earthquake, + _eew = eew; factory _$NotificationSettingsResponseImpl.fromJson( - Map json) => - _$$NotificationSettingsResponseImplFromJson(json); + Map json, + ) => _$$NotificationSettingsResponseImplFromJson(json); final List _earthquake; @override @@ -165,17 +180,20 @@ class _$NotificationSettingsResponseImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationSettingsResponseImpl && - const DeepCollectionEquality() - .equals(other._earthquake, _earthquake) && + const DeepCollectionEquality().equals( + other._earthquake, + _earthquake, + ) && const DeepCollectionEquality().equals(other._eew, _eew)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_earthquake), - const DeepCollectionEquality().hash(_eew)); + runtimeType, + const DeepCollectionEquality().hash(_earthquake), + const DeepCollectionEquality().hash(_eew), + ); /// Create a copy of NotificationSettingsResponse /// with the given fields replaced by the non-null parameter values. @@ -183,24 +201,24 @@ class _$NotificationSettingsResponseImpl @override @pragma('vm:prefer-inline') _$$NotificationSettingsResponseImplCopyWith< - _$NotificationSettingsResponseImpl> - get copyWith => __$$NotificationSettingsResponseImplCopyWithImpl< - _$NotificationSettingsResponseImpl>(this, _$identity); + _$NotificationSettingsResponseImpl + > + get copyWith => __$$NotificationSettingsResponseImplCopyWithImpl< + _$NotificationSettingsResponseImpl + >(this, _$identity); @override Map toJson() { - return _$$NotificationSettingsResponseImplToJson( - this, - ); + return _$$NotificationSettingsResponseImplToJson(this); } } abstract class _NotificationSettingsResponse implements NotificationSettingsResponse { - const factory _NotificationSettingsResponse( - {required final List earthquake, - required final List eew}) = - _$NotificationSettingsResponseImpl; + const factory _NotificationSettingsResponse({ + required final List earthquake, + required final List eew, + }) = _$NotificationSettingsResponseImpl; factory _NotificationSettingsResponse.fromJson(Map json) = _$NotificationSettingsResponseImpl.fromJson; @@ -215,6 +233,7 @@ abstract class _NotificationSettingsResponse @override @JsonKey(includeFromJson: false, includeToJson: false) _$$NotificationSettingsResponseImplCopyWith< - _$NotificationSettingsResponseImpl> - get copyWith => throw _privateConstructorUsedError; + _$NotificationSettingsResponseImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.g.dart b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.g.dart index c85f63de..57669046 100644 --- a/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/auth/notification_settings_response.g.dart @@ -9,32 +9,35 @@ part of 'notification_settings_response.dart'; // ************************************************************************** _$NotificationSettingsResponseImpl _$$NotificationSettingsResponseImplFromJson( - Map json) => - $checkedCreate( - r'_$NotificationSettingsResponseImpl', - json, - ($checkedConvert) { - final val = _$NotificationSettingsResponseImpl( - earthquake: $checkedConvert( - 'earthquake', - (v) => (v as List) - .map((e) => DevicesEarthquakeSettings.fromJson( - e as Map)) - .toList()), - eew: $checkedConvert( - 'eew', - (v) => (v as List) - .map((e) => - DevicesEewSettings.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$NotificationSettingsResponseImpl', json, ( + $checkedConvert, +) { + final val = _$NotificationSettingsResponseImpl( + earthquake: $checkedConvert( + 'earthquake', + (v) => + (v as List) + .map( + (e) => DevicesEarthquakeSettings.fromJson( + e as Map, + ), + ) + .toList(), + ), + eew: $checkedConvert( + 'eew', + (v) => + (v as List) + .map( + (e) => DevicesEewSettings.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; +}); Map _$$NotificationSettingsResponseImplToJson( - _$NotificationSettingsResponseImpl instance) => - { - 'earthquake': instance.earthquake, - 'eew': instance.eew, - }; + _$NotificationSettingsResponseImpl instance, +) => {'earthquake': instance.earthquake, 'eew': instance.eew}; diff --git a/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.freezed.dart b/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.freezed.dart index c4d588fe..9570ce95 100644 --- a/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.freezed.dart @@ -12,10 +12,12 @@ part of 'devices_earthquake_settings.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); DevicesEarthquakeSettings _$DevicesEarthquakeSettingsFromJson( - Map json) { + Map json, +) { return _DevicesEarthquakeSettings.fromJson(json); } @@ -40,21 +42,25 @@ mixin _$DevicesEarthquakeSettings { /// @nodoc abstract class $DevicesEarthquakeSettingsCopyWith<$Res> { - factory $DevicesEarthquakeSettingsCopyWith(DevicesEarthquakeSettings value, - $Res Function(DevicesEarthquakeSettings) then) = - _$DevicesEarthquakeSettingsCopyWithImpl<$Res, DevicesEarthquakeSettings>; + factory $DevicesEarthquakeSettingsCopyWith( + DevicesEarthquakeSettings value, + $Res Function(DevicesEarthquakeSettings) then, + ) = _$DevicesEarthquakeSettingsCopyWithImpl<$Res, DevicesEarthquakeSettings>; @useResult - $Res call( - {String id, - JmaForecastIntensity minJmaIntensity, - int regionId, - DateTime createdAt, - DateTime updatedAt}); + $Res call({ + String id, + JmaForecastIntensity minJmaIntensity, + int regionId, + DateTime createdAt, + DateTime updatedAt, + }); } /// @nodoc -class _$DevicesEarthquakeSettingsCopyWithImpl<$Res, - $Val extends DevicesEarthquakeSettings> +class _$DevicesEarthquakeSettingsCopyWithImpl< + $Res, + $Val extends DevicesEarthquakeSettings +> implements $DevicesEarthquakeSettingsCopyWith<$Res> { _$DevicesEarthquakeSettingsCopyWithImpl(this._value, this._then); @@ -74,28 +80,36 @@ class _$DevicesEarthquakeSettingsCopyWithImpl<$Res, Object? createdAt = null, Object? updatedAt = null, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: + null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ) + as $Val, + ); } } @@ -103,28 +117,32 @@ class _$DevicesEarthquakeSettingsCopyWithImpl<$Res, abstract class _$$DevicesEarthquakeSettingsImplCopyWith<$Res> implements $DevicesEarthquakeSettingsCopyWith<$Res> { factory _$$DevicesEarthquakeSettingsImplCopyWith( - _$DevicesEarthquakeSettingsImpl value, - $Res Function(_$DevicesEarthquakeSettingsImpl) then) = - __$$DevicesEarthquakeSettingsImplCopyWithImpl<$Res>; + _$DevicesEarthquakeSettingsImpl value, + $Res Function(_$DevicesEarthquakeSettingsImpl) then, + ) = __$$DevicesEarthquakeSettingsImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - JmaForecastIntensity minJmaIntensity, - int regionId, - DateTime createdAt, - DateTime updatedAt}); + $Res call({ + String id, + JmaForecastIntensity minJmaIntensity, + int regionId, + DateTime createdAt, + DateTime updatedAt, + }); } /// @nodoc class __$$DevicesEarthquakeSettingsImplCopyWithImpl<$Res> - extends _$DevicesEarthquakeSettingsCopyWithImpl<$Res, - _$DevicesEarthquakeSettingsImpl> + extends + _$DevicesEarthquakeSettingsCopyWithImpl< + $Res, + _$DevicesEarthquakeSettingsImpl + > implements _$$DevicesEarthquakeSettingsImplCopyWith<$Res> { __$$DevicesEarthquakeSettingsImplCopyWithImpl( - _$DevicesEarthquakeSettingsImpl _value, - $Res Function(_$DevicesEarthquakeSettingsImpl) _then) - : super(_value, _then); + _$DevicesEarthquakeSettingsImpl _value, + $Res Function(_$DevicesEarthquakeSettingsImpl) _then, + ) : super(_value, _then); /// Create a copy of DevicesEarthquakeSettings /// with the given fields replaced by the non-null parameter values. @@ -137,40 +155,48 @@ class __$$DevicesEarthquakeSettingsImplCopyWithImpl<$Res> Object? createdAt = null, Object? updatedAt = null, }) { - return _then(_$DevicesEarthquakeSettingsImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - )); + return _then( + _$DevicesEarthquakeSettingsImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: + null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ), + ); } } /// @nodoc @JsonSerializable() class _$DevicesEarthquakeSettingsImpl implements _DevicesEarthquakeSettings { - const _$DevicesEarthquakeSettingsImpl( - {required this.id, - required this.minJmaIntensity, - required this.regionId, - required this.createdAt, - required this.updatedAt}); + const _$DevicesEarthquakeSettingsImpl({ + required this.id, + required this.minJmaIntensity, + required this.regionId, + required this.createdAt, + required this.updatedAt, + }); factory _$DevicesEarthquakeSettingsImpl.fromJson(Map json) => _$$DevicesEarthquakeSettingsImplFromJson(json); @@ -210,7 +236,13 @@ class _$DevicesEarthquakeSettingsImpl implements _DevicesEarthquakeSettings { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, id, minJmaIntensity, regionId, createdAt, updatedAt); + runtimeType, + id, + minJmaIntensity, + regionId, + createdAt, + updatedAt, + ); /// Create a copy of DevicesEarthquakeSettings /// with the given fields replaced by the non-null parameter values. @@ -218,24 +250,24 @@ class _$DevicesEarthquakeSettingsImpl implements _DevicesEarthquakeSettings { @override @pragma('vm:prefer-inline') _$$DevicesEarthquakeSettingsImplCopyWith<_$DevicesEarthquakeSettingsImpl> - get copyWith => __$$DevicesEarthquakeSettingsImplCopyWithImpl< - _$DevicesEarthquakeSettingsImpl>(this, _$identity); + get copyWith => __$$DevicesEarthquakeSettingsImplCopyWithImpl< + _$DevicesEarthquakeSettingsImpl + >(this, _$identity); @override Map toJson() { - return _$$DevicesEarthquakeSettingsImplToJson( - this, - ); + return _$$DevicesEarthquakeSettingsImplToJson(this); } } abstract class _DevicesEarthquakeSettings implements DevicesEarthquakeSettings { - const factory _DevicesEarthquakeSettings( - {required final String id, - required final JmaForecastIntensity minJmaIntensity, - required final int regionId, - required final DateTime createdAt, - required final DateTime updatedAt}) = _$DevicesEarthquakeSettingsImpl; + const factory _DevicesEarthquakeSettings({ + required final String id, + required final JmaForecastIntensity minJmaIntensity, + required final int regionId, + required final DateTime createdAt, + required final DateTime updatedAt, + }) = _$DevicesEarthquakeSettingsImpl; factory _DevicesEarthquakeSettings.fromJson(Map json) = _$DevicesEarthquakeSettingsImpl.fromJson; @@ -256,5 +288,5 @@ abstract class _DevicesEarthquakeSettings implements DevicesEarthquakeSettings { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$DevicesEarthquakeSettingsImplCopyWith<_$DevicesEarthquakeSettingsImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.g.dart b/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.g.dart index 278e6969..115461b2 100644 --- a/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/devices_earthquake_settings.g.dart @@ -9,41 +9,46 @@ part of 'devices_earthquake_settings.dart'; // ************************************************************************** _$DevicesEarthquakeSettingsImpl _$$DevicesEarthquakeSettingsImplFromJson( - Map json) => - $checkedCreate( - r'_$DevicesEarthquakeSettingsImpl', - json, - ($checkedConvert) { - final val = _$DevicesEarthquakeSettingsImpl( - id: $checkedConvert('id', (v) => v as String), - minJmaIntensity: $checkedConvert('min_jma_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), - createdAt: - $checkedConvert('created_at', (v) => DateTime.parse(v as String)), - updatedAt: - $checkedConvert('updated_at', (v) => DateTime.parse(v as String)), - ); - return val; - }, - fieldKeyMap: const { - 'minJmaIntensity': 'min_jma_intensity', - 'regionId': 'region_id', - 'createdAt': 'created_at', - 'updatedAt': 'updated_at' - }, + Map json, +) => $checkedCreate( + r'_$DevicesEarthquakeSettingsImpl', + json, + ($checkedConvert) { + final val = _$DevicesEarthquakeSettingsImpl( + id: $checkedConvert('id', (v) => v as String), + minJmaIntensity: $checkedConvert( + 'min_jma_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), + createdAt: $checkedConvert( + 'created_at', + (v) => DateTime.parse(v as String), + ), + updatedAt: $checkedConvert( + 'updated_at', + (v) => DateTime.parse(v as String), + ), ); + return val; + }, + fieldKeyMap: const { + 'minJmaIntensity': 'min_jma_intensity', + 'regionId': 'region_id', + 'createdAt': 'created_at', + 'updatedAt': 'updated_at', + }, +); Map _$$DevicesEarthquakeSettingsImplToJson( - _$DevicesEarthquakeSettingsImpl instance) => - { - 'id': instance.id, - 'min_jma_intensity': - _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, - 'region_id': instance.regionId, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), - }; + _$DevicesEarthquakeSettingsImpl instance, +) => { + 'id': instance.id, + 'min_jma_intensity': _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, + 'region_id': instance.regionId, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', diff --git a/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.freezed.dart b/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.freezed.dart index 3988f98e..86f20212 100644 --- a/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.freezed.dart @@ -12,7 +12,8 @@ part of 'devices_eew_settings.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); DevicesEewSettings _$DevicesEewSettingsFromJson(Map json) { return _DevicesEewSettings.fromJson(json); @@ -40,15 +41,17 @@ mixin _$DevicesEewSettings { /// @nodoc abstract class $DevicesEewSettingsCopyWith<$Res> { factory $DevicesEewSettingsCopyWith( - DevicesEewSettings value, $Res Function(DevicesEewSettings) then) = - _$DevicesEewSettingsCopyWithImpl<$Res, DevicesEewSettings>; + DevicesEewSettings value, + $Res Function(DevicesEewSettings) then, + ) = _$DevicesEewSettingsCopyWithImpl<$Res, DevicesEewSettings>; @useResult - $Res call( - {String id, - JmaForecastIntensity minJmaIntensity, - int regionId, - DateTime createdAt, - DateTime updatedAt}); + $Res call({ + String id, + JmaForecastIntensity minJmaIntensity, + int regionId, + DateTime createdAt, + DateTime updatedAt, + }); } /// @nodoc @@ -72,54 +75,65 @@ class _$DevicesEewSettingsCopyWithImpl<$Res, $Val extends DevicesEewSettings> Object? createdAt = null, Object? updatedAt = null, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: + null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ) + as $Val, + ); } } /// @nodoc abstract class _$$DevicesEewSettingsImplCopyWith<$Res> implements $DevicesEewSettingsCopyWith<$Res> { - factory _$$DevicesEewSettingsImplCopyWith(_$DevicesEewSettingsImpl value, - $Res Function(_$DevicesEewSettingsImpl) then) = - __$$DevicesEewSettingsImplCopyWithImpl<$Res>; + factory _$$DevicesEewSettingsImplCopyWith( + _$DevicesEewSettingsImpl value, + $Res Function(_$DevicesEewSettingsImpl) then, + ) = __$$DevicesEewSettingsImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - JmaForecastIntensity minJmaIntensity, - int regionId, - DateTime createdAt, - DateTime updatedAt}); + $Res call({ + String id, + JmaForecastIntensity minJmaIntensity, + int regionId, + DateTime createdAt, + DateTime updatedAt, + }); } /// @nodoc class __$$DevicesEewSettingsImplCopyWithImpl<$Res> extends _$DevicesEewSettingsCopyWithImpl<$Res, _$DevicesEewSettingsImpl> implements _$$DevicesEewSettingsImplCopyWith<$Res> { - __$$DevicesEewSettingsImplCopyWithImpl(_$DevicesEewSettingsImpl _value, - $Res Function(_$DevicesEewSettingsImpl) _then) - : super(_value, _then); + __$$DevicesEewSettingsImplCopyWithImpl( + _$DevicesEewSettingsImpl _value, + $Res Function(_$DevicesEewSettingsImpl) _then, + ) : super(_value, _then); /// Create a copy of DevicesEewSettings /// with the given fields replaced by the non-null parameter values. @@ -132,40 +146,48 @@ class __$$DevicesEewSettingsImplCopyWithImpl<$Res> Object? createdAt = null, Object? updatedAt = null, }) { - return _then(_$DevicesEewSettingsImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - minJmaIntensity: null == minJmaIntensity - ? _value.minJmaIntensity - : minJmaIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - regionId: null == regionId - ? _value.regionId - : regionId // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - updatedAt: null == updatedAt - ? _value.updatedAt - : updatedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - )); + return _then( + _$DevicesEewSettingsImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + minJmaIntensity: + null == minJmaIntensity + ? _value.minJmaIntensity + : minJmaIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + regionId: + null == regionId + ? _value.regionId + : regionId // ignore: cast_nullable_to_non_nullable + as int, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: + null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ), + ); } } /// @nodoc @JsonSerializable() class _$DevicesEewSettingsImpl implements _DevicesEewSettings { - const _$DevicesEewSettingsImpl( - {required this.id, - required this.minJmaIntensity, - required this.regionId, - required this.createdAt, - required this.updatedAt}); + const _$DevicesEewSettingsImpl({ + required this.id, + required this.minJmaIntensity, + required this.regionId, + required this.createdAt, + required this.updatedAt, + }); factory _$DevicesEewSettingsImpl.fromJson(Map json) => _$$DevicesEewSettingsImplFromJson(json); @@ -205,7 +227,13 @@ class _$DevicesEewSettingsImpl implements _DevicesEewSettings { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, id, minJmaIntensity, regionId, createdAt, updatedAt); + runtimeType, + id, + minJmaIntensity, + regionId, + createdAt, + updatedAt, + ); /// Create a copy of DevicesEewSettings /// with the given fields replaced by the non-null parameter values. @@ -214,23 +242,24 @@ class _$DevicesEewSettingsImpl implements _DevicesEewSettings { @pragma('vm:prefer-inline') _$$DevicesEewSettingsImplCopyWith<_$DevicesEewSettingsImpl> get copyWith => __$$DevicesEewSettingsImplCopyWithImpl<_$DevicesEewSettingsImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$DevicesEewSettingsImplToJson( - this, - ); + return _$$DevicesEewSettingsImplToJson(this); } } abstract class _DevicesEewSettings implements DevicesEewSettings { - const factory _DevicesEewSettings( - {required final String id, - required final JmaForecastIntensity minJmaIntensity, - required final int regionId, - required final DateTime createdAt, - required final DateTime updatedAt}) = _$DevicesEewSettingsImpl; + const factory _DevicesEewSettings({ + required final String id, + required final JmaForecastIntensity minJmaIntensity, + required final int regionId, + required final DateTime createdAt, + required final DateTime updatedAt, + }) = _$DevicesEewSettingsImpl; factory _DevicesEewSettings.fromJson(Map json) = _$DevicesEewSettingsImpl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.g.dart b/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.g.dart index 41e7ad19..2c528736 100644 --- a/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/devices_eew_settings.g.dart @@ -9,41 +9,46 @@ part of 'devices_eew_settings.dart'; // ************************************************************************** _$DevicesEewSettingsImpl _$$DevicesEewSettingsImplFromJson( - Map json) => - $checkedCreate( - r'_$DevicesEewSettingsImpl', - json, - ($checkedConvert) { - final val = _$DevicesEewSettingsImpl( - id: $checkedConvert('id', (v) => v as String), - minJmaIntensity: $checkedConvert('min_jma_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), - createdAt: - $checkedConvert('created_at', (v) => DateTime.parse(v as String)), - updatedAt: - $checkedConvert('updated_at', (v) => DateTime.parse(v as String)), - ); - return val; - }, - fieldKeyMap: const { - 'minJmaIntensity': 'min_jma_intensity', - 'regionId': 'region_id', - 'createdAt': 'created_at', - 'updatedAt': 'updated_at' - }, + Map json, +) => $checkedCreate( + r'_$DevicesEewSettingsImpl', + json, + ($checkedConvert) { + final val = _$DevicesEewSettingsImpl( + id: $checkedConvert('id', (v) => v as String), + minJmaIntensity: $checkedConvert( + 'min_jma_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + regionId: $checkedConvert('region_id', (v) => (v as num).toInt()), + createdAt: $checkedConvert( + 'created_at', + (v) => DateTime.parse(v as String), + ), + updatedAt: $checkedConvert( + 'updated_at', + (v) => DateTime.parse(v as String), + ), ); + return val; + }, + fieldKeyMap: const { + 'minJmaIntensity': 'min_jma_intensity', + 'regionId': 'region_id', + 'createdAt': 'created_at', + 'updatedAt': 'updated_at', + }, +); Map _$$DevicesEewSettingsImplToJson( - _$DevicesEewSettingsImpl instance) => - { - 'id': instance.id, - 'min_jma_intensity': - _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, - 'region_id': instance.regionId, - 'created_at': instance.createdAt.toIso8601String(), - 'updated_at': instance.updatedAt.toIso8601String(), - }; + _$DevicesEewSettingsImpl instance, +) => { + 'id': instance.id, + 'min_jma_intensity': _$JmaForecastIntensityEnumMap[instance.minJmaIntensity]!, + 'region_id': instance.regionId, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake.freezed.dart b/packages/eqapi_types/lib/src/model/v1/earthquake.freezed.dart index 5196523e..20ac5dc6 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake.freezed.dart @@ -12,7 +12,8 @@ part of 'earthquake.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EarthquakeV1 _$EarthquakeV1FromJson(Map json) { return _EarthquakeV1.fromJson(json); @@ -64,33 +65,35 @@ mixin _$EarthquakeV1 { /// @nodoc abstract class $EarthquakeV1CopyWith<$Res> { factory $EarthquakeV1CopyWith( - EarthquakeV1 value, $Res Function(EarthquakeV1) then) = - _$EarthquakeV1CopyWithImpl<$Res, EarthquakeV1>; + EarthquakeV1 value, + $Res Function(EarthquakeV1) then, + ) = _$EarthquakeV1CopyWithImpl<$Res, EarthquakeV1>; @useResult - $Res call( - {int eventId, - String status, - DateTime? arrivalTime, - int? depth, - int? epicenterCode, - int? epicenterDetailCode, - String? headline, - List? intensityCities, - List? intensityPrefectures, - List? intensityRegions, - List? intensityStations, - double? latitude, - double? longitude, - List? lpgmIntensityPrefectures, - List? lpgmIntensityRegions, - List? lpgmIntenstiyStations, - double? magnitude, - String? magnitudeCondition, - JmaIntensity? maxIntensity, - List? maxIntensityRegionIds, - JmaLgIntensity? maxLpgmIntensity, - DateTime? originTime, - String? text}); + $Res call({ + int eventId, + String status, + DateTime? arrivalTime, + int? depth, + int? epicenterCode, + int? epicenterDetailCode, + String? headline, + List? intensityCities, + List? intensityPrefectures, + List? intensityRegions, + List? intensityStations, + double? latitude, + double? longitude, + List? lpgmIntensityPrefectures, + List? lpgmIntensityRegions, + List? lpgmIntenstiyStations, + double? magnitude, + String? magnitudeCondition, + JmaIntensity? maxIntensity, + List? maxIntensityRegionIds, + JmaLgIntensity? maxLpgmIntensity, + DateTime? originTime, + String? text, + }); } /// @nodoc @@ -132,100 +135,126 @@ class _$EarthquakeV1CopyWithImpl<$Res, $Val extends EarthquakeV1> Object? originTime = freezed, Object? text = freezed, }) { - return _then(_value.copyWith( - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - epicenterCode: freezed == epicenterCode - ? _value.epicenterCode - : epicenterCode // ignore: cast_nullable_to_non_nullable - as int?, - epicenterDetailCode: freezed == epicenterDetailCode - ? _value.epicenterDetailCode - : epicenterDetailCode // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - intensityCities: freezed == intensityCities - ? _value.intensityCities - : intensityCities // ignore: cast_nullable_to_non_nullable - as List?, - intensityPrefectures: freezed == intensityPrefectures - ? _value.intensityPrefectures - : intensityPrefectures // ignore: cast_nullable_to_non_nullable - as List?, - intensityRegions: freezed == intensityRegions - ? _value.intensityRegions - : intensityRegions // ignore: cast_nullable_to_non_nullable - as List?, - intensityStations: freezed == intensityStations - ? _value.intensityStations - : intensityStations // ignore: cast_nullable_to_non_nullable - as List?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - lpgmIntensityPrefectures: freezed == lpgmIntensityPrefectures - ? _value.lpgmIntensityPrefectures - : lpgmIntensityPrefectures // ignore: cast_nullable_to_non_nullable - as List?, - lpgmIntensityRegions: freezed == lpgmIntensityRegions - ? _value.lpgmIntensityRegions - : lpgmIntensityRegions // ignore: cast_nullable_to_non_nullable - as List?, - lpgmIntenstiyStations: freezed == lpgmIntenstiyStations - ? _value.lpgmIntenstiyStations - : lpgmIntenstiyStations // ignore: cast_nullable_to_non_nullable - as List?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeCondition: freezed == magnitudeCondition - ? _value.magnitudeCondition - : magnitudeCondition // ignore: cast_nullable_to_non_nullable - as String?, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - maxIntensityRegionIds: freezed == maxIntensityRegionIds - ? _value.maxIntensityRegionIds - : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable - as List?, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + epicenterCode: + freezed == epicenterCode + ? _value.epicenterCode + : epicenterCode // ignore: cast_nullable_to_non_nullable + as int?, + epicenterDetailCode: + freezed == epicenterDetailCode + ? _value.epicenterDetailCode + : epicenterDetailCode // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + intensityCities: + freezed == intensityCities + ? _value.intensityCities + : intensityCities // ignore: cast_nullable_to_non_nullable + as List?, + intensityPrefectures: + freezed == intensityPrefectures + ? _value.intensityPrefectures + : intensityPrefectures // ignore: cast_nullable_to_non_nullable + as List?, + intensityRegions: + freezed == intensityRegions + ? _value.intensityRegions + : intensityRegions // ignore: cast_nullable_to_non_nullable + as List?, + intensityStations: + freezed == intensityStations + ? _value.intensityStations + : intensityStations // ignore: cast_nullable_to_non_nullable + as List?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + lpgmIntensityPrefectures: + freezed == lpgmIntensityPrefectures + ? _value.lpgmIntensityPrefectures + : lpgmIntensityPrefectures // ignore: cast_nullable_to_non_nullable + as List?, + lpgmIntensityRegions: + freezed == lpgmIntensityRegions + ? _value.lpgmIntensityRegions + : lpgmIntensityRegions // ignore: cast_nullable_to_non_nullable + as List?, + lpgmIntenstiyStations: + freezed == lpgmIntenstiyStations + ? _value.lpgmIntenstiyStations + : lpgmIntenstiyStations // ignore: cast_nullable_to_non_nullable + as List?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeCondition: + freezed == magnitudeCondition + ? _value.magnitudeCondition + : magnitudeCondition // ignore: cast_nullable_to_non_nullable + as String?, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + maxIntensityRegionIds: + freezed == maxIntensityRegionIds + ? _value.maxIntensityRegionIds + : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable + as List?, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } @@ -233,34 +262,36 @@ class _$EarthquakeV1CopyWithImpl<$Res, $Val extends EarthquakeV1> abstract class _$$EarthquakeV1ImplCopyWith<$Res> implements $EarthquakeV1CopyWith<$Res> { factory _$$EarthquakeV1ImplCopyWith( - _$EarthquakeV1Impl value, $Res Function(_$EarthquakeV1Impl) then) = - __$$EarthquakeV1ImplCopyWithImpl<$Res>; + _$EarthquakeV1Impl value, + $Res Function(_$EarthquakeV1Impl) then, + ) = __$$EarthquakeV1ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int eventId, - String status, - DateTime? arrivalTime, - int? depth, - int? epicenterCode, - int? epicenterDetailCode, - String? headline, - List? intensityCities, - List? intensityPrefectures, - List? intensityRegions, - List? intensityStations, - double? latitude, - double? longitude, - List? lpgmIntensityPrefectures, - List? lpgmIntensityRegions, - List? lpgmIntenstiyStations, - double? magnitude, - String? magnitudeCondition, - JmaIntensity? maxIntensity, - List? maxIntensityRegionIds, - JmaLgIntensity? maxLpgmIntensity, - DateTime? originTime, - String? text}); + $Res call({ + int eventId, + String status, + DateTime? arrivalTime, + int? depth, + int? epicenterCode, + int? epicenterDetailCode, + String? headline, + List? intensityCities, + List? intensityPrefectures, + List? intensityRegions, + List? intensityStations, + double? latitude, + double? longitude, + List? lpgmIntensityPrefectures, + List? lpgmIntensityRegions, + List? lpgmIntenstiyStations, + double? magnitude, + String? magnitudeCondition, + JmaIntensity? maxIntensity, + List? maxIntensityRegionIds, + JmaLgIntensity? maxLpgmIntensity, + DateTime? originTime, + String? text, + }); } /// @nodoc @@ -268,8 +299,9 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> extends _$EarthquakeV1CopyWithImpl<$Res, _$EarthquakeV1Impl> implements _$$EarthquakeV1ImplCopyWith<$Res> { __$$EarthquakeV1ImplCopyWithImpl( - _$EarthquakeV1Impl _value, $Res Function(_$EarthquakeV1Impl) _then) - : super(_value, _then); + _$EarthquakeV1Impl _value, + $Res Function(_$EarthquakeV1Impl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeV1 /// with the given fields replaced by the non-null parameter values. @@ -300,138 +332,163 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> Object? originTime = freezed, Object? text = freezed, }) { - return _then(_$EarthquakeV1Impl( - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - epicenterCode: freezed == epicenterCode - ? _value.epicenterCode - : epicenterCode // ignore: cast_nullable_to_non_nullable - as int?, - epicenterDetailCode: freezed == epicenterDetailCode - ? _value.epicenterDetailCode - : epicenterDetailCode // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - intensityCities: freezed == intensityCities - ? _value._intensityCities - : intensityCities // ignore: cast_nullable_to_non_nullable - as List?, - intensityPrefectures: freezed == intensityPrefectures - ? _value._intensityPrefectures - : intensityPrefectures // ignore: cast_nullable_to_non_nullable - as List?, - intensityRegions: freezed == intensityRegions - ? _value._intensityRegions - : intensityRegions // ignore: cast_nullable_to_non_nullable - as List?, - intensityStations: freezed == intensityStations - ? _value._intensityStations - : intensityStations // ignore: cast_nullable_to_non_nullable - as List?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - lpgmIntensityPrefectures: freezed == lpgmIntensityPrefectures - ? _value._lpgmIntensityPrefectures - : lpgmIntensityPrefectures // ignore: cast_nullable_to_non_nullable - as List?, - lpgmIntensityRegions: freezed == lpgmIntensityRegions - ? _value._lpgmIntensityRegions - : lpgmIntensityRegions // ignore: cast_nullable_to_non_nullable - as List?, - lpgmIntenstiyStations: freezed == lpgmIntenstiyStations - ? _value._lpgmIntenstiyStations - : lpgmIntenstiyStations // ignore: cast_nullable_to_non_nullable - as List?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeCondition: freezed == magnitudeCondition - ? _value.magnitudeCondition - : magnitudeCondition // ignore: cast_nullable_to_non_nullable - as String?, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - maxIntensityRegionIds: freezed == maxIntensityRegionIds - ? _value._maxIntensityRegionIds - : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable - as List?, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$EarthquakeV1Impl( + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + epicenterCode: + freezed == epicenterCode + ? _value.epicenterCode + : epicenterCode // ignore: cast_nullable_to_non_nullable + as int?, + epicenterDetailCode: + freezed == epicenterDetailCode + ? _value.epicenterDetailCode + : epicenterDetailCode // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + intensityCities: + freezed == intensityCities + ? _value._intensityCities + : intensityCities // ignore: cast_nullable_to_non_nullable + as List?, + intensityPrefectures: + freezed == intensityPrefectures + ? _value._intensityPrefectures + : intensityPrefectures // ignore: cast_nullable_to_non_nullable + as List?, + intensityRegions: + freezed == intensityRegions + ? _value._intensityRegions + : intensityRegions // ignore: cast_nullable_to_non_nullable + as List?, + intensityStations: + freezed == intensityStations + ? _value._intensityStations + : intensityStations // ignore: cast_nullable_to_non_nullable + as List?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + lpgmIntensityPrefectures: + freezed == lpgmIntensityPrefectures + ? _value._lpgmIntensityPrefectures + : lpgmIntensityPrefectures // ignore: cast_nullable_to_non_nullable + as List?, + lpgmIntensityRegions: + freezed == lpgmIntensityRegions + ? _value._lpgmIntensityRegions + : lpgmIntensityRegions // ignore: cast_nullable_to_non_nullable + as List?, + lpgmIntenstiyStations: + freezed == lpgmIntenstiyStations + ? _value._lpgmIntenstiyStations + : lpgmIntenstiyStations // ignore: cast_nullable_to_non_nullable + as List?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeCondition: + freezed == magnitudeCondition + ? _value.magnitudeCondition + : magnitudeCondition // ignore: cast_nullable_to_non_nullable + as String?, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + maxIntensityRegionIds: + freezed == maxIntensityRegionIds + ? _value._maxIntensityRegionIds + : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable + as List?, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeV1Impl implements _EarthquakeV1 { - const _$EarthquakeV1Impl( - {required this.eventId, - required this.status, - this.arrivalTime, - this.depth, - this.epicenterCode, - this.epicenterDetailCode, - this.headline, - final List? intensityCities, - final List? intensityPrefectures, - final List? intensityRegions, - final List? intensityStations, - this.latitude, - this.longitude, - final List? lpgmIntensityPrefectures, - final List? lpgmIntensityRegions, - final List? lpgmIntenstiyStations, - this.magnitude, - this.magnitudeCondition, - this.maxIntensity, - final List? maxIntensityRegionIds, - this.maxLpgmIntensity, - this.originTime, - this.text}) - : _intensityCities = intensityCities, - _intensityPrefectures = intensityPrefectures, - _intensityRegions = intensityRegions, - _intensityStations = intensityStations, - _lpgmIntensityPrefectures = lpgmIntensityPrefectures, - _lpgmIntensityRegions = lpgmIntensityRegions, - _lpgmIntenstiyStations = lpgmIntenstiyStations, - _maxIntensityRegionIds = maxIntensityRegionIds; + const _$EarthquakeV1Impl({ + required this.eventId, + required this.status, + this.arrivalTime, + this.depth, + this.epicenterCode, + this.epicenterDetailCode, + this.headline, + final List? intensityCities, + final List? intensityPrefectures, + final List? intensityRegions, + final List? intensityStations, + this.latitude, + this.longitude, + final List? lpgmIntensityPrefectures, + final List? lpgmIntensityRegions, + final List? lpgmIntenstiyStations, + this.magnitude, + this.magnitudeCondition, + this.maxIntensity, + final List? maxIntensityRegionIds, + this.maxLpgmIntensity, + this.originTime, + this.text, + }) : _intensityCities = intensityCities, + _intensityPrefectures = intensityPrefectures, + _intensityRegions = intensityRegions, + _intensityStations = intensityStations, + _lpgmIntensityPrefectures = lpgmIntensityPrefectures, + _lpgmIntensityRegions = lpgmIntensityRegions, + _lpgmIntenstiyStations = lpgmIntenstiyStations, + _maxIntensityRegionIds = maxIntensityRegionIds; factory _$EarthquakeV1Impl.fromJson(Map json) => _$$EarthquakeV1ImplFromJson(json); @@ -575,32 +632,48 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { other.epicenterDetailCode == epicenterDetailCode) && (identical(other.headline, headline) || other.headline == headline) && - const DeepCollectionEquality() - .equals(other._intensityCities, _intensityCities) && - const DeepCollectionEquality() - .equals(other._intensityPrefectures, _intensityPrefectures) && - const DeepCollectionEquality() - .equals(other._intensityRegions, _intensityRegions) && - const DeepCollectionEquality() - .equals(other._intensityStations, _intensityStations) && + const DeepCollectionEquality().equals( + other._intensityCities, + _intensityCities, + ) && + const DeepCollectionEquality().equals( + other._intensityPrefectures, + _intensityPrefectures, + ) && + const DeepCollectionEquality().equals( + other._intensityRegions, + _intensityRegions, + ) && + const DeepCollectionEquality().equals( + other._intensityStations, + _intensityStations, + ) && (identical(other.latitude, latitude) || other.latitude == latitude) && (identical(other.longitude, longitude) || other.longitude == longitude) && const DeepCollectionEquality().equals( - other._lpgmIntensityPrefectures, _lpgmIntensityPrefectures) && - const DeepCollectionEquality() - .equals(other._lpgmIntensityRegions, _lpgmIntensityRegions) && - const DeepCollectionEquality() - .equals(other._lpgmIntenstiyStations, _lpgmIntenstiyStations) && + other._lpgmIntensityPrefectures, + _lpgmIntensityPrefectures, + ) && + const DeepCollectionEquality().equals( + other._lpgmIntensityRegions, + _lpgmIntensityRegions, + ) && + const DeepCollectionEquality().equals( + other._lpgmIntenstiyStations, + _lpgmIntenstiyStations, + ) && (identical(other.magnitude, magnitude) || other.magnitude == magnitude) && (identical(other.magnitudeCondition, magnitudeCondition) || other.magnitudeCondition == magnitudeCondition) && (identical(other.maxIntensity, maxIntensity) || other.maxIntensity == maxIntensity) && - const DeepCollectionEquality() - .equals(other._maxIntensityRegionIds, _maxIntensityRegionIds) && + const DeepCollectionEquality().equals( + other._maxIntensityRegionIds, + _maxIntensityRegionIds, + ) && (identical(other.maxLpgmIntensity, maxLpgmIntensity) || other.maxLpgmIntensity == maxLpgmIntensity) && (identical(other.originTime, originTime) || @@ -611,31 +684,31 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ - runtimeType, - eventId, - status, - arrivalTime, - depth, - epicenterCode, - epicenterDetailCode, - headline, - const DeepCollectionEquality().hash(_intensityCities), - const DeepCollectionEquality().hash(_intensityPrefectures), - const DeepCollectionEquality().hash(_intensityRegions), - const DeepCollectionEquality().hash(_intensityStations), - latitude, - longitude, - const DeepCollectionEquality().hash(_lpgmIntensityPrefectures), - const DeepCollectionEquality().hash(_lpgmIntensityRegions), - const DeepCollectionEquality().hash(_lpgmIntenstiyStations), - magnitude, - magnitudeCondition, - maxIntensity, - const DeepCollectionEquality().hash(_maxIntensityRegionIds), - maxLpgmIntensity, - originTime, - text - ]); + runtimeType, + eventId, + status, + arrivalTime, + depth, + epicenterCode, + epicenterDetailCode, + headline, + const DeepCollectionEquality().hash(_intensityCities), + const DeepCollectionEquality().hash(_intensityPrefectures), + const DeepCollectionEquality().hash(_intensityRegions), + const DeepCollectionEquality().hash(_intensityStations), + latitude, + longitude, + const DeepCollectionEquality().hash(_lpgmIntensityPrefectures), + const DeepCollectionEquality().hash(_lpgmIntensityRegions), + const DeepCollectionEquality().hash(_lpgmIntenstiyStations), + magnitude, + magnitudeCondition, + maxIntensity, + const DeepCollectionEquality().hash(_maxIntensityRegionIds), + maxLpgmIntensity, + originTime, + text, + ]); /// Create a copy of EarthquakeV1 /// with the given fields replaced by the non-null parameter values. @@ -647,37 +720,36 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { @override Map toJson() { - return _$$EarthquakeV1ImplToJson( - this, - ); + return _$$EarthquakeV1ImplToJson(this); } } abstract class _EarthquakeV1 implements EarthquakeV1 { - const factory _EarthquakeV1( - {required final int eventId, - required final String status, - final DateTime? arrivalTime, - final int? depth, - final int? epicenterCode, - final int? epicenterDetailCode, - final String? headline, - final List? intensityCities, - final List? intensityPrefectures, - final List? intensityRegions, - final List? intensityStations, - final double? latitude, - final double? longitude, - final List? lpgmIntensityPrefectures, - final List? lpgmIntensityRegions, - final List? lpgmIntenstiyStations, - final double? magnitude, - final String? magnitudeCondition, - final JmaIntensity? maxIntensity, - final List? maxIntensityRegionIds, - final JmaLgIntensity? maxLpgmIntensity, - final DateTime? originTime, - final String? text}) = _$EarthquakeV1Impl; + const factory _EarthquakeV1({ + required final int eventId, + required final String status, + final DateTime? arrivalTime, + final int? depth, + final int? epicenterCode, + final int? epicenterDetailCode, + final String? headline, + final List? intensityCities, + final List? intensityPrefectures, + final List? intensityRegions, + final List? intensityStations, + final double? latitude, + final double? longitude, + final List? lpgmIntensityPrefectures, + final List? lpgmIntensityRegions, + final List? lpgmIntenstiyStations, + final double? magnitude, + final String? magnitudeCondition, + final JmaIntensity? maxIntensity, + final List? maxIntensityRegionIds, + final JmaLgIntensity? maxLpgmIntensity, + final DateTime? originTime, + final String? text, + }) = _$EarthquakeV1Impl; factory _EarthquakeV1.fromJson(Map json) = _$EarthquakeV1Impl.fromJson; @@ -773,26 +845,28 @@ mixin _$EarthquakeV1Base { /// @nodoc abstract class $EarthquakeV1BaseCopyWith<$Res> { factory $EarthquakeV1BaseCopyWith( - EarthquakeV1Base value, $Res Function(EarthquakeV1Base) then) = - _$EarthquakeV1BaseCopyWithImpl<$Res, EarthquakeV1Base>; + EarthquakeV1Base value, + $Res Function(EarthquakeV1Base) then, + ) = _$EarthquakeV1BaseCopyWithImpl<$Res, EarthquakeV1Base>; @useResult - $Res call( - {int eventId, - String status, - DateTime? arrivalTime, - int? depth, - int? epicenterCode, - int? epicenterDetailCode, - String? headline, - double? latitude, - double? longitude, - double? magnitude, - String? magnitudeCondition, - JmaIntensity? maxIntensity, - List? maxIntensityRegionIds, - JmaLgIntensity? maxLpgmIntensity, - DateTime? originTime, - String? text}); + $Res call({ + int eventId, + String status, + DateTime? arrivalTime, + int? depth, + int? epicenterCode, + int? epicenterDetailCode, + String? headline, + double? latitude, + double? longitude, + double? magnitude, + String? magnitudeCondition, + JmaIntensity? maxIntensity, + List? maxIntensityRegionIds, + JmaLgIntensity? maxLpgmIntensity, + DateTime? originTime, + String? text, + }); } /// @nodoc @@ -827,109 +901,131 @@ class _$EarthquakeV1BaseCopyWithImpl<$Res, $Val extends EarthquakeV1Base> Object? originTime = freezed, Object? text = freezed, }) { - return _then(_value.copyWith( - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - epicenterCode: freezed == epicenterCode - ? _value.epicenterCode - : epicenterCode // ignore: cast_nullable_to_non_nullable - as int?, - epicenterDetailCode: freezed == epicenterDetailCode - ? _value.epicenterDetailCode - : epicenterDetailCode // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeCondition: freezed == magnitudeCondition - ? _value.magnitudeCondition - : magnitudeCondition // ignore: cast_nullable_to_non_nullable - as String?, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - maxIntensityRegionIds: freezed == maxIntensityRegionIds - ? _value.maxIntensityRegionIds - : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable - as List?, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + epicenterCode: + freezed == epicenterCode + ? _value.epicenterCode + : epicenterCode // ignore: cast_nullable_to_non_nullable + as int?, + epicenterDetailCode: + freezed == epicenterDetailCode + ? _value.epicenterDetailCode + : epicenterDetailCode // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeCondition: + freezed == magnitudeCondition + ? _value.magnitudeCondition + : magnitudeCondition // ignore: cast_nullable_to_non_nullable + as String?, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + maxIntensityRegionIds: + freezed == maxIntensityRegionIds + ? _value.maxIntensityRegionIds + : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable + as List?, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeV1BaseImplCopyWith<$Res> implements $EarthquakeV1BaseCopyWith<$Res> { - factory _$$EarthquakeV1BaseImplCopyWith(_$EarthquakeV1BaseImpl value, - $Res Function(_$EarthquakeV1BaseImpl) then) = - __$$EarthquakeV1BaseImplCopyWithImpl<$Res>; + factory _$$EarthquakeV1BaseImplCopyWith( + _$EarthquakeV1BaseImpl value, + $Res Function(_$EarthquakeV1BaseImpl) then, + ) = __$$EarthquakeV1BaseImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int eventId, - String status, - DateTime? arrivalTime, - int? depth, - int? epicenterCode, - int? epicenterDetailCode, - String? headline, - double? latitude, - double? longitude, - double? magnitude, - String? magnitudeCondition, - JmaIntensity? maxIntensity, - List? maxIntensityRegionIds, - JmaLgIntensity? maxLpgmIntensity, - DateTime? originTime, - String? text}); + $Res call({ + int eventId, + String status, + DateTime? arrivalTime, + int? depth, + int? epicenterCode, + int? epicenterDetailCode, + String? headline, + double? latitude, + double? longitude, + double? magnitude, + String? magnitudeCondition, + JmaIntensity? maxIntensity, + List? maxIntensityRegionIds, + JmaLgIntensity? maxLpgmIntensity, + DateTime? originTime, + String? text, + }); } /// @nodoc class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> extends _$EarthquakeV1BaseCopyWithImpl<$Res, _$EarthquakeV1BaseImpl> implements _$$EarthquakeV1BaseImplCopyWith<$Res> { - __$$EarthquakeV1BaseImplCopyWithImpl(_$EarthquakeV1BaseImpl _value, - $Res Function(_$EarthquakeV1BaseImpl) _then) - : super(_value, _then); + __$$EarthquakeV1BaseImplCopyWithImpl( + _$EarthquakeV1BaseImpl _value, + $Res Function(_$EarthquakeV1BaseImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeV1Base /// with the given fields replaced by the non-null parameter values. @@ -953,96 +1049,114 @@ class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> Object? originTime = freezed, Object? text = freezed, }) { - return _then(_$EarthquakeV1BaseImpl( - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - epicenterCode: freezed == epicenterCode - ? _value.epicenterCode - : epicenterCode // ignore: cast_nullable_to_non_nullable - as int?, - epicenterDetailCode: freezed == epicenterDetailCode - ? _value.epicenterDetailCode - : epicenterDetailCode // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitudeCondition: freezed == magnitudeCondition - ? _value.magnitudeCondition - : magnitudeCondition // ignore: cast_nullable_to_non_nullable - as String?, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - maxIntensityRegionIds: freezed == maxIntensityRegionIds - ? _value._maxIntensityRegionIds - : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable - as List?, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$EarthquakeV1BaseImpl( + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + epicenterCode: + freezed == epicenterCode + ? _value.epicenterCode + : epicenterCode // ignore: cast_nullable_to_non_nullable + as int?, + epicenterDetailCode: + freezed == epicenterDetailCode + ? _value.epicenterDetailCode + : epicenterDetailCode // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitudeCondition: + freezed == magnitudeCondition + ? _value.magnitudeCondition + : magnitudeCondition // ignore: cast_nullable_to_non_nullable + as String?, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + maxIntensityRegionIds: + freezed == maxIntensityRegionIds + ? _value._maxIntensityRegionIds + : maxIntensityRegionIds // ignore: cast_nullable_to_non_nullable + as List?, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { - const _$EarthquakeV1BaseImpl( - {required this.eventId, - required this.status, - this.arrivalTime, - this.depth, - this.epicenterCode, - this.epicenterDetailCode, - this.headline, - this.latitude, - this.longitude, - this.magnitude, - this.magnitudeCondition, - this.maxIntensity, - final List? maxIntensityRegionIds, - this.maxLpgmIntensity, - this.originTime, - this.text}) - : _maxIntensityRegionIds = maxIntensityRegionIds; + const _$EarthquakeV1BaseImpl({ + required this.eventId, + required this.status, + this.arrivalTime, + this.depth, + this.epicenterCode, + this.epicenterDetailCode, + this.headline, + this.latitude, + this.longitude, + this.magnitude, + this.magnitudeCondition, + this.maxIntensity, + final List? maxIntensityRegionIds, + this.maxLpgmIntensity, + this.originTime, + this.text, + }) : _maxIntensityRegionIds = maxIntensityRegionIds; factory _$EarthquakeV1BaseImpl.fromJson(Map json) => _$$EarthquakeV1BaseImplFromJson(json); @@ -1120,8 +1234,10 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { other.magnitudeCondition == magnitudeCondition) && (identical(other.maxIntensity, maxIntensity) || other.maxIntensity == maxIntensity) && - const DeepCollectionEquality() - .equals(other._maxIntensityRegionIds, _maxIntensityRegionIds) && + const DeepCollectionEquality().equals( + other._maxIntensityRegionIds, + _maxIntensityRegionIds, + ) && (identical(other.maxLpgmIntensity, maxLpgmIntensity) || other.maxLpgmIntensity == maxLpgmIntensity) && (identical(other.originTime, originTime) || @@ -1132,23 +1248,24 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - eventId, - status, - arrivalTime, - depth, - epicenterCode, - epicenterDetailCode, - headline, - latitude, - longitude, - magnitude, - magnitudeCondition, - maxIntensity, - const DeepCollectionEquality().hash(_maxIntensityRegionIds), - maxLpgmIntensity, - originTime, - text); + runtimeType, + eventId, + status, + arrivalTime, + depth, + epicenterCode, + epicenterDetailCode, + headline, + latitude, + longitude, + magnitude, + magnitudeCondition, + maxIntensity, + const DeepCollectionEquality().hash(_maxIntensityRegionIds), + maxLpgmIntensity, + originTime, + text, + ); /// Create a copy of EarthquakeV1Base /// with the given fields replaced by the non-null parameter values. @@ -1157,34 +1274,35 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { @pragma('vm:prefer-inline') _$$EarthquakeV1BaseImplCopyWith<_$EarthquakeV1BaseImpl> get copyWith => __$$EarthquakeV1BaseImplCopyWithImpl<_$EarthquakeV1BaseImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeV1BaseImplToJson( - this, - ); + return _$$EarthquakeV1BaseImplToJson(this); } } abstract class _EarthquakeV1Base implements EarthquakeV1Base { - const factory _EarthquakeV1Base( - {required final int eventId, - required final String status, - final DateTime? arrivalTime, - final int? depth, - final int? epicenterCode, - final int? epicenterDetailCode, - final String? headline, - final double? latitude, - final double? longitude, - final double? magnitude, - final String? magnitudeCondition, - final JmaIntensity? maxIntensity, - final List? maxIntensityRegionIds, - final JmaLgIntensity? maxLpgmIntensity, - final DateTime? originTime, - final String? text}) = _$EarthquakeV1BaseImpl; + const factory _EarthquakeV1Base({ + required final int eventId, + required final String status, + final DateTime? arrivalTime, + final int? depth, + final int? epicenterCode, + final int? epicenterDetailCode, + final String? headline, + final double? latitude, + final double? longitude, + final double? magnitude, + final String? magnitudeCondition, + final JmaIntensity? maxIntensity, + final List? maxIntensityRegionIds, + final JmaLgIntensity? maxLpgmIntensity, + final DateTime? originTime, + final String? text, + }) = _$EarthquakeV1BaseImpl; factory _EarthquakeV1Base.fromJson(Map json) = _$EarthquakeV1BaseImpl.fromJson; @@ -1231,7 +1349,8 @@ abstract class _EarthquakeV1Base implements EarthquakeV1Base { } ObservedRegionIntensity _$ObservedRegionIntensityFromJson( - Map json) { + Map json, +) { return _ObservedRegionIntensity.fromJson(json); } @@ -1254,19 +1373,23 @@ mixin _$ObservedRegionIntensity { /// @nodoc abstract class $ObservedRegionIntensityCopyWith<$Res> { - factory $ObservedRegionIntensityCopyWith(ObservedRegionIntensity value, - $Res Function(ObservedRegionIntensity) then) = - _$ObservedRegionIntensityCopyWithImpl<$Res, ObservedRegionIntensity>; + factory $ObservedRegionIntensityCopyWith( + ObservedRegionIntensity value, + $Res Function(ObservedRegionIntensity) then, + ) = _$ObservedRegionIntensityCopyWithImpl<$Res, ObservedRegionIntensity>; @useResult - $Res call( - {String code, - String name, - @JsonKey(name: 'maxInt') JmaIntensity? intensity}); + $Res call({ + String code, + String name, + @JsonKey(name: 'maxInt') JmaIntensity? intensity, + }); } /// @nodoc -class _$ObservedRegionIntensityCopyWithImpl<$Res, - $Val extends ObservedRegionIntensity> +class _$ObservedRegionIntensityCopyWithImpl< + $Res, + $Val extends ObservedRegionIntensity +> implements $ObservedRegionIntensityCopyWith<$Res> { _$ObservedRegionIntensityCopyWithImpl(this._value, this._then); @@ -1284,20 +1407,26 @@ class _$ObservedRegionIntensityCopyWithImpl<$Res, Object? name = null, Object? intensity = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - intensity: freezed == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + intensity: + freezed == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + ) + as $Val, + ); } } @@ -1305,26 +1434,30 @@ class _$ObservedRegionIntensityCopyWithImpl<$Res, abstract class _$$ObservedRegionIntensityImplCopyWith<$Res> implements $ObservedRegionIntensityCopyWith<$Res> { factory _$$ObservedRegionIntensityImplCopyWith( - _$ObservedRegionIntensityImpl value, - $Res Function(_$ObservedRegionIntensityImpl) then) = - __$$ObservedRegionIntensityImplCopyWithImpl<$Res>; + _$ObservedRegionIntensityImpl value, + $Res Function(_$ObservedRegionIntensityImpl) then, + ) = __$$ObservedRegionIntensityImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - @JsonKey(name: 'maxInt') JmaIntensity? intensity}); + $Res call({ + String code, + String name, + @JsonKey(name: 'maxInt') JmaIntensity? intensity, + }); } /// @nodoc class __$$ObservedRegionIntensityImplCopyWithImpl<$Res> - extends _$ObservedRegionIntensityCopyWithImpl<$Res, - _$ObservedRegionIntensityImpl> + extends + _$ObservedRegionIntensityCopyWithImpl< + $Res, + _$ObservedRegionIntensityImpl + > implements _$$ObservedRegionIntensityImplCopyWith<$Res> { __$$ObservedRegionIntensityImplCopyWithImpl( - _$ObservedRegionIntensityImpl _value, - $Res Function(_$ObservedRegionIntensityImpl) _then) - : super(_value, _then); + _$ObservedRegionIntensityImpl _value, + $Res Function(_$ObservedRegionIntensityImpl) _then, + ) : super(_value, _then); /// Create a copy of ObservedRegionIntensity /// with the given fields replaced by the non-null parameter values. @@ -1335,30 +1468,36 @@ class __$$ObservedRegionIntensityImplCopyWithImpl<$Res> Object? name = null, Object? intensity = freezed, }) { - return _then(_$ObservedRegionIntensityImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - intensity: freezed == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - )); + return _then( + _$ObservedRegionIntensityImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + intensity: + freezed == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + ), + ); } } /// @nodoc @JsonSerializable() class _$ObservedRegionIntensityImpl implements _ObservedRegionIntensity { - const _$ObservedRegionIntensityImpl( - {required this.code, - required this.name, - @JsonKey(name: 'maxInt') required this.intensity}); + const _$ObservedRegionIntensityImpl({ + required this.code, + required this.name, + @JsonKey(name: 'maxInt') required this.intensity, + }); factory _$ObservedRegionIntensityImpl.fromJson(Map json) => _$$ObservedRegionIntensityImplFromJson(json); @@ -1397,23 +1536,22 @@ class _$ObservedRegionIntensityImpl implements _ObservedRegionIntensity { @override @pragma('vm:prefer-inline') _$$ObservedRegionIntensityImplCopyWith<_$ObservedRegionIntensityImpl> - get copyWith => __$$ObservedRegionIntensityImplCopyWithImpl< - _$ObservedRegionIntensityImpl>(this, _$identity); + get copyWith => __$$ObservedRegionIntensityImplCopyWithImpl< + _$ObservedRegionIntensityImpl + >(this, _$identity); @override Map toJson() { - return _$$ObservedRegionIntensityImplToJson( - this, - ); + return _$$ObservedRegionIntensityImplToJson(this); } } abstract class _ObservedRegionIntensity implements ObservedRegionIntensity { - const factory _ObservedRegionIntensity( - {required final String code, - required final String name, - @JsonKey(name: 'maxInt') required final JmaIntensity? intensity}) = - _$ObservedRegionIntensityImpl; + const factory _ObservedRegionIntensity({ + required final String code, + required final String name, + @JsonKey(name: 'maxInt') required final JmaIntensity? intensity, + }) = _$ObservedRegionIntensityImpl; factory _ObservedRegionIntensity.fromJson(Map json) = _$ObservedRegionIntensityImpl.fromJson; @@ -1431,11 +1569,12 @@ abstract class _ObservedRegionIntensity implements ObservedRegionIntensity { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ObservedRegionIntensityImplCopyWith<_$ObservedRegionIntensityImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } ObservedRegionLpgmIntensity _$ObservedRegionLpgmIntensityFromJson( - Map json) { + Map json, +) { return _ObservedRegionLpgmIntensity.fromJson(json); } @@ -1455,27 +1594,33 @@ mixin _$ObservedRegionLpgmIntensity { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $ObservedRegionLpgmIntensityCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ObservedRegionLpgmIntensityCopyWith<$Res> { factory $ObservedRegionLpgmIntensityCopyWith( - ObservedRegionLpgmIntensity value, - $Res Function(ObservedRegionLpgmIntensity) then) = - _$ObservedRegionLpgmIntensityCopyWithImpl<$Res, - ObservedRegionLpgmIntensity>; + ObservedRegionLpgmIntensity value, + $Res Function(ObservedRegionLpgmIntensity) then, + ) = + _$ObservedRegionLpgmIntensityCopyWithImpl< + $Res, + ObservedRegionLpgmIntensity + >; @useResult - $Res call( - {String code, - String name, - @JsonKey(name: 'maxInt') JmaIntensity? intensity, - @JsonKey(name: 'maxLgInt') JmaLgIntensity? lpgmIntensity}); + $Res call({ + String code, + String name, + @JsonKey(name: 'maxInt') JmaIntensity? intensity, + @JsonKey(name: 'maxLgInt') JmaLgIntensity? lpgmIntensity, + }); } /// @nodoc -class _$ObservedRegionLpgmIntensityCopyWithImpl<$Res, - $Val extends ObservedRegionLpgmIntensity> +class _$ObservedRegionLpgmIntensityCopyWithImpl< + $Res, + $Val extends ObservedRegionLpgmIntensity +> implements $ObservedRegionLpgmIntensityCopyWith<$Res> { _$ObservedRegionLpgmIntensityCopyWithImpl(this._value, this._then); @@ -1494,24 +1639,31 @@ class _$ObservedRegionLpgmIntensityCopyWithImpl<$Res, Object? intensity = freezed, Object? lpgmIntensity = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - intensity: freezed == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - lpgmIntensity: freezed == lpgmIntensity - ? _value.lpgmIntensity - : lpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + intensity: + freezed == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + lpgmIntensity: + freezed == lpgmIntensity + ? _value.lpgmIntensity + : lpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + ) + as $Val, + ); } } @@ -1519,27 +1671,31 @@ class _$ObservedRegionLpgmIntensityCopyWithImpl<$Res, abstract class _$$ObservedRegionLpgmIntensityImplCopyWith<$Res> implements $ObservedRegionLpgmIntensityCopyWith<$Res> { factory _$$ObservedRegionLpgmIntensityImplCopyWith( - _$ObservedRegionLpgmIntensityImpl value, - $Res Function(_$ObservedRegionLpgmIntensityImpl) then) = - __$$ObservedRegionLpgmIntensityImplCopyWithImpl<$Res>; + _$ObservedRegionLpgmIntensityImpl value, + $Res Function(_$ObservedRegionLpgmIntensityImpl) then, + ) = __$$ObservedRegionLpgmIntensityImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - @JsonKey(name: 'maxInt') JmaIntensity? intensity, - @JsonKey(name: 'maxLgInt') JmaLgIntensity? lpgmIntensity}); + $Res call({ + String code, + String name, + @JsonKey(name: 'maxInt') JmaIntensity? intensity, + @JsonKey(name: 'maxLgInt') JmaLgIntensity? lpgmIntensity, + }); } /// @nodoc class __$$ObservedRegionLpgmIntensityImplCopyWithImpl<$Res> - extends _$ObservedRegionLpgmIntensityCopyWithImpl<$Res, - _$ObservedRegionLpgmIntensityImpl> + extends + _$ObservedRegionLpgmIntensityCopyWithImpl< + $Res, + _$ObservedRegionLpgmIntensityImpl + > implements _$$ObservedRegionLpgmIntensityImplCopyWith<$Res> { __$$ObservedRegionLpgmIntensityImplCopyWithImpl( - _$ObservedRegionLpgmIntensityImpl _value, - $Res Function(_$ObservedRegionLpgmIntensityImpl) _then) - : super(_value, _then); + _$ObservedRegionLpgmIntensityImpl _value, + $Res Function(_$ObservedRegionLpgmIntensityImpl) _then, + ) : super(_value, _then); /// Create a copy of ObservedRegionLpgmIntensity /// with the given fields replaced by the non-null parameter values. @@ -1551,24 +1707,30 @@ class __$$ObservedRegionLpgmIntensityImplCopyWithImpl<$Res> Object? intensity = freezed, Object? lpgmIntensity = freezed, }) { - return _then(_$ObservedRegionLpgmIntensityImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - intensity: freezed == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - lpgmIntensity: freezed == lpgmIntensity - ? _value.lpgmIntensity - : lpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - )); + return _then( + _$ObservedRegionLpgmIntensityImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + intensity: + freezed == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + lpgmIntensity: + freezed == lpgmIntensity + ? _value.lpgmIntensity + : lpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + ), + ); } } @@ -1576,15 +1738,16 @@ class __$$ObservedRegionLpgmIntensityImplCopyWithImpl<$Res> @JsonSerializable() class _$ObservedRegionLpgmIntensityImpl implements _ObservedRegionLpgmIntensity { - const _$ObservedRegionLpgmIntensityImpl( - {required this.code, - required this.name, - @JsonKey(name: 'maxInt') required this.intensity, - @JsonKey(name: 'maxLgInt') required this.lpgmIntensity}); + const _$ObservedRegionLpgmIntensityImpl({ + required this.code, + required this.name, + @JsonKey(name: 'maxInt') required this.intensity, + @JsonKey(name: 'maxLgInt') required this.lpgmIntensity, + }); factory _$ObservedRegionLpgmIntensityImpl.fromJson( - Map json) => - _$$ObservedRegionLpgmIntensityImplFromJson(json); + Map json, + ) => _$$ObservedRegionLpgmIntensityImplFromJson(json); @override final String code; @@ -1626,26 +1789,24 @@ class _$ObservedRegionLpgmIntensityImpl @override @pragma('vm:prefer-inline') _$$ObservedRegionLpgmIntensityImplCopyWith<_$ObservedRegionLpgmIntensityImpl> - get copyWith => __$$ObservedRegionLpgmIntensityImplCopyWithImpl< - _$ObservedRegionLpgmIntensityImpl>(this, _$identity); + get copyWith => __$$ObservedRegionLpgmIntensityImplCopyWithImpl< + _$ObservedRegionLpgmIntensityImpl + >(this, _$identity); @override Map toJson() { - return _$$ObservedRegionLpgmIntensityImplToJson( - this, - ); + return _$$ObservedRegionLpgmIntensityImplToJson(this); } } abstract class _ObservedRegionLpgmIntensity implements ObservedRegionLpgmIntensity { - const factory _ObservedRegionLpgmIntensity( - {required final String code, - required final String name, - @JsonKey(name: 'maxInt') required final JmaIntensity? intensity, - @JsonKey(name: 'maxLgInt') - required final JmaLgIntensity? lpgmIntensity}) = - _$ObservedRegionLpgmIntensityImpl; + const factory _ObservedRegionLpgmIntensity({ + required final String code, + required final String name, + @JsonKey(name: 'maxInt') required final JmaIntensity? intensity, + @JsonKey(name: 'maxLgInt') required final JmaLgIntensity? lpgmIntensity, + }) = _$ObservedRegionLpgmIntensityImpl; factory _ObservedRegionLpgmIntensity.fromJson(Map json) = _$ObservedRegionLpgmIntensityImpl.fromJson; @@ -1666,5 +1827,5 @@ abstract class _ObservedRegionLpgmIntensity @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ObservedRegionLpgmIntensityImplCopyWith<_$ObservedRegionLpgmIntensityImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake.g.dart b/packages/eqapi_types/lib/src/model/v1/earthquake.g.dart index 0c8f36fb..ce4630df 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake.g.dart @@ -8,105 +8,152 @@ part of 'earthquake.dart'; // JsonSerializableGenerator // ************************************************************************** -_$EarthquakeV1Impl _$$EarthquakeV1ImplFromJson(Map json) => - $checkedCreate( - r'_$EarthquakeV1Impl', - json, - ($checkedConvert) { - final val = _$EarthquakeV1Impl( - eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), - status: $checkedConvert('status', (v) => v as String), - arrivalTime: $checkedConvert('arrival_time', - (v) => v == null ? null : DateTime.parse(v as String)), - depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), - epicenterCode: - $checkedConvert('epicenter_code', (v) => (v as num?)?.toInt()), - epicenterDetailCode: $checkedConvert( - 'epicenter_detail_code', (v) => (v as num?)?.toInt()), - headline: $checkedConvert('headline', (v) => v as String?), - intensityCities: $checkedConvert( - 'intensity_cities', - (v) => (v as List?) - ?.map((e) => ObservedRegionIntensity.fromJson( - e as Map)) - .toList()), - intensityPrefectures: $checkedConvert( - 'intensity_prefectures', - (v) => (v as List?) - ?.map((e) => ObservedRegionIntensity.fromJson( - e as Map)) - .toList()), - intensityRegions: $checkedConvert( - 'intensity_regions', - (v) => (v as List?) - ?.map((e) => ObservedRegionIntensity.fromJson( - e as Map)) - .toList()), - intensityStations: $checkedConvert( - 'intensity_stations', - (v) => (v as List?) - ?.map((e) => ObservedRegionIntensity.fromJson( - e as Map)) - .toList()), - latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), - longitude: - $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), - lpgmIntensityPrefectures: $checkedConvert( - 'lpgm_intensity_prefectures', - (v) => (v as List?) - ?.map((e) => ObservedRegionLpgmIntensity.fromJson( - e as Map)) - .toList()), - lpgmIntensityRegions: $checkedConvert( - 'lpgm_intensity_regions', - (v) => (v as List?) - ?.map((e) => ObservedRegionLpgmIntensity.fromJson( - e as Map)) - .toList()), - lpgmIntenstiyStations: $checkedConvert( - 'lpgm_intenstiy_stations', - (v) => (v as List?) - ?.map((e) => ObservedRegionLpgmIntensity.fromJson( - e as Map)) - .toList()), - magnitude: - $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), - magnitudeCondition: - $checkedConvert('magnitude_condition', (v) => v as String?), - maxIntensity: $checkedConvert('max_intensity', - (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v)), - maxIntensityRegionIds: $checkedConvert( - 'max_intensity_region_ids', - (v) => (v as List?) - ?.map((e) => (e as num).toInt()) - .toList()), - maxLpgmIntensity: $checkedConvert('max_lpgm_intensity', - (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), - originTime: $checkedConvert('origin_time', - (v) => v == null ? null : DateTime.parse(v as String)), - text: $checkedConvert('text', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const { - 'eventId': 'event_id', - 'arrivalTime': 'arrival_time', - 'epicenterCode': 'epicenter_code', - 'epicenterDetailCode': 'epicenter_detail_code', - 'intensityCities': 'intensity_cities', - 'intensityPrefectures': 'intensity_prefectures', - 'intensityRegions': 'intensity_regions', - 'intensityStations': 'intensity_stations', - 'lpgmIntensityPrefectures': 'lpgm_intensity_prefectures', - 'lpgmIntensityRegions': 'lpgm_intensity_regions', - 'lpgmIntenstiyStations': 'lpgm_intenstiy_stations', - 'magnitudeCondition': 'magnitude_condition', - 'maxIntensity': 'max_intensity', - 'maxIntensityRegionIds': 'max_intensity_region_ids', - 'maxLpgmIntensity': 'max_lpgm_intensity', - 'originTime': 'origin_time' - }, +_$EarthquakeV1Impl _$$EarthquakeV1ImplFromJson( + Map json, +) => $checkedCreate( + r'_$EarthquakeV1Impl', + json, + ($checkedConvert) { + final val = _$EarthquakeV1Impl( + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + status: $checkedConvert('status', (v) => v as String), + arrivalTime: $checkedConvert( + 'arrival_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), + epicenterCode: $checkedConvert( + 'epicenter_code', + (v) => (v as num?)?.toInt(), + ), + epicenterDetailCode: $checkedConvert( + 'epicenter_detail_code', + (v) => (v as num?)?.toInt(), + ), + headline: $checkedConvert('headline', (v) => v as String?), + intensityCities: $checkedConvert( + 'intensity_cities', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + intensityPrefectures: $checkedConvert( + 'intensity_prefectures', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + intensityRegions: $checkedConvert( + 'intensity_regions', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + intensityStations: $checkedConvert( + 'intensity_stations', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), + longitude: $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), + lpgmIntensityPrefectures: $checkedConvert( + 'lpgm_intensity_prefectures', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionLpgmIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + lpgmIntensityRegions: $checkedConvert( + 'lpgm_intensity_regions', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionLpgmIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + lpgmIntenstiyStations: $checkedConvert( + 'lpgm_intenstiy_stations', + (v) => + (v as List?) + ?.map( + (e) => ObservedRegionLpgmIntensity.fromJson( + e as Map, + ), + ) + .toList(), + ), + magnitude: $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), + magnitudeCondition: $checkedConvert( + 'magnitude_condition', + (v) => v as String?, + ), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v), + ), + maxIntensityRegionIds: $checkedConvert( + 'max_intensity_region_ids', + (v) => (v as List?)?.map((e) => (e as num).toInt()).toList(), + ), + maxLpgmIntensity: $checkedConvert( + 'max_lpgm_intensity', + (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v), + ), + originTime: $checkedConvert( + 'origin_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + text: $checkedConvert('text', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const { + 'eventId': 'event_id', + 'arrivalTime': 'arrival_time', + 'epicenterCode': 'epicenter_code', + 'epicenterDetailCode': 'epicenter_detail_code', + 'intensityCities': 'intensity_cities', + 'intensityPrefectures': 'intensity_prefectures', + 'intensityRegions': 'intensity_regions', + 'intensityStations': 'intensity_stations', + 'lpgmIntensityPrefectures': 'lpgm_intensity_prefectures', + 'lpgmIntensityRegions': 'lpgm_intensity_regions', + 'lpgmIntenstiyStations': 'lpgm_intenstiy_stations', + 'magnitudeCondition': 'magnitude_condition', + 'maxIntensity': 'max_intensity', + 'maxIntensityRegionIds': 'max_intensity_region_ids', + 'maxLpgmIntensity': 'max_lpgm_intensity', + 'originTime': 'origin_time', + }, +); Map _$$EarthquakeV1ImplToJson(_$EarthquakeV1Impl instance) => { @@ -157,127 +204,139 @@ const _$JmaLgIntensityEnumMap = { }; _$EarthquakeV1BaseImpl _$$EarthquakeV1BaseImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeV1BaseImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeV1BaseImpl( - eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), - status: $checkedConvert('status', (v) => v as String), - arrivalTime: $checkedConvert('arrival_time', - (v) => v == null ? null : DateTime.parse(v as String)), - depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), - epicenterCode: - $checkedConvert('epicenter_code', (v) => (v as num?)?.toInt()), - epicenterDetailCode: $checkedConvert( - 'epicenter_detail_code', (v) => (v as num?)?.toInt()), - headline: $checkedConvert('headline', (v) => v as String?), - latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), - longitude: - $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), - magnitude: - $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), - magnitudeCondition: - $checkedConvert('magnitude_condition', (v) => v as String?), - maxIntensity: $checkedConvert('max_intensity', - (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v)), - maxIntensityRegionIds: $checkedConvert( - 'max_intensity_region_ids', - (v) => (v as List?) - ?.map((e) => (e as num).toInt()) - .toList()), - maxLpgmIntensity: $checkedConvert('max_lpgm_intensity', - (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), - originTime: $checkedConvert('origin_time', - (v) => v == null ? null : DateTime.parse(v as String)), - text: $checkedConvert('text', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const { - 'eventId': 'event_id', - 'arrivalTime': 'arrival_time', - 'epicenterCode': 'epicenter_code', - 'epicenterDetailCode': 'epicenter_detail_code', - 'magnitudeCondition': 'magnitude_condition', - 'maxIntensity': 'max_intensity', - 'maxIntensityRegionIds': 'max_intensity_region_ids', - 'maxLpgmIntensity': 'max_lpgm_intensity', - 'originTime': 'origin_time' - }, + Map json, +) => $checkedCreate( + r'_$EarthquakeV1BaseImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeV1BaseImpl( + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + status: $checkedConvert('status', (v) => v as String), + arrivalTime: $checkedConvert( + 'arrival_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), + epicenterCode: $checkedConvert( + 'epicenter_code', + (v) => (v as num?)?.toInt(), + ), + epicenterDetailCode: $checkedConvert( + 'epicenter_detail_code', + (v) => (v as num?)?.toInt(), + ), + headline: $checkedConvert('headline', (v) => v as String?), + latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), + longitude: $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), + magnitude: $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), + magnitudeCondition: $checkedConvert( + 'magnitude_condition', + (v) => v as String?, + ), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v), + ), + maxIntensityRegionIds: $checkedConvert( + 'max_intensity_region_ids', + (v) => (v as List?)?.map((e) => (e as num).toInt()).toList(), + ), + maxLpgmIntensity: $checkedConvert( + 'max_lpgm_intensity', + (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v), + ), + originTime: $checkedConvert( + 'origin_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + text: $checkedConvert('text', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const { + 'eventId': 'event_id', + 'arrivalTime': 'arrival_time', + 'epicenterCode': 'epicenter_code', + 'epicenterDetailCode': 'epicenter_detail_code', + 'magnitudeCondition': 'magnitude_condition', + 'maxIntensity': 'max_intensity', + 'maxIntensityRegionIds': 'max_intensity_region_ids', + 'maxLpgmIntensity': 'max_lpgm_intensity', + 'originTime': 'origin_time', + }, +); Map _$$EarthquakeV1BaseImplToJson( - _$EarthquakeV1BaseImpl instance) => - { - 'event_id': instance.eventId, - 'status': instance.status, - 'arrival_time': instance.arrivalTime?.toIso8601String(), - 'depth': instance.depth, - 'epicenter_code': instance.epicenterCode, - 'epicenter_detail_code': instance.epicenterDetailCode, - 'headline': instance.headline, - 'latitude': instance.latitude, - 'longitude': instance.longitude, - 'magnitude': instance.magnitude, - 'magnitude_condition': instance.magnitudeCondition, - 'max_intensity': _$JmaIntensityEnumMap[instance.maxIntensity], - 'max_intensity_region_ids': instance.maxIntensityRegionIds, - 'max_lpgm_intensity': _$JmaLgIntensityEnumMap[instance.maxLpgmIntensity], - 'origin_time': instance.originTime?.toIso8601String(), - 'text': instance.text, - }; + _$EarthquakeV1BaseImpl instance, +) => { + 'event_id': instance.eventId, + 'status': instance.status, + 'arrival_time': instance.arrivalTime?.toIso8601String(), + 'depth': instance.depth, + 'epicenter_code': instance.epicenterCode, + 'epicenter_detail_code': instance.epicenterDetailCode, + 'headline': instance.headline, + 'latitude': instance.latitude, + 'longitude': instance.longitude, + 'magnitude': instance.magnitude, + 'magnitude_condition': instance.magnitudeCondition, + 'max_intensity': _$JmaIntensityEnumMap[instance.maxIntensity], + 'max_intensity_region_ids': instance.maxIntensityRegionIds, + 'max_lpgm_intensity': _$JmaLgIntensityEnumMap[instance.maxLpgmIntensity], + 'origin_time': instance.originTime?.toIso8601String(), + 'text': instance.text, +}; _$ObservedRegionIntensityImpl _$$ObservedRegionIntensityImplFromJson( - Map json) => - $checkedCreate( - r'_$ObservedRegionIntensityImpl', - json, - ($checkedConvert) { - final val = _$ObservedRegionIntensityImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - intensity: $checkedConvert( - 'maxInt', (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const {'intensity': 'maxInt'}, - ); + Map json, +) => $checkedCreate(r'_$ObservedRegionIntensityImpl', json, ($checkedConvert) { + final val = _$ObservedRegionIntensityImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + intensity: $checkedConvert( + 'maxInt', + (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v), + ), + ); + return val; +}, fieldKeyMap: const {'intensity': 'maxInt'}); Map _$$ObservedRegionIntensityImplToJson( - _$ObservedRegionIntensityImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'maxInt': _$JmaIntensityEnumMap[instance.intensity], - }; + _$ObservedRegionIntensityImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'maxInt': _$JmaIntensityEnumMap[instance.intensity], +}; _$ObservedRegionLpgmIntensityImpl _$$ObservedRegionLpgmIntensityImplFromJson( - Map json) => - $checkedCreate( - r'_$ObservedRegionLpgmIntensityImpl', - json, - ($checkedConvert) { - final val = _$ObservedRegionLpgmIntensityImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - intensity: $checkedConvert( - 'maxInt', (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v)), - lpgmIntensity: $checkedConvert('maxLgInt', - (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const {'intensity': 'maxInt', 'lpgmIntensity': 'maxLgInt'}, + Map json, +) => $checkedCreate( + r'_$ObservedRegionLpgmIntensityImpl', + json, + ($checkedConvert) { + final val = _$ObservedRegionLpgmIntensityImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + intensity: $checkedConvert( + 'maxInt', + (v) => $enumDecodeNullable(_$JmaIntensityEnumMap, v), + ), + lpgmIntensity: $checkedConvert( + 'maxLgInt', + (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const {'intensity': 'maxInt', 'lpgmIntensity': 'maxLgInt'}, +); Map _$$ObservedRegionLpgmIntensityImplToJson( - _$ObservedRegionLpgmIntensityImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'maxInt': _$JmaIntensityEnumMap[instance.intensity], - 'maxLgInt': _$JmaLgIntensityEnumMap[instance.lpgmIntensity], - }; + _$ObservedRegionLpgmIntensityImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'maxInt': _$JmaIntensityEnumMap[instance.intensity], + 'maxLgInt': _$JmaLgIntensityEnumMap[instance.lpgmIntensity], +}; diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake_early.dart b/packages/eqapi_types/lib/src/model/v1/earthquake_early.dart index 39081f35..688dcacd 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake_early.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake_early.dart @@ -23,12 +23,4 @@ class EarthquakeEarly with _$EarthquakeEarly { _$EarthquakeEarlyFromJson(json); } -enum OriginTimePrecision { - month, - day, - hour, - minute, - second, - millisecond, - ; -} +enum OriginTimePrecision { month, day, hour, minute, second, millisecond } diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake_early.freezed.dart b/packages/eqapi_types/lib/src/model/v1/earthquake_early.freezed.dart index 260e18ca..c558e342 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake_early.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake_early.freezed.dart @@ -12,7 +12,8 @@ part of 'earthquake_early.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EarthquakeEarly _$EarthquakeEarlyFromJson(Map json) { return _EarthquakeEarly.fromJson(json); @@ -45,20 +46,22 @@ mixin _$EarthquakeEarly { /// @nodoc abstract class $EarthquakeEarlyCopyWith<$Res> { factory $EarthquakeEarlyCopyWith( - EarthquakeEarly value, $Res Function(EarthquakeEarly) then) = - _$EarthquakeEarlyCopyWithImpl<$Res, EarthquakeEarly>; + EarthquakeEarly value, + $Res Function(EarthquakeEarly) then, + ) = _$EarthquakeEarlyCopyWithImpl<$Res, EarthquakeEarly>; @useResult - $Res call( - {String id, - int? depth, - double? latitude, - double? longitude, - double? magnitude, - JmaForecastIntensity? maxIntensity, - bool maxIntensityIsEarly, - String name, - DateTime originTime, - OriginTimePrecision originTimePrecision}); + $Res call({ + String id, + int? depth, + double? latitude, + double? longitude, + double? magnitude, + JmaForecastIntensity? maxIntensity, + bool maxIntensityIsEarly, + String name, + DateTime originTime, + OriginTimePrecision originTimePrecision, + }); } /// @nodoc @@ -87,70 +90,85 @@ class _$EarthquakeEarlyCopyWithImpl<$Res, $Val extends EarthquakeEarly> Object? originTime = null, Object? originTimePrecision = null, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - maxIntensityIsEarly: null == maxIntensityIsEarly - ? _value.maxIntensityIsEarly - : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable - as bool, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - originTime: null == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime, - originTimePrecision: null == originTimePrecision - ? _value.originTimePrecision - : originTimePrecision // ignore: cast_nullable_to_non_nullable - as OriginTimePrecision, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + maxIntensityIsEarly: + null == maxIntensityIsEarly + ? _value.maxIntensityIsEarly + : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable + as bool, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + originTime: + null == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime, + originTimePrecision: + null == originTimePrecision + ? _value.originTimePrecision + : originTimePrecision // ignore: cast_nullable_to_non_nullable + as OriginTimePrecision, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeEarlyImplCopyWith<$Res> implements $EarthquakeEarlyCopyWith<$Res> { - factory _$$EarthquakeEarlyImplCopyWith(_$EarthquakeEarlyImpl value, - $Res Function(_$EarthquakeEarlyImpl) then) = - __$$EarthquakeEarlyImplCopyWithImpl<$Res>; + factory _$$EarthquakeEarlyImplCopyWith( + _$EarthquakeEarlyImpl value, + $Res Function(_$EarthquakeEarlyImpl) then, + ) = __$$EarthquakeEarlyImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - int? depth, - double? latitude, - double? longitude, - double? magnitude, - JmaForecastIntensity? maxIntensity, - bool maxIntensityIsEarly, - String name, - DateTime originTime, - OriginTimePrecision originTimePrecision}); + $Res call({ + String id, + int? depth, + double? latitude, + double? longitude, + double? magnitude, + JmaForecastIntensity? maxIntensity, + bool maxIntensityIsEarly, + String name, + DateTime originTime, + OriginTimePrecision originTimePrecision, + }); } /// @nodoc @@ -158,8 +176,9 @@ class __$$EarthquakeEarlyImplCopyWithImpl<$Res> extends _$EarthquakeEarlyCopyWithImpl<$Res, _$EarthquakeEarlyImpl> implements _$$EarthquakeEarlyImplCopyWith<$Res> { __$$EarthquakeEarlyImplCopyWithImpl( - _$EarthquakeEarlyImpl _value, $Res Function(_$EarthquakeEarlyImpl) _then) - : super(_value, _then); + _$EarthquakeEarlyImpl _value, + $Res Function(_$EarthquakeEarlyImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeEarly /// with the given fields replaced by the non-null parameter values. @@ -177,65 +196,78 @@ class __$$EarthquakeEarlyImplCopyWithImpl<$Res> Object? originTime = null, Object? originTimePrecision = null, }) { - return _then(_$EarthquakeEarlyImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - maxIntensityIsEarly: null == maxIntensityIsEarly - ? _value.maxIntensityIsEarly - : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable - as bool, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - originTime: null == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime, - originTimePrecision: null == originTimePrecision - ? _value.originTimePrecision - : originTimePrecision // ignore: cast_nullable_to_non_nullable - as OriginTimePrecision, - )); + return _then( + _$EarthquakeEarlyImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + maxIntensityIsEarly: + null == maxIntensityIsEarly + ? _value.maxIntensityIsEarly + : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable + as bool, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + originTime: + null == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime, + originTimePrecision: + null == originTimePrecision + ? _value.originTimePrecision + : originTimePrecision // ignore: cast_nullable_to_non_nullable + as OriginTimePrecision, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeEarlyImpl implements _EarthquakeEarly { - const _$EarthquakeEarlyImpl( - {required this.id, - required this.depth, - required this.latitude, - required this.longitude, - required this.magnitude, - required this.maxIntensity, - required this.maxIntensityIsEarly, - required this.name, - required this.originTime, - required this.originTimePrecision}); + const _$EarthquakeEarlyImpl({ + required this.id, + required this.depth, + required this.latitude, + required this.longitude, + required this.magnitude, + required this.maxIntensity, + required this.maxIntensityIsEarly, + required this.name, + required this.originTime, + required this.originTimePrecision, + }); factory _$EarthquakeEarlyImpl.fromJson(Map json) => _$$EarthquakeEarlyImplFromJson(json); @@ -293,17 +325,18 @@ class _$EarthquakeEarlyImpl implements _EarthquakeEarly { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - id, - depth, - latitude, - longitude, - magnitude, - maxIntensity, - maxIntensityIsEarly, - name, - originTime, - originTimePrecision); + runtimeType, + id, + depth, + latitude, + longitude, + magnitude, + maxIntensity, + maxIntensityIsEarly, + name, + originTime, + originTimePrecision, + ); /// Create a copy of EarthquakeEarly /// with the given fields replaced by the non-null parameter values. @@ -312,29 +345,29 @@ class _$EarthquakeEarlyImpl implements _EarthquakeEarly { @pragma('vm:prefer-inline') _$$EarthquakeEarlyImplCopyWith<_$EarthquakeEarlyImpl> get copyWith => __$$EarthquakeEarlyImplCopyWithImpl<_$EarthquakeEarlyImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeEarlyImplToJson( - this, - ); + return _$$EarthquakeEarlyImplToJson(this); } } abstract class _EarthquakeEarly implements EarthquakeEarly { - const factory _EarthquakeEarly( - {required final String id, - required final int? depth, - required final double? latitude, - required final double? longitude, - required final double? magnitude, - required final JmaForecastIntensity? maxIntensity, - required final bool maxIntensityIsEarly, - required final String name, - required final DateTime originTime, - required final OriginTimePrecision originTimePrecision}) = - _$EarthquakeEarlyImpl; + const factory _EarthquakeEarly({ + required final String id, + required final int? depth, + required final double? latitude, + required final double? longitude, + required final double? magnitude, + required final JmaForecastIntensity? maxIntensity, + required final bool maxIntensityIsEarly, + required final String name, + required final DateTime originTime, + required final OriginTimePrecision originTimePrecision, + }) = _$EarthquakeEarlyImpl; factory _EarthquakeEarly.fromJson(Map json) = _$EarthquakeEarlyImpl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake_early.g.dart b/packages/eqapi_types/lib/src/model/v1/earthquake_early.g.dart index 54439fc7..dee9c27c 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake_early.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake_early.g.dart @@ -9,54 +9,60 @@ part of 'earthquake_early.dart'; // ************************************************************************** _$EarthquakeEarlyImpl _$$EarthquakeEarlyImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeEarlyImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeEarlyImpl( - id: $checkedConvert('id', (v) => v as String), - depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), - latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), - longitude: - $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), - magnitude: - $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), - maxIntensity: $checkedConvert('max_intensity', - (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v)), - maxIntensityIsEarly: - $checkedConvert('max_intensity_is_early', (v) => v as bool), - name: $checkedConvert('name', (v) => v as String), - originTime: $checkedConvert( - 'origin_time', (v) => DateTime.parse(v as String)), - originTimePrecision: $checkedConvert('origin_time_precision', - (v) => $enumDecode(_$OriginTimePrecisionEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const { - 'maxIntensity': 'max_intensity', - 'maxIntensityIsEarly': 'max_intensity_is_early', - 'originTime': 'origin_time', - 'originTimePrecision': 'origin_time_precision' - }, + Map json, +) => $checkedCreate( + r'_$EarthquakeEarlyImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeEarlyImpl( + id: $checkedConvert('id', (v) => v as String), + depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), + latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), + longitude: $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), + magnitude: $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v), + ), + maxIntensityIsEarly: $checkedConvert( + 'max_intensity_is_early', + (v) => v as bool, + ), + name: $checkedConvert('name', (v) => v as String), + originTime: $checkedConvert( + 'origin_time', + (v) => DateTime.parse(v as String), + ), + originTimePrecision: $checkedConvert( + 'origin_time_precision', + (v) => $enumDecode(_$OriginTimePrecisionEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const { + 'maxIntensity': 'max_intensity', + 'maxIntensityIsEarly': 'max_intensity_is_early', + 'originTime': 'origin_time', + 'originTimePrecision': 'origin_time_precision', + }, +); Map _$$EarthquakeEarlyImplToJson( - _$EarthquakeEarlyImpl instance) => - { - 'id': instance.id, - 'depth': instance.depth, - 'latitude': instance.latitude, - 'longitude': instance.longitude, - 'magnitude': instance.magnitude, - 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity], - 'max_intensity_is_early': instance.maxIntensityIsEarly, - 'name': instance.name, - 'origin_time': instance.originTime.toIso8601String(), - 'origin_time_precision': - _$OriginTimePrecisionEnumMap[instance.originTimePrecision]!, - }; + _$EarthquakeEarlyImpl instance, +) => { + 'id': instance.id, + 'depth': instance.depth, + 'latitude': instance.latitude, + 'longitude': instance.longitude, + 'magnitude': instance.magnitude, + 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity], + 'max_intensity_is_early': instance.maxIntensityIsEarly, + 'name': instance.name, + 'origin_time': instance.originTime.toIso8601String(), + 'origin_time_precision': + _$OriginTimePrecisionEnumMap[instance.originTimePrecision]!, +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.freezed.dart b/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.freezed.dart index 74d9c7b9..fb2fa443 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.freezed.dart @@ -12,7 +12,8 @@ part of 'earthquake_early_event.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EarthquakeEarlyEvent _$EarthquakeEarlyEventFromJson(Map json) { return _EarthquakeEarlyEvent.fromJson(json); @@ -46,28 +47,32 @@ mixin _$EarthquakeEarlyEvent { /// @nodoc abstract class $EarthquakeEarlyEventCopyWith<$Res> { - factory $EarthquakeEarlyEventCopyWith(EarthquakeEarlyEvent value, - $Res Function(EarthquakeEarlyEvent) then) = - _$EarthquakeEarlyEventCopyWithImpl<$Res, EarthquakeEarlyEvent>; + factory $EarthquakeEarlyEventCopyWith( + EarthquakeEarlyEvent value, + $Res Function(EarthquakeEarlyEvent) then, + ) = _$EarthquakeEarlyEventCopyWithImpl<$Res, EarthquakeEarlyEvent>; @useResult - $Res call( - {String id, - String name, - double? lat, - double? lon, - double? depth, - double? magnitude, - DateTime originTime, - OriginTimePrecision originTimePrecision, - JmaForecastIntensity? maxIntensity, - bool maxIntensityIsEarly, - List regions, - List cities}); + $Res call({ + String id, + String name, + double? lat, + double? lon, + double? depth, + double? magnitude, + DateTime originTime, + OriginTimePrecision originTimePrecision, + JmaForecastIntensity? maxIntensity, + bool maxIntensityIsEarly, + List regions, + List cities, + }); } /// @nodoc -class _$EarthquakeEarlyEventCopyWithImpl<$Res, - $Val extends EarthquakeEarlyEvent> +class _$EarthquakeEarlyEventCopyWithImpl< + $Res, + $Val extends EarthquakeEarlyEvent +> implements $EarthquakeEarlyEventCopyWith<$Res> { _$EarthquakeEarlyEventCopyWithImpl(this._value, this._then); @@ -94,89 +99,107 @@ class _$EarthquakeEarlyEventCopyWithImpl<$Res, Object? regions = null, Object? cities = null, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - lat: freezed == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double?, - lon: freezed == lon - ? _value.lon - : lon // ignore: cast_nullable_to_non_nullable - as double?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - originTime: null == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime, - originTimePrecision: null == originTimePrecision - ? _value.originTimePrecision - : originTimePrecision // ignore: cast_nullable_to_non_nullable - as OriginTimePrecision, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - maxIntensityIsEarly: null == maxIntensityIsEarly - ? _value.maxIntensityIsEarly - : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable - as bool, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - cities: null == cities - ? _value.cities - : cities // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + lat: + freezed == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double?, + lon: + freezed == lon + ? _value.lon + : lon // ignore: cast_nullable_to_non_nullable + as double?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + originTime: + null == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime, + originTimePrecision: + null == originTimePrecision + ? _value.originTimePrecision + : originTimePrecision // ignore: cast_nullable_to_non_nullable + as OriginTimePrecision, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + maxIntensityIsEarly: + null == maxIntensityIsEarly + ? _value.maxIntensityIsEarly + : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable + as bool, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + cities: + null == cities + ? _value.cities + : cities // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeEarlyEventImplCopyWith<$Res> implements $EarthquakeEarlyEventCopyWith<$Res> { - factory _$$EarthquakeEarlyEventImplCopyWith(_$EarthquakeEarlyEventImpl value, - $Res Function(_$EarthquakeEarlyEventImpl) then) = - __$$EarthquakeEarlyEventImplCopyWithImpl<$Res>; + factory _$$EarthquakeEarlyEventImplCopyWith( + _$EarthquakeEarlyEventImpl value, + $Res Function(_$EarthquakeEarlyEventImpl) then, + ) = __$$EarthquakeEarlyEventImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String id, - String name, - double? lat, - double? lon, - double? depth, - double? magnitude, - DateTime originTime, - OriginTimePrecision originTimePrecision, - JmaForecastIntensity? maxIntensity, - bool maxIntensityIsEarly, - List regions, - List cities}); + $Res call({ + String id, + String name, + double? lat, + double? lon, + double? depth, + double? magnitude, + DateTime originTime, + OriginTimePrecision originTimePrecision, + JmaForecastIntensity? maxIntensity, + bool maxIntensityIsEarly, + List regions, + List cities, + }); } /// @nodoc class __$$EarthquakeEarlyEventImplCopyWithImpl<$Res> extends _$EarthquakeEarlyEventCopyWithImpl<$Res, _$EarthquakeEarlyEventImpl> implements _$$EarthquakeEarlyEventImplCopyWith<$Res> { - __$$EarthquakeEarlyEventImplCopyWithImpl(_$EarthquakeEarlyEventImpl _value, - $Res Function(_$EarthquakeEarlyEventImpl) _then) - : super(_value, _then); + __$$EarthquakeEarlyEventImplCopyWithImpl( + _$EarthquakeEarlyEventImpl _value, + $Res Function(_$EarthquakeEarlyEventImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeEarlyEvent /// with the given fields replaced by the non-null parameter values. @@ -196,77 +219,91 @@ class __$$EarthquakeEarlyEventImplCopyWithImpl<$Res> Object? regions = null, Object? cities = null, }) { - return _then(_$EarthquakeEarlyEventImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - lat: freezed == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double?, - lon: freezed == lon - ? _value.lon - : lon // ignore: cast_nullable_to_non_nullable - as double?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - originTime: null == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime, - originTimePrecision: null == originTimePrecision - ? _value.originTimePrecision - : originTimePrecision // ignore: cast_nullable_to_non_nullable - as OriginTimePrecision, - maxIntensity: freezed == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - maxIntensityIsEarly: null == maxIntensityIsEarly - ? _value.maxIntensityIsEarly - : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable - as bool, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - cities: null == cities - ? _value._cities - : cities // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$EarthquakeEarlyEventImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + lat: + freezed == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double?, + lon: + freezed == lon + ? _value.lon + : lon // ignore: cast_nullable_to_non_nullable + as double?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + originTime: + null == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime, + originTimePrecision: + null == originTimePrecision + ? _value.originTimePrecision + : originTimePrecision // ignore: cast_nullable_to_non_nullable + as OriginTimePrecision, + maxIntensity: + freezed == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + maxIntensityIsEarly: + null == maxIntensityIsEarly + ? _value.maxIntensityIsEarly + : maxIntensityIsEarly // ignore: cast_nullable_to_non_nullable + as bool, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + cities: + null == cities + ? _value._cities + : cities // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeEarlyEventImpl implements _EarthquakeEarlyEvent { - const _$EarthquakeEarlyEventImpl( - {required this.id, - required this.name, - required this.lat, - required this.lon, - required this.depth, - required this.magnitude, - required this.originTime, - required this.originTimePrecision, - required this.maxIntensity, - required this.maxIntensityIsEarly, - required final List regions, - required final List cities}) - : _regions = regions, - _cities = cities; + const _$EarthquakeEarlyEventImpl({ + required this.id, + required this.name, + required this.lat, + required this.lon, + required this.depth, + required this.magnitude, + required this.originTime, + required this.originTimePrecision, + required this.maxIntensity, + required this.maxIntensityIsEarly, + required final List regions, + required final List cities, + }) : _regions = regions, + _cities = cities; factory _$EarthquakeEarlyEventImpl.fromJson(Map json) => _$$EarthquakeEarlyEventImplFromJson(json); @@ -339,19 +376,20 @@ class _$EarthquakeEarlyEventImpl implements _EarthquakeEarlyEvent { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - id, - name, - lat, - lon, - depth, - magnitude, - originTime, - originTimePrecision, - maxIntensity, - maxIntensityIsEarly, - const DeepCollectionEquality().hash(_regions), - const DeepCollectionEquality().hash(_cities)); + runtimeType, + id, + name, + lat, + lon, + depth, + magnitude, + originTime, + originTimePrecision, + maxIntensity, + maxIntensityIsEarly, + const DeepCollectionEquality().hash(_regions), + const DeepCollectionEquality().hash(_cities), + ); /// Create a copy of EarthquakeEarlyEvent /// with the given fields replaced by the non-null parameter values. @@ -359,33 +397,33 @@ class _$EarthquakeEarlyEventImpl implements _EarthquakeEarlyEvent { @override @pragma('vm:prefer-inline') _$$EarthquakeEarlyEventImplCopyWith<_$EarthquakeEarlyEventImpl> - get copyWith => - __$$EarthquakeEarlyEventImplCopyWithImpl<_$EarthquakeEarlyEventImpl>( - this, _$identity); + get copyWith => + __$$EarthquakeEarlyEventImplCopyWithImpl<_$EarthquakeEarlyEventImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeEarlyEventImplToJson( - this, - ); + return _$$EarthquakeEarlyEventImplToJson(this); } } abstract class _EarthquakeEarlyEvent implements EarthquakeEarlyEvent { - const factory _EarthquakeEarlyEvent( - {required final String id, - required final String name, - required final double? lat, - required final double? lon, - required final double? depth, - required final double? magnitude, - required final DateTime originTime, - required final OriginTimePrecision originTimePrecision, - required final JmaForecastIntensity? maxIntensity, - required final bool maxIntensityIsEarly, - required final List regions, - required final List cities}) = - _$EarthquakeEarlyEventImpl; + const factory _EarthquakeEarlyEvent({ + required final String id, + required final String name, + required final double? lat, + required final double? lon, + required final double? depth, + required final double? magnitude, + required final DateTime originTime, + required final OriginTimePrecision originTimePrecision, + required final JmaForecastIntensity? maxIntensity, + required final bool maxIntensityIsEarly, + required final List regions, + required final List cities, + }) = _$EarthquakeEarlyEventImpl; factory _EarthquakeEarlyEvent.fromJson(Map json) = _$EarthquakeEarlyEventImpl.fromJson; @@ -420,11 +458,12 @@ abstract class _EarthquakeEarlyEvent implements EarthquakeEarlyEvent { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeEarlyEventImplCopyWith<_$EarthquakeEarlyEventImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } EarthquakeEarlyRegion _$EarthquakeEarlyRegionFromJson( - Map json) { + Map json, +) { return _EarthquakeEarlyRegion.fromJson(json); } @@ -446,16 +485,19 @@ mixin _$EarthquakeEarlyRegion { /// @nodoc abstract class $EarthquakeEarlyRegionCopyWith<$Res> { - factory $EarthquakeEarlyRegionCopyWith(EarthquakeEarlyRegion value, - $Res Function(EarthquakeEarlyRegion) then) = - _$EarthquakeEarlyRegionCopyWithImpl<$Res, EarthquakeEarlyRegion>; + factory $EarthquakeEarlyRegionCopyWith( + EarthquakeEarlyRegion value, + $Res Function(EarthquakeEarlyRegion) then, + ) = _$EarthquakeEarlyRegionCopyWithImpl<$Res, EarthquakeEarlyRegion>; @useResult $Res call({String name, String code, JmaForecastIntensity maxIntensity}); } /// @nodoc -class _$EarthquakeEarlyRegionCopyWithImpl<$Res, - $Val extends EarthquakeEarlyRegion> +class _$EarthquakeEarlyRegionCopyWithImpl< + $Res, + $Val extends EarthquakeEarlyRegion +> implements $EarthquakeEarlyRegionCopyWith<$Res> { _$EarthquakeEarlyRegionCopyWithImpl(this._value, this._then); @@ -473,20 +515,26 @@ class _$EarthquakeEarlyRegionCopyWithImpl<$Res, Object? code = null, Object? maxIntensity = null, }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - ) as $Val); + return _then( + _value.copyWith( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ) + as $Val, + ); } } @@ -494,9 +542,9 @@ class _$EarthquakeEarlyRegionCopyWithImpl<$Res, abstract class _$$EarthquakeEarlyRegionImplCopyWith<$Res> implements $EarthquakeEarlyRegionCopyWith<$Res> { factory _$$EarthquakeEarlyRegionImplCopyWith( - _$EarthquakeEarlyRegionImpl value, - $Res Function(_$EarthquakeEarlyRegionImpl) then) = - __$$EarthquakeEarlyRegionImplCopyWithImpl<$Res>; + _$EarthquakeEarlyRegionImpl value, + $Res Function(_$EarthquakeEarlyRegionImpl) then, + ) = __$$EarthquakeEarlyRegionImplCopyWithImpl<$Res>; @override @useResult $Res call({String name, String code, JmaForecastIntensity maxIntensity}); @@ -504,12 +552,13 @@ abstract class _$$EarthquakeEarlyRegionImplCopyWith<$Res> /// @nodoc class __$$EarthquakeEarlyRegionImplCopyWithImpl<$Res> - extends _$EarthquakeEarlyRegionCopyWithImpl<$Res, - _$EarthquakeEarlyRegionImpl> + extends + _$EarthquakeEarlyRegionCopyWithImpl<$Res, _$EarthquakeEarlyRegionImpl> implements _$$EarthquakeEarlyRegionImplCopyWith<$Res> { - __$$EarthquakeEarlyRegionImplCopyWithImpl(_$EarthquakeEarlyRegionImpl _value, - $Res Function(_$EarthquakeEarlyRegionImpl) _then) - : super(_value, _then); + __$$EarthquakeEarlyRegionImplCopyWithImpl( + _$EarthquakeEarlyRegionImpl _value, + $Res Function(_$EarthquakeEarlyRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeEarlyRegion /// with the given fields replaced by the non-null parameter values. @@ -520,28 +569,36 @@ class __$$EarthquakeEarlyRegionImplCopyWithImpl<$Res> Object? code = null, Object? maxIntensity = null, }) { - return _then(_$EarthquakeEarlyRegionImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - )); + return _then( + _$EarthquakeEarlyRegionImpl( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeEarlyRegionImpl implements _EarthquakeEarlyRegion { - const _$EarthquakeEarlyRegionImpl( - {required this.name, required this.code, required this.maxIntensity}); + const _$EarthquakeEarlyRegionImpl({ + required this.name, + required this.code, + required this.maxIntensity, + }); factory _$EarthquakeEarlyRegionImpl.fromJson(Map json) => _$$EarthquakeEarlyRegionImplFromJson(json); @@ -579,23 +636,24 @@ class _$EarthquakeEarlyRegionImpl implements _EarthquakeEarlyRegion { @override @pragma('vm:prefer-inline') _$$EarthquakeEarlyRegionImplCopyWith<_$EarthquakeEarlyRegionImpl> - get copyWith => __$$EarthquakeEarlyRegionImplCopyWithImpl< - _$EarthquakeEarlyRegionImpl>(this, _$identity); + get copyWith => + __$$EarthquakeEarlyRegionImplCopyWithImpl<_$EarthquakeEarlyRegionImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeEarlyRegionImplToJson( - this, - ); + return _$$EarthquakeEarlyRegionImplToJson(this); } } abstract class _EarthquakeEarlyRegion implements EarthquakeEarlyRegion { - const factory _EarthquakeEarlyRegion( - {required final String name, - required final String code, - required final JmaForecastIntensity maxIntensity}) = - _$EarthquakeEarlyRegionImpl; + const factory _EarthquakeEarlyRegion({ + required final String name, + required final String code, + required final JmaForecastIntensity maxIntensity, + }) = _$EarthquakeEarlyRegionImpl; factory _EarthquakeEarlyRegion.fromJson(Map json) = _$EarthquakeEarlyRegionImpl.fromJson; @@ -612,7 +670,7 @@ abstract class _EarthquakeEarlyRegion implements EarthquakeEarlyRegion { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeEarlyRegionImplCopyWith<_$EarthquakeEarlyRegionImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } EarthquakeEarlyCity _$EarthquakeEarlyCityFromJson(Map json) { @@ -640,14 +698,16 @@ mixin _$EarthquakeEarlyCity { /// @nodoc abstract class $EarthquakeEarlyCityCopyWith<$Res> { factory $EarthquakeEarlyCityCopyWith( - EarthquakeEarlyCity value, $Res Function(EarthquakeEarlyCity) then) = - _$EarthquakeEarlyCityCopyWithImpl<$Res, EarthquakeEarlyCity>; + EarthquakeEarlyCity value, + $Res Function(EarthquakeEarlyCity) then, + ) = _$EarthquakeEarlyCityCopyWithImpl<$Res, EarthquakeEarlyCity>; @useResult - $Res call( - {String name, - String? code, - JmaForecastIntensity maxIntensity, - List observationPoints}); + $Res call({ + String name, + String? code, + JmaForecastIntensity maxIntensity, + List observationPoints, + }); } /// @nodoc @@ -670,49 +730,59 @@ class _$EarthquakeEarlyCityCopyWithImpl<$Res, $Val extends EarthquakeEarlyCity> Object? maxIntensity = null, Object? observationPoints = null, }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String?, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - observationPoints: null == observationPoints - ? _value.observationPoints - : observationPoints // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + code: + freezed == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String?, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + observationPoints: + null == observationPoints + ? _value.observationPoints + : observationPoints // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeEarlyCityImplCopyWith<$Res> implements $EarthquakeEarlyCityCopyWith<$Res> { - factory _$$EarthquakeEarlyCityImplCopyWith(_$EarthquakeEarlyCityImpl value, - $Res Function(_$EarthquakeEarlyCityImpl) then) = - __$$EarthquakeEarlyCityImplCopyWithImpl<$Res>; + factory _$$EarthquakeEarlyCityImplCopyWith( + _$EarthquakeEarlyCityImpl value, + $Res Function(_$EarthquakeEarlyCityImpl) then, + ) = __$$EarthquakeEarlyCityImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String name, - String? code, - JmaForecastIntensity maxIntensity, - List observationPoints}); + $Res call({ + String name, + String? code, + JmaForecastIntensity maxIntensity, + List observationPoints, + }); } /// @nodoc class __$$EarthquakeEarlyCityImplCopyWithImpl<$Res> extends _$EarthquakeEarlyCityCopyWithImpl<$Res, _$EarthquakeEarlyCityImpl> implements _$$EarthquakeEarlyCityImplCopyWith<$Res> { - __$$EarthquakeEarlyCityImplCopyWithImpl(_$EarthquakeEarlyCityImpl _value, - $Res Function(_$EarthquakeEarlyCityImpl) _then) - : super(_value, _then); + __$$EarthquakeEarlyCityImplCopyWithImpl( + _$EarthquakeEarlyCityImpl _value, + $Res Function(_$EarthquakeEarlyCityImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeEarlyCity /// with the given fields replaced by the non-null parameter values. @@ -724,36 +794,42 @@ class __$$EarthquakeEarlyCityImplCopyWithImpl<$Res> Object? maxIntensity = null, Object? observationPoints = null, }) { - return _then(_$EarthquakeEarlyCityImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String?, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - observationPoints: null == observationPoints - ? _value._observationPoints - : observationPoints // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$EarthquakeEarlyCityImpl( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + code: + freezed == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String?, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + observationPoints: + null == observationPoints + ? _value._observationPoints + : observationPoints // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeEarlyCityImpl implements _EarthquakeEarlyCity { - const _$EarthquakeEarlyCityImpl( - {required this.name, - required this.code, - required this.maxIntensity, - required final List observationPoints}) - : _observationPoints = observationPoints; + const _$EarthquakeEarlyCityImpl({ + required this.name, + required this.code, + required this.maxIntensity, + required final List observationPoints, + }) : _observationPoints = observationPoints; factory _$EarthquakeEarlyCityImpl.fromJson(Map json) => _$$EarthquakeEarlyCityImplFromJson(json); @@ -787,14 +863,21 @@ class _$EarthquakeEarlyCityImpl implements _EarthquakeEarlyCity { (identical(other.code, code) || other.code == code) && (identical(other.maxIntensity, maxIntensity) || other.maxIntensity == maxIntensity) && - const DeepCollectionEquality() - .equals(other._observationPoints, _observationPoints)); + const DeepCollectionEquality().equals( + other._observationPoints, + _observationPoints, + )); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, name, code, maxIntensity, - const DeepCollectionEquality().hash(_observationPoints)); + int get hashCode => Object.hash( + runtimeType, + name, + code, + maxIntensity, + const DeepCollectionEquality().hash(_observationPoints), + ); /// Create a copy of EarthquakeEarlyCity /// with the given fields replaced by the non-null parameter values. @@ -803,23 +886,23 @@ class _$EarthquakeEarlyCityImpl implements _EarthquakeEarlyCity { @pragma('vm:prefer-inline') _$$EarthquakeEarlyCityImplCopyWith<_$EarthquakeEarlyCityImpl> get copyWith => __$$EarthquakeEarlyCityImplCopyWithImpl<_$EarthquakeEarlyCityImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeEarlyCityImplToJson( - this, - ); + return _$$EarthquakeEarlyCityImplToJson(this); } } abstract class _EarthquakeEarlyCity implements EarthquakeEarlyCity { - const factory _EarthquakeEarlyCity( - {required final String name, - required final String? code, - required final JmaForecastIntensity maxIntensity, - required final List - observationPoints}) = _$EarthquakeEarlyCityImpl; + const factory _EarthquakeEarlyCity({ + required final String name, + required final String? code, + required final JmaForecastIntensity maxIntensity, + required final List observationPoints, + }) = _$EarthquakeEarlyCityImpl; factory _EarthquakeEarlyCity.fromJson(Map json) = _$EarthquakeEarlyCityImpl.fromJson; @@ -842,7 +925,8 @@ abstract class _EarthquakeEarlyCity implements EarthquakeEarlyCity { } EarthquakeEarlyObservationPoint _$EarthquakeEarlyObservationPointFromJson( - Map json) { + Map json, +) { return _EarthquakeEarlyObservationPoint.fromJson(json); } @@ -860,24 +944,33 @@ mixin _$EarthquakeEarlyObservationPoint { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeEarlyObservationPointCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeEarlyObservationPointCopyWith<$Res> { factory $EarthquakeEarlyObservationPointCopyWith( - EarthquakeEarlyObservationPoint value, - $Res Function(EarthquakeEarlyObservationPoint) then) = - _$EarthquakeEarlyObservationPointCopyWithImpl<$Res, - EarthquakeEarlyObservationPoint>; + EarthquakeEarlyObservationPoint value, + $Res Function(EarthquakeEarlyObservationPoint) then, + ) = + _$EarthquakeEarlyObservationPointCopyWithImpl< + $Res, + EarthquakeEarlyObservationPoint + >; @useResult - $Res call( - {String name, double lat, double lon, JmaForecastIntensity intensity}); + $Res call({ + String name, + double lat, + double lon, + JmaForecastIntensity intensity, + }); } /// @nodoc -class _$EarthquakeEarlyObservationPointCopyWithImpl<$Res, - $Val extends EarthquakeEarlyObservationPoint> +class _$EarthquakeEarlyObservationPointCopyWithImpl< + $Res, + $Val extends EarthquakeEarlyObservationPoint +> implements $EarthquakeEarlyObservationPointCopyWith<$Res> { _$EarthquakeEarlyObservationPointCopyWithImpl(this._value, this._then); @@ -896,24 +989,31 @@ class _$EarthquakeEarlyObservationPointCopyWithImpl<$Res, Object? lon = null, Object? intensity = null, }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - lat: null == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double, - lon: null == lon - ? _value.lon - : lon // ignore: cast_nullable_to_non_nullable - as double, - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - ) as $Val); + return _then( + _value.copyWith( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + lat: + null == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double, + lon: + null == lon + ? _value.lon + : lon // ignore: cast_nullable_to_non_nullable + as double, + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ) + as $Val, + ); } } @@ -921,24 +1021,31 @@ class _$EarthquakeEarlyObservationPointCopyWithImpl<$Res, abstract class _$$EarthquakeEarlyObservationPointImplCopyWith<$Res> implements $EarthquakeEarlyObservationPointCopyWith<$Res> { factory _$$EarthquakeEarlyObservationPointImplCopyWith( - _$EarthquakeEarlyObservationPointImpl value, - $Res Function(_$EarthquakeEarlyObservationPointImpl) then) = - __$$EarthquakeEarlyObservationPointImplCopyWithImpl<$Res>; + _$EarthquakeEarlyObservationPointImpl value, + $Res Function(_$EarthquakeEarlyObservationPointImpl) then, + ) = __$$EarthquakeEarlyObservationPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String name, double lat, double lon, JmaForecastIntensity intensity}); + $Res call({ + String name, + double lat, + double lon, + JmaForecastIntensity intensity, + }); } /// @nodoc class __$$EarthquakeEarlyObservationPointImplCopyWithImpl<$Res> - extends _$EarthquakeEarlyObservationPointCopyWithImpl<$Res, - _$EarthquakeEarlyObservationPointImpl> + extends + _$EarthquakeEarlyObservationPointCopyWithImpl< + $Res, + _$EarthquakeEarlyObservationPointImpl + > implements _$$EarthquakeEarlyObservationPointImplCopyWith<$Res> { __$$EarthquakeEarlyObservationPointImplCopyWithImpl( - _$EarthquakeEarlyObservationPointImpl _value, - $Res Function(_$EarthquakeEarlyObservationPointImpl) _then) - : super(_value, _then); + _$EarthquakeEarlyObservationPointImpl _value, + $Res Function(_$EarthquakeEarlyObservationPointImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeEarlyObservationPoint /// with the given fields replaced by the non-null parameter values. @@ -950,24 +1057,30 @@ class __$$EarthquakeEarlyObservationPointImplCopyWithImpl<$Res> Object? lon = null, Object? intensity = null, }) { - return _then(_$EarthquakeEarlyObservationPointImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - lat: null == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double, - lon: null == lon - ? _value.lon - : lon // ignore: cast_nullable_to_non_nullable - as double, - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - )); + return _then( + _$EarthquakeEarlyObservationPointImpl( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + lat: + null == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double, + lon: + null == lon + ? _value.lon + : lon // ignore: cast_nullable_to_non_nullable + as double, + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + ), + ); } } @@ -975,15 +1088,16 @@ class __$$EarthquakeEarlyObservationPointImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeEarlyObservationPointImpl implements _EarthquakeEarlyObservationPoint { - const _$EarthquakeEarlyObservationPointImpl( - {required this.name, - required this.lat, - required this.lon, - required this.intensity}); + const _$EarthquakeEarlyObservationPointImpl({ + required this.name, + required this.lat, + required this.lon, + required this.intensity, + }); factory _$EarthquakeEarlyObservationPointImpl.fromJson( - Map json) => - _$$EarthquakeEarlyObservationPointImplFromJson(json); + Map json, + ) => _$$EarthquakeEarlyObservationPointImplFromJson(json); @override final String name; @@ -1021,26 +1135,26 @@ class _$EarthquakeEarlyObservationPointImpl @override @pragma('vm:prefer-inline') _$$EarthquakeEarlyObservationPointImplCopyWith< - _$EarthquakeEarlyObservationPointImpl> - get copyWith => __$$EarthquakeEarlyObservationPointImplCopyWithImpl< - _$EarthquakeEarlyObservationPointImpl>(this, _$identity); + _$EarthquakeEarlyObservationPointImpl + > + get copyWith => __$$EarthquakeEarlyObservationPointImplCopyWithImpl< + _$EarthquakeEarlyObservationPointImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeEarlyObservationPointImplToJson( - this, - ); + return _$$EarthquakeEarlyObservationPointImplToJson(this); } } abstract class _EarthquakeEarlyObservationPoint implements EarthquakeEarlyObservationPoint { - const factory _EarthquakeEarlyObservationPoint( - {required final String name, - required final double lat, - required final double lon, - required final JmaForecastIntensity intensity}) = - _$EarthquakeEarlyObservationPointImpl; + const factory _EarthquakeEarlyObservationPoint({ + required final String name, + required final double lat, + required final double lon, + required final JmaForecastIntensity intensity, + }) = _$EarthquakeEarlyObservationPointImpl; factory _EarthquakeEarlyObservationPoint.fromJson(Map json) = _$EarthquakeEarlyObservationPointImpl.fromJson; @@ -1059,6 +1173,7 @@ abstract class _EarthquakeEarlyObservationPoint @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeEarlyObservationPointImplCopyWith< - _$EarthquakeEarlyObservationPointImpl> - get copyWith => throw _privateConstructorUsedError; + _$EarthquakeEarlyObservationPointImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.g.dart b/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.g.dart index 6c3ada2b..b772cbb0 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake_early_event.g.dart @@ -9,67 +9,82 @@ part of 'earthquake_early_event.dart'; // ************************************************************************** _$EarthquakeEarlyEventImpl _$$EarthquakeEarlyEventImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeEarlyEventImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeEarlyEventImpl( - id: $checkedConvert('id', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - lat: $checkedConvert('lat', (v) => (v as num?)?.toDouble()), - lon: $checkedConvert('lon', (v) => (v as num?)?.toDouble()), - depth: $checkedConvert('depth', (v) => (v as num?)?.toDouble()), - magnitude: - $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), - originTime: $checkedConvert( - 'origin_time', (v) => DateTime.parse(v as String)), - originTimePrecision: $checkedConvert('origin_time_precision', - (v) => $enumDecode(_$OriginTimePrecisionEnumMap, v)), - maxIntensity: $checkedConvert('max_intensity', - (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v)), - maxIntensityIsEarly: - $checkedConvert('max_intensity_is_early', (v) => v as bool), - regions: $checkedConvert( - 'regions', - (v) => (v as List) - .map((e) => - EarthquakeEarlyRegion.fromJson(e as Map)) - .toList()), - cities: $checkedConvert( - 'cities', - (v) => (v as List) - .map((e) => - EarthquakeEarlyCity.fromJson(e as Map)) - .toList()), - ); - return val; - }, - fieldKeyMap: const { - 'originTime': 'origin_time', - 'originTimePrecision': 'origin_time_precision', - 'maxIntensity': 'max_intensity', - 'maxIntensityIsEarly': 'max_intensity_is_early' - }, + Map json, +) => $checkedCreate( + r'_$EarthquakeEarlyEventImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeEarlyEventImpl( + id: $checkedConvert('id', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + lat: $checkedConvert('lat', (v) => (v as num?)?.toDouble()), + lon: $checkedConvert('lon', (v) => (v as num?)?.toDouble()), + depth: $checkedConvert('depth', (v) => (v as num?)?.toDouble()), + magnitude: $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), + originTime: $checkedConvert( + 'origin_time', + (v) => DateTime.parse(v as String), + ), + originTimePrecision: $checkedConvert( + 'origin_time_precision', + (v) => $enumDecode(_$OriginTimePrecisionEnumMap, v), + ), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v), + ), + maxIntensityIsEarly: $checkedConvert( + 'max_intensity_is_early', + (v) => v as bool, + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List) + .map( + (e) => + EarthquakeEarlyRegion.fromJson(e as Map), + ) + .toList(), + ), + cities: $checkedConvert( + 'cities', + (v) => + (v as List) + .map( + (e) => + EarthquakeEarlyCity.fromJson(e as Map), + ) + .toList(), + ), ); + return val; + }, + fieldKeyMap: const { + 'originTime': 'origin_time', + 'originTimePrecision': 'origin_time_precision', + 'maxIntensity': 'max_intensity', + 'maxIntensityIsEarly': 'max_intensity_is_early', + }, +); Map _$$EarthquakeEarlyEventImplToJson( - _$EarthquakeEarlyEventImpl instance) => - { - 'id': instance.id, - 'name': instance.name, - 'lat': instance.lat, - 'lon': instance.lon, - 'depth': instance.depth, - 'magnitude': instance.magnitude, - 'origin_time': instance.originTime.toIso8601String(), - 'origin_time_precision': - _$OriginTimePrecisionEnumMap[instance.originTimePrecision]!, - 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity], - 'max_intensity_is_early': instance.maxIntensityIsEarly, - 'regions': instance.regions, - 'cities': instance.cities, - }; + _$EarthquakeEarlyEventImpl instance, +) => { + 'id': instance.id, + 'name': instance.name, + 'lat': instance.lat, + 'lon': instance.lon, + 'depth': instance.depth, + 'magnitude': instance.magnitude, + 'origin_time': instance.originTime.toIso8601String(), + 'origin_time_precision': + _$OriginTimePrecisionEnumMap[instance.originTimePrecision]!, + 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity], + 'max_intensity_is_early': instance.maxIntensityIsEarly, + 'regions': instance.regions, + 'cities': instance.cities, +}; const _$OriginTimePrecisionEnumMap = { OriginTimePrecision.month: 'month', @@ -95,87 +110,96 @@ const _$JmaForecastIntensityEnumMap = { }; _$EarthquakeEarlyRegionImpl _$$EarthquakeEarlyRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeEarlyRegionImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeEarlyRegionImpl( - name: $checkedConvert('name', (v) => v as String), - code: $checkedConvert('code', (v) => v as String), - maxIntensity: $checkedConvert('max_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const {'maxIntensity': 'max_intensity'}, + Map json, +) => $checkedCreate( + r'_$EarthquakeEarlyRegionImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeEarlyRegionImpl( + name: $checkedConvert('name', (v) => v as String), + code: $checkedConvert('code', (v) => v as String), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const {'maxIntensity': 'max_intensity'}, +); Map _$$EarthquakeEarlyRegionImplToJson( - _$EarthquakeEarlyRegionImpl instance) => - { - 'name': instance.name, - 'code': instance.code, - 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, - }; + _$EarthquakeEarlyRegionImpl instance, +) => { + 'name': instance.name, + 'code': instance.code, + 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, +}; _$EarthquakeEarlyCityImpl _$$EarthquakeEarlyCityImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeEarlyCityImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeEarlyCityImpl( - name: $checkedConvert('name', (v) => v as String), - code: $checkedConvert('code', (v) => v as String?), - maxIntensity: $checkedConvert('max_intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - observationPoints: $checkedConvert( - 'observation_points', - (v) => (v as List) - .map((e) => EarthquakeEarlyObservationPoint.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - fieldKeyMap: const { - 'maxIntensity': 'max_intensity', - 'observationPoints': 'observation_points' - }, + Map json, +) => $checkedCreate( + r'_$EarthquakeEarlyCityImpl', + json, + ($checkedConvert) { + final val = _$EarthquakeEarlyCityImpl( + name: $checkedConvert('name', (v) => v as String), + code: $checkedConvert('code', (v) => v as String?), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + observationPoints: $checkedConvert( + 'observation_points', + (v) => + (v as List) + .map( + (e) => EarthquakeEarlyObservationPoint.fromJson( + e as Map, + ), + ) + .toList(), + ), ); + return val; + }, + fieldKeyMap: const { + 'maxIntensity': 'max_intensity', + 'observationPoints': 'observation_points', + }, +); Map _$$EarthquakeEarlyCityImplToJson( - _$EarthquakeEarlyCityImpl instance) => - { - 'name': instance.name, - 'code': instance.code, - 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, - 'observation_points': instance.observationPoints, - }; + _$EarthquakeEarlyCityImpl instance, +) => { + 'name': instance.name, + 'code': instance.code, + 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, + 'observation_points': instance.observationPoints, +}; _$EarthquakeEarlyObservationPointImpl - _$$EarthquakeEarlyObservationPointImplFromJson(Map json) => - $checkedCreate( - r'_$EarthquakeEarlyObservationPointImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeEarlyObservationPointImpl( - name: $checkedConvert('name', (v) => v as String), - lat: $checkedConvert('lat', (v) => (v as num).toDouble()), - lon: $checkedConvert('lon', (v) => (v as num).toDouble()), - intensity: $checkedConvert('intensity', - (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - ); - return val; - }, - ); +_$$EarthquakeEarlyObservationPointImplFromJson(Map json) => + $checkedCreate(r'_$EarthquakeEarlyObservationPointImpl', json, ( + $checkedConvert, + ) { + final val = _$EarthquakeEarlyObservationPointImpl( + name: $checkedConvert('name', (v) => v as String), + lat: $checkedConvert('lat', (v) => (v as num).toDouble()), + lon: $checkedConvert('lon', (v) => (v as num).toDouble()), + intensity: $checkedConvert( + 'intensity', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + ); + return val; + }); Map _$$EarthquakeEarlyObservationPointImplToJson( - _$EarthquakeEarlyObservationPointImpl instance) => - { - 'name': instance.name, - 'lat': instance.lat, - 'lon': instance.lon, - 'intensity': _$JmaForecastIntensityEnumMap[instance.intensity]!, - }; + _$EarthquakeEarlyObservationPointImpl instance, +) => { + 'name': instance.name, + 'lat': instance.lat, + 'lon': instance.lon, + 'intensity': _$JmaForecastIntensityEnumMap[instance.intensity]!, +}; diff --git a/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart b/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart index 7d804318..93a29228 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart @@ -12,7 +12,8 @@ part of 'eew.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EewV1 _$EewV1FromJson(Map json) { return _EewV1.fromJson(json); @@ -65,33 +66,34 @@ abstract class $EewV1CopyWith<$Res> { factory $EewV1CopyWith(EewV1 value, $Res Function(EewV1) then) = _$EewV1CopyWithImpl<$Res, EewV1>; @useResult - $Res call( - {int id, - int eventId, - String type, - String schemaType, - String status, - String infoType, - DateTime reportTime, - bool isCanceled, - bool isLastInfo, - bool? isPlum, - EewAccuracy? accuracy, - int? serialNo, - String? headline, - bool? isWarning, - DateTime? originTime, - DateTime? arrivalTime, - String? hypoName, - int? depth, - double? latitude, - double? longitude, - double? magnitude, - JmaForecastIntensity? forecastMaxIntensity, - bool? forecastMaxIntensityIsOver, - JmaForecastLgIntensity? forecastMaxLpgmIntensity, - bool? forecastMaxLpgmIntensityIsOver, - List? regions}); + $Res call({ + int id, + int eventId, + String type, + String schemaType, + String status, + String infoType, + DateTime reportTime, + bool isCanceled, + bool isLastInfo, + bool? isPlum, + EewAccuracy? accuracy, + int? serialNo, + String? headline, + bool? isWarning, + DateTime? originTime, + DateTime? arrivalTime, + String? hypoName, + int? depth, + double? latitude, + double? longitude, + double? magnitude, + JmaForecastIntensity? forecastMaxIntensity, + bool? forecastMaxIntensityIsOver, + JmaForecastLgIntensity? forecastMaxLpgmIntensity, + bool? forecastMaxLpgmIntensityIsOver, + List? regions, + }); $EewAccuracyCopyWith<$Res>? get accuracy; } @@ -138,112 +140,141 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> Object? forecastMaxLpgmIntensityIsOver = freezed, Object? regions = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - schemaType: null == schemaType - ? _value.schemaType - : schemaType // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - infoType: null == infoType - ? _value.infoType - : infoType // ignore: cast_nullable_to_non_nullable - as String, - reportTime: null == reportTime - ? _value.reportTime - : reportTime // ignore: cast_nullable_to_non_nullable - as DateTime, - isCanceled: null == isCanceled - ? _value.isCanceled - : isCanceled // ignore: cast_nullable_to_non_nullable - as bool, - isLastInfo: null == isLastInfo - ? _value.isLastInfo - : isLastInfo // ignore: cast_nullable_to_non_nullable - as bool, - isPlum: freezed == isPlum - ? _value.isPlum - : isPlum // ignore: cast_nullable_to_non_nullable - as bool?, - accuracy: freezed == accuracy - ? _value.accuracy - : accuracy // ignore: cast_nullable_to_non_nullable - as EewAccuracy?, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - isWarning: freezed == isWarning - ? _value.isWarning - : isWarning // ignore: cast_nullable_to_non_nullable - as bool?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - hypoName: freezed == hypoName - ? _value.hypoName - : hypoName // ignore: cast_nullable_to_non_nullable - as String?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - forecastMaxIntensity: freezed == forecastMaxIntensity - ? _value.forecastMaxIntensity - : forecastMaxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - forecastMaxIntensityIsOver: freezed == forecastMaxIntensityIsOver - ? _value.forecastMaxIntensityIsOver - : forecastMaxIntensityIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - forecastMaxLpgmIntensity: freezed == forecastMaxLpgmIntensity - ? _value.forecastMaxLpgmIntensity - : forecastMaxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastLgIntensity?, - forecastMaxLpgmIntensityIsOver: freezed == forecastMaxLpgmIntensityIsOver - ? _value.forecastMaxLpgmIntensityIsOver - : forecastMaxLpgmIntensityIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - regions: freezed == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + schemaType: + null == schemaType + ? _value.schemaType + : schemaType // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + infoType: + null == infoType + ? _value.infoType + : infoType // ignore: cast_nullable_to_non_nullable + as String, + reportTime: + null == reportTime + ? _value.reportTime + : reportTime // ignore: cast_nullable_to_non_nullable + as DateTime, + isCanceled: + null == isCanceled + ? _value.isCanceled + : isCanceled // ignore: cast_nullable_to_non_nullable + as bool, + isLastInfo: + null == isLastInfo + ? _value.isLastInfo + : isLastInfo // ignore: cast_nullable_to_non_nullable + as bool, + isPlum: + freezed == isPlum + ? _value.isPlum + : isPlum // ignore: cast_nullable_to_non_nullable + as bool?, + accuracy: + freezed == accuracy + ? _value.accuracy + : accuracy // ignore: cast_nullable_to_non_nullable + as EewAccuracy?, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + isWarning: + freezed == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + hypoName: + freezed == hypoName + ? _value.hypoName + : hypoName // ignore: cast_nullable_to_non_nullable + as String?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + forecastMaxIntensity: + freezed == forecastMaxIntensity + ? _value.forecastMaxIntensity + : forecastMaxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + forecastMaxIntensityIsOver: + freezed == forecastMaxIntensityIsOver + ? _value.forecastMaxIntensityIsOver + : forecastMaxIntensityIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + forecastMaxLpgmIntensity: + freezed == forecastMaxLpgmIntensity + ? _value.forecastMaxLpgmIntensity + : forecastMaxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastLgIntensity?, + forecastMaxLpgmIntensityIsOver: + freezed == forecastMaxLpgmIntensityIsOver + ? _value.forecastMaxLpgmIntensityIsOver + : forecastMaxLpgmIntensityIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + regions: + freezed == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); } /// Create a copy of EewV1 @@ -264,37 +295,39 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> /// @nodoc abstract class _$$EewV1ImplCopyWith<$Res> implements $EewV1CopyWith<$Res> { factory _$$EewV1ImplCopyWith( - _$EewV1Impl value, $Res Function(_$EewV1Impl) then) = - __$$EewV1ImplCopyWithImpl<$Res>; + _$EewV1Impl value, + $Res Function(_$EewV1Impl) then, + ) = __$$EewV1ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int id, - int eventId, - String type, - String schemaType, - String status, - String infoType, - DateTime reportTime, - bool isCanceled, - bool isLastInfo, - bool? isPlum, - EewAccuracy? accuracy, - int? serialNo, - String? headline, - bool? isWarning, - DateTime? originTime, - DateTime? arrivalTime, - String? hypoName, - int? depth, - double? latitude, - double? longitude, - double? magnitude, - JmaForecastIntensity? forecastMaxIntensity, - bool? forecastMaxIntensityIsOver, - JmaForecastLgIntensity? forecastMaxLpgmIntensity, - bool? forecastMaxLpgmIntensityIsOver, - List? regions}); + $Res call({ + int id, + int eventId, + String type, + String schemaType, + String status, + String infoType, + DateTime reportTime, + bool isCanceled, + bool isLastInfo, + bool? isPlum, + EewAccuracy? accuracy, + int? serialNo, + String? headline, + bool? isWarning, + DateTime? originTime, + DateTime? arrivalTime, + String? hypoName, + int? depth, + double? latitude, + double? longitude, + double? magnitude, + JmaForecastIntensity? forecastMaxIntensity, + bool? forecastMaxIntensityIsOver, + JmaForecastLgIntensity? forecastMaxLpgmIntensity, + bool? forecastMaxLpgmIntensityIsOver, + List? regions, + }); @override $EewAccuracyCopyWith<$Res>? get accuracy; @@ -305,8 +338,9 @@ class __$$EewV1ImplCopyWithImpl<$Res> extends _$EewV1CopyWithImpl<$Res, _$EewV1Impl> implements _$$EewV1ImplCopyWith<$Res> { __$$EewV1ImplCopyWithImpl( - _$EewV1Impl _value, $Res Function(_$EewV1Impl) _then) - : super(_value, _then); + _$EewV1Impl _value, + $Res Function(_$EewV1Impl) _then, + ) : super(_value, _then); /// Create a copy of EewV1 /// with the given fields replaced by the non-null parameter values. @@ -340,147 +374,175 @@ class __$$EewV1ImplCopyWithImpl<$Res> Object? forecastMaxLpgmIntensityIsOver = freezed, Object? regions = freezed, }) { - return _then(_$EewV1Impl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - schemaType: null == schemaType - ? _value.schemaType - : schemaType // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - infoType: null == infoType - ? _value.infoType - : infoType // ignore: cast_nullable_to_non_nullable - as String, - reportTime: null == reportTime - ? _value.reportTime - : reportTime // ignore: cast_nullable_to_non_nullable - as DateTime, - isCanceled: null == isCanceled - ? _value.isCanceled - : isCanceled // ignore: cast_nullable_to_non_nullable - as bool, - isLastInfo: null == isLastInfo - ? _value.isLastInfo - : isLastInfo // ignore: cast_nullable_to_non_nullable - as bool, - isPlum: freezed == isPlum - ? _value.isPlum - : isPlum // ignore: cast_nullable_to_non_nullable - as bool?, - accuracy: freezed == accuracy - ? _value.accuracy - : accuracy // ignore: cast_nullable_to_non_nullable - as EewAccuracy?, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - isWarning: freezed == isWarning - ? _value.isWarning - : isWarning // ignore: cast_nullable_to_non_nullable - as bool?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - hypoName: freezed == hypoName - ? _value.hypoName - : hypoName // ignore: cast_nullable_to_non_nullable - as String?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - forecastMaxIntensity: freezed == forecastMaxIntensity - ? _value.forecastMaxIntensity - : forecastMaxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity?, - forecastMaxIntensityIsOver: freezed == forecastMaxIntensityIsOver - ? _value.forecastMaxIntensityIsOver - : forecastMaxIntensityIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - forecastMaxLpgmIntensity: freezed == forecastMaxLpgmIntensity - ? _value.forecastMaxLpgmIntensity - : forecastMaxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastLgIntensity?, - forecastMaxLpgmIntensityIsOver: freezed == forecastMaxLpgmIntensityIsOver - ? _value.forecastMaxLpgmIntensityIsOver - : forecastMaxLpgmIntensityIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - regions: freezed == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List?, - )); + return _then( + _$EewV1Impl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + schemaType: + null == schemaType + ? _value.schemaType + : schemaType // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + infoType: + null == infoType + ? _value.infoType + : infoType // ignore: cast_nullable_to_non_nullable + as String, + reportTime: + null == reportTime + ? _value.reportTime + : reportTime // ignore: cast_nullable_to_non_nullable + as DateTime, + isCanceled: + null == isCanceled + ? _value.isCanceled + : isCanceled // ignore: cast_nullable_to_non_nullable + as bool, + isLastInfo: + null == isLastInfo + ? _value.isLastInfo + : isLastInfo // ignore: cast_nullable_to_non_nullable + as bool, + isPlum: + freezed == isPlum + ? _value.isPlum + : isPlum // ignore: cast_nullable_to_non_nullable + as bool?, + accuracy: + freezed == accuracy + ? _value.accuracy + : accuracy // ignore: cast_nullable_to_non_nullable + as EewAccuracy?, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + isWarning: + freezed == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + hypoName: + freezed == hypoName + ? _value.hypoName + : hypoName // ignore: cast_nullable_to_non_nullable + as String?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + forecastMaxIntensity: + freezed == forecastMaxIntensity + ? _value.forecastMaxIntensity + : forecastMaxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity?, + forecastMaxIntensityIsOver: + freezed == forecastMaxIntensityIsOver + ? _value.forecastMaxIntensityIsOver + : forecastMaxIntensityIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + forecastMaxLpgmIntensity: + freezed == forecastMaxLpgmIntensity + ? _value.forecastMaxLpgmIntensity + : forecastMaxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastLgIntensity?, + forecastMaxLpgmIntensityIsOver: + freezed == forecastMaxLpgmIntensityIsOver + ? _value.forecastMaxLpgmIntensityIsOver + : forecastMaxLpgmIntensityIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + regions: + freezed == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EewV1Impl extends _EewV1 { - const _$EewV1Impl( - {required this.id, - required this.eventId, - required this.type, - required this.schemaType, - required this.status, - required this.infoType, - required this.reportTime, - required this.isCanceled, - required this.isLastInfo, - required this.isPlum, - required this.accuracy, - this.serialNo, - this.headline, - this.isWarning, - this.originTime, - this.arrivalTime, - this.hypoName, - this.depth, - this.latitude, - this.longitude, - this.magnitude, - this.forecastMaxIntensity, - this.forecastMaxIntensityIsOver, - this.forecastMaxLpgmIntensity, - this.forecastMaxLpgmIntensityIsOver, - final List? regions}) - : _regions = regions, - super._(); + const _$EewV1Impl({ + required this.id, + required this.eventId, + required this.type, + required this.schemaType, + required this.status, + required this.infoType, + required this.reportTime, + required this.isCanceled, + required this.isLastInfo, + required this.isPlum, + required this.accuracy, + this.serialNo, + this.headline, + this.isWarning, + this.originTime, + this.arrivalTime, + this.hypoName, + this.depth, + this.latitude, + this.longitude, + this.magnitude, + this.forecastMaxIntensity, + this.forecastMaxIntensityIsOver, + this.forecastMaxLpgmIntensity, + this.forecastMaxLpgmIntensityIsOver, + final List? regions, + }) : _regions = regions, + super._(); factory _$EewV1Impl.fromJson(Map json) => _$$EewV1ImplFromJson(json); @@ -593,15 +655,21 @@ class _$EewV1Impl extends _EewV1 { other.magnitude == magnitude) && (identical(other.forecastMaxIntensity, forecastMaxIntensity) || other.forecastMaxIntensity == forecastMaxIntensity) && - (identical(other.forecastMaxIntensityIsOver, - forecastMaxIntensityIsOver) || + (identical( + other.forecastMaxIntensityIsOver, + forecastMaxIntensityIsOver, + ) || other.forecastMaxIntensityIsOver == forecastMaxIntensityIsOver) && (identical( - other.forecastMaxLpgmIntensity, forecastMaxLpgmIntensity) || + other.forecastMaxLpgmIntensity, + forecastMaxLpgmIntensity, + ) || other.forecastMaxLpgmIntensity == forecastMaxLpgmIntensity) && - (identical(other.forecastMaxLpgmIntensityIsOver, - forecastMaxLpgmIntensityIsOver) || + (identical( + other.forecastMaxLpgmIntensityIsOver, + forecastMaxLpgmIntensityIsOver, + ) || other.forecastMaxLpgmIntensityIsOver == forecastMaxLpgmIntensityIsOver) && const DeepCollectionEquality().equals(other._regions, _regions)); @@ -610,34 +678,34 @@ class _$EewV1Impl extends _EewV1 { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ - runtimeType, - id, - eventId, - type, - schemaType, - status, - infoType, - reportTime, - isCanceled, - isLastInfo, - isPlum, - accuracy, - serialNo, - headline, - isWarning, - originTime, - arrivalTime, - hypoName, - depth, - latitude, - longitude, - magnitude, - forecastMaxIntensity, - forecastMaxIntensityIsOver, - forecastMaxLpgmIntensity, - forecastMaxLpgmIntensityIsOver, - const DeepCollectionEquality().hash(_regions) - ]); + runtimeType, + id, + eventId, + type, + schemaType, + status, + infoType, + reportTime, + isCanceled, + isLastInfo, + isPlum, + accuracy, + serialNo, + headline, + isWarning, + originTime, + arrivalTime, + hypoName, + depth, + latitude, + longitude, + magnitude, + forecastMaxIntensity, + forecastMaxIntensityIsOver, + forecastMaxLpgmIntensity, + forecastMaxLpgmIntensityIsOver, + const DeepCollectionEquality().hash(_regions), + ]); /// Create a copy of EewV1 /// with the given fields replaced by the non-null parameter values. @@ -649,40 +717,39 @@ class _$EewV1Impl extends _EewV1 { @override Map toJson() { - return _$$EewV1ImplToJson( - this, - ); + return _$$EewV1ImplToJson(this); } } abstract class _EewV1 extends EewV1 { - const factory _EewV1( - {required final int id, - required final int eventId, - required final String type, - required final String schemaType, - required final String status, - required final String infoType, - required final DateTime reportTime, - required final bool isCanceled, - required final bool isLastInfo, - required final bool? isPlum, - required final EewAccuracy? accuracy, - final int? serialNo, - final String? headline, - final bool? isWarning, - final DateTime? originTime, - final DateTime? arrivalTime, - final String? hypoName, - final int? depth, - final double? latitude, - final double? longitude, - final double? magnitude, - final JmaForecastIntensity? forecastMaxIntensity, - final bool? forecastMaxIntensityIsOver, - final JmaForecastLgIntensity? forecastMaxLpgmIntensity, - final bool? forecastMaxLpgmIntensityIsOver, - final List? regions}) = _$EewV1Impl; + const factory _EewV1({ + required final int id, + required final int eventId, + required final String type, + required final String schemaType, + required final String status, + required final String infoType, + required final DateTime reportTime, + required final bool isCanceled, + required final bool isLastInfo, + required final bool? isPlum, + required final EewAccuracy? accuracy, + final int? serialNo, + final String? headline, + final bool? isWarning, + final DateTime? originTime, + final DateTime? arrivalTime, + final String? hypoName, + final int? depth, + final double? latitude, + final double? longitude, + final double? magnitude, + final JmaForecastIntensity? forecastMaxIntensity, + final bool? forecastMaxIntensityIsOver, + final JmaForecastLgIntensity? forecastMaxLpgmIntensity, + final bool? forecastMaxLpgmIntensityIsOver, + final List? regions, + }) = _$EewV1Impl; const _EewV1._() : super._(); factory _EewV1.fromJson(Map json) = _$EewV1Impl.fromJson; @@ -749,7 +816,8 @@ abstract class _EewV1 extends EewV1 { } EstimatedIntensityRegion _$EstimatedIntensityRegionFromJson( - Map json) { + Map json, +) { return _EstimatedIntensityRegion.fromJson(json); } @@ -782,26 +850,30 @@ mixin _$EstimatedIntensityRegion { /// @nodoc abstract class $EstimatedIntensityRegionCopyWith<$Res> { - factory $EstimatedIntensityRegionCopyWith(EstimatedIntensityRegion value, - $Res Function(EstimatedIntensityRegion) then) = - _$EstimatedIntensityRegionCopyWithImpl<$Res, EstimatedIntensityRegion>; + factory $EstimatedIntensityRegionCopyWith( + EstimatedIntensityRegion value, + $Res Function(EstimatedIntensityRegion) then, + ) = _$EstimatedIntensityRegionCopyWithImpl<$Res, EstimatedIntensityRegion>; @useResult - $Res call( - {String code, - String name, - @JsonKey(name: 'isPlum') bool isPlum, - @JsonKey(name: 'isWarning') bool isWarning, - @JsonKey(name: 'forecastMaxInt') ForecastMaxInt forecastMaxInt, - @JsonKey(name: 'forecastMaxLgInt') ForecastMaxLgInt? forecastMaxLgInt, - @JsonKey(name: 'arrivalTime') DateTime? arrivalTime}); + $Res call({ + String code, + String name, + @JsonKey(name: 'isPlum') bool isPlum, + @JsonKey(name: 'isWarning') bool isWarning, + @JsonKey(name: 'forecastMaxInt') ForecastMaxInt forecastMaxInt, + @JsonKey(name: 'forecastMaxLgInt') ForecastMaxLgInt? forecastMaxLgInt, + @JsonKey(name: 'arrivalTime') DateTime? arrivalTime, + }); $ForecastMaxIntCopyWith<$Res> get forecastMaxInt; $ForecastMaxLgIntCopyWith<$Res>? get forecastMaxLgInt; } /// @nodoc -class _$EstimatedIntensityRegionCopyWithImpl<$Res, - $Val extends EstimatedIntensityRegion> +class _$EstimatedIntensityRegionCopyWithImpl< + $Res, + $Val extends EstimatedIntensityRegion +> implements $EstimatedIntensityRegionCopyWith<$Res> { _$EstimatedIntensityRegionCopyWithImpl(this._value, this._then); @@ -823,36 +895,46 @@ class _$EstimatedIntensityRegionCopyWithImpl<$Res, Object? forecastMaxLgInt = freezed, Object? arrivalTime = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - isPlum: null == isPlum - ? _value.isPlum - : isPlum // ignore: cast_nullable_to_non_nullable - as bool, - isWarning: null == isWarning - ? _value.isWarning - : isWarning // ignore: cast_nullable_to_non_nullable - as bool, - forecastMaxInt: null == forecastMaxInt - ? _value.forecastMaxInt - : forecastMaxInt // ignore: cast_nullable_to_non_nullable - as ForecastMaxInt, - forecastMaxLgInt: freezed == forecastMaxLgInt - ? _value.forecastMaxLgInt - : forecastMaxLgInt // ignore: cast_nullable_to_non_nullable - as ForecastMaxLgInt?, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + isPlum: + null == isPlum + ? _value.isPlum + : isPlum // ignore: cast_nullable_to_non_nullable + as bool, + isWarning: + null == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool, + forecastMaxInt: + null == forecastMaxInt + ? _value.forecastMaxInt + : forecastMaxInt // ignore: cast_nullable_to_non_nullable + as ForecastMaxInt, + forecastMaxLgInt: + freezed == forecastMaxLgInt + ? _value.forecastMaxLgInt + : forecastMaxLgInt // ignore: cast_nullable_to_non_nullable + as ForecastMaxLgInt?, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + ) + as $Val, + ); } /// Create a copy of EstimatedIntensityRegion @@ -884,19 +966,20 @@ class _$EstimatedIntensityRegionCopyWithImpl<$Res, abstract class _$$EstimatedIntensityRegionImplCopyWith<$Res> implements $EstimatedIntensityRegionCopyWith<$Res> { factory _$$EstimatedIntensityRegionImplCopyWith( - _$EstimatedIntensityRegionImpl value, - $Res Function(_$EstimatedIntensityRegionImpl) then) = - __$$EstimatedIntensityRegionImplCopyWithImpl<$Res>; + _$EstimatedIntensityRegionImpl value, + $Res Function(_$EstimatedIntensityRegionImpl) then, + ) = __$$EstimatedIntensityRegionImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - @JsonKey(name: 'isPlum') bool isPlum, - @JsonKey(name: 'isWarning') bool isWarning, - @JsonKey(name: 'forecastMaxInt') ForecastMaxInt forecastMaxInt, - @JsonKey(name: 'forecastMaxLgInt') ForecastMaxLgInt? forecastMaxLgInt, - @JsonKey(name: 'arrivalTime') DateTime? arrivalTime}); + $Res call({ + String code, + String name, + @JsonKey(name: 'isPlum') bool isPlum, + @JsonKey(name: 'isWarning') bool isWarning, + @JsonKey(name: 'forecastMaxInt') ForecastMaxInt forecastMaxInt, + @JsonKey(name: 'forecastMaxLgInt') ForecastMaxLgInt? forecastMaxLgInt, + @JsonKey(name: 'arrivalTime') DateTime? arrivalTime, + }); @override $ForecastMaxIntCopyWith<$Res> get forecastMaxInt; @@ -906,13 +989,16 @@ abstract class _$$EstimatedIntensityRegionImplCopyWith<$Res> /// @nodoc class __$$EstimatedIntensityRegionImplCopyWithImpl<$Res> - extends _$EstimatedIntensityRegionCopyWithImpl<$Res, - _$EstimatedIntensityRegionImpl> + extends + _$EstimatedIntensityRegionCopyWithImpl< + $Res, + _$EstimatedIntensityRegionImpl + > implements _$$EstimatedIntensityRegionImplCopyWith<$Res> { __$$EstimatedIntensityRegionImplCopyWithImpl( - _$EstimatedIntensityRegionImpl _value, - $Res Function(_$EstimatedIntensityRegionImpl) _then) - : super(_value, _then); + _$EstimatedIntensityRegionImpl _value, + $Res Function(_$EstimatedIntensityRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of EstimatedIntensityRegion /// with the given fields replaced by the non-null parameter values. @@ -927,50 +1013,60 @@ class __$$EstimatedIntensityRegionImplCopyWithImpl<$Res> Object? forecastMaxLgInt = freezed, Object? arrivalTime = freezed, }) { - return _then(_$EstimatedIntensityRegionImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - isPlum: null == isPlum - ? _value.isPlum - : isPlum // ignore: cast_nullable_to_non_nullable - as bool, - isWarning: null == isWarning - ? _value.isWarning - : isWarning // ignore: cast_nullable_to_non_nullable - as bool, - forecastMaxInt: null == forecastMaxInt - ? _value.forecastMaxInt - : forecastMaxInt // ignore: cast_nullable_to_non_nullable - as ForecastMaxInt, - forecastMaxLgInt: freezed == forecastMaxLgInt - ? _value.forecastMaxLgInt - : forecastMaxLgInt // ignore: cast_nullable_to_non_nullable - as ForecastMaxLgInt?, - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - )); + return _then( + _$EstimatedIntensityRegionImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + isPlum: + null == isPlum + ? _value.isPlum + : isPlum // ignore: cast_nullable_to_non_nullable + as bool, + isWarning: + null == isWarning + ? _value.isWarning + : isWarning // ignore: cast_nullable_to_non_nullable + as bool, + forecastMaxInt: + null == forecastMaxInt + ? _value.forecastMaxInt + : forecastMaxInt // ignore: cast_nullable_to_non_nullable + as ForecastMaxInt, + forecastMaxLgInt: + freezed == forecastMaxLgInt + ? _value.forecastMaxLgInt + : forecastMaxLgInt // ignore: cast_nullable_to_non_nullable + as ForecastMaxLgInt?, + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EstimatedIntensityRegionImpl implements _EstimatedIntensityRegion { - const _$EstimatedIntensityRegionImpl( - {required this.code, - required this.name, - @JsonKey(name: 'isPlum') required this.isPlum, - @JsonKey(name: 'isWarning') required this.isWarning, - @JsonKey(name: 'forecastMaxInt') required this.forecastMaxInt, - @JsonKey(name: 'forecastMaxLgInt') required this.forecastMaxLgInt, - @JsonKey(name: 'arrivalTime') required this.arrivalTime}); + const _$EstimatedIntensityRegionImpl({ + required this.code, + required this.name, + @JsonKey(name: 'isPlum') required this.isPlum, + @JsonKey(name: 'isWarning') required this.isWarning, + @JsonKey(name: 'forecastMaxInt') required this.forecastMaxInt, + @JsonKey(name: 'forecastMaxLgInt') required this.forecastMaxLgInt, + @JsonKey(name: 'arrivalTime') required this.arrivalTime, + }); factory _$EstimatedIntensityRegionImpl.fromJson(Map json) => _$$EstimatedIntensityRegionImplFromJson(json); @@ -1022,8 +1118,16 @@ class _$EstimatedIntensityRegionImpl implements _EstimatedIntensityRegion { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, code, name, isPlum, isWarning, - forecastMaxInt, forecastMaxLgInt, arrivalTime); + int get hashCode => Object.hash( + runtimeType, + code, + name, + isPlum, + isWarning, + forecastMaxInt, + forecastMaxLgInt, + arrivalTime, + ); /// Create a copy of EstimatedIntensityRegion /// with the given fields replaced by the non-null parameter values. @@ -1031,29 +1135,28 @@ class _$EstimatedIntensityRegionImpl implements _EstimatedIntensityRegion { @override @pragma('vm:prefer-inline') _$$EstimatedIntensityRegionImplCopyWith<_$EstimatedIntensityRegionImpl> - get copyWith => __$$EstimatedIntensityRegionImplCopyWithImpl< - _$EstimatedIntensityRegionImpl>(this, _$identity); + get copyWith => __$$EstimatedIntensityRegionImplCopyWithImpl< + _$EstimatedIntensityRegionImpl + >(this, _$identity); @override Map toJson() { - return _$$EstimatedIntensityRegionImplToJson( - this, - ); + return _$$EstimatedIntensityRegionImplToJson(this); } } abstract class _EstimatedIntensityRegion implements EstimatedIntensityRegion { - const factory _EstimatedIntensityRegion( - {required final String code, - required final String name, - @JsonKey(name: 'isPlum') required final bool isPlum, - @JsonKey(name: 'isWarning') required final bool isWarning, - @JsonKey(name: 'forecastMaxInt') - required final ForecastMaxInt forecastMaxInt, - @JsonKey(name: 'forecastMaxLgInt') - required final ForecastMaxLgInt? forecastMaxLgInt, - @JsonKey(name: 'arrivalTime') required final DateTime? arrivalTime}) = - _$EstimatedIntensityRegionImpl; + const factory _EstimatedIntensityRegion({ + required final String code, + required final String name, + @JsonKey(name: 'isPlum') required final bool isPlum, + @JsonKey(name: 'isWarning') required final bool isWarning, + @JsonKey(name: 'forecastMaxInt') + required final ForecastMaxInt forecastMaxInt, + @JsonKey(name: 'forecastMaxLgInt') + required final ForecastMaxLgInt? forecastMaxLgInt, + @JsonKey(name: 'arrivalTime') required final DateTime? arrivalTime, + }) = _$EstimatedIntensityRegionImpl; factory _EstimatedIntensityRegion.fromJson(Map json) = _$EstimatedIntensityRegionImpl.fromJson; @@ -1085,7 +1188,7 @@ abstract class _EstimatedIntensityRegion implements EstimatedIntensityRegion { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EstimatedIntensityRegionImplCopyWith<_$EstimatedIntensityRegionImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } EewAccuracy _$EewAccuracyFromJson(Map json) { @@ -1118,17 +1221,18 @@ mixin _$EewAccuracy { /// @nodoc abstract class $EewAccuracyCopyWith<$Res> { factory $EewAccuracyCopyWith( - EewAccuracy value, $Res Function(EewAccuracy) then) = - _$EewAccuracyCopyWithImpl<$Res, EewAccuracy>; + EewAccuracy value, + $Res Function(EewAccuracy) then, + ) = _$EewAccuracyCopyWithImpl<$Res, EewAccuracy>; @useResult - $Res call( - {@JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) - List epicenters, - @JsonKey(fromJson: int.parse, toJson: intToString) int depth, - @JsonKey(fromJson: int.parse, toJson: intToString) - int magnitudeCalculation, - @JsonKey(fromJson: int.parse, toJson: intToString) - int numberOfMagnitudeCalculation}); + $Res call({ + @JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) + List epicenters, + @JsonKey(fromJson: int.parse, toJson: intToString) int depth, + @JsonKey(fromJson: int.parse, toJson: intToString) int magnitudeCalculation, + @JsonKey(fromJson: int.parse, toJson: intToString) + int numberOfMagnitudeCalculation, + }); } /// @nodoc @@ -1151,24 +1255,31 @@ class _$EewAccuracyCopyWithImpl<$Res, $Val extends EewAccuracy> Object? magnitudeCalculation = null, Object? numberOfMagnitudeCalculation = null, }) { - return _then(_value.copyWith( - epicenters: null == epicenters - ? _value.epicenters - : epicenters // ignore: cast_nullable_to_non_nullable - as List, - depth: null == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int, - magnitudeCalculation: null == magnitudeCalculation - ? _value.magnitudeCalculation - : magnitudeCalculation // ignore: cast_nullable_to_non_nullable - as int, - numberOfMagnitudeCalculation: null == numberOfMagnitudeCalculation - ? _value.numberOfMagnitudeCalculation - : numberOfMagnitudeCalculation // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + return _then( + _value.copyWith( + epicenters: + null == epicenters + ? _value.epicenters + : epicenters // ignore: cast_nullable_to_non_nullable + as List, + depth: + null == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int, + magnitudeCalculation: + null == magnitudeCalculation + ? _value.magnitudeCalculation + : magnitudeCalculation // ignore: cast_nullable_to_non_nullable + as int, + numberOfMagnitudeCalculation: + null == numberOfMagnitudeCalculation + ? _value.numberOfMagnitudeCalculation + : numberOfMagnitudeCalculation // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); } } @@ -1176,18 +1287,19 @@ class _$EewAccuracyCopyWithImpl<$Res, $Val extends EewAccuracy> abstract class _$$EewAccuracyImplCopyWith<$Res> implements $EewAccuracyCopyWith<$Res> { factory _$$EewAccuracyImplCopyWith( - _$EewAccuracyImpl value, $Res Function(_$EewAccuracyImpl) then) = - __$$EewAccuracyImplCopyWithImpl<$Res>; + _$EewAccuracyImpl value, + $Res Function(_$EewAccuracyImpl) then, + ) = __$$EewAccuracyImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) - List epicenters, - @JsonKey(fromJson: int.parse, toJson: intToString) int depth, - @JsonKey(fromJson: int.parse, toJson: intToString) - int magnitudeCalculation, - @JsonKey(fromJson: int.parse, toJson: intToString) - int numberOfMagnitudeCalculation}); + $Res call({ + @JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) + List epicenters, + @JsonKey(fromJson: int.parse, toJson: intToString) int depth, + @JsonKey(fromJson: int.parse, toJson: intToString) int magnitudeCalculation, + @JsonKey(fromJson: int.parse, toJson: intToString) + int numberOfMagnitudeCalculation, + }); } /// @nodoc @@ -1195,8 +1307,9 @@ class __$$EewAccuracyImplCopyWithImpl<$Res> extends _$EewAccuracyCopyWithImpl<$Res, _$EewAccuracyImpl> implements _$$EewAccuracyImplCopyWith<$Res> { __$$EewAccuracyImplCopyWithImpl( - _$EewAccuracyImpl _value, $Res Function(_$EewAccuracyImpl) _then) - : super(_value, _then); + _$EewAccuracyImpl _value, + $Res Function(_$EewAccuracyImpl) _then, + ) : super(_value, _then); /// Create a copy of EewAccuracy /// with the given fields replaced by the non-null parameter values. @@ -1208,24 +1321,30 @@ class __$$EewAccuracyImplCopyWithImpl<$Res> Object? magnitudeCalculation = null, Object? numberOfMagnitudeCalculation = null, }) { - return _then(_$EewAccuracyImpl( - epicenters: null == epicenters - ? _value._epicenters - : epicenters // ignore: cast_nullable_to_non_nullable - as List, - depth: null == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int, - magnitudeCalculation: null == magnitudeCalculation - ? _value.magnitudeCalculation - : magnitudeCalculation // ignore: cast_nullable_to_non_nullable - as int, - numberOfMagnitudeCalculation: null == numberOfMagnitudeCalculation - ? _value.numberOfMagnitudeCalculation - : numberOfMagnitudeCalculation // ignore: cast_nullable_to_non_nullable - as int, - )); + return _then( + _$EewAccuracyImpl( + epicenters: + null == epicenters + ? _value._epicenters + : epicenters // ignore: cast_nullable_to_non_nullable + as List, + depth: + null == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int, + magnitudeCalculation: + null == magnitudeCalculation + ? _value.magnitudeCalculation + : magnitudeCalculation // ignore: cast_nullable_to_non_nullable + as int, + numberOfMagnitudeCalculation: + null == numberOfMagnitudeCalculation + ? _value.numberOfMagnitudeCalculation + : numberOfMagnitudeCalculation // ignore: cast_nullable_to_non_nullable + as int, + ), + ); } } @@ -1233,15 +1352,15 @@ class __$$EewAccuracyImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$EewAccuracyImpl implements _EewAccuracy { - const _$EewAccuracyImpl( - {@JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) - required final List epicenters, - @JsonKey(fromJson: int.parse, toJson: intToString) required this.depth, - @JsonKey(fromJson: int.parse, toJson: intToString) - required this.magnitudeCalculation, - @JsonKey(fromJson: int.parse, toJson: intToString) - required this.numberOfMagnitudeCalculation}) - : _epicenters = epicenters; + const _$EewAccuracyImpl({ + @JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) + required final List epicenters, + @JsonKey(fromJson: int.parse, toJson: intToString) required this.depth, + @JsonKey(fromJson: int.parse, toJson: intToString) + required this.magnitudeCalculation, + @JsonKey(fromJson: int.parse, toJson: intToString) + required this.numberOfMagnitudeCalculation, + }) : _epicenters = epicenters; factory _$EewAccuracyImpl.fromJson(Map json) => _$$EewAccuracyImplFromJson(json); @@ -1280,13 +1399,17 @@ class _$EewAccuracyImpl implements _EewAccuracy { return identical(this, other) || (other.runtimeType == runtimeType && other is _$EewAccuracyImpl && - const DeepCollectionEquality() - .equals(other._epicenters, _epicenters) && + const DeepCollectionEquality().equals( + other._epicenters, + _epicenters, + ) && (identical(other.depth, depth) || other.depth == depth) && (identical(other.magnitudeCalculation, magnitudeCalculation) || other.magnitudeCalculation == magnitudeCalculation) && - (identical(other.numberOfMagnitudeCalculation, - numberOfMagnitudeCalculation) || + (identical( + other.numberOfMagnitudeCalculation, + numberOfMagnitudeCalculation, + ) || other.numberOfMagnitudeCalculation == numberOfMagnitudeCalculation)); } @@ -1294,11 +1417,12 @@ class _$EewAccuracyImpl implements _EewAccuracy { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_epicenters), - depth, - magnitudeCalculation, - numberOfMagnitudeCalculation); + runtimeType, + const DeepCollectionEquality().hash(_epicenters), + depth, + magnitudeCalculation, + numberOfMagnitudeCalculation, + ); /// Create a copy of EewAccuracy /// with the given fields replaced by the non-null parameter values. @@ -1310,22 +1434,20 @@ class _$EewAccuracyImpl implements _EewAccuracy { @override Map toJson() { - return _$$EewAccuracyImplToJson( - this, - ); + return _$$EewAccuracyImplToJson(this); } } abstract class _EewAccuracy implements EewAccuracy { - const factory _EewAccuracy( - {@JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) - required final List epicenters, - @JsonKey(fromJson: int.parse, toJson: intToString) - required final int depth, - @JsonKey(fromJson: int.parse, toJson: intToString) - required final int magnitudeCalculation, - @JsonKey(fromJson: int.parse, toJson: intToString) - required final int numberOfMagnitudeCalculation}) = _$EewAccuracyImpl; + const factory _EewAccuracy({ + @JsonKey(fromJson: stringListToIntList, toJson: intListToStringList) + required final List epicenters, + @JsonKey(fromJson: int.parse, toJson: intToString) required final int depth, + @JsonKey(fromJson: int.parse, toJson: intToString) + required final int magnitudeCalculation, + @JsonKey(fromJson: int.parse, toJson: intToString) + required final int numberOfMagnitudeCalculation, + }) = _$EewAccuracyImpl; factory _EewAccuracy.fromJson(Map json) = _$EewAccuracyImpl.fromJson; @@ -1375,8 +1497,9 @@ mixin _$ForecastMaxInt { /// @nodoc abstract class $ForecastMaxIntCopyWith<$Res> { factory $ForecastMaxIntCopyWith( - ForecastMaxInt value, $Res Function(ForecastMaxInt) then) = - _$ForecastMaxIntCopyWithImpl<$Res, ForecastMaxInt>; + ForecastMaxInt value, + $Res Function(ForecastMaxInt) then, + ) = _$ForecastMaxIntCopyWithImpl<$Res, ForecastMaxInt>; @useResult $Res call({JmaForecastIntensity from, JmaForecastIntensityOver to}); } @@ -1395,29 +1518,32 @@ class _$ForecastMaxIntCopyWithImpl<$Res, $Val extends ForecastMaxInt> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? from = null, - Object? to = null, - }) { - return _then(_value.copyWith( - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensityOver, - ) as $Val); + $Res call({Object? from = null, Object? to = null}) { + return _then( + _value.copyWith( + from: + null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + to: + null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensityOver, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ForecastMaxIntImplCopyWith<$Res> implements $ForecastMaxIntCopyWith<$Res> { - factory _$$ForecastMaxIntImplCopyWith(_$ForecastMaxIntImpl value, - $Res Function(_$ForecastMaxIntImpl) then) = - __$$ForecastMaxIntImplCopyWithImpl<$Res>; + factory _$$ForecastMaxIntImplCopyWith( + _$ForecastMaxIntImpl value, + $Res Function(_$ForecastMaxIntImpl) then, + ) = __$$ForecastMaxIntImplCopyWithImpl<$Res>; @override @useResult $Res call({JmaForecastIntensity from, JmaForecastIntensityOver to}); @@ -1428,27 +1554,29 @@ class __$$ForecastMaxIntImplCopyWithImpl<$Res> extends _$ForecastMaxIntCopyWithImpl<$Res, _$ForecastMaxIntImpl> implements _$$ForecastMaxIntImplCopyWith<$Res> { __$$ForecastMaxIntImplCopyWithImpl( - _$ForecastMaxIntImpl _value, $Res Function(_$ForecastMaxIntImpl) _then) - : super(_value, _then); + _$ForecastMaxIntImpl _value, + $Res Function(_$ForecastMaxIntImpl) _then, + ) : super(_value, _then); /// Create a copy of ForecastMaxInt /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? from = null, - Object? to = null, - }) { - return _then(_$ForecastMaxIntImpl( - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensityOver, - )); + $Res call({Object? from = null, Object? to = null}) { + return _then( + _$ForecastMaxIntImpl( + from: + null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + to: + null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensityOver, + ), + ); } } @@ -1491,20 +1619,21 @@ class _$ForecastMaxIntImpl implements _ForecastMaxInt { @pragma('vm:prefer-inline') _$$ForecastMaxIntImplCopyWith<_$ForecastMaxIntImpl> get copyWith => __$$ForecastMaxIntImplCopyWithImpl<_$ForecastMaxIntImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$ForecastMaxIntImplToJson( - this, - ); + return _$$ForecastMaxIntImplToJson(this); } } abstract class _ForecastMaxInt implements ForecastMaxInt { - const factory _ForecastMaxInt( - {required final JmaForecastIntensity from, - required final JmaForecastIntensityOver to}) = _$ForecastMaxIntImpl; + const factory _ForecastMaxInt({ + required final JmaForecastIntensity from, + required final JmaForecastIntensityOver to, + }) = _$ForecastMaxIntImpl; factory _ForecastMaxInt.fromJson(Map json) = _$ForecastMaxIntImpl.fromJson; @@ -1544,8 +1673,9 @@ mixin _$ForecastMaxLgInt { /// @nodoc abstract class $ForecastMaxLgIntCopyWith<$Res> { factory $ForecastMaxLgIntCopyWith( - ForecastMaxLgInt value, $Res Function(ForecastMaxLgInt) then) = - _$ForecastMaxLgIntCopyWithImpl<$Res, ForecastMaxLgInt>; + ForecastMaxLgInt value, + $Res Function(ForecastMaxLgInt) then, + ) = _$ForecastMaxLgIntCopyWithImpl<$Res, ForecastMaxLgInt>; @useResult $Res call({JmaForecastLgIntensity from, JmaForecastLgIntensityOver to}); } @@ -1564,29 +1694,32 @@ class _$ForecastMaxLgIntCopyWithImpl<$Res, $Val extends ForecastMaxLgInt> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? from = null, - Object? to = null, - }) { - return _then(_value.copyWith( - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as JmaForecastLgIntensity, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as JmaForecastLgIntensityOver, - ) as $Val); + $Res call({Object? from = null, Object? to = null}) { + return _then( + _value.copyWith( + from: + null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as JmaForecastLgIntensity, + to: + null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as JmaForecastLgIntensityOver, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ForecastMaxLgIntImplCopyWith<$Res> implements $ForecastMaxLgIntCopyWith<$Res> { - factory _$$ForecastMaxLgIntImplCopyWith(_$ForecastMaxLgIntImpl value, - $Res Function(_$ForecastMaxLgIntImpl) then) = - __$$ForecastMaxLgIntImplCopyWithImpl<$Res>; + factory _$$ForecastMaxLgIntImplCopyWith( + _$ForecastMaxLgIntImpl value, + $Res Function(_$ForecastMaxLgIntImpl) then, + ) = __$$ForecastMaxLgIntImplCopyWithImpl<$Res>; @override @useResult $Res call({JmaForecastLgIntensity from, JmaForecastLgIntensityOver to}); @@ -1596,28 +1729,30 @@ abstract class _$$ForecastMaxLgIntImplCopyWith<$Res> class __$$ForecastMaxLgIntImplCopyWithImpl<$Res> extends _$ForecastMaxLgIntCopyWithImpl<$Res, _$ForecastMaxLgIntImpl> implements _$$ForecastMaxLgIntImplCopyWith<$Res> { - __$$ForecastMaxLgIntImplCopyWithImpl(_$ForecastMaxLgIntImpl _value, - $Res Function(_$ForecastMaxLgIntImpl) _then) - : super(_value, _then); + __$$ForecastMaxLgIntImplCopyWithImpl( + _$ForecastMaxLgIntImpl _value, + $Res Function(_$ForecastMaxLgIntImpl) _then, + ) : super(_value, _then); /// Create a copy of ForecastMaxLgInt /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? from = null, - Object? to = null, - }) { - return _then(_$ForecastMaxLgIntImpl( - from: null == from - ? _value.from - : from // ignore: cast_nullable_to_non_nullable - as JmaForecastLgIntensity, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable - as JmaForecastLgIntensityOver, - )); + $Res call({Object? from = null, Object? to = null}) { + return _then( + _$ForecastMaxLgIntImpl( + from: + null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as JmaForecastLgIntensity, + to: + null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as JmaForecastLgIntensityOver, + ), + ); } } @@ -1660,20 +1795,21 @@ class _$ForecastMaxLgIntImpl implements _ForecastMaxLgInt { @pragma('vm:prefer-inline') _$$ForecastMaxLgIntImplCopyWith<_$ForecastMaxLgIntImpl> get copyWith => __$$ForecastMaxLgIntImplCopyWithImpl<_$ForecastMaxLgIntImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$ForecastMaxLgIntImplToJson( - this, - ); + return _$$ForecastMaxLgIntImplToJson(this); } } abstract class _ForecastMaxLgInt implements ForecastMaxLgInt { - const factory _ForecastMaxLgInt( - {required final JmaForecastLgIntensity from, - required final JmaForecastLgIntensityOver to}) = _$ForecastMaxLgIntImpl; + const factory _ForecastMaxLgInt({ + required final JmaForecastLgIntensity from, + required final JmaForecastLgIntensityOver to, + }) = _$ForecastMaxLgIntImpl; factory _ForecastMaxLgInt.fromJson(Map json) = _$ForecastMaxLgIntImpl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/eew.g.dart b/packages/eqapi_types/lib/src/model/v1/eew.g.dart index 0de0e099..491a654a 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.g.dart @@ -9,77 +9,93 @@ part of 'eew.dart'; // ************************************************************************** _$EewV1Impl _$$EewV1ImplFromJson(Map json) => $checkedCreate( - r'_$EewV1Impl', - json, - ($checkedConvert) { - final val = _$EewV1Impl( - id: $checkedConvert('id', (v) => (v as num).toInt()), - eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), - type: $checkedConvert('type', (v) => v as String), - schemaType: $checkedConvert('schema_type', (v) => v as String), - status: $checkedConvert('status', (v) => v as String), - infoType: $checkedConvert('info_type', (v) => v as String), - reportTime: $checkedConvert( - 'report_time', (v) => DateTime.parse(v as String)), - isCanceled: $checkedConvert('is_canceled', (v) => v as bool), - isLastInfo: $checkedConvert('is_last_info', (v) => v as bool), - isPlum: $checkedConvert('is_plum', (v) => v as bool?), - accuracy: $checkedConvert( - 'accuracy', - (v) => v == null - ? null - : EewAccuracy.fromJson(v as Map)), - serialNo: $checkedConvert('serial_no', (v) => (v as num?)?.toInt()), - headline: $checkedConvert('headline', (v) => v as String?), - isWarning: $checkedConvert('is_warning', (v) => v as bool?), - originTime: $checkedConvert('origin_time', - (v) => v == null ? null : DateTime.parse(v as String)), - arrivalTime: $checkedConvert('arrival_time', - (v) => v == null ? null : DateTime.parse(v as String)), - hypoName: $checkedConvert('hypo_name', (v) => v as String?), - depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), - latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), - longitude: - $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), - magnitude: - $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), - forecastMaxIntensity: $checkedConvert('forecast_max_intensity', - (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v)), - forecastMaxIntensityIsOver: $checkedConvert( - 'forecast_max_intensity_is_over', (v) => v as bool?), - forecastMaxLpgmIntensity: $checkedConvert( - 'forecast_max_lpgm_intensity', - (v) => $enumDecodeNullable(_$JmaForecastLgIntensityEnumMap, v)), - forecastMaxLpgmIntensityIsOver: $checkedConvert( - 'forecast_max_lpgm_intensity_is_over', (v) => v as bool?), - regions: $checkedConvert( - 'regions', - (v) => (v as List?) - ?.map((e) => EstimatedIntensityRegion.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - fieldKeyMap: const { - 'eventId': 'event_id', - 'schemaType': 'schema_type', - 'infoType': 'info_type', - 'reportTime': 'report_time', - 'isCanceled': 'is_canceled', - 'isLastInfo': 'is_last_info', - 'isPlum': 'is_plum', - 'serialNo': 'serial_no', - 'isWarning': 'is_warning', - 'originTime': 'origin_time', - 'arrivalTime': 'arrival_time', - 'hypoName': 'hypo_name', - 'forecastMaxIntensity': 'forecast_max_intensity', - 'forecastMaxIntensityIsOver': 'forecast_max_intensity_is_over', - 'forecastMaxLpgmIntensity': 'forecast_max_lpgm_intensity', - 'forecastMaxLpgmIntensityIsOver': 'forecast_max_lpgm_intensity_is_over' - }, + r'_$EewV1Impl', + json, + ($checkedConvert) { + final val = _$EewV1Impl( + id: $checkedConvert('id', (v) => (v as num).toInt()), + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + type: $checkedConvert('type', (v) => v as String), + schemaType: $checkedConvert('schema_type', (v) => v as String), + status: $checkedConvert('status', (v) => v as String), + infoType: $checkedConvert('info_type', (v) => v as String), + reportTime: $checkedConvert( + 'report_time', + (v) => DateTime.parse(v as String), + ), + isCanceled: $checkedConvert('is_canceled', (v) => v as bool), + isLastInfo: $checkedConvert('is_last_info', (v) => v as bool), + isPlum: $checkedConvert('is_plum', (v) => v as bool?), + accuracy: $checkedConvert( + 'accuracy', + (v) => + v == null ? null : EewAccuracy.fromJson(v as Map), + ), + serialNo: $checkedConvert('serial_no', (v) => (v as num?)?.toInt()), + headline: $checkedConvert('headline', (v) => v as String?), + isWarning: $checkedConvert('is_warning', (v) => v as bool?), + originTime: $checkedConvert( + 'origin_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + arrivalTime: $checkedConvert( + 'arrival_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + hypoName: $checkedConvert('hypo_name', (v) => v as String?), + depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), + latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), + longitude: $checkedConvert('longitude', (v) => (v as num?)?.toDouble()), + magnitude: $checkedConvert('magnitude', (v) => (v as num?)?.toDouble()), + forecastMaxIntensity: $checkedConvert( + 'forecast_max_intensity', + (v) => $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v), + ), + forecastMaxIntensityIsOver: $checkedConvert( + 'forecast_max_intensity_is_over', + (v) => v as bool?, + ), + forecastMaxLpgmIntensity: $checkedConvert( + 'forecast_max_lpgm_intensity', + (v) => $enumDecodeNullable(_$JmaForecastLgIntensityEnumMap, v), + ), + forecastMaxLpgmIntensityIsOver: $checkedConvert( + 'forecast_max_lpgm_intensity_is_over', + (v) => v as bool?, + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List?) + ?.map( + (e) => EstimatedIntensityRegion.fromJson( + e as Map, + ), + ) + .toList(), + ), ); + return val; + }, + fieldKeyMap: const { + 'eventId': 'event_id', + 'schemaType': 'schema_type', + 'infoType': 'info_type', + 'reportTime': 'report_time', + 'isCanceled': 'is_canceled', + 'isLastInfo': 'is_last_info', + 'isPlum': 'is_plum', + 'serialNo': 'serial_no', + 'isWarning': 'is_warning', + 'originTime': 'origin_time', + 'arrivalTime': 'arrival_time', + 'hypoName': 'hypo_name', + 'forecastMaxIntensity': 'forecast_max_intensity', + 'forecastMaxIntensityIsOver': 'forecast_max_intensity_is_over', + 'forecastMaxLpgmIntensity': 'forecast_max_lpgm_intensity', + 'forecastMaxLpgmIntensityIsOver': 'forecast_max_lpgm_intensity_is_over', + }, +); Map _$$EewV1ImplToJson(_$EewV1Impl instance) => { @@ -138,90 +154,95 @@ const _$JmaForecastLgIntensityEnumMap = { }; _$EstimatedIntensityRegionImpl _$$EstimatedIntensityRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$EstimatedIntensityRegionImpl', - json, - ($checkedConvert) { - final val = _$EstimatedIntensityRegionImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - isPlum: $checkedConvert('isPlum', (v) => v as bool), - isWarning: $checkedConvert('isWarning', (v) => v as bool), - forecastMaxInt: $checkedConvert('forecastMaxInt', - (v) => ForecastMaxInt.fromJson(v as Map)), - forecastMaxLgInt: $checkedConvert( - 'forecastMaxLgInt', - (v) => v == null - ? null - : ForecastMaxLgInt.fromJson(v as Map)), - arrivalTime: $checkedConvert('arrivalTime', - (v) => v == null ? null : DateTime.parse(v as String)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EstimatedIntensityRegionImpl', json, ($checkedConvert) { + final val = _$EstimatedIntensityRegionImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + isPlum: $checkedConvert('isPlum', (v) => v as bool), + isWarning: $checkedConvert('isWarning', (v) => v as bool), + forecastMaxInt: $checkedConvert( + 'forecastMaxInt', + (v) => ForecastMaxInt.fromJson(v as Map), + ), + forecastMaxLgInt: $checkedConvert( + 'forecastMaxLgInt', + (v) => + v == null + ? null + : ForecastMaxLgInt.fromJson(v as Map), + ), + arrivalTime: $checkedConvert( + 'arrivalTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; +}); Map _$$EstimatedIntensityRegionImplToJson( - _$EstimatedIntensityRegionImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'isPlum': instance.isPlum, - 'isWarning': instance.isWarning, - 'forecastMaxInt': instance.forecastMaxInt, - 'forecastMaxLgInt': instance.forecastMaxLgInt, - 'arrivalTime': instance.arrivalTime?.toIso8601String(), - }; + _$EstimatedIntensityRegionImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'isPlum': instance.isPlum, + 'isWarning': instance.isWarning, + 'forecastMaxInt': instance.forecastMaxInt, + 'forecastMaxLgInt': instance.forecastMaxLgInt, + 'arrivalTime': instance.arrivalTime?.toIso8601String(), +}; _$EewAccuracyImpl _$$EewAccuracyImplFromJson(Map json) => - $checkedCreate( - r'_$EewAccuracyImpl', - json, - ($checkedConvert) { - final val = _$EewAccuracyImpl( - epicenters: $checkedConvert( - 'epicenters', (v) => stringListToIntList(v as List)), - depth: $checkedConvert('depth', (v) => int.parse(v as String)), - magnitudeCalculation: $checkedConvert( - 'magnitudeCalculation', (v) => int.parse(v as String)), - numberOfMagnitudeCalculation: $checkedConvert( - 'numberOfMagnitudeCalculation', (v) => int.parse(v as String)), - ); - return val; - }, - ); + $checkedCreate(r'_$EewAccuracyImpl', json, ($checkedConvert) { + final val = _$EewAccuracyImpl( + epicenters: $checkedConvert( + 'epicenters', + (v) => stringListToIntList(v as List), + ), + depth: $checkedConvert('depth', (v) => int.parse(v as String)), + magnitudeCalculation: $checkedConvert( + 'magnitudeCalculation', + (v) => int.parse(v as String), + ), + numberOfMagnitudeCalculation: $checkedConvert( + 'numberOfMagnitudeCalculation', + (v) => int.parse(v as String), + ), + ); + return val; + }); Map _$$EewAccuracyImplToJson(_$EewAccuracyImpl instance) => { 'epicenters': intListToStringList(instance.epicenters), 'depth': intToString(instance.depth), 'magnitudeCalculation': intToString(instance.magnitudeCalculation), - 'numberOfMagnitudeCalculation': - intToString(instance.numberOfMagnitudeCalculation), + 'numberOfMagnitudeCalculation': intToString( + instance.numberOfMagnitudeCalculation, + ), }; _$ForecastMaxIntImpl _$$ForecastMaxIntImplFromJson(Map json) => - $checkedCreate( - r'_$ForecastMaxIntImpl', - json, - ($checkedConvert) { - final val = _$ForecastMaxIntImpl( - from: $checkedConvert( - 'from', (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v)), - to: $checkedConvert( - 'to', (v) => $enumDecode(_$JmaForecastIntensityOverEnumMap, v)), - ); - return val; - }, - ); + $checkedCreate(r'_$ForecastMaxIntImpl', json, ($checkedConvert) { + final val = _$ForecastMaxIntImpl( + from: $checkedConvert( + 'from', + (v) => $enumDecode(_$JmaForecastIntensityEnumMap, v), + ), + to: $checkedConvert( + 'to', + (v) => $enumDecode(_$JmaForecastIntensityOverEnumMap, v), + ), + ); + return val; + }); Map _$$ForecastMaxIntImplToJson( - _$ForecastMaxIntImpl instance) => - { - 'from': _$JmaForecastIntensityEnumMap[instance.from]!, - 'to': _$JmaForecastIntensityOverEnumMap[instance.to]!, - }; + _$ForecastMaxIntImpl instance, +) => { + 'from': _$JmaForecastIntensityEnumMap[instance.from]!, + 'to': _$JmaForecastIntensityOverEnumMap[instance.to]!, +}; const _$JmaForecastIntensityOverEnumMap = { JmaForecastIntensityOver.zero: '0', @@ -239,27 +260,27 @@ const _$JmaForecastIntensityOverEnumMap = { }; _$ForecastMaxLgIntImpl _$$ForecastMaxLgIntImplFromJson( - Map json) => - $checkedCreate( - r'_$ForecastMaxLgIntImpl', - json, - ($checkedConvert) { - final val = _$ForecastMaxLgIntImpl( - from: $checkedConvert( - 'from', (v) => $enumDecode(_$JmaForecastLgIntensityEnumMap, v)), - to: $checkedConvert( - 'to', (v) => $enumDecode(_$JmaForecastLgIntensityOverEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$ForecastMaxLgIntImpl', json, ($checkedConvert) { + final val = _$ForecastMaxLgIntImpl( + from: $checkedConvert( + 'from', + (v) => $enumDecode(_$JmaForecastLgIntensityEnumMap, v), + ), + to: $checkedConvert( + 'to', + (v) => $enumDecode(_$JmaForecastLgIntensityOverEnumMap, v), + ), + ); + return val; +}); Map _$$ForecastMaxLgIntImplToJson( - _$ForecastMaxLgIntImpl instance) => - { - 'from': _$JmaForecastLgIntensityEnumMap[instance.from]!, - 'to': _$JmaForecastLgIntensityOverEnumMap[instance.to]!, - }; + _$ForecastMaxLgIntImpl instance, +) => { + 'from': _$JmaForecastLgIntensityEnumMap[instance.from]!, + 'to': _$JmaForecastLgIntensityOverEnumMap[instance.to]!, +}; const _$JmaForecastLgIntensityOverEnumMap = { JmaForecastLgIntensityOver.zero: '0', diff --git a/packages/eqapi_types/lib/src/model/v1/information.dart b/packages/eqapi_types/lib/src/model/v1/information.dart index 8b39a42b..42db2086 100644 --- a/packages/eqapi_types/lib/src/model/v1/information.dart +++ b/packages/eqapi_types/lib/src/model/v1/information.dart @@ -13,10 +13,7 @@ class InformationV1 with _$InformationV1 implements V1Database { ) required InformationAuthor author, required Map body, - @JsonKey( - name: 'created_at', - ) - required DateTime createdAt, + @JsonKey(name: 'created_at') required DateTime createdAt, required int id, @JsonKey( unknownEnumValue: InformationLevel.info, @@ -31,14 +28,6 @@ class InformationV1 with _$InformationV1 implements V1Database { _$InformationV1FromJson(json); } -enum InformationAuthor { - jma, - developer, - unknown, -} +enum InformationAuthor { jma, developer, unknown } -enum InformationLevel { - info, - warning, - critical, -} +enum InformationLevel { info, warning, critical } diff --git a/packages/eqapi_types/lib/src/model/v1/information.freezed.dart b/packages/eqapi_types/lib/src/model/v1/information.freezed.dart index 5b8babb6..50ab57f6 100644 --- a/packages/eqapi_types/lib/src/model/v1/information.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/information.freezed.dart @@ -12,7 +12,8 @@ part of 'information.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); InformationV1 _$InformationV1FromJson(Map json) { return _InformationV1.fromJson(json); @@ -21,16 +22,18 @@ InformationV1 _$InformationV1FromJson(Map json) { /// @nodoc mixin _$InformationV1 { @JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) InformationAuthor get author => throw _privateConstructorUsedError; Map get body => throw _privateConstructorUsedError; @JsonKey(name: 'created_at') DateTime get createdAt => throw _privateConstructorUsedError; int get id => throw _privateConstructorUsedError; @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) InformationLevel get level => throw _privateConstructorUsedError; String get title => throw _privateConstructorUsedError; String get type => throw _privateConstructorUsedError; @@ -48,23 +51,27 @@ mixin _$InformationV1 { /// @nodoc abstract class $InformationV1CopyWith<$Res> { factory $InformationV1CopyWith( - InformationV1 value, $Res Function(InformationV1) then) = - _$InformationV1CopyWithImpl<$Res, InformationV1>; + InformationV1 value, + $Res Function(InformationV1) then, + ) = _$InformationV1CopyWithImpl<$Res, InformationV1>; @useResult - $Res call( - {@JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) - InformationAuthor author, - Map body, - @JsonKey(name: 'created_at') DateTime createdAt, - int id, - @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) - InformationLevel level, - String title, - String type}); + $Res call({ + @JsonKey( + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) + InformationAuthor author, + Map body, + @JsonKey(name: 'created_at') DateTime createdAt, + int id, + @JsonKey( + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) + InformationLevel level, + String title, + String type, + }); } /// @nodoc @@ -90,36 +97,46 @@ class _$InformationV1CopyWithImpl<$Res, $Val extends InformationV1> Object? title = null, Object? type = null, }) { - return _then(_value.copyWith( - author: null == author - ? _value.author - : author // ignore: cast_nullable_to_non_nullable - as InformationAuthor, - body: null == body - ? _value.body - : body // ignore: cast_nullable_to_non_nullable - as Map, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - level: null == level - ? _value.level - : level // ignore: cast_nullable_to_non_nullable - as InformationLevel, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + return _then( + _value.copyWith( + author: + null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as InformationAuthor, + body: + null == body + ? _value.body + : body // ignore: cast_nullable_to_non_nullable + as Map, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + level: + null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as InformationLevel, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -127,24 +144,28 @@ class _$InformationV1CopyWithImpl<$Res, $Val extends InformationV1> abstract class _$$InformationV1ImplCopyWith<$Res> implements $InformationV1CopyWith<$Res> { factory _$$InformationV1ImplCopyWith( - _$InformationV1Impl value, $Res Function(_$InformationV1Impl) then) = - __$$InformationV1ImplCopyWithImpl<$Res>; + _$InformationV1Impl value, + $Res Function(_$InformationV1Impl) then, + ) = __$$InformationV1ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) - InformationAuthor author, - Map body, - @JsonKey(name: 'created_at') DateTime createdAt, - int id, - @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) - InformationLevel level, - String title, - String type}); + $Res call({ + @JsonKey( + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) + InformationAuthor author, + Map body, + @JsonKey(name: 'created_at') DateTime createdAt, + int id, + @JsonKey( + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) + InformationLevel level, + String title, + String type, + }); } /// @nodoc @@ -152,8 +173,9 @@ class __$$InformationV1ImplCopyWithImpl<$Res> extends _$InformationV1CopyWithImpl<$Res, _$InformationV1Impl> implements _$$InformationV1ImplCopyWith<$Res> { __$$InformationV1ImplCopyWithImpl( - _$InformationV1Impl _value, $Res Function(_$InformationV1Impl) _then) - : super(_value, _then); + _$InformationV1Impl _value, + $Res Function(_$InformationV1Impl) _then, + ) : super(_value, _then); /// Create a copy of InformationV1 /// with the given fields replaced by the non-null parameter values. @@ -168,65 +190,77 @@ class __$$InformationV1ImplCopyWithImpl<$Res> Object? title = null, Object? type = null, }) { - return _then(_$InformationV1Impl( - author: null == author - ? _value.author - : author // ignore: cast_nullable_to_non_nullable - as InformationAuthor, - body: null == body - ? _value._body - : body // ignore: cast_nullable_to_non_nullable - as Map, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - level: null == level - ? _value.level - : level // ignore: cast_nullable_to_non_nullable - as InformationLevel, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - )); + return _then( + _$InformationV1Impl( + author: + null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as InformationAuthor, + body: + null == body + ? _value._body + : body // ignore: cast_nullable_to_non_nullable + as Map, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + level: + null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as InformationLevel, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$InformationV1Impl implements _InformationV1 { - const _$InformationV1Impl( - {@JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) - required this.author, - required final Map body, - @JsonKey(name: 'created_at') required this.createdAt, - required this.id, - @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) - required this.level, - required this.title, - required this.type}) - : _body = body; + const _$InformationV1Impl({ + @JsonKey( + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) + required this.author, + required final Map body, + @JsonKey(name: 'created_at') required this.createdAt, + required this.id, + @JsonKey( + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) + required this.level, + required this.title, + required this.type, + }) : _body = body; factory _$InformationV1Impl.fromJson(Map json) => _$$InformationV1ImplFromJson(json); @override @JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) final InformationAuthor author; final Map _body; @override @@ -243,8 +277,9 @@ class _$InformationV1Impl implements _InformationV1 { final int id; @override @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) final InformationLevel level; @override final String title; @@ -274,14 +309,15 @@ class _$InformationV1Impl implements _InformationV1 { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - author, - const DeepCollectionEquality().hash(_body), - createdAt, - id, - level, - title, - type); + runtimeType, + author, + const DeepCollectionEquality().hash(_body), + createdAt, + id, + level, + title, + type, + ); /// Create a copy of InformationV1 /// with the given fields replaced by the non-null parameter values. @@ -293,35 +329,37 @@ class _$InformationV1Impl implements _InformationV1 { @override Map toJson() { - return _$$InformationV1ImplToJson( - this, - ); + return _$$InformationV1ImplToJson(this); } } abstract class _InformationV1 implements InformationV1 { - const factory _InformationV1( - {@JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) - required final InformationAuthor author, - required final Map body, - @JsonKey(name: 'created_at') required final DateTime createdAt, - required final int id, - @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) - required final InformationLevel level, - required final String title, - required final String type}) = _$InformationV1Impl; + const factory _InformationV1({ + @JsonKey( + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) + required final InformationAuthor author, + required final Map body, + @JsonKey(name: 'created_at') required final DateTime createdAt, + required final int id, + @JsonKey( + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) + required final InformationLevel level, + required final String title, + required final String type, + }) = _$InformationV1Impl; factory _InformationV1.fromJson(Map json) = _$InformationV1Impl.fromJson; @override @JsonKey( - unknownEnumValue: InformationAuthor.unknown, - defaultValue: InformationAuthor.unknown) + unknownEnumValue: InformationAuthor.unknown, + defaultValue: InformationAuthor.unknown, + ) InformationAuthor get author; @override Map get body; @@ -332,8 +370,9 @@ abstract class _InformationV1 implements InformationV1 { int get id; @override @JsonKey( - unknownEnumValue: InformationLevel.info, - defaultValue: InformationLevel.info) + unknownEnumValue: InformationLevel.info, + defaultValue: InformationLevel.info, + ) InformationLevel get level; @override String get title; diff --git a/packages/eqapi_types/lib/src/model/v1/information.g.dart b/packages/eqapi_types/lib/src/model/v1/information.g.dart index d5705ccd..94a061f9 100644 --- a/packages/eqapi_types/lib/src/model/v1/information.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/information.g.dart @@ -9,34 +9,39 @@ part of 'information.dart'; // ************************************************************************** _$InformationV1Impl _$$InformationV1ImplFromJson(Map json) => - $checkedCreate( - r'_$InformationV1Impl', - json, - ($checkedConvert) { - final val = _$InformationV1Impl( - author: $checkedConvert( - 'author', - (v) => - $enumDecodeNullable(_$InformationAuthorEnumMap, v, - unknownValue: InformationAuthor.unknown) ?? - InformationAuthor.unknown), - body: $checkedConvert('body', (v) => v as Map), - createdAt: - $checkedConvert('created_at', (v) => DateTime.parse(v as String)), - id: $checkedConvert('id', (v) => (v as num).toInt()), - level: $checkedConvert( - 'level', - (v) => - $enumDecodeNullable(_$InformationLevelEnumMap, v, - unknownValue: InformationLevel.info) ?? - InformationLevel.info), - title: $checkedConvert('title', (v) => v as String), - type: $checkedConvert('type', (v) => v as String), - ); - return val; - }, - fieldKeyMap: const {'createdAt': 'created_at'}, - ); + $checkedCreate(r'_$InformationV1Impl', json, ($checkedConvert) { + final val = _$InformationV1Impl( + author: $checkedConvert( + 'author', + (v) => + $enumDecodeNullable( + _$InformationAuthorEnumMap, + v, + unknownValue: InformationAuthor.unknown, + ) ?? + InformationAuthor.unknown, + ), + body: $checkedConvert('body', (v) => v as Map), + createdAt: $checkedConvert( + 'created_at', + (v) => DateTime.parse(v as String), + ), + id: $checkedConvert('id', (v) => (v as num).toInt()), + level: $checkedConvert( + 'level', + (v) => + $enumDecodeNullable( + _$InformationLevelEnumMap, + v, + unknownValue: InformationLevel.info, + ) ?? + InformationLevel.info, + ), + title: $checkedConvert('title', (v) => v as String), + type: $checkedConvert('type', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'createdAt': 'created_at'}); Map _$$InformationV1ImplToJson(_$InformationV1Impl instance) => { diff --git a/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.freezed.dart b/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.freezed.dart index 8ba77e89..0c8d0e2f 100644 --- a/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.freezed.dart @@ -12,7 +12,8 @@ part of 'intensity_sub_division.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); IntensitySubDivision _$IntensitySubDivisionFromJson(Map json) { return _IntensitySubDivision.fromJson(json); @@ -38,21 +39,25 @@ mixin _$IntensitySubDivision { /// @nodoc abstract class $IntensitySubDivisionCopyWith<$Res> { - factory $IntensitySubDivisionCopyWith(IntensitySubDivision value, - $Res Function(IntensitySubDivision) then) = - _$IntensitySubDivisionCopyWithImpl<$Res, IntensitySubDivision>; + factory $IntensitySubDivisionCopyWith( + IntensitySubDivision value, + $Res Function(IntensitySubDivision) then, + ) = _$IntensitySubDivisionCopyWithImpl<$Res, IntensitySubDivision>; @useResult - $Res call( - {int id, - int eventId, - String areaCode, - JmaIntensity maxIntensity, - JmaLgIntensity? maxLpgmIntensity}); + $Res call({ + int id, + int eventId, + String areaCode, + JmaIntensity maxIntensity, + JmaLgIntensity? maxLpgmIntensity, + }); } /// @nodoc -class _$IntensitySubDivisionCopyWithImpl<$Res, - $Val extends IntensitySubDivision> +class _$IntensitySubDivisionCopyWithImpl< + $Res, + $Val extends IntensitySubDivision +> implements $IntensitySubDivisionCopyWith<$Res> { _$IntensitySubDivisionCopyWithImpl(this._value, this._then); @@ -72,54 +77,65 @@ class _$IntensitySubDivisionCopyWithImpl<$Res, Object? maxIntensity = null, Object? maxLpgmIntensity = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - areaCode: null == areaCode - ? _value.areaCode - : areaCode // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + areaCode: + null == areaCode + ? _value.areaCode + : areaCode // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$IntensitySubDivisionImplCopyWith<$Res> implements $IntensitySubDivisionCopyWith<$Res> { - factory _$$IntensitySubDivisionImplCopyWith(_$IntensitySubDivisionImpl value, - $Res Function(_$IntensitySubDivisionImpl) then) = - __$$IntensitySubDivisionImplCopyWithImpl<$Res>; + factory _$$IntensitySubDivisionImplCopyWith( + _$IntensitySubDivisionImpl value, + $Res Function(_$IntensitySubDivisionImpl) then, + ) = __$$IntensitySubDivisionImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int id, - int eventId, - String areaCode, - JmaIntensity maxIntensity, - JmaLgIntensity? maxLpgmIntensity}); + $Res call({ + int id, + int eventId, + String areaCode, + JmaIntensity maxIntensity, + JmaLgIntensity? maxLpgmIntensity, + }); } /// @nodoc class __$$IntensitySubDivisionImplCopyWithImpl<$Res> extends _$IntensitySubDivisionCopyWithImpl<$Res, _$IntensitySubDivisionImpl> implements _$$IntensitySubDivisionImplCopyWith<$Res> { - __$$IntensitySubDivisionImplCopyWithImpl(_$IntensitySubDivisionImpl _value, - $Res Function(_$IntensitySubDivisionImpl) _then) - : super(_value, _then); + __$$IntensitySubDivisionImplCopyWithImpl( + _$IntensitySubDivisionImpl _value, + $Res Function(_$IntensitySubDivisionImpl) _then, + ) : super(_value, _then); /// Create a copy of IntensitySubDivision /// with the given fields replaced by the non-null parameter values. @@ -132,40 +148,48 @@ class __$$IntensitySubDivisionImplCopyWithImpl<$Res> Object? maxIntensity = null, Object? maxLpgmIntensity = freezed, }) { - return _then(_$IntensitySubDivisionImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - areaCode: null == areaCode - ? _value.areaCode - : areaCode // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - )); + return _then( + _$IntensitySubDivisionImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + areaCode: + null == areaCode + ? _value.areaCode + : areaCode // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + ), + ); } } /// @nodoc @JsonSerializable() class _$IntensitySubDivisionImpl implements _IntensitySubDivision { - const _$IntensitySubDivisionImpl( - {required this.id, - required this.eventId, - required this.areaCode, - required this.maxIntensity, - required this.maxLpgmIntensity}); + const _$IntensitySubDivisionImpl({ + required this.id, + required this.eventId, + required this.areaCode, + required this.maxIntensity, + required this.maxLpgmIntensity, + }); factory _$IntensitySubDivisionImpl.fromJson(Map json) => _$$IntensitySubDivisionImplFromJson(json); @@ -204,7 +228,13 @@ class _$IntensitySubDivisionImpl implements _IntensitySubDivision { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, id, eventId, areaCode, maxIntensity, maxLpgmIntensity); + runtimeType, + id, + eventId, + areaCode, + maxIntensity, + maxLpgmIntensity, + ); /// Create a copy of IntensitySubDivision /// with the given fields replaced by the non-null parameter values. @@ -212,26 +242,26 @@ class _$IntensitySubDivisionImpl implements _IntensitySubDivision { @override @pragma('vm:prefer-inline') _$$IntensitySubDivisionImplCopyWith<_$IntensitySubDivisionImpl> - get copyWith => - __$$IntensitySubDivisionImplCopyWithImpl<_$IntensitySubDivisionImpl>( - this, _$identity); + get copyWith => + __$$IntensitySubDivisionImplCopyWithImpl<_$IntensitySubDivisionImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$IntensitySubDivisionImplToJson( - this, - ); + return _$$IntensitySubDivisionImplToJson(this); } } abstract class _IntensitySubDivision implements IntensitySubDivision { - const factory _IntensitySubDivision( - {required final int id, - required final int eventId, - required final String areaCode, - required final JmaIntensity maxIntensity, - required final JmaLgIntensity? maxLpgmIntensity}) = - _$IntensitySubDivisionImpl; + const factory _IntensitySubDivision({ + required final int id, + required final int eventId, + required final String areaCode, + required final JmaIntensity maxIntensity, + required final JmaLgIntensity? maxLpgmIntensity, + }) = _$IntensitySubDivisionImpl; factory _IntensitySubDivision.fromJson(Map json) = _$IntensitySubDivisionImpl.fromJson; @@ -252,5 +282,5 @@ abstract class _IntensitySubDivision implements IntensitySubDivision { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$IntensitySubDivisionImplCopyWith<_$IntensitySubDivisionImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.g.dart b/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.g.dart index af3b7734..d0ae99fc 100644 --- a/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/intensity_sub_division.g.dart @@ -9,39 +9,43 @@ part of 'intensity_sub_division.dart'; // ************************************************************************** _$IntensitySubDivisionImpl _$$IntensitySubDivisionImplFromJson( - Map json) => - $checkedCreate( - r'_$IntensitySubDivisionImpl', - json, - ($checkedConvert) { - final val = _$IntensitySubDivisionImpl( - id: $checkedConvert('id', (v) => (v as num).toInt()), - eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), - areaCode: $checkedConvert('area_code', (v) => v as String), - maxIntensity: $checkedConvert( - 'max_intensity', (v) => $enumDecode(_$JmaIntensityEnumMap, v)), - maxLpgmIntensity: $checkedConvert('max_lpgm_intensity', - (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), - ); - return val; - }, - fieldKeyMap: const { - 'eventId': 'event_id', - 'areaCode': 'area_code', - 'maxIntensity': 'max_intensity', - 'maxLpgmIntensity': 'max_lpgm_intensity' - }, + Map json, +) => $checkedCreate( + r'_$IntensitySubDivisionImpl', + json, + ($checkedConvert) { + final val = _$IntensitySubDivisionImpl( + id: $checkedConvert('id', (v) => (v as num).toInt()), + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + areaCode: $checkedConvert('area_code', (v) => v as String), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => $enumDecode(_$JmaIntensityEnumMap, v), + ), + maxLpgmIntensity: $checkedConvert( + 'max_lpgm_intensity', + (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v), + ), ); + return val; + }, + fieldKeyMap: const { + 'eventId': 'event_id', + 'areaCode': 'area_code', + 'maxIntensity': 'max_intensity', + 'maxLpgmIntensity': 'max_lpgm_intensity', + }, +); Map _$$IntensitySubDivisionImplToJson( - _$IntensitySubDivisionImpl instance) => - { - 'id': instance.id, - 'event_id': instance.eventId, - 'area_code': instance.areaCode, - 'max_intensity': _$JmaIntensityEnumMap[instance.maxIntensity]!, - 'max_lpgm_intensity': _$JmaLgIntensityEnumMap[instance.maxLpgmIntensity], - }; + _$IntensitySubDivisionImpl instance, +) => { + 'id': instance.id, + 'event_id': instance.eventId, + 'area_code': instance.areaCode, + 'max_intensity': _$JmaIntensityEnumMap[instance.maxIntensity]!, + 'max_lpgm_intensity': _$JmaLgIntensityEnumMap[instance.maxLpgmIntensity], +}; const _$JmaIntensityEnumMap = { JmaIntensity.one: '1', diff --git a/packages/eqapi_types/lib/src/model/v1/response/region.freezed.dart b/packages/eqapi_types/lib/src/model/v1/response/region.freezed.dart index 17c8fece..36241662 100644 --- a/packages/eqapi_types/lib/src/model/v1/response/region.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/response/region.freezed.dart @@ -12,7 +12,8 @@ part of 'region.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); RegionItem _$RegionItemFromJson(Map json) { return _RegionItem.fromJson(json); @@ -40,16 +41,18 @@ mixin _$RegionItem { /// @nodoc abstract class $RegionItemCopyWith<$Res> { factory $RegionItemCopyWith( - RegionItem value, $Res Function(RegionItem) then) = - _$RegionItemCopyWithImpl<$Res, RegionItem>; + RegionItem value, + $Res Function(RegionItem) then, + ) = _$RegionItemCopyWithImpl<$Res, RegionItem>; @useResult - $Res call( - {int id, - int eventId, - String areaCode, - JmaIntensity maxIntensity, - JmaLgIntensity? maxLpgmIntensity, - EarthquakeV1Base earthquake}); + $Res call({ + int id, + int eventId, + String areaCode, + JmaIntensity maxIntensity, + JmaLgIntensity? maxLpgmIntensity, + EarthquakeV1Base earthquake, + }); $EarthquakeV1BaseCopyWith<$Res> get earthquake; } @@ -76,32 +79,41 @@ class _$RegionItemCopyWithImpl<$Res, $Val extends RegionItem> Object? maxLpgmIntensity = freezed, Object? earthquake = null, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - areaCode: null == areaCode - ? _value.areaCode - : areaCode // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as EarthquakeV1Base, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + areaCode: + null == areaCode + ? _value.areaCode + : areaCode // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as EarthquakeV1Base, + ) + as $Val, + ); } /// Create a copy of RegionItem @@ -119,17 +131,19 @@ class _$RegionItemCopyWithImpl<$Res, $Val extends RegionItem> abstract class _$$RegionItemImplCopyWith<$Res> implements $RegionItemCopyWith<$Res> { factory _$$RegionItemImplCopyWith( - _$RegionItemImpl value, $Res Function(_$RegionItemImpl) then) = - __$$RegionItemImplCopyWithImpl<$Res>; + _$RegionItemImpl value, + $Res Function(_$RegionItemImpl) then, + ) = __$$RegionItemImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int id, - int eventId, - String areaCode, - JmaIntensity maxIntensity, - JmaLgIntensity? maxLpgmIntensity, - EarthquakeV1Base earthquake}); + $Res call({ + int id, + int eventId, + String areaCode, + JmaIntensity maxIntensity, + JmaLgIntensity? maxLpgmIntensity, + EarthquakeV1Base earthquake, + }); @override $EarthquakeV1BaseCopyWith<$Res> get earthquake; @@ -140,8 +154,9 @@ class __$$RegionItemImplCopyWithImpl<$Res> extends _$RegionItemCopyWithImpl<$Res, _$RegionItemImpl> implements _$$RegionItemImplCopyWith<$Res> { __$$RegionItemImplCopyWithImpl( - _$RegionItemImpl _value, $Res Function(_$RegionItemImpl) _then) - : super(_value, _then); + _$RegionItemImpl _value, + $Res Function(_$RegionItemImpl) _then, + ) : super(_value, _then); /// Create a copy of RegionItem /// with the given fields replaced by the non-null parameter values. @@ -155,45 +170,54 @@ class __$$RegionItemImplCopyWithImpl<$Res> Object? maxLpgmIntensity = freezed, Object? earthquake = null, }) { - return _then(_$RegionItemImpl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - areaCode: null == areaCode - ? _value.areaCode - : areaCode // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity, - maxLpgmIntensity: freezed == maxLpgmIntensity - ? _value.maxLpgmIntensity - : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable - as JmaLgIntensity?, - earthquake: null == earthquake - ? _value.earthquake - : earthquake // ignore: cast_nullable_to_non_nullable - as EarthquakeV1Base, - )); + return _then( + _$RegionItemImpl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + areaCode: + null == areaCode + ? _value.areaCode + : areaCode // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity, + maxLpgmIntensity: + freezed == maxLpgmIntensity + ? _value.maxLpgmIntensity + : maxLpgmIntensity // ignore: cast_nullable_to_non_nullable + as JmaLgIntensity?, + earthquake: + null == earthquake + ? _value.earthquake + : earthquake // ignore: cast_nullable_to_non_nullable + as EarthquakeV1Base, + ), + ); } } /// @nodoc @JsonSerializable() class _$RegionItemImpl implements _RegionItem { - const _$RegionItemImpl( - {required this.id, - required this.eventId, - required this.areaCode, - required this.maxIntensity, - required this.maxLpgmIntensity, - required this.earthquake}); + const _$RegionItemImpl({ + required this.id, + required this.eventId, + required this.areaCode, + required this.maxIntensity, + required this.maxLpgmIntensity, + required this.earthquake, + }); factory _$RegionItemImpl.fromJson(Map json) => _$$RegionItemImplFromJson(json); @@ -235,8 +259,15 @@ class _$RegionItemImpl implements _RegionItem { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, id, eventId, areaCode, - maxIntensity, maxLpgmIntensity, earthquake); + int get hashCode => Object.hash( + runtimeType, + id, + eventId, + areaCode, + maxIntensity, + maxLpgmIntensity, + earthquake, + ); /// Create a copy of RegionItem /// with the given fields replaced by the non-null parameter values. @@ -248,20 +279,19 @@ class _$RegionItemImpl implements _RegionItem { @override Map toJson() { - return _$$RegionItemImplToJson( - this, - ); + return _$$RegionItemImplToJson(this); } } abstract class _RegionItem implements RegionItem { - const factory _RegionItem( - {required final int id, - required final int eventId, - required final String areaCode, - required final JmaIntensity maxIntensity, - required final JmaLgIntensity? maxLpgmIntensity, - required final EarthquakeV1Base earthquake}) = _$RegionItemImpl; + const factory _RegionItem({ + required final int id, + required final int eventId, + required final String areaCode, + required final JmaIntensity maxIntensity, + required final JmaLgIntensity? maxLpgmIntensity, + required final EarthquakeV1Base earthquake, + }) = _$RegionItemImpl; factory _RegionItem.fromJson(Map json) = _$RegionItemImpl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/response/region.g.dart b/packages/eqapi_types/lib/src/model/v1/response/region.g.dart index 812b3a0e..5cd9fe9f 100644 --- a/packages/eqapi_types/lib/src/model/v1/response/region.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/response/region.g.dart @@ -18,11 +18,17 @@ _$RegionItemImpl _$$RegionItemImplFromJson(Map json) => eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), areaCode: $checkedConvert('area_code', (v) => v as String), maxIntensity: $checkedConvert( - 'max_intensity', (v) => $enumDecode(_$JmaIntensityEnumMap, v)), - maxLpgmIntensity: $checkedConvert('max_lpgm_intensity', - (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), - earthquake: $checkedConvert('earthquake', - (v) => EarthquakeV1Base.fromJson(v as Map)), + 'max_intensity', + (v) => $enumDecode(_$JmaIntensityEnumMap, v), + ), + maxLpgmIntensity: $checkedConvert( + 'max_lpgm_intensity', + (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v), + ), + earthquake: $checkedConvert( + 'earthquake', + (v) => EarthquakeV1Base.fromJson(v as Map), + ), ); return val; }, @@ -30,7 +36,7 @@ _$RegionItemImpl _$$RegionItemImplFromJson(Map json) => 'eventId': 'event_id', 'areaCode': 'area_code', 'maxIntensity': 'max_intensity', - 'maxLpgmIntensity': 'max_lpgm_intensity' + 'maxLpgmIntensity': 'max_lpgm_intensity', }, ); diff --git a/packages/eqapi_types/lib/src/model/v1/shake_detection_event.freezed.dart b/packages/eqapi_types/lib/src/model/v1/shake_detection_event.freezed.dart index 05b2b607..e9f7352d 100644 --- a/packages/eqapi_types/lib/src/model/v1/shake_detection_event.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/shake_detection_event.freezed.dart @@ -12,10 +12,12 @@ part of 'shake_detection_event.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); ShakeDetectionWebSocketTelegram _$ShakeDetectionWebSocketTelegramFromJson( - Map json) { + Map json, +) { return _ShakeDetectionWebSocketTelegram.fromJson(json); } @@ -30,23 +32,28 @@ mixin _$ShakeDetectionWebSocketTelegram { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $ShakeDetectionWebSocketTelegramCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ShakeDetectionWebSocketTelegramCopyWith<$Res> { factory $ShakeDetectionWebSocketTelegramCopyWith( - ShakeDetectionWebSocketTelegram value, - $Res Function(ShakeDetectionWebSocketTelegram) then) = - _$ShakeDetectionWebSocketTelegramCopyWithImpl<$Res, - ShakeDetectionWebSocketTelegram>; + ShakeDetectionWebSocketTelegram value, + $Res Function(ShakeDetectionWebSocketTelegram) then, + ) = + _$ShakeDetectionWebSocketTelegramCopyWithImpl< + $Res, + ShakeDetectionWebSocketTelegram + >; @useResult $Res call({List events}); } /// @nodoc -class _$ShakeDetectionWebSocketTelegramCopyWithImpl<$Res, - $Val extends ShakeDetectionWebSocketTelegram> +class _$ShakeDetectionWebSocketTelegramCopyWithImpl< + $Res, + $Val extends ShakeDetectionWebSocketTelegram +> implements $ShakeDetectionWebSocketTelegramCopyWith<$Res> { _$ShakeDetectionWebSocketTelegramCopyWithImpl(this._value, this._then); @@ -59,15 +66,17 @@ class _$ShakeDetectionWebSocketTelegramCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? events = null, - }) { - return _then(_value.copyWith( - events: null == events - ? _value.events - : events // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? events = null}) { + return _then( + _value.copyWith( + events: + null == events + ? _value.events + : events // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -75,9 +84,9 @@ class _$ShakeDetectionWebSocketTelegramCopyWithImpl<$Res, abstract class _$$ShakeDetectionWebSocketTelegramImplCopyWith<$Res> implements $ShakeDetectionWebSocketTelegramCopyWith<$Res> { factory _$$ShakeDetectionWebSocketTelegramImplCopyWith( - _$ShakeDetectionWebSocketTelegramImpl value, - $Res Function(_$ShakeDetectionWebSocketTelegramImpl) then) = - __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl<$Res>; + _$ShakeDetectionWebSocketTelegramImpl value, + $Res Function(_$ShakeDetectionWebSocketTelegramImpl) then, + ) = __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl<$Res>; @override @useResult $Res call({List events}); @@ -85,27 +94,31 @@ abstract class _$$ShakeDetectionWebSocketTelegramImplCopyWith<$Res> /// @nodoc class __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl<$Res> - extends _$ShakeDetectionWebSocketTelegramCopyWithImpl<$Res, - _$ShakeDetectionWebSocketTelegramImpl> + extends + _$ShakeDetectionWebSocketTelegramCopyWithImpl< + $Res, + _$ShakeDetectionWebSocketTelegramImpl + > implements _$$ShakeDetectionWebSocketTelegramImplCopyWith<$Res> { __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl( - _$ShakeDetectionWebSocketTelegramImpl _value, - $Res Function(_$ShakeDetectionWebSocketTelegramImpl) _then) - : super(_value, _then); + _$ShakeDetectionWebSocketTelegramImpl _value, + $Res Function(_$ShakeDetectionWebSocketTelegramImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionWebSocketTelegram /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? events = null, - }) { - return _then(_$ShakeDetectionWebSocketTelegramImpl( - events: null == events - ? _value._events - : events // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? events = null}) { + return _then( + _$ShakeDetectionWebSocketTelegramImpl( + events: + null == events + ? _value._events + : events // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -113,13 +126,13 @@ class __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl<$Res> @JsonSerializable() class _$ShakeDetectionWebSocketTelegramImpl implements _ShakeDetectionWebSocketTelegram { - const _$ShakeDetectionWebSocketTelegramImpl( - {required final List events}) - : _events = events; + const _$ShakeDetectionWebSocketTelegramImpl({ + required final List events, + }) : _events = events; factory _$ShakeDetectionWebSocketTelegramImpl.fromJson( - Map json) => - _$$ShakeDetectionWebSocketTelegramImplFromJson(json); + Map json, + ) => _$$ShakeDetectionWebSocketTelegramImplFromJson(json); final List _events; @override @@ -153,23 +166,23 @@ class _$ShakeDetectionWebSocketTelegramImpl @override @pragma('vm:prefer-inline') _$$ShakeDetectionWebSocketTelegramImplCopyWith< - _$ShakeDetectionWebSocketTelegramImpl> - get copyWith => __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl< - _$ShakeDetectionWebSocketTelegramImpl>(this, _$identity); + _$ShakeDetectionWebSocketTelegramImpl + > + get copyWith => __$$ShakeDetectionWebSocketTelegramImplCopyWithImpl< + _$ShakeDetectionWebSocketTelegramImpl + >(this, _$identity); @override Map toJson() { - return _$$ShakeDetectionWebSocketTelegramImplToJson( - this, - ); + return _$$ShakeDetectionWebSocketTelegramImplToJson(this); } } abstract class _ShakeDetectionWebSocketTelegram implements ShakeDetectionWebSocketTelegram { - const factory _ShakeDetectionWebSocketTelegram( - {required final List events}) = - _$ShakeDetectionWebSocketTelegramImpl; + const factory _ShakeDetectionWebSocketTelegram({ + required final List events, + }) = _$ShakeDetectionWebSocketTelegramImpl; factory _ShakeDetectionWebSocketTelegram.fromJson(Map json) = _$ShakeDetectionWebSocketTelegramImpl.fromJson; @@ -182,8 +195,9 @@ abstract class _ShakeDetectionWebSocketTelegram @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ShakeDetectionWebSocketTelegramImplCopyWith< - _$ShakeDetectionWebSocketTelegramImpl> - get copyWith => throw _privateConstructorUsedError; + _$ShakeDetectionWebSocketTelegramImpl + > + get copyWith => throw _privateConstructorUsedError; } ShakeDetectionEvent _$ShakeDetectionEventFromJson(Map json) { @@ -202,8 +216,9 @@ mixin _$ShakeDetectionEvent { /// `Unknown`もしくは`Error`の場合、Nullにフォールバックされます @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get maxIntensity => throw _privateConstructorUsedError; List get regions => throw _privateConstructorUsedError; ShakeDetectionLatLng get topLeft => throw _privateConstructorUsedError; @@ -223,23 +238,26 @@ mixin _$ShakeDetectionEvent { /// @nodoc abstract class $ShakeDetectionEventCopyWith<$Res> { factory $ShakeDetectionEventCopyWith( - ShakeDetectionEvent value, $Res Function(ShakeDetectionEvent) then) = - _$ShakeDetectionEventCopyWithImpl<$Res, ShakeDetectionEvent>; + ShakeDetectionEvent value, + $Res Function(ShakeDetectionEvent) then, + ) = _$ShakeDetectionEventCopyWithImpl<$Res, ShakeDetectionEvent>; @useResult - $Res call( - {@JsonKey(defaultValue: -1) int? id, - String eventId, - @JsonKey(defaultValue: -1) int serialNo, - DateTime createdAt, - DateTime insertedAt, - @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity maxIntensity, - List regions, - ShakeDetectionLatLng topLeft, - ShakeDetectionLatLng bottomRight, - int pointCount}); + $Res call({ + @JsonKey(defaultValue: -1) int? id, + String eventId, + @JsonKey(defaultValue: -1) int serialNo, + DateTime createdAt, + DateTime insertedAt, + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity maxIntensity, + List regions, + ShakeDetectionLatLng topLeft, + ShakeDetectionLatLng bottomRight, + int pointCount, + }); $ShakeDetectionLatLngCopyWith<$Res> get topLeft; $ShakeDetectionLatLngCopyWith<$Res> get bottomRight; @@ -271,48 +289,61 @@ class _$ShakeDetectionEventCopyWithImpl<$Res, $Val extends ShakeDetectionEvent> Object? bottomRight = null, Object? pointCount = null, }) { - return _then(_value.copyWith( - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as String, - serialNo: null == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - insertedAt: null == insertedAt - ? _value.insertedAt - : insertedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - regions: null == regions - ? _value.regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - topLeft: null == topLeft - ? _value.topLeft - : topLeft // ignore: cast_nullable_to_non_nullable - as ShakeDetectionLatLng, - bottomRight: null == bottomRight - ? _value.bottomRight - : bottomRight // ignore: cast_nullable_to_non_nullable - as ShakeDetectionLatLng, - pointCount: null == pointCount - ? _value.pointCount - : pointCount // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + return _then( + _value.copyWith( + id: + freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as String, + serialNo: + null == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + insertedAt: + null == insertedAt + ? _value.insertedAt + : insertedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + regions: + null == regions + ? _value.regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + topLeft: + null == topLeft + ? _value.topLeft + : topLeft // ignore: cast_nullable_to_non_nullable + as ShakeDetectionLatLng, + bottomRight: + null == bottomRight + ? _value.bottomRight + : bottomRight // ignore: cast_nullable_to_non_nullable + as ShakeDetectionLatLng, + pointCount: + null == pointCount + ? _value.pointCount + : pointCount // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); } /// Create a copy of ShakeDetectionEvent @@ -339,25 +370,28 @@ class _$ShakeDetectionEventCopyWithImpl<$Res, $Val extends ShakeDetectionEvent> /// @nodoc abstract class _$$ShakeDetectionEventImplCopyWith<$Res> implements $ShakeDetectionEventCopyWith<$Res> { - factory _$$ShakeDetectionEventImplCopyWith(_$ShakeDetectionEventImpl value, - $Res Function(_$ShakeDetectionEventImpl) then) = - __$$ShakeDetectionEventImplCopyWithImpl<$Res>; + factory _$$ShakeDetectionEventImplCopyWith( + _$ShakeDetectionEventImpl value, + $Res Function(_$ShakeDetectionEventImpl) then, + ) = __$$ShakeDetectionEventImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(defaultValue: -1) int? id, - String eventId, - @JsonKey(defaultValue: -1) int serialNo, - DateTime createdAt, - DateTime insertedAt, - @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity maxIntensity, - List regions, - ShakeDetectionLatLng topLeft, - ShakeDetectionLatLng bottomRight, - int pointCount}); + $Res call({ + @JsonKey(defaultValue: -1) int? id, + String eventId, + @JsonKey(defaultValue: -1) int serialNo, + DateTime createdAt, + DateTime insertedAt, + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity maxIntensity, + List regions, + ShakeDetectionLatLng topLeft, + ShakeDetectionLatLng bottomRight, + int pointCount, + }); @override $ShakeDetectionLatLngCopyWith<$Res> get topLeft; @@ -369,9 +403,10 @@ abstract class _$$ShakeDetectionEventImplCopyWith<$Res> class __$$ShakeDetectionEventImplCopyWithImpl<$Res> extends _$ShakeDetectionEventCopyWithImpl<$Res, _$ShakeDetectionEventImpl> implements _$$ShakeDetectionEventImplCopyWith<$Res> { - __$$ShakeDetectionEventImplCopyWithImpl(_$ShakeDetectionEventImpl _value, - $Res Function(_$ShakeDetectionEventImpl) _then) - : super(_value, _then); + __$$ShakeDetectionEventImplCopyWithImpl( + _$ShakeDetectionEventImpl _value, + $Res Function(_$ShakeDetectionEventImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionEvent /// with the given fields replaced by the non-null parameter values. @@ -389,69 +424,82 @@ class __$$ShakeDetectionEventImplCopyWithImpl<$Res> Object? bottomRight = null, Object? pointCount = null, }) { - return _then(_$ShakeDetectionEventImpl( - id: freezed == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int?, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as String, - serialNo: null == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - insertedAt: null == insertedAt - ? _value.insertedAt - : insertedAt // ignore: cast_nullable_to_non_nullable - as DateTime, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - regions: null == regions - ? _value._regions - : regions // ignore: cast_nullable_to_non_nullable - as List, - topLeft: null == topLeft - ? _value.topLeft - : topLeft // ignore: cast_nullable_to_non_nullable - as ShakeDetectionLatLng, - bottomRight: null == bottomRight - ? _value.bottomRight - : bottomRight // ignore: cast_nullable_to_non_nullable - as ShakeDetectionLatLng, - pointCount: null == pointCount - ? _value.pointCount - : pointCount // ignore: cast_nullable_to_non_nullable - as int, - )); + return _then( + _$ShakeDetectionEventImpl( + id: + freezed == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int?, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as String, + serialNo: + null == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + insertedAt: + null == insertedAt + ? _value.insertedAt + : insertedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + regions: + null == regions + ? _value._regions + : regions // ignore: cast_nullable_to_non_nullable + as List, + topLeft: + null == topLeft + ? _value.topLeft + : topLeft // ignore: cast_nullable_to_non_nullable + as ShakeDetectionLatLng, + bottomRight: + null == bottomRight + ? _value.bottomRight + : bottomRight // ignore: cast_nullable_to_non_nullable + as ShakeDetectionLatLng, + pointCount: + null == pointCount + ? _value.pointCount + : pointCount // ignore: cast_nullable_to_non_nullable + as int, + ), + ); } } /// @nodoc @JsonSerializable() class _$ShakeDetectionEventImpl implements _ShakeDetectionEvent { - const _$ShakeDetectionEventImpl( - {@JsonKey(defaultValue: -1) required this.id, - required this.eventId, - @JsonKey(defaultValue: -1) required this.serialNo, - required this.createdAt, - required this.insertedAt, - @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required this.maxIntensity, - required final List regions, - required this.topLeft, - required this.bottomRight, - required this.pointCount}) - : _regions = regions; + const _$ShakeDetectionEventImpl({ + @JsonKey(defaultValue: -1) required this.id, + required this.eventId, + @JsonKey(defaultValue: -1) required this.serialNo, + required this.createdAt, + required this.insertedAt, + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required this.maxIntensity, + required final List regions, + required this.topLeft, + required this.bottomRight, + required this.pointCount, + }) : _regions = regions; factory _$ShakeDetectionEventImpl.fromJson(Map json) => _$$ShakeDetectionEventImplFromJson(json); @@ -472,8 +520,9 @@ class _$ShakeDetectionEventImpl implements _ShakeDetectionEvent { /// `Unknown`もしくは`Error`の場合、Nullにフォールバックされます @override @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) final JmaForecastIntensity maxIntensity; final List _regions; @override @@ -521,17 +570,18 @@ class _$ShakeDetectionEventImpl implements _ShakeDetectionEvent { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - id, - eventId, - serialNo, - createdAt, - insertedAt, - maxIntensity, - const DeepCollectionEquality().hash(_regions), - topLeft, - bottomRight, - pointCount); + runtimeType, + id, + eventId, + serialNo, + createdAt, + insertedAt, + maxIntensity, + const DeepCollectionEquality().hash(_regions), + topLeft, + bottomRight, + pointCount, + ); /// Create a copy of ShakeDetectionEvent /// with the given fields replaced by the non-null parameter values. @@ -540,31 +590,33 @@ class _$ShakeDetectionEventImpl implements _ShakeDetectionEvent { @pragma('vm:prefer-inline') _$$ShakeDetectionEventImplCopyWith<_$ShakeDetectionEventImpl> get copyWith => __$$ShakeDetectionEventImplCopyWithImpl<_$ShakeDetectionEventImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$ShakeDetectionEventImplToJson( - this, - ); + return _$$ShakeDetectionEventImplToJson(this); } } abstract class _ShakeDetectionEvent implements ShakeDetectionEvent { - const factory _ShakeDetectionEvent( - {@JsonKey(defaultValue: -1) required final int? id, - required final String eventId, - @JsonKey(defaultValue: -1) required final int serialNo, - required final DateTime createdAt, - required final DateTime insertedAt, - @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required final JmaForecastIntensity maxIntensity, - required final List regions, - required final ShakeDetectionLatLng topLeft, - required final ShakeDetectionLatLng bottomRight, - required final int pointCount}) = _$ShakeDetectionEventImpl; + const factory _ShakeDetectionEvent({ + @JsonKey(defaultValue: -1) required final int? id, + required final String eventId, + @JsonKey(defaultValue: -1) required final int serialNo, + required final DateTime createdAt, + required final DateTime insertedAt, + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required final JmaForecastIntensity maxIntensity, + required final List regions, + required final ShakeDetectionLatLng topLeft, + required final ShakeDetectionLatLng bottomRight, + required final int pointCount, + }) = _$ShakeDetectionEventImpl; factory _ShakeDetectionEvent.fromJson(Map json) = _$ShakeDetectionEventImpl.fromJson; @@ -585,8 +637,9 @@ abstract class _ShakeDetectionEvent implements ShakeDetectionEvent { /// `Unknown`もしくは`Error`の場合、Nullにフォールバックされます @override @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get maxIntensity; @override List get regions; @@ -613,9 +666,10 @@ ShakeDetectionRegion _$ShakeDetectionRegionFromJson(Map json) { mixin _$ShakeDetectionRegion { String get name => throw _privateConstructorUsedError; @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get maxIntensity => throw _privateConstructorUsedError; List get points => throw _privateConstructorUsedError; @@ -631,23 +685,28 @@ mixin _$ShakeDetectionRegion { /// @nodoc abstract class $ShakeDetectionRegionCopyWith<$Res> { - factory $ShakeDetectionRegionCopyWith(ShakeDetectionRegion value, - $Res Function(ShakeDetectionRegion) then) = - _$ShakeDetectionRegionCopyWithImpl<$Res, ShakeDetectionRegion>; + factory $ShakeDetectionRegionCopyWith( + ShakeDetectionRegion value, + $Res Function(ShakeDetectionRegion) then, + ) = _$ShakeDetectionRegionCopyWithImpl<$Res, ShakeDetectionRegion>; @useResult - $Res call( - {String name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity maxIntensity, - List points}); + $Res call({ + String name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity maxIntensity, + List points, + }); } /// @nodoc -class _$ShakeDetectionRegionCopyWithImpl<$Res, - $Val extends ShakeDetectionRegion> +class _$ShakeDetectionRegionCopyWithImpl< + $Res, + $Val extends ShakeDetectionRegion +> implements $ShakeDetectionRegionCopyWith<$Res> { _$ShakeDetectionRegionCopyWithImpl(this._value, this._then); @@ -665,48 +724,58 @@ class _$ShakeDetectionRegionCopyWithImpl<$Res, Object? maxIntensity = null, Object? points = null, }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - points: null == points - ? _value.points - : points // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + points: + null == points + ? _value.points + : points // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ShakeDetectionRegionImplCopyWith<$Res> implements $ShakeDetectionRegionCopyWith<$Res> { - factory _$$ShakeDetectionRegionImplCopyWith(_$ShakeDetectionRegionImpl value, - $Res Function(_$ShakeDetectionRegionImpl) then) = - __$$ShakeDetectionRegionImplCopyWithImpl<$Res>; + factory _$$ShakeDetectionRegionImplCopyWith( + _$ShakeDetectionRegionImpl value, + $Res Function(_$ShakeDetectionRegionImpl) then, + ) = __$$ShakeDetectionRegionImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity maxIntensity, - List points}); + $Res call({ + String name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity maxIntensity, + List points, + }); } /// @nodoc class __$$ShakeDetectionRegionImplCopyWithImpl<$Res> extends _$ShakeDetectionRegionCopyWithImpl<$Res, _$ShakeDetectionRegionImpl> implements _$$ShakeDetectionRegionImplCopyWith<$Res> { - __$$ShakeDetectionRegionImplCopyWithImpl(_$ShakeDetectionRegionImpl _value, - $Res Function(_$ShakeDetectionRegionImpl) _then) - : super(_value, _then); + __$$ShakeDetectionRegionImplCopyWithImpl( + _$ShakeDetectionRegionImpl _value, + $Res Function(_$ShakeDetectionRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionRegion /// with the given fields replaced by the non-null parameter values. @@ -717,35 +786,41 @@ class __$$ShakeDetectionRegionImplCopyWithImpl<$Res> Object? maxIntensity = null, Object? points = null, }) { - return _then(_$ShakeDetectionRegionImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - maxIntensity: null == maxIntensity - ? _value.maxIntensity - : maxIntensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - points: null == points - ? _value._points - : points // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$ShakeDetectionRegionImpl( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + maxIntensity: + null == maxIntensity + ? _value.maxIntensity + : maxIntensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + points: + null == points + ? _value._points + : points // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$ShakeDetectionRegionImpl implements _ShakeDetectionRegion { - const _$ShakeDetectionRegionImpl( - {required this.name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required this.maxIntensity, - required final List points}) - : _points = points; + const _$ShakeDetectionRegionImpl({ + required this.name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required this.maxIntensity, + required final List points, + }) : _points = points; factory _$ShakeDetectionRegionImpl.fromJson(Map json) => _$$ShakeDetectionRegionImplFromJson(json); @@ -754,9 +829,10 @@ class _$ShakeDetectionRegionImpl implements _ShakeDetectionRegion { final String name; @override @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) final JmaForecastIntensity maxIntensity; final List _points; @override @@ -784,8 +860,12 @@ class _$ShakeDetectionRegionImpl implements _ShakeDetectionRegion { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, name, maxIntensity, - const DeepCollectionEquality().hash(_points)); + int get hashCode => Object.hash( + runtimeType, + name, + maxIntensity, + const DeepCollectionEquality().hash(_points), + ); /// Create a copy of ShakeDetectionRegion /// with the given fields replaced by the non-null parameter values. @@ -793,28 +873,29 @@ class _$ShakeDetectionRegionImpl implements _ShakeDetectionRegion { @override @pragma('vm:prefer-inline') _$$ShakeDetectionRegionImplCopyWith<_$ShakeDetectionRegionImpl> - get copyWith => - __$$ShakeDetectionRegionImplCopyWithImpl<_$ShakeDetectionRegionImpl>( - this, _$identity); + get copyWith => + __$$ShakeDetectionRegionImplCopyWithImpl<_$ShakeDetectionRegionImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$ShakeDetectionRegionImplToJson( - this, - ); + return _$$ShakeDetectionRegionImplToJson(this); } } abstract class _ShakeDetectionRegion implements ShakeDetectionRegion { - const factory _ShakeDetectionRegion( - {required final String name, - @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required final JmaForecastIntensity maxIntensity, - required final List points}) = - _$ShakeDetectionRegionImpl; + const factory _ShakeDetectionRegion({ + required final String name, + @JsonKey( + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required final JmaForecastIntensity maxIntensity, + required final List points, + }) = _$ShakeDetectionRegionImpl; factory _ShakeDetectionRegion.fromJson(Map json) = _$ShakeDetectionRegionImpl.fromJson; @@ -823,9 +904,10 @@ abstract class _ShakeDetectionRegion implements ShakeDetectionRegion { String get name; @override @JsonKey( - name: 'maxIntensity', - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + name: 'maxIntensity', + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get maxIntensity; @override List get points; @@ -835,7 +917,7 @@ abstract class _ShakeDetectionRegion implements ShakeDetectionRegion { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ShakeDetectionRegionImplCopyWith<_$ShakeDetectionRegionImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } ShakeDetectionPoint _$ShakeDetectionPointFromJson(Map json) { @@ -845,8 +927,9 @@ ShakeDetectionPoint _$ShakeDetectionPointFromJson(Map json) { /// @nodoc mixin _$ShakeDetectionPoint { @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get intensity => throw _privateConstructorUsedError; String get code => throw _privateConstructorUsedError; @@ -863,15 +946,18 @@ mixin _$ShakeDetectionPoint { /// @nodoc abstract class $ShakeDetectionPointCopyWith<$Res> { factory $ShakeDetectionPointCopyWith( - ShakeDetectionPoint value, $Res Function(ShakeDetectionPoint) then) = - _$ShakeDetectionPointCopyWithImpl<$Res, ShakeDetectionPoint>; + ShakeDetectionPoint value, + $Res Function(ShakeDetectionPoint) then, + ) = _$ShakeDetectionPointCopyWithImpl<$Res, ShakeDetectionPoint>; @useResult - $Res call( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity intensity, - String code}); + $Res call({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity intensity, + String code, + }); } /// @nodoc @@ -888,85 +974,95 @@ class _$ShakeDetectionPointCopyWithImpl<$Res, $Val extends ShakeDetectionPoint> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? intensity = null, - Object? code = null, - }) { - return _then(_value.copyWith( - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? intensity = null, Object? code = null}) { + return _then( + _value.copyWith( + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ShakeDetectionPointImplCopyWith<$Res> implements $ShakeDetectionPointCopyWith<$Res> { - factory _$$ShakeDetectionPointImplCopyWith(_$ShakeDetectionPointImpl value, - $Res Function(_$ShakeDetectionPointImpl) then) = - __$$ShakeDetectionPointImplCopyWithImpl<$Res>; + factory _$$ShakeDetectionPointImplCopyWith( + _$ShakeDetectionPointImpl value, + $Res Function(_$ShakeDetectionPointImpl) then, + ) = __$$ShakeDetectionPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - JmaForecastIntensity intensity, - String code}); + $Res call({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + JmaForecastIntensity intensity, + String code, + }); } /// @nodoc class __$$ShakeDetectionPointImplCopyWithImpl<$Res> extends _$ShakeDetectionPointCopyWithImpl<$Res, _$ShakeDetectionPointImpl> implements _$$ShakeDetectionPointImplCopyWith<$Res> { - __$$ShakeDetectionPointImplCopyWithImpl(_$ShakeDetectionPointImpl _value, - $Res Function(_$ShakeDetectionPointImpl) _then) - : super(_value, _then); + __$$ShakeDetectionPointImplCopyWithImpl( + _$ShakeDetectionPointImpl _value, + $Res Function(_$ShakeDetectionPointImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionPoint /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? intensity = null, - Object? code = null, - }) { - return _then(_$ShakeDetectionPointImpl( - intensity: null == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaForecastIntensity, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? intensity = null, Object? code = null}) { + return _then( + _$ShakeDetectionPointImpl( + intensity: + null == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaForecastIntensity, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$ShakeDetectionPointImpl implements _ShakeDetectionPoint { - const _$ShakeDetectionPointImpl( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required this.intensity, - required this.code}); + const _$ShakeDetectionPointImpl({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required this.intensity, + required this.code, + }); factory _$ShakeDetectionPointImpl.fromJson(Map json) => _$$ShakeDetectionPointImplFromJson(json); @override @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) final JmaForecastIntensity intensity; @override final String code; @@ -997,31 +1093,34 @@ class _$ShakeDetectionPointImpl implements _ShakeDetectionPoint { @pragma('vm:prefer-inline') _$$ShakeDetectionPointImplCopyWith<_$ShakeDetectionPointImpl> get copyWith => __$$ShakeDetectionPointImplCopyWithImpl<_$ShakeDetectionPointImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$ShakeDetectionPointImplToJson( - this, - ); + return _$$ShakeDetectionPointImplToJson(this); } } abstract class _ShakeDetectionPoint implements ShakeDetectionPoint { - const factory _ShakeDetectionPoint( - {@JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) - required final JmaForecastIntensity intensity, - required final String code}) = _$ShakeDetectionPointImpl; + const factory _ShakeDetectionPoint({ + @JsonKey( + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) + required final JmaForecastIntensity intensity, + required final String code, + }) = _$ShakeDetectionPointImpl; factory _ShakeDetectionPoint.fromJson(Map json) = _$ShakeDetectionPointImpl.fromJson; @override @JsonKey( - unknownEnumValue: JmaForecastIntensity.unknown, - defaultValue: JmaForecastIntensity.unknown) + unknownEnumValue: JmaForecastIntensity.unknown, + defaultValue: JmaForecastIntensity.unknown, + ) JmaForecastIntensity get intensity; @override String get code; @@ -1055,16 +1154,19 @@ mixin _$ShakeDetectionLatLng { /// @nodoc abstract class $ShakeDetectionLatLngCopyWith<$Res> { - factory $ShakeDetectionLatLngCopyWith(ShakeDetectionLatLng value, - $Res Function(ShakeDetectionLatLng) then) = - _$ShakeDetectionLatLngCopyWithImpl<$Res, ShakeDetectionLatLng>; + factory $ShakeDetectionLatLngCopyWith( + ShakeDetectionLatLng value, + $Res Function(ShakeDetectionLatLng) then, + ) = _$ShakeDetectionLatLngCopyWithImpl<$Res, ShakeDetectionLatLng>; @useResult $Res call({double latitude, double longitude}); } /// @nodoc -class _$ShakeDetectionLatLngCopyWithImpl<$Res, - $Val extends ShakeDetectionLatLng> +class _$ShakeDetectionLatLngCopyWithImpl< + $Res, + $Val extends ShakeDetectionLatLng +> implements $ShakeDetectionLatLngCopyWith<$Res> { _$ShakeDetectionLatLngCopyWithImpl(this._value, this._then); @@ -1077,29 +1179,32 @@ class _$ShakeDetectionLatLngCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? latitude = null, - Object? longitude = null, - }) { - return _then(_value.copyWith( - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + $Res call({Object? latitude = null, Object? longitude = null}) { + return _then( + _value.copyWith( + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ShakeDetectionLatLngImplCopyWith<$Res> implements $ShakeDetectionLatLngCopyWith<$Res> { - factory _$$ShakeDetectionLatLngImplCopyWith(_$ShakeDetectionLatLngImpl value, - $Res Function(_$ShakeDetectionLatLngImpl) then) = - __$$ShakeDetectionLatLngImplCopyWithImpl<$Res>; + factory _$$ShakeDetectionLatLngImplCopyWith( + _$ShakeDetectionLatLngImpl value, + $Res Function(_$ShakeDetectionLatLngImpl) then, + ) = __$$ShakeDetectionLatLngImplCopyWithImpl<$Res>; @override @useResult $Res call({double latitude, double longitude}); @@ -1109,36 +1214,40 @@ abstract class _$$ShakeDetectionLatLngImplCopyWith<$Res> class __$$ShakeDetectionLatLngImplCopyWithImpl<$Res> extends _$ShakeDetectionLatLngCopyWithImpl<$Res, _$ShakeDetectionLatLngImpl> implements _$$ShakeDetectionLatLngImplCopyWith<$Res> { - __$$ShakeDetectionLatLngImplCopyWithImpl(_$ShakeDetectionLatLngImpl _value, - $Res Function(_$ShakeDetectionLatLngImpl) _then) - : super(_value, _then); + __$$ShakeDetectionLatLngImplCopyWithImpl( + _$ShakeDetectionLatLngImpl _value, + $Res Function(_$ShakeDetectionLatLngImpl) _then, + ) : super(_value, _then); /// Create a copy of ShakeDetectionLatLng /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? latitude = null, - Object? longitude = null, - }) { - return _then(_$ShakeDetectionLatLngImpl( - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - )); + $Res call({Object? latitude = null, Object? longitude = null}) { + return _then( + _$ShakeDetectionLatLngImpl( + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } /// @nodoc @JsonSerializable() class _$ShakeDetectionLatLngImpl implements _ShakeDetectionLatLng { - const _$ShakeDetectionLatLngImpl( - {required this.latitude, required this.longitude}); + const _$ShakeDetectionLatLngImpl({ + required this.latitude, + required this.longitude, + }); factory _$ShakeDetectionLatLngImpl.fromJson(Map json) => _$$ShakeDetectionLatLngImplFromJson(json); @@ -1174,22 +1283,23 @@ class _$ShakeDetectionLatLngImpl implements _ShakeDetectionLatLng { @override @pragma('vm:prefer-inline') _$$ShakeDetectionLatLngImplCopyWith<_$ShakeDetectionLatLngImpl> - get copyWith => - __$$ShakeDetectionLatLngImplCopyWithImpl<_$ShakeDetectionLatLngImpl>( - this, _$identity); + get copyWith => + __$$ShakeDetectionLatLngImplCopyWithImpl<_$ShakeDetectionLatLngImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$ShakeDetectionLatLngImplToJson( - this, - ); + return _$$ShakeDetectionLatLngImplToJson(this); } } abstract class _ShakeDetectionLatLng implements ShakeDetectionLatLng { - const factory _ShakeDetectionLatLng( - {required final double latitude, - required final double longitude}) = _$ShakeDetectionLatLngImpl; + const factory _ShakeDetectionLatLng({ + required final double latitude, + required final double longitude, + }) = _$ShakeDetectionLatLngImpl; factory _ShakeDetectionLatLng.fromJson(Map json) = _$ShakeDetectionLatLngImpl.fromJson; @@ -1204,5 +1314,5 @@ abstract class _ShakeDetectionLatLng implements ShakeDetectionLatLng { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$ShakeDetectionLatLngImplCopyWith<_$ShakeDetectionLatLngImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/shake_detection_event.g.dart b/packages/eqapi_types/lib/src/model/v1/shake_detection_event.g.dart index d38a3b3b..0f00e09f 100644 --- a/packages/eqapi_types/lib/src/model/v1/shake_detection_event.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/shake_detection_event.g.dart @@ -9,90 +9,105 @@ part of 'shake_detection_event.dart'; // ************************************************************************** _$ShakeDetectionWebSocketTelegramImpl - _$$ShakeDetectionWebSocketTelegramImplFromJson(Map json) => - $checkedCreate( - r'_$ShakeDetectionWebSocketTelegramImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionWebSocketTelegramImpl( - events: $checkedConvert( - 'events', - (v) => (v as List) - .map((e) => ShakeDetectionEvent.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); +_$$ShakeDetectionWebSocketTelegramImplFromJson(Map json) => + $checkedCreate(r'_$ShakeDetectionWebSocketTelegramImpl', json, ( + $checkedConvert, + ) { + final val = _$ShakeDetectionWebSocketTelegramImpl( + events: $checkedConvert( + 'events', + (v) => + (v as List) + .map( + (e) => + ShakeDetectionEvent.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; + }); Map _$$ShakeDetectionWebSocketTelegramImplToJson( - _$ShakeDetectionWebSocketTelegramImpl instance) => - { - 'events': instance.events, - }; + _$ShakeDetectionWebSocketTelegramImpl instance, +) => {'events': instance.events}; _$ShakeDetectionEventImpl _$$ShakeDetectionEventImplFromJson( - Map json) => - $checkedCreate( - r'_$ShakeDetectionEventImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionEventImpl( - id: $checkedConvert('id', (v) => (v as num?)?.toInt() ?? -1), - eventId: $checkedConvert('event_id', (v) => v as String), - serialNo: - $checkedConvert('serial_no', (v) => (v as num?)?.toInt() ?? -1), - createdAt: - $checkedConvert('created_at', (v) => DateTime.parse(v as String)), - insertedAt: $checkedConvert( - 'inserted_at', (v) => DateTime.parse(v as String)), - maxIntensity: $checkedConvert( - 'max_intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v, - unknownValue: JmaForecastIntensity.unknown) ?? - JmaForecastIntensity.unknown), - regions: $checkedConvert( - 'regions', - (v) => (v as List) - .map((e) => - ShakeDetectionRegion.fromJson(e as Map)) - .toList()), - topLeft: $checkedConvert('top_left', - (v) => ShakeDetectionLatLng.fromJson(v as Map)), - bottomRight: $checkedConvert('bottom_right', - (v) => ShakeDetectionLatLng.fromJson(v as Map)), - pointCount: $checkedConvert('point_count', (v) => (v as num).toInt()), - ); - return val; - }, - fieldKeyMap: const { - 'eventId': 'event_id', - 'serialNo': 'serial_no', - 'createdAt': 'created_at', - 'insertedAt': 'inserted_at', - 'maxIntensity': 'max_intensity', - 'topLeft': 'top_left', - 'bottomRight': 'bottom_right', - 'pointCount': 'point_count' - }, + Map json, +) => $checkedCreate( + r'_$ShakeDetectionEventImpl', + json, + ($checkedConvert) { + final val = _$ShakeDetectionEventImpl( + id: $checkedConvert('id', (v) => (v as num?)?.toInt() ?? -1), + eventId: $checkedConvert('event_id', (v) => v as String), + serialNo: $checkedConvert('serial_no', (v) => (v as num?)?.toInt() ?? -1), + createdAt: $checkedConvert( + 'created_at', + (v) => DateTime.parse(v as String), + ), + insertedAt: $checkedConvert( + 'inserted_at', + (v) => DateTime.parse(v as String), + ), + maxIntensity: $checkedConvert( + 'max_intensity', + (v) => + $enumDecodeNullable( + _$JmaForecastIntensityEnumMap, + v, + unknownValue: JmaForecastIntensity.unknown, + ) ?? + JmaForecastIntensity.unknown, + ), + regions: $checkedConvert( + 'regions', + (v) => + (v as List) + .map( + (e) => + ShakeDetectionRegion.fromJson(e as Map), + ) + .toList(), + ), + topLeft: $checkedConvert( + 'top_left', + (v) => ShakeDetectionLatLng.fromJson(v as Map), + ), + bottomRight: $checkedConvert( + 'bottom_right', + (v) => ShakeDetectionLatLng.fromJson(v as Map), + ), + pointCount: $checkedConvert('point_count', (v) => (v as num).toInt()), ); + return val; + }, + fieldKeyMap: const { + 'eventId': 'event_id', + 'serialNo': 'serial_no', + 'createdAt': 'created_at', + 'insertedAt': 'inserted_at', + 'maxIntensity': 'max_intensity', + 'topLeft': 'top_left', + 'bottomRight': 'bottom_right', + 'pointCount': 'point_count', + }, +); Map _$$ShakeDetectionEventImplToJson( - _$ShakeDetectionEventImpl instance) => - { - 'id': instance.id, - 'event_id': instance.eventId, - 'serial_no': instance.serialNo, - 'created_at': instance.createdAt.toIso8601String(), - 'inserted_at': instance.insertedAt.toIso8601String(), - 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, - 'regions': instance.regions, - 'top_left': instance.topLeft, - 'bottom_right': instance.bottomRight, - 'point_count': instance.pointCount, - }; + _$ShakeDetectionEventImpl instance, +) => { + 'id': instance.id, + 'event_id': instance.eventId, + 'serial_no': instance.serialNo, + 'created_at': instance.createdAt.toIso8601String(), + 'inserted_at': instance.insertedAt.toIso8601String(), + 'max_intensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, + 'regions': instance.regions, + 'top_left': instance.topLeft, + 'bottom_right': instance.bottomRight, + 'point_count': instance.pointCount, +}; const _$JmaForecastIntensityEnumMap = { JmaForecastIntensity.zero: '0', @@ -109,81 +124,80 @@ const _$JmaForecastIntensityEnumMap = { }; _$ShakeDetectionRegionImpl _$$ShakeDetectionRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$ShakeDetectionRegionImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionRegionImpl( - name: $checkedConvert('name', (v) => v as String), - maxIntensity: $checkedConvert( - 'maxIntensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v, - unknownValue: JmaForecastIntensity.unknown) ?? - JmaForecastIntensity.unknown), - points: $checkedConvert( - 'points', - (v) => (v as List) - .map((e) => - ShakeDetectionPoint.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$ShakeDetectionRegionImpl', json, ($checkedConvert) { + final val = _$ShakeDetectionRegionImpl( + name: $checkedConvert('name', (v) => v as String), + maxIntensity: $checkedConvert( + 'maxIntensity', + (v) => + $enumDecodeNullable( + _$JmaForecastIntensityEnumMap, + v, + unknownValue: JmaForecastIntensity.unknown, + ) ?? + JmaForecastIntensity.unknown, + ), + points: $checkedConvert( + 'points', + (v) => + (v as List) + .map( + (e) => ShakeDetectionPoint.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; +}); Map _$$ShakeDetectionRegionImplToJson( - _$ShakeDetectionRegionImpl instance) => - { - 'name': instance.name, - 'maxIntensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, - 'points': instance.points, - }; + _$ShakeDetectionRegionImpl instance, +) => { + 'name': instance.name, + 'maxIntensity': _$JmaForecastIntensityEnumMap[instance.maxIntensity]!, + 'points': instance.points, +}; _$ShakeDetectionPointImpl _$$ShakeDetectionPointImplFromJson( - Map json) => - $checkedCreate( - r'_$ShakeDetectionPointImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionPointImpl( - intensity: $checkedConvert( - 'intensity', - (v) => - $enumDecodeNullable(_$JmaForecastIntensityEnumMap, v, - unknownValue: JmaForecastIntensity.unknown) ?? - JmaForecastIntensity.unknown), - code: $checkedConvert('code', (v) => v as String), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$ShakeDetectionPointImpl', json, ($checkedConvert) { + final val = _$ShakeDetectionPointImpl( + intensity: $checkedConvert( + 'intensity', + (v) => + $enumDecodeNullable( + _$JmaForecastIntensityEnumMap, + v, + unknownValue: JmaForecastIntensity.unknown, + ) ?? + JmaForecastIntensity.unknown, + ), + code: $checkedConvert('code', (v) => v as String), + ); + return val; +}); Map _$$ShakeDetectionPointImplToJson( - _$ShakeDetectionPointImpl instance) => - { - 'intensity': _$JmaForecastIntensityEnumMap[instance.intensity]!, - 'code': instance.code, - }; + _$ShakeDetectionPointImpl instance, +) => { + 'intensity': _$JmaForecastIntensityEnumMap[instance.intensity]!, + 'code': instance.code, +}; _$ShakeDetectionLatLngImpl _$$ShakeDetectionLatLngImplFromJson( - Map json) => - $checkedCreate( - r'_$ShakeDetectionLatLngImpl', - json, - ($checkedConvert) { - final val = _$ShakeDetectionLatLngImpl( - latitude: $checkedConvert('latitude', (v) => (v as num).toDouble()), - longitude: $checkedConvert('longitude', (v) => (v as num).toDouble()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$ShakeDetectionLatLngImpl', json, ($checkedConvert) { + final val = _$ShakeDetectionLatLngImpl( + latitude: $checkedConvert('latitude', (v) => (v as num).toDouble()), + longitude: $checkedConvert('longitude', (v) => (v as num).toDouble()), + ); + return val; +}); Map _$$ShakeDetectionLatLngImplToJson( - _$ShakeDetectionLatLngImpl instance) => - { - 'latitude': instance.latitude, - 'longitude': instance.longitude, - }; + _$ShakeDetectionLatLngImpl instance, +) => { + 'latitude': instance.latitude, + 'longitude': instance.longitude, +}; diff --git a/packages/eqapi_types/lib/src/model/v1/telegram.freezed.dart b/packages/eqapi_types/lib/src/model/v1/telegram.freezed.dart index dab4d2ea..38ed4078 100644 --- a/packages/eqapi_types/lib/src/model/v1/telegram.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/telegram.freezed.dart @@ -12,7 +12,8 @@ part of 'telegram.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); TelegramV1 _$TelegramV1FromJson(Map json) { return _TelegramV1.fromJson(json); @@ -46,22 +47,24 @@ mixin _$TelegramV1 { /// @nodoc abstract class $TelegramV1CopyWith<$Res> { factory $TelegramV1CopyWith( - TelegramV1 value, $Res Function(TelegramV1) then) = - _$TelegramV1CopyWithImpl<$Res, TelegramV1>; + TelegramV1 value, + $Res Function(TelegramV1) then, + ) = _$TelegramV1CopyWithImpl<$Res, TelegramV1>; @useResult - $Res call( - {int id, - int eventId, - String type, - String schemaType, - String status, - String infoType, - DateTime pressTime, - DateTime reportTime, - Map body, - DateTime? validTime, - int? serialNo, - String? headline}); + $Res call({ + int id, + int eventId, + String type, + String schemaType, + String status, + String infoType, + DateTime pressTime, + DateTime reportTime, + Map body, + DateTime? validTime, + int? serialNo, + String? headline, + }); } /// @nodoc @@ -92,56 +95,71 @@ class _$TelegramV1CopyWithImpl<$Res, $Val extends TelegramV1> Object? serialNo = freezed, Object? headline = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - schemaType: null == schemaType - ? _value.schemaType - : schemaType // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - infoType: null == infoType - ? _value.infoType - : infoType // ignore: cast_nullable_to_non_nullable - as String, - pressTime: null == pressTime - ? _value.pressTime - : pressTime // ignore: cast_nullable_to_non_nullable - as DateTime, - reportTime: null == reportTime - ? _value.reportTime - : reportTime // ignore: cast_nullable_to_non_nullable - as DateTime, - body: null == body - ? _value.body - : body // ignore: cast_nullable_to_non_nullable - as Map, - validTime: freezed == validTime - ? _value.validTime - : validTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + schemaType: + null == schemaType + ? _value.schemaType + : schemaType // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + infoType: + null == infoType + ? _value.infoType + : infoType // ignore: cast_nullable_to_non_nullable + as String, + pressTime: + null == pressTime + ? _value.pressTime + : pressTime // ignore: cast_nullable_to_non_nullable + as DateTime, + reportTime: + null == reportTime + ? _value.reportTime + : reportTime // ignore: cast_nullable_to_non_nullable + as DateTime, + body: + null == body + ? _value.body + : body // ignore: cast_nullable_to_non_nullable + as Map, + validTime: + freezed == validTime + ? _value.validTime + : validTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } @@ -149,23 +167,25 @@ class _$TelegramV1CopyWithImpl<$Res, $Val extends TelegramV1> abstract class _$$TelegramV1ImplCopyWith<$Res> implements $TelegramV1CopyWith<$Res> { factory _$$TelegramV1ImplCopyWith( - _$TelegramV1Impl value, $Res Function(_$TelegramV1Impl) then) = - __$$TelegramV1ImplCopyWithImpl<$Res>; + _$TelegramV1Impl value, + $Res Function(_$TelegramV1Impl) then, + ) = __$$TelegramV1ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int id, - int eventId, - String type, - String schemaType, - String status, - String infoType, - DateTime pressTime, - DateTime reportTime, - Map body, - DateTime? validTime, - int? serialNo, - String? headline}); + $Res call({ + int id, + int eventId, + String type, + String schemaType, + String status, + String infoType, + DateTime pressTime, + DateTime reportTime, + Map body, + DateTime? validTime, + int? serialNo, + String? headline, + }); } /// @nodoc @@ -173,8 +193,9 @@ class __$$TelegramV1ImplCopyWithImpl<$Res> extends _$TelegramV1CopyWithImpl<$Res, _$TelegramV1Impl> implements _$$TelegramV1ImplCopyWith<$Res> { __$$TelegramV1ImplCopyWithImpl( - _$TelegramV1Impl _value, $Res Function(_$TelegramV1Impl) _then) - : super(_value, _then); + _$TelegramV1Impl _value, + $Res Function(_$TelegramV1Impl) _then, + ) : super(_value, _then); /// Create a copy of TelegramV1 /// with the given fields replaced by the non-null parameter values. @@ -194,76 +215,90 @@ class __$$TelegramV1ImplCopyWithImpl<$Res> Object? serialNo = freezed, Object? headline = freezed, }) { - return _then(_$TelegramV1Impl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - schemaType: null == schemaType - ? _value.schemaType - : schemaType // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - infoType: null == infoType - ? _value.infoType - : infoType // ignore: cast_nullable_to_non_nullable - as String, - pressTime: null == pressTime - ? _value.pressTime - : pressTime // ignore: cast_nullable_to_non_nullable - as DateTime, - reportTime: null == reportTime - ? _value.reportTime - : reportTime // ignore: cast_nullable_to_non_nullable - as DateTime, - body: null == body - ? _value._body - : body // ignore: cast_nullable_to_non_nullable - as Map, - validTime: freezed == validTime - ? _value.validTime - : validTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int?, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$TelegramV1Impl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + schemaType: + null == schemaType + ? _value.schemaType + : schemaType // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + infoType: + null == infoType + ? _value.infoType + : infoType // ignore: cast_nullable_to_non_nullable + as String, + pressTime: + null == pressTime + ? _value.pressTime + : pressTime // ignore: cast_nullable_to_non_nullable + as DateTime, + reportTime: + null == reportTime + ? _value.reportTime + : reportTime // ignore: cast_nullable_to_non_nullable + as DateTime, + body: + null == body + ? _value._body + : body // ignore: cast_nullable_to_non_nullable + as Map, + validTime: + freezed == validTime + ? _value.validTime + : validTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int?, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$TelegramV1Impl implements _TelegramV1 { - const _$TelegramV1Impl( - {required this.id, - required this.eventId, - required this.type, - required this.schemaType, - required this.status, - required this.infoType, - required this.pressTime, - required this.reportTime, - required final Map body, - this.validTime, - this.serialNo, - this.headline}) - : _body = body; + const _$TelegramV1Impl({ + required this.id, + required this.eventId, + required this.type, + required this.schemaType, + required this.status, + required this.infoType, + required this.pressTime, + required this.reportTime, + required final Map body, + this.validTime, + this.serialNo, + this.headline, + }) : _body = body; factory _$TelegramV1Impl.fromJson(Map json) => _$$TelegramV1ImplFromJson(json); @@ -333,19 +368,20 @@ class _$TelegramV1Impl implements _TelegramV1 { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - id, - eventId, - type, - schemaType, - status, - infoType, - pressTime, - reportTime, - const DeepCollectionEquality().hash(_body), - validTime, - serialNo, - headline); + runtimeType, + id, + eventId, + type, + schemaType, + status, + infoType, + pressTime, + reportTime, + const DeepCollectionEquality().hash(_body), + validTime, + serialNo, + headline, + ); /// Create a copy of TelegramV1 /// with the given fields replaced by the non-null parameter values. @@ -357,26 +393,25 @@ class _$TelegramV1Impl implements _TelegramV1 { @override Map toJson() { - return _$$TelegramV1ImplToJson( - this, - ); + return _$$TelegramV1ImplToJson(this); } } abstract class _TelegramV1 implements TelegramV1 { - const factory _TelegramV1( - {required final int id, - required final int eventId, - required final String type, - required final String schemaType, - required final String status, - required final String infoType, - required final DateTime pressTime, - required final DateTime reportTime, - required final Map body, - final DateTime? validTime, - final int? serialNo, - final String? headline}) = _$TelegramV1Impl; + const factory _TelegramV1({ + required final int id, + required final int eventId, + required final String type, + required final String schemaType, + required final String status, + required final String infoType, + required final DateTime pressTime, + required final DateTime reportTime, + required final Map body, + final DateTime? validTime, + final int? serialNo, + final String? headline, + }) = _$TelegramV1Impl; factory _TelegramV1.fromJson(Map json) = _$TelegramV1Impl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/telegram.g.dart b/packages/eqapi_types/lib/src/model/v1/telegram.g.dart index 179cd566..8bdd655f 100644 --- a/packages/eqapi_types/lib/src/model/v1/telegram.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/telegram.g.dart @@ -20,13 +20,19 @@ _$TelegramV1Impl _$$TelegramV1ImplFromJson(Map json) => schemaType: $checkedConvert('schema_type', (v) => v as String), status: $checkedConvert('status', (v) => v as String), infoType: $checkedConvert('info_type', (v) => v as String), - pressTime: - $checkedConvert('press_time', (v) => DateTime.parse(v as String)), + pressTime: $checkedConvert( + 'press_time', + (v) => DateTime.parse(v as String), + ), reportTime: $checkedConvert( - 'report_time', (v) => DateTime.parse(v as String)), + 'report_time', + (v) => DateTime.parse(v as String), + ), body: $checkedConvert('body', (v) => v as Map), - validTime: $checkedConvert('valid_time', - (v) => v == null ? null : DateTime.parse(v as String)), + validTime: $checkedConvert( + 'valid_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), serialNo: $checkedConvert('serial_no', (v) => (v as num?)?.toInt()), headline: $checkedConvert('headline', (v) => v as String?), ); @@ -39,7 +45,7 @@ _$TelegramV1Impl _$$TelegramV1ImplFromJson(Map json) => 'pressTime': 'press_time', 'reportTime': 'report_time', 'validTime': 'valid_time', - 'serialNo': 'serial_no' + 'serialNo': 'serial_no', }, ); diff --git a/packages/eqapi_types/lib/src/model/v1/tsunami.dart b/packages/eqapi_types/lib/src/model/v1/tsunami.dart index 9bc27c98..cdb31c25 100644 --- a/packages/eqapi_types/lib/src/model/v1/tsunami.dart +++ b/packages/eqapi_types/lib/src/model/v1/tsunami.dart @@ -40,18 +40,18 @@ class TsunamiV1 implements V1Database { @override Map toJson() => { - 'eventId': eventId, - 'headline': headline, - 'id': id, - 'infoType': infoType, - 'pressAt': pressAt.toIso8601String(), - 'reportAt': reportAt.toIso8601String(), - 'serialNo': serialNo, - 'status': status, - 'type': type, - 'validAt': validAt?.toIso8601String(), - 'body': body.toJson(), - }; + 'eventId': eventId, + 'headline': headline, + 'id': id, + 'infoType': infoType, + 'pressAt': pressAt.toIso8601String(), + 'reportAt': reportAt.toIso8601String(), + 'serialNo': serialNo, + 'status': status, + 'type': type, + 'validAt': validAt?.toIso8601String(), + 'body': body.toJson(), + }; final int eventId; final String? headline; @@ -92,16 +92,17 @@ sealed class TsunamiBody { ) { final infoTypeStr = parent['infoType'].toString(); final typeStr = parent['type'].toString(); - final type = - TsunamiBodyType.values.firstWhereOrNull((e) => e.value == typeStr); + final type = TsunamiBodyType.values.firstWhereOrNull( + (e) => e.value == typeStr, + ); return switch (infoTypeStr) { '取消' => CancelBody.fromJson(json), '発表' || '訂正' => switch (type) { - TsunamiBodyType.vtse41 => PublicBodyVTSE41.fromJson(json), - TsunamiBodyType.vtse51 => PublicBodyVTSE51.fromJson(json), - TsunamiBodyType.vtse52 => PublicBodyVTSE52.fromJson(json), - null => throw ArgumentError('Unknown type: $typeStr'), - }, + TsunamiBodyType.vtse41 => PublicBodyVTSE41.fromJson(json), + TsunamiBodyType.vtse51 => PublicBodyVTSE51.fromJson(json), + TsunamiBodyType.vtse52 => PublicBodyVTSE52.fromJson(json), + null => throw ArgumentError('Unknown type: $typeStr'), + }, _ => throw ArgumentError('Unknown infoType: $infoTypeStr'), }; } @@ -111,8 +112,7 @@ sealed class TsunamiBody { enum TsunamiBodyType { vtse41('津波警報・注意報・予報a'), vtse51('津波情報a'), - vtse52('沖合の津波観測に関する情報'), - ; + vtse52('沖合の津波観測に関する情報'); const TsunamiBodyType(this.value); final String value; @@ -142,9 +142,7 @@ class CommentWarning with _$CommentWarning { @freezed class CancelBody with _$CancelBody implements TsunamiBody { - const factory CancelBody({ - required String text, - }) = _CancelBody; + const factory CancelBody({required String text}) = _CancelBody; factory CancelBody.fromJson(Map json) => _$CancelBodyFromJson(json); @@ -208,8 +206,7 @@ enum TsunamiForecastFirstHeightCondition { firstTideDetected('第1波の到達を確認'), /// "ただちに津波来襲と予測" - immediately('ただちに津波来襲と予測'), - ; + immediately('ただちに津波来襲と予測'); const TsunamiForecastFirstHeightCondition(this.value); final String value; @@ -233,8 +230,7 @@ enum TsunamiMaxHeightCondition { high('高い'), /// 巨大 - huge('巨大'), - ; + huge('巨大'); const TsunamiMaxHeightCondition(this.value); final String value; @@ -310,8 +306,7 @@ class TsunamiObservationStation with _$TsunamiObservationStation { @JsonEnum(valueField: 'value') enum TsunamiObservationStationFirstHeightIntial { push('押し'), - pull('引き'), - ; + pull('引き'); const TsunamiObservationStationFirstHeightIntial(this.value); final String value; @@ -326,8 +321,7 @@ enum TsunamiObservationStationCondition { observing('観測中'), /// 重要 - important('重要'), - ; + important('重要'); const TsunamiObservationStationCondition(this.value); final String value; @@ -358,8 +352,7 @@ class TsunamiEstimation with _$TsunamiEstimation { @JsonEnum(valueField: 'value') enum TsunamiEstimationFirstHeightCondition { /// 早いところでは既に津波到達と推定 - alreadyArrived('早いところでは既に津波到達と推定'), - ; + alreadyArrived('早いところでは既に津波到達と推定'); const TsunamiEstimationFirstHeightCondition(this.value); final String value; @@ -471,8 +464,7 @@ enum EarthquakeMagnitudeCondition { unknown('M不明'), /// M8を超える巨大地震 - huge('M8を超える巨大地震'), - ; + huge('M8を超える巨大地震'); const EarthquakeMagnitudeCondition(this.value); final String value; diff --git a/packages/eqapi_types/lib/src/model/v1/tsunami.freezed.dart b/packages/eqapi_types/lib/src/model/v1/tsunami.freezed.dart index e71e8b7d..acdf030a 100644 --- a/packages/eqapi_types/lib/src/model/v1/tsunami.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/tsunami.freezed.dart @@ -12,7 +12,8 @@ part of 'tsunami.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); _TsunamiV1Base _$TsunamiV1BaseFromJson(Map json) { return __TsunamiV1Base.fromJson(json); @@ -44,20 +45,22 @@ mixin _$TsunamiV1Base { /// @nodoc abstract class _$TsunamiV1BaseCopyWith<$Res> { factory _$TsunamiV1BaseCopyWith( - _TsunamiV1Base value, $Res Function(_TsunamiV1Base) then) = - __$TsunamiV1BaseCopyWithImpl<$Res, _TsunamiV1Base>; + _TsunamiV1Base value, + $Res Function(_TsunamiV1Base) then, + ) = __$TsunamiV1BaseCopyWithImpl<$Res, _TsunamiV1Base>; @useResult - $Res call( - {int eventId, - String? headline, - int id, - String infoType, - DateTime pressAt, - DateTime reportAt, - int? serialNo, - String status, - String type, - DateTime? validAt}); + $Res call({ + int eventId, + String? headline, + int id, + String infoType, + DateTime pressAt, + DateTime reportAt, + int? serialNo, + String status, + String type, + DateTime? validAt, + }); } /// @nodoc @@ -86,70 +89,85 @@ class __$TsunamiV1BaseCopyWithImpl<$Res, $Val extends _TsunamiV1Base> Object? type = null, Object? validAt = freezed, }) { - return _then(_value.copyWith( - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - infoType: null == infoType - ? _value.infoType - : infoType // ignore: cast_nullable_to_non_nullable - as String, - pressAt: null == pressAt - ? _value.pressAt - : pressAt // ignore: cast_nullable_to_non_nullable - as DateTime, - reportAt: null == reportAt - ? _value.reportAt - : reportAt // ignore: cast_nullable_to_non_nullable - as DateTime, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - validAt: freezed == validAt - ? _value.validAt - : validAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - ) as $Val); + return _then( + _value.copyWith( + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + infoType: + null == infoType + ? _value.infoType + : infoType // ignore: cast_nullable_to_non_nullable + as String, + pressAt: + null == pressAt + ? _value.pressAt + : pressAt // ignore: cast_nullable_to_non_nullable + as DateTime, + reportAt: + null == reportAt + ? _value.reportAt + : reportAt // ignore: cast_nullable_to_non_nullable + as DateTime, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int?, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + validAt: + freezed == validAt + ? _value.validAt + : validAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$_TsunamiV1BaseImplCopyWith<$Res> implements _$TsunamiV1BaseCopyWith<$Res> { - factory _$$_TsunamiV1BaseImplCopyWith(_$_TsunamiV1BaseImpl value, - $Res Function(_$_TsunamiV1BaseImpl) then) = - __$$_TsunamiV1BaseImplCopyWithImpl<$Res>; + factory _$$_TsunamiV1BaseImplCopyWith( + _$_TsunamiV1BaseImpl value, + $Res Function(_$_TsunamiV1BaseImpl) then, + ) = __$$_TsunamiV1BaseImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int eventId, - String? headline, - int id, - String infoType, - DateTime pressAt, - DateTime reportAt, - int? serialNo, - String status, - String type, - DateTime? validAt}); + $Res call({ + int eventId, + String? headline, + int id, + String infoType, + DateTime pressAt, + DateTime reportAt, + int? serialNo, + String status, + String type, + DateTime? validAt, + }); } /// @nodoc @@ -157,8 +175,9 @@ class __$$_TsunamiV1BaseImplCopyWithImpl<$Res> extends __$TsunamiV1BaseCopyWithImpl<$Res, _$_TsunamiV1BaseImpl> implements _$$_TsunamiV1BaseImplCopyWith<$Res> { __$$_TsunamiV1BaseImplCopyWithImpl( - _$_TsunamiV1BaseImpl _value, $Res Function(_$_TsunamiV1BaseImpl) _then) - : super(_value, _then); + _$_TsunamiV1BaseImpl _value, + $Res Function(_$_TsunamiV1BaseImpl) _then, + ) : super(_value, _then); /// Create a copy of _TsunamiV1Base /// with the given fields replaced by the non-null parameter values. @@ -176,65 +195,78 @@ class __$$_TsunamiV1BaseImplCopyWithImpl<$Res> Object? type = null, Object? validAt = freezed, }) { - return _then(_$_TsunamiV1BaseImpl( - eventId: null == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int, - headline: freezed == headline - ? _value.headline - : headline // ignore: cast_nullable_to_non_nullable - as String?, - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - infoType: null == infoType - ? _value.infoType - : infoType // ignore: cast_nullable_to_non_nullable - as String, - pressAt: null == pressAt - ? _value.pressAt - : pressAt // ignore: cast_nullable_to_non_nullable - as DateTime, - reportAt: null == reportAt - ? _value.reportAt - : reportAt // ignore: cast_nullable_to_non_nullable - as DateTime, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as int?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - type: null == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as String, - validAt: freezed == validAt - ? _value.validAt - : validAt // ignore: cast_nullable_to_non_nullable - as DateTime?, - )); + return _then( + _$_TsunamiV1BaseImpl( + eventId: + null == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int, + headline: + freezed == headline + ? _value.headline + : headline // ignore: cast_nullable_to_non_nullable + as String?, + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + infoType: + null == infoType + ? _value.infoType + : infoType // ignore: cast_nullable_to_non_nullable + as String, + pressAt: + null == pressAt + ? _value.pressAt + : pressAt // ignore: cast_nullable_to_non_nullable + as DateTime, + reportAt: + null == reportAt + ? _value.reportAt + : reportAt // ignore: cast_nullable_to_non_nullable + as DateTime, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as int?, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + type: + null == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as String, + validAt: + freezed == validAt + ? _value.validAt + : validAt // ignore: cast_nullable_to_non_nullable + as DateTime?, + ), + ); } } /// @nodoc @JsonSerializable() class _$_TsunamiV1BaseImpl implements __TsunamiV1Base { - const _$_TsunamiV1BaseImpl( - {required this.eventId, - required this.headline, - required this.id, - required this.infoType, - required this.pressAt, - required this.reportAt, - required this.serialNo, - required this.status, - required this.type, - required this.validAt}); + const _$_TsunamiV1BaseImpl({ + required this.eventId, + required this.headline, + required this.id, + required this.infoType, + required this.pressAt, + required this.reportAt, + required this.serialNo, + required this.status, + required this.type, + required this.validAt, + }); factory _$_TsunamiV1BaseImpl.fromJson(Map json) => _$$_TsunamiV1BaseImplFromJson(json); @@ -288,8 +320,19 @@ class _$_TsunamiV1BaseImpl implements __TsunamiV1Base { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, eventId, headline, id, infoType, - pressAt, reportAt, serialNo, status, type, validAt); + int get hashCode => Object.hash( + runtimeType, + eventId, + headline, + id, + infoType, + pressAt, + reportAt, + serialNo, + status, + type, + validAt, + ); /// Create a copy of _TsunamiV1Base /// with the given fields replaced by the non-null parameter values. @@ -298,28 +341,29 @@ class _$_TsunamiV1BaseImpl implements __TsunamiV1Base { @pragma('vm:prefer-inline') _$$_TsunamiV1BaseImplCopyWith<_$_TsunamiV1BaseImpl> get copyWith => __$$_TsunamiV1BaseImplCopyWithImpl<_$_TsunamiV1BaseImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$_TsunamiV1BaseImplToJson( - this, - ); + return _$$_TsunamiV1BaseImplToJson(this); } } abstract class __TsunamiV1Base implements _TsunamiV1Base { - const factory __TsunamiV1Base( - {required final int eventId, - required final String? headline, - required final int id, - required final String infoType, - required final DateTime pressAt, - required final DateTime reportAt, - required final int? serialNo, - required final String status, - required final String type, - required final DateTime? validAt}) = _$_TsunamiV1BaseImpl; + const factory __TsunamiV1Base({ + required final int eventId, + required final String? headline, + required final int id, + required final String infoType, + required final DateTime pressAt, + required final DateTime reportAt, + required final int? serialNo, + required final String status, + required final String type, + required final DateTime? validAt, + }) = _$_TsunamiV1BaseImpl; factory __TsunamiV1Base.fromJson(Map json) = _$_TsunamiV1BaseImpl.fromJson; @@ -395,20 +439,22 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? free = freezed, - Object? warning = freezed, - }) { - return _then(_value.copyWith( - free: freezed == free - ? _value.free - : free // ignore: cast_nullable_to_non_nullable - as String?, - warning: freezed == warning - ? _value.warning - : warning // ignore: cast_nullable_to_non_nullable - as CommentWarning?, - ) as $Val); + $Res call({Object? free = freezed, Object? warning = freezed}) { + return _then( + _value.copyWith( + free: + freezed == free + ? _value.free + : free // ignore: cast_nullable_to_non_nullable + as String?, + warning: + freezed == warning + ? _value.warning + : warning // ignore: cast_nullable_to_non_nullable + as CommentWarning?, + ) + as $Val, + ); } /// Create a copy of Comment @@ -429,8 +475,9 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> /// @nodoc abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> { factory _$$CommentImplCopyWith( - _$CommentImpl value, $Res Function(_$CommentImpl) then) = - __$$CommentImplCopyWithImpl<$Res>; + _$CommentImpl value, + $Res Function(_$CommentImpl) then, + ) = __$$CommentImplCopyWithImpl<$Res>; @override @useResult $Res call({String? free, CommentWarning? warning}); @@ -444,27 +491,29 @@ class __$$CommentImplCopyWithImpl<$Res> extends _$CommentCopyWithImpl<$Res, _$CommentImpl> implements _$$CommentImplCopyWith<$Res> { __$$CommentImplCopyWithImpl( - _$CommentImpl _value, $Res Function(_$CommentImpl) _then) - : super(_value, _then); + _$CommentImpl _value, + $Res Function(_$CommentImpl) _then, + ) : super(_value, _then); /// Create a copy of Comment /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? free = freezed, - Object? warning = freezed, - }) { - return _then(_$CommentImpl( - free: freezed == free - ? _value.free - : free // ignore: cast_nullable_to_non_nullable - as String?, - warning: freezed == warning - ? _value.warning - : warning // ignore: cast_nullable_to_non_nullable - as CommentWarning?, - )); + $Res call({Object? free = freezed, Object? warning = freezed}) { + return _then( + _$CommentImpl( + free: + freezed == free + ? _value.free + : free // ignore: cast_nullable_to_non_nullable + as String?, + warning: + freezed == warning + ? _value.warning + : warning // ignore: cast_nullable_to_non_nullable + as CommentWarning?, + ), + ); } } @@ -509,16 +558,15 @@ class _$CommentImpl implements _Comment { @override Map toJson() { - return _$$CommentImplToJson( - this, - ); + return _$$CommentImplToJson(this); } } abstract class _Comment implements Comment { - const factory _Comment( - {required final String? free, - required final CommentWarning? warning}) = _$CommentImpl; + const factory _Comment({ + required final String? free, + required final CommentWarning? warning, + }) = _$CommentImpl; factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson; @@ -557,8 +605,9 @@ mixin _$CommentWarning { /// @nodoc abstract class $CommentWarningCopyWith<$Res> { factory $CommentWarningCopyWith( - CommentWarning value, $Res Function(CommentWarning) then) = - _$CommentWarningCopyWithImpl<$Res, CommentWarning>; + CommentWarning value, + $Res Function(CommentWarning) then, + ) = _$CommentWarningCopyWithImpl<$Res, CommentWarning>; @useResult $Res call({String text, List codes}); } @@ -577,29 +626,32 @@ class _$CommentWarningCopyWithImpl<$Res, $Val extends CommentWarning> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? text = null, - Object? codes = null, - }) { - return _then(_value.copyWith( - text: null == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String, - codes: null == codes - ? _value.codes - : codes // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? text = null, Object? codes = null}) { + return _then( + _value.copyWith( + text: + null == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String, + codes: + null == codes + ? _value.codes + : codes // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$CommentWarningImplCopyWith<$Res> implements $CommentWarningCopyWith<$Res> { - factory _$$CommentWarningImplCopyWith(_$CommentWarningImpl value, - $Res Function(_$CommentWarningImpl) then) = - __$$CommentWarningImplCopyWithImpl<$Res>; + factory _$$CommentWarningImplCopyWith( + _$CommentWarningImpl value, + $Res Function(_$CommentWarningImpl) then, + ) = __$$CommentWarningImplCopyWithImpl<$Res>; @override @useResult $Res call({String text, List codes}); @@ -610,36 +662,39 @@ class __$$CommentWarningImplCopyWithImpl<$Res> extends _$CommentWarningCopyWithImpl<$Res, _$CommentWarningImpl> implements _$$CommentWarningImplCopyWith<$Res> { __$$CommentWarningImplCopyWithImpl( - _$CommentWarningImpl _value, $Res Function(_$CommentWarningImpl) _then) - : super(_value, _then); + _$CommentWarningImpl _value, + $Res Function(_$CommentWarningImpl) _then, + ) : super(_value, _then); /// Create a copy of CommentWarning /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? text = null, - Object? codes = null, - }) { - return _then(_$CommentWarningImpl( - text: null == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String, - codes: null == codes - ? _value._codes - : codes // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? text = null, Object? codes = null}) { + return _then( + _$CommentWarningImpl( + text: + null == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String, + codes: + null == codes + ? _value._codes + : codes // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$CommentWarningImpl implements _CommentWarning { - const _$CommentWarningImpl( - {required this.text, required final List codes}) - : _codes = codes; + const _$CommentWarningImpl({ + required this.text, + required final List codes, + }) : _codes = codes; factory _$CommentWarningImpl.fromJson(Map json) => _$$CommentWarningImplFromJson(json); @@ -671,7 +726,10 @@ class _$CommentWarningImpl implements _CommentWarning { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, text, const DeepCollectionEquality().hash(_codes)); + runtimeType, + text, + const DeepCollectionEquality().hash(_codes), + ); /// Create a copy of CommentWarning /// with the given fields replaced by the non-null parameter values. @@ -680,20 +738,21 @@ class _$CommentWarningImpl implements _CommentWarning { @pragma('vm:prefer-inline') _$$CommentWarningImplCopyWith<_$CommentWarningImpl> get copyWith => __$$CommentWarningImplCopyWithImpl<_$CommentWarningImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$CommentWarningImplToJson( - this, - ); + return _$$CommentWarningImplToJson(this); } } abstract class _CommentWarning implements CommentWarning { - const factory _CommentWarning( - {required final String text, - required final List codes}) = _$CommentWarningImpl; + const factory _CommentWarning({ + required final String text, + required final List codes, + }) = _$CommentWarningImpl; factory _CommentWarning.fromJson(Map json) = _$CommentWarningImpl.fromJson; @@ -732,8 +791,9 @@ mixin _$CancelBody { /// @nodoc abstract class $CancelBodyCopyWith<$Res> { factory $CancelBodyCopyWith( - CancelBody value, $Res Function(CancelBody) then) = - _$CancelBodyCopyWithImpl<$Res, CancelBody>; + CancelBody value, + $Res Function(CancelBody) then, + ) = _$CancelBodyCopyWithImpl<$Res, CancelBody>; @useResult $Res call({String text}); } @@ -752,15 +812,17 @@ class _$CancelBodyCopyWithImpl<$Res, $Val extends CancelBody> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? text = null, - }) { - return _then(_value.copyWith( - text: null == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? text = null}) { + return _then( + _value.copyWith( + text: + null == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -768,8 +830,9 @@ class _$CancelBodyCopyWithImpl<$Res, $Val extends CancelBody> abstract class _$$CancelBodyImplCopyWith<$Res> implements $CancelBodyCopyWith<$Res> { factory _$$CancelBodyImplCopyWith( - _$CancelBodyImpl value, $Res Function(_$CancelBodyImpl) then) = - __$$CancelBodyImplCopyWithImpl<$Res>; + _$CancelBodyImpl value, + $Res Function(_$CancelBodyImpl) then, + ) = __$$CancelBodyImplCopyWithImpl<$Res>; @override @useResult $Res call({String text}); @@ -780,22 +843,24 @@ class __$$CancelBodyImplCopyWithImpl<$Res> extends _$CancelBodyCopyWithImpl<$Res, _$CancelBodyImpl> implements _$$CancelBodyImplCopyWith<$Res> { __$$CancelBodyImplCopyWithImpl( - _$CancelBodyImpl _value, $Res Function(_$CancelBodyImpl) _then) - : super(_value, _then); + _$CancelBodyImpl _value, + $Res Function(_$CancelBodyImpl) _then, + ) : super(_value, _then); /// Create a copy of CancelBody /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? text = null, - }) { - return _then(_$CancelBodyImpl( - text: null == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? text = null}) { + return _then( + _$CancelBodyImpl( + text: + null == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } @@ -837,9 +902,7 @@ class _$CancelBodyImpl implements _CancelBody { @override Map toJson() { - return _$$CancelBodyImplToJson( - this, - ); + return _$$CancelBodyImplToJson(this); } } @@ -861,7 +924,8 @@ abstract class _CancelBody implements CancelBody { } PublicBodyVTSE41Tsunami _$PublicBodyVTSE41TsunamiFromJson( - Map json) { + Map json, +) { return _PublicBodyVTSE41Tsunami.fromJson(json); } @@ -881,16 +945,19 @@ mixin _$PublicBodyVTSE41Tsunami { /// @nodoc abstract class $PublicBodyVTSE41TsunamiCopyWith<$Res> { - factory $PublicBodyVTSE41TsunamiCopyWith(PublicBodyVTSE41Tsunami value, - $Res Function(PublicBodyVTSE41Tsunami) then) = - _$PublicBodyVTSE41TsunamiCopyWithImpl<$Res, PublicBodyVTSE41Tsunami>; + factory $PublicBodyVTSE41TsunamiCopyWith( + PublicBodyVTSE41Tsunami value, + $Res Function(PublicBodyVTSE41Tsunami) then, + ) = _$PublicBodyVTSE41TsunamiCopyWithImpl<$Res, PublicBodyVTSE41Tsunami>; @useResult $Res call({List forecasts}); } /// @nodoc -class _$PublicBodyVTSE41TsunamiCopyWithImpl<$Res, - $Val extends PublicBodyVTSE41Tsunami> +class _$PublicBodyVTSE41TsunamiCopyWithImpl< + $Res, + $Val extends PublicBodyVTSE41Tsunami +> implements $PublicBodyVTSE41TsunamiCopyWith<$Res> { _$PublicBodyVTSE41TsunamiCopyWithImpl(this._value, this._then); @@ -903,15 +970,17 @@ class _$PublicBodyVTSE41TsunamiCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? forecasts = null, - }) { - return _then(_value.copyWith( - forecasts: null == forecasts - ? _value.forecasts - : forecasts // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? forecasts = null}) { + return _then( + _value.copyWith( + forecasts: + null == forecasts + ? _value.forecasts + : forecasts // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -919,9 +988,9 @@ class _$PublicBodyVTSE41TsunamiCopyWithImpl<$Res, abstract class _$$PublicBodyVTSE41TsunamiImplCopyWith<$Res> implements $PublicBodyVTSE41TsunamiCopyWith<$Res> { factory _$$PublicBodyVTSE41TsunamiImplCopyWith( - _$PublicBodyVTSE41TsunamiImpl value, - $Res Function(_$PublicBodyVTSE41TsunamiImpl) then) = - __$$PublicBodyVTSE41TsunamiImplCopyWithImpl<$Res>; + _$PublicBodyVTSE41TsunamiImpl value, + $Res Function(_$PublicBodyVTSE41TsunamiImpl) then, + ) = __$$PublicBodyVTSE41TsunamiImplCopyWithImpl<$Res>; @override @useResult $Res call({List forecasts}); @@ -929,36 +998,40 @@ abstract class _$$PublicBodyVTSE41TsunamiImplCopyWith<$Res> /// @nodoc class __$$PublicBodyVTSE41TsunamiImplCopyWithImpl<$Res> - extends _$PublicBodyVTSE41TsunamiCopyWithImpl<$Res, - _$PublicBodyVTSE41TsunamiImpl> + extends + _$PublicBodyVTSE41TsunamiCopyWithImpl< + $Res, + _$PublicBodyVTSE41TsunamiImpl + > implements _$$PublicBodyVTSE41TsunamiImplCopyWith<$Res> { __$$PublicBodyVTSE41TsunamiImplCopyWithImpl( - _$PublicBodyVTSE41TsunamiImpl _value, - $Res Function(_$PublicBodyVTSE41TsunamiImpl) _then) - : super(_value, _then); + _$PublicBodyVTSE41TsunamiImpl _value, + $Res Function(_$PublicBodyVTSE41TsunamiImpl) _then, + ) : super(_value, _then); /// Create a copy of PublicBodyVTSE41Tsunami /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? forecasts = null, - }) { - return _then(_$PublicBodyVTSE41TsunamiImpl( - forecasts: null == forecasts - ? _value._forecasts - : forecasts // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? forecasts = null}) { + return _then( + _$PublicBodyVTSE41TsunamiImpl( + forecasts: + null == forecasts + ? _value._forecasts + : forecasts // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$PublicBodyVTSE41TsunamiImpl implements _PublicBodyVTSE41Tsunami { - const _$PublicBodyVTSE41TsunamiImpl( - {required final List forecasts}) - : _forecasts = forecasts; + const _$PublicBodyVTSE41TsunamiImpl({ + required final List forecasts, + }) : _forecasts = forecasts; factory _$PublicBodyVTSE41TsunamiImpl.fromJson(Map json) => _$$PublicBodyVTSE41TsunamiImplFromJson(json); @@ -981,8 +1054,10 @@ class _$PublicBodyVTSE41TsunamiImpl implements _PublicBodyVTSE41Tsunami { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PublicBodyVTSE41TsunamiImpl && - const DeepCollectionEquality() - .equals(other._forecasts, _forecasts)); + const DeepCollectionEquality().equals( + other._forecasts, + _forecasts, + )); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -996,21 +1071,20 @@ class _$PublicBodyVTSE41TsunamiImpl implements _PublicBodyVTSE41Tsunami { @override @pragma('vm:prefer-inline') _$$PublicBodyVTSE41TsunamiImplCopyWith<_$PublicBodyVTSE41TsunamiImpl> - get copyWith => __$$PublicBodyVTSE41TsunamiImplCopyWithImpl< - _$PublicBodyVTSE41TsunamiImpl>(this, _$identity); + get copyWith => __$$PublicBodyVTSE41TsunamiImplCopyWithImpl< + _$PublicBodyVTSE41TsunamiImpl + >(this, _$identity); @override Map toJson() { - return _$$PublicBodyVTSE41TsunamiImplToJson( - this, - ); + return _$$PublicBodyVTSE41TsunamiImplToJson(this); } } abstract class _PublicBodyVTSE41Tsunami implements PublicBodyVTSE41Tsunami { - const factory _PublicBodyVTSE41Tsunami( - {required final List forecasts}) = - _$PublicBodyVTSE41TsunamiImpl; + const factory _PublicBodyVTSE41Tsunami({ + required final List forecasts, + }) = _$PublicBodyVTSE41TsunamiImpl; factory _PublicBodyVTSE41Tsunami.fromJson(Map json) = _$PublicBodyVTSE41TsunamiImpl.fromJson; @@ -1023,11 +1097,12 @@ abstract class _PublicBodyVTSE41Tsunami implements PublicBodyVTSE41Tsunami { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$PublicBodyVTSE41TsunamiImplCopyWith<_$PublicBodyVTSE41TsunamiImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } PublicBodyVTSE51Tsunami _$PublicBodyVTSE51TsunamiFromJson( - Map json) { + Map json, +) { return _PublicBodyVTSE51Tsunami.fromJson(json); } @@ -1049,18 +1124,22 @@ mixin _$PublicBodyVTSE51Tsunami { /// @nodoc abstract class $PublicBodyVTSE51TsunamiCopyWith<$Res> { - factory $PublicBodyVTSE51TsunamiCopyWith(PublicBodyVTSE51Tsunami value, - $Res Function(PublicBodyVTSE51Tsunami) then) = - _$PublicBodyVTSE51TsunamiCopyWithImpl<$Res, PublicBodyVTSE51Tsunami>; + factory $PublicBodyVTSE51TsunamiCopyWith( + PublicBodyVTSE51Tsunami value, + $Res Function(PublicBodyVTSE51Tsunami) then, + ) = _$PublicBodyVTSE51TsunamiCopyWithImpl<$Res, PublicBodyVTSE51Tsunami>; @useResult - $Res call( - {List forecasts, - List? observations}); + $Res call({ + List forecasts, + List? observations, + }); } /// @nodoc -class _$PublicBodyVTSE51TsunamiCopyWithImpl<$Res, - $Val extends PublicBodyVTSE51Tsunami> +class _$PublicBodyVTSE51TsunamiCopyWithImpl< + $Res, + $Val extends PublicBodyVTSE51Tsunami +> implements $PublicBodyVTSE51TsunamiCopyWith<$Res> { _$PublicBodyVTSE51TsunamiCopyWithImpl(this._value, this._then); @@ -1073,20 +1152,22 @@ class _$PublicBodyVTSE51TsunamiCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? forecasts = null, - Object? observations = freezed, - }) { - return _then(_value.copyWith( - forecasts: null == forecasts - ? _value.forecasts - : forecasts // ignore: cast_nullable_to_non_nullable - as List, - observations: freezed == observations - ? _value.observations - : observations // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); + $Res call({Object? forecasts = null, Object? observations = freezed}) { + return _then( + _value.copyWith( + forecasts: + null == forecasts + ? _value.forecasts + : forecasts // ignore: cast_nullable_to_non_nullable + as List, + observations: + freezed == observations + ? _value.observations + : observations // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); } } @@ -1094,55 +1175,60 @@ class _$PublicBodyVTSE51TsunamiCopyWithImpl<$Res, abstract class _$$PublicBodyVTSE51TsunamiImplCopyWith<$Res> implements $PublicBodyVTSE51TsunamiCopyWith<$Res> { factory _$$PublicBodyVTSE51TsunamiImplCopyWith( - _$PublicBodyVTSE51TsunamiImpl value, - $Res Function(_$PublicBodyVTSE51TsunamiImpl) then) = - __$$PublicBodyVTSE51TsunamiImplCopyWithImpl<$Res>; + _$PublicBodyVTSE51TsunamiImpl value, + $Res Function(_$PublicBodyVTSE51TsunamiImpl) then, + ) = __$$PublicBodyVTSE51TsunamiImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {List forecasts, - List? observations}); + $Res call({ + List forecasts, + List? observations, + }); } /// @nodoc class __$$PublicBodyVTSE51TsunamiImplCopyWithImpl<$Res> - extends _$PublicBodyVTSE51TsunamiCopyWithImpl<$Res, - _$PublicBodyVTSE51TsunamiImpl> + extends + _$PublicBodyVTSE51TsunamiCopyWithImpl< + $Res, + _$PublicBodyVTSE51TsunamiImpl + > implements _$$PublicBodyVTSE51TsunamiImplCopyWith<$Res> { __$$PublicBodyVTSE51TsunamiImplCopyWithImpl( - _$PublicBodyVTSE51TsunamiImpl _value, - $Res Function(_$PublicBodyVTSE51TsunamiImpl) _then) - : super(_value, _then); + _$PublicBodyVTSE51TsunamiImpl _value, + $Res Function(_$PublicBodyVTSE51TsunamiImpl) _then, + ) : super(_value, _then); /// Create a copy of PublicBodyVTSE51Tsunami /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? forecasts = null, - Object? observations = freezed, - }) { - return _then(_$PublicBodyVTSE51TsunamiImpl( - forecasts: null == forecasts - ? _value._forecasts - : forecasts // ignore: cast_nullable_to_non_nullable - as List, - observations: freezed == observations - ? _value._observations - : observations // ignore: cast_nullable_to_non_nullable - as List?, - )); + $Res call({Object? forecasts = null, Object? observations = freezed}) { + return _then( + _$PublicBodyVTSE51TsunamiImpl( + forecasts: + null == forecasts + ? _value._forecasts + : forecasts // ignore: cast_nullable_to_non_nullable + as List, + observations: + freezed == observations + ? _value._observations + : observations // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); } } /// @nodoc @JsonSerializable() class _$PublicBodyVTSE51TsunamiImpl implements _PublicBodyVTSE51Tsunami { - const _$PublicBodyVTSE51TsunamiImpl( - {required final List forecasts, - required final List? observations}) - : _forecasts = forecasts, - _observations = observations; + const _$PublicBodyVTSE51TsunamiImpl({ + required final List forecasts, + required final List? observations, + }) : _forecasts = forecasts, + _observations = observations; factory _$PublicBodyVTSE51TsunamiImpl.fromJson(Map json) => _$$PublicBodyVTSE51TsunamiImplFromJson(json); @@ -1175,18 +1261,23 @@ class _$PublicBodyVTSE51TsunamiImpl implements _PublicBodyVTSE51Tsunami { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PublicBodyVTSE51TsunamiImpl && - const DeepCollectionEquality() - .equals(other._forecasts, _forecasts) && - const DeepCollectionEquality() - .equals(other._observations, _observations)); + const DeepCollectionEquality().equals( + other._forecasts, + _forecasts, + ) && + const DeepCollectionEquality().equals( + other._observations, + _observations, + )); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_forecasts), - const DeepCollectionEquality().hash(_observations)); + runtimeType, + const DeepCollectionEquality().hash(_forecasts), + const DeepCollectionEquality().hash(_observations), + ); /// Create a copy of PublicBodyVTSE51Tsunami /// with the given fields replaced by the non-null parameter values. @@ -1194,22 +1285,21 @@ class _$PublicBodyVTSE51TsunamiImpl implements _PublicBodyVTSE51Tsunami { @override @pragma('vm:prefer-inline') _$$PublicBodyVTSE51TsunamiImplCopyWith<_$PublicBodyVTSE51TsunamiImpl> - get copyWith => __$$PublicBodyVTSE51TsunamiImplCopyWithImpl< - _$PublicBodyVTSE51TsunamiImpl>(this, _$identity); + get copyWith => __$$PublicBodyVTSE51TsunamiImplCopyWithImpl< + _$PublicBodyVTSE51TsunamiImpl + >(this, _$identity); @override Map toJson() { - return _$$PublicBodyVTSE51TsunamiImplToJson( - this, - ); + return _$$PublicBodyVTSE51TsunamiImplToJson(this); } } abstract class _PublicBodyVTSE51Tsunami implements PublicBodyVTSE51Tsunami { - const factory _PublicBodyVTSE51Tsunami( - {required final List forecasts, - required final List? observations}) = - _$PublicBodyVTSE51TsunamiImpl; + const factory _PublicBodyVTSE51Tsunami({ + required final List forecasts, + required final List? observations, + }) = _$PublicBodyVTSE51TsunamiImpl; factory _PublicBodyVTSE51Tsunami.fromJson(Map json) = _$PublicBodyVTSE51TsunamiImpl.fromJson; @@ -1224,11 +1314,12 @@ abstract class _PublicBodyVTSE51Tsunami implements PublicBodyVTSE51Tsunami { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$PublicBodyVTSE51TsunamiImplCopyWith<_$PublicBodyVTSE51TsunamiImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } PublicBodyVTSE52Tsunami _$PublicBodyVTSE52TsunamiFromJson( - Map json) { + Map json, +) { return _PublicBodyVTSE52Tsunami.fromJson(json); } @@ -1250,18 +1341,22 @@ mixin _$PublicBodyVTSE52Tsunami { /// @nodoc abstract class $PublicBodyVTSE52TsunamiCopyWith<$Res> { - factory $PublicBodyVTSE52TsunamiCopyWith(PublicBodyVTSE52Tsunami value, - $Res Function(PublicBodyVTSE52Tsunami) then) = - _$PublicBodyVTSE52TsunamiCopyWithImpl<$Res, PublicBodyVTSE52Tsunami>; + factory $PublicBodyVTSE52TsunamiCopyWith( + PublicBodyVTSE52Tsunami value, + $Res Function(PublicBodyVTSE52Tsunami) then, + ) = _$PublicBodyVTSE52TsunamiCopyWithImpl<$Res, PublicBodyVTSE52Tsunami>; @useResult - $Res call( - {List? observations, - List estimations}); + $Res call({ + List? observations, + List estimations, + }); } /// @nodoc -class _$PublicBodyVTSE52TsunamiCopyWithImpl<$Res, - $Val extends PublicBodyVTSE52Tsunami> +class _$PublicBodyVTSE52TsunamiCopyWithImpl< + $Res, + $Val extends PublicBodyVTSE52Tsunami +> implements $PublicBodyVTSE52TsunamiCopyWith<$Res> { _$PublicBodyVTSE52TsunamiCopyWithImpl(this._value, this._then); @@ -1274,20 +1369,22 @@ class _$PublicBodyVTSE52TsunamiCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? observations = freezed, - Object? estimations = null, - }) { - return _then(_value.copyWith( - observations: freezed == observations - ? _value.observations - : observations // ignore: cast_nullable_to_non_nullable - as List?, - estimations: null == estimations - ? _value.estimations - : estimations // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? observations = freezed, Object? estimations = null}) { + return _then( + _value.copyWith( + observations: + freezed == observations + ? _value.observations + : observations // ignore: cast_nullable_to_non_nullable + as List?, + estimations: + null == estimations + ? _value.estimations + : estimations // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } @@ -1295,55 +1392,60 @@ class _$PublicBodyVTSE52TsunamiCopyWithImpl<$Res, abstract class _$$PublicBodyVTSE52TsunamiImplCopyWith<$Res> implements $PublicBodyVTSE52TsunamiCopyWith<$Res> { factory _$$PublicBodyVTSE52TsunamiImplCopyWith( - _$PublicBodyVTSE52TsunamiImpl value, - $Res Function(_$PublicBodyVTSE52TsunamiImpl) then) = - __$$PublicBodyVTSE52TsunamiImplCopyWithImpl<$Res>; + _$PublicBodyVTSE52TsunamiImpl value, + $Res Function(_$PublicBodyVTSE52TsunamiImpl) then, + ) = __$$PublicBodyVTSE52TsunamiImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {List? observations, - List estimations}); + $Res call({ + List? observations, + List estimations, + }); } /// @nodoc class __$$PublicBodyVTSE52TsunamiImplCopyWithImpl<$Res> - extends _$PublicBodyVTSE52TsunamiCopyWithImpl<$Res, - _$PublicBodyVTSE52TsunamiImpl> + extends + _$PublicBodyVTSE52TsunamiCopyWithImpl< + $Res, + _$PublicBodyVTSE52TsunamiImpl + > implements _$$PublicBodyVTSE52TsunamiImplCopyWith<$Res> { __$$PublicBodyVTSE52TsunamiImplCopyWithImpl( - _$PublicBodyVTSE52TsunamiImpl _value, - $Res Function(_$PublicBodyVTSE52TsunamiImpl) _then) - : super(_value, _then); + _$PublicBodyVTSE52TsunamiImpl _value, + $Res Function(_$PublicBodyVTSE52TsunamiImpl) _then, + ) : super(_value, _then); /// Create a copy of PublicBodyVTSE52Tsunami /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? observations = freezed, - Object? estimations = null, - }) { - return _then(_$PublicBodyVTSE52TsunamiImpl( - observations: freezed == observations - ? _value._observations - : observations // ignore: cast_nullable_to_non_nullable - as List?, - estimations: null == estimations - ? _value._estimations - : estimations // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? observations = freezed, Object? estimations = null}) { + return _then( + _$PublicBodyVTSE52TsunamiImpl( + observations: + freezed == observations + ? _value._observations + : observations // ignore: cast_nullable_to_non_nullable + as List?, + estimations: + null == estimations + ? _value._estimations + : estimations // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$PublicBodyVTSE52TsunamiImpl implements _PublicBodyVTSE52Tsunami { - const _$PublicBodyVTSE52TsunamiImpl( - {required final List? observations, - required final List estimations}) - : _observations = observations, - _estimations = estimations; + const _$PublicBodyVTSE52TsunamiImpl({ + required final List? observations, + required final List estimations, + }) : _observations = observations, + _estimations = estimations; factory _$PublicBodyVTSE52TsunamiImpl.fromJson(Map json) => _$$PublicBodyVTSE52TsunamiImplFromJson(json); @@ -1376,18 +1478,23 @@ class _$PublicBodyVTSE52TsunamiImpl implements _PublicBodyVTSE52Tsunami { return identical(this, other) || (other.runtimeType == runtimeType && other is _$PublicBodyVTSE52TsunamiImpl && - const DeepCollectionEquality() - .equals(other._observations, _observations) && - const DeepCollectionEquality() - .equals(other._estimations, _estimations)); + const DeepCollectionEquality().equals( + other._observations, + _observations, + ) && + const DeepCollectionEquality().equals( + other._estimations, + _estimations, + )); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_observations), - const DeepCollectionEquality().hash(_estimations)); + runtimeType, + const DeepCollectionEquality().hash(_observations), + const DeepCollectionEquality().hash(_estimations), + ); /// Create a copy of PublicBodyVTSE52Tsunami /// with the given fields replaced by the non-null parameter values. @@ -1395,22 +1502,21 @@ class _$PublicBodyVTSE52TsunamiImpl implements _PublicBodyVTSE52Tsunami { @override @pragma('vm:prefer-inline') _$$PublicBodyVTSE52TsunamiImplCopyWith<_$PublicBodyVTSE52TsunamiImpl> - get copyWith => __$$PublicBodyVTSE52TsunamiImplCopyWithImpl< - _$PublicBodyVTSE52TsunamiImpl>(this, _$identity); + get copyWith => __$$PublicBodyVTSE52TsunamiImplCopyWithImpl< + _$PublicBodyVTSE52TsunamiImpl + >(this, _$identity); @override Map toJson() { - return _$$PublicBodyVTSE52TsunamiImplToJson( - this, - ); + return _$$PublicBodyVTSE52TsunamiImplToJson(this); } } abstract class _PublicBodyVTSE52Tsunami implements PublicBodyVTSE52Tsunami { - const factory _PublicBodyVTSE52Tsunami( - {required final List? observations, - required final List estimations}) = - _$PublicBodyVTSE52TsunamiImpl; + const factory _PublicBodyVTSE52Tsunami({ + required final List? observations, + required final List estimations, + }) = _$PublicBodyVTSE52TsunamiImpl; factory _PublicBodyVTSE52Tsunami.fromJson(Map json) = _$PublicBodyVTSE52TsunamiImpl.fromJson; @@ -1425,7 +1531,7 @@ abstract class _PublicBodyVTSE52Tsunami implements PublicBodyVTSE52Tsunami { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$PublicBodyVTSE52TsunamiImplCopyWith<_$PublicBodyVTSE52TsunamiImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } TsunamiForecast _$TsunamiForecastFromJson(Map json) { @@ -1457,17 +1563,19 @@ mixin _$TsunamiForecast { /// @nodoc abstract class $TsunamiForecastCopyWith<$Res> { factory $TsunamiForecastCopyWith( - TsunamiForecast value, $Res Function(TsunamiForecast) then) = - _$TsunamiForecastCopyWithImpl<$Res, TsunamiForecast>; + TsunamiForecast value, + $Res Function(TsunamiForecast) then, + ) = _$TsunamiForecastCopyWithImpl<$Res, TsunamiForecast>; @useResult - $Res call( - {String code, - String name, - String kind, - String lastKind, - TsunamiForecastFirstHeight? firstHeight, - TsunamiForecastMaxHeight? maxHeight, - List? stations}); + $Res call({ + String code, + String name, + String kind, + String lastKind, + TsunamiForecastFirstHeight? firstHeight, + TsunamiForecastMaxHeight? maxHeight, + List? stations, + }); $TsunamiForecastFirstHeightCopyWith<$Res>? get firstHeight; $TsunamiForecastMaxHeightCopyWith<$Res>? get maxHeight; @@ -1496,36 +1604,46 @@ class _$TsunamiForecastCopyWithImpl<$Res, $Val extends TsunamiForecast> Object? maxHeight = freezed, Object? stations = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kind: null == kind - ? _value.kind - : kind // ignore: cast_nullable_to_non_nullable - as String, - lastKind: null == lastKind - ? _value.lastKind - : lastKind // ignore: cast_nullable_to_non_nullable - as String, - firstHeight: freezed == firstHeight - ? _value.firstHeight - : firstHeight // ignore: cast_nullable_to_non_nullable - as TsunamiForecastFirstHeight?, - maxHeight: freezed == maxHeight - ? _value.maxHeight - : maxHeight // ignore: cast_nullable_to_non_nullable - as TsunamiForecastMaxHeight?, - stations: freezed == stations - ? _value.stations - : stations // ignore: cast_nullable_to_non_nullable - as List?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kind: + null == kind + ? _value.kind + : kind // ignore: cast_nullable_to_non_nullable + as String, + lastKind: + null == lastKind + ? _value.lastKind + : lastKind // ignore: cast_nullable_to_non_nullable + as String, + firstHeight: + freezed == firstHeight + ? _value.firstHeight + : firstHeight // ignore: cast_nullable_to_non_nullable + as TsunamiForecastFirstHeight?, + maxHeight: + freezed == maxHeight + ? _value.maxHeight + : maxHeight // ignore: cast_nullable_to_non_nullable + as TsunamiForecastMaxHeight?, + stations: + freezed == stations + ? _value.stations + : stations // ignore: cast_nullable_to_non_nullable + as List?, + ) + as $Val, + ); } /// Create a copy of TsunamiForecast @@ -1537,8 +1655,9 @@ class _$TsunamiForecastCopyWithImpl<$Res, $Val extends TsunamiForecast> return null; } - return $TsunamiForecastFirstHeightCopyWith<$Res>(_value.firstHeight!, - (value) { + return $TsunamiForecastFirstHeightCopyWith<$Res>(_value.firstHeight!, ( + value, + ) { return _then(_value.copyWith(firstHeight: value) as $Val); }); } @@ -1561,19 +1680,21 @@ class _$TsunamiForecastCopyWithImpl<$Res, $Val extends TsunamiForecast> /// @nodoc abstract class _$$TsunamiForecastImplCopyWith<$Res> implements $TsunamiForecastCopyWith<$Res> { - factory _$$TsunamiForecastImplCopyWith(_$TsunamiForecastImpl value, - $Res Function(_$TsunamiForecastImpl) then) = - __$$TsunamiForecastImplCopyWithImpl<$Res>; + factory _$$TsunamiForecastImplCopyWith( + _$TsunamiForecastImpl value, + $Res Function(_$TsunamiForecastImpl) then, + ) = __$$TsunamiForecastImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - String kind, - String lastKind, - TsunamiForecastFirstHeight? firstHeight, - TsunamiForecastMaxHeight? maxHeight, - List? stations}); + $Res call({ + String code, + String name, + String kind, + String lastKind, + TsunamiForecastFirstHeight? firstHeight, + TsunamiForecastMaxHeight? maxHeight, + List? stations, + }); @override $TsunamiForecastFirstHeightCopyWith<$Res>? get firstHeight; @@ -1586,8 +1707,9 @@ class __$$TsunamiForecastImplCopyWithImpl<$Res> extends _$TsunamiForecastCopyWithImpl<$Res, _$TsunamiForecastImpl> implements _$$TsunamiForecastImplCopyWith<$Res> { __$$TsunamiForecastImplCopyWithImpl( - _$TsunamiForecastImpl _value, $Res Function(_$TsunamiForecastImpl) _then) - : super(_value, _then); + _$TsunamiForecastImpl _value, + $Res Function(_$TsunamiForecastImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiForecast /// with the given fields replaced by the non-null parameter values. @@ -1602,36 +1724,45 @@ class __$$TsunamiForecastImplCopyWithImpl<$Res> Object? maxHeight = freezed, Object? stations = freezed, }) { - return _then(_$TsunamiForecastImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kind: null == kind - ? _value.kind - : kind // ignore: cast_nullable_to_non_nullable - as String, - lastKind: null == lastKind - ? _value.lastKind - : lastKind // ignore: cast_nullable_to_non_nullable - as String, - firstHeight: freezed == firstHeight - ? _value.firstHeight - : firstHeight // ignore: cast_nullable_to_non_nullable - as TsunamiForecastFirstHeight?, - maxHeight: freezed == maxHeight - ? _value.maxHeight - : maxHeight // ignore: cast_nullable_to_non_nullable - as TsunamiForecastMaxHeight?, - stations: freezed == stations - ? _value._stations - : stations // ignore: cast_nullable_to_non_nullable - as List?, - )); + return _then( + _$TsunamiForecastImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kind: + null == kind + ? _value.kind + : kind // ignore: cast_nullable_to_non_nullable + as String, + lastKind: + null == lastKind + ? _value.lastKind + : lastKind // ignore: cast_nullable_to_non_nullable + as String, + firstHeight: + freezed == firstHeight + ? _value.firstHeight + : firstHeight // ignore: cast_nullable_to_non_nullable + as TsunamiForecastFirstHeight?, + maxHeight: + freezed == maxHeight + ? _value.maxHeight + : maxHeight // ignore: cast_nullable_to_non_nullable + as TsunamiForecastMaxHeight?, + stations: + freezed == stations + ? _value._stations + : stations // ignore: cast_nullable_to_non_nullable + as List?, + ), + ); } } @@ -1639,15 +1770,15 @@ class __$$TsunamiForecastImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiForecastImpl implements _TsunamiForecast { - const _$TsunamiForecastImpl( - {required this.code, - required this.name, - required this.kind, - required this.lastKind, - required this.firstHeight, - required this.maxHeight, - required final List? stations}) - : _stations = stations; + const _$TsunamiForecastImpl({ + required this.code, + required this.name, + required this.kind, + required this.lastKind, + required this.firstHeight, + required this.maxHeight, + required final List? stations, + }) : _stations = stations; factory _$TsunamiForecastImpl.fromJson(Map json) => _$$TsunamiForecastImplFromJson(json); @@ -1698,8 +1829,16 @@ class _$TsunamiForecastImpl implements _TsunamiForecast { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, code, name, kind, lastKind, - firstHeight, maxHeight, const DeepCollectionEquality().hash(_stations)); + int get hashCode => Object.hash( + runtimeType, + code, + name, + kind, + lastKind, + firstHeight, + maxHeight, + const DeepCollectionEquality().hash(_stations), + ); /// Create a copy of TsunamiForecast /// with the given fields replaced by the non-null parameter values. @@ -1708,26 +1847,26 @@ class _$TsunamiForecastImpl implements _TsunamiForecast { @pragma('vm:prefer-inline') _$$TsunamiForecastImplCopyWith<_$TsunamiForecastImpl> get copyWith => __$$TsunamiForecastImplCopyWithImpl<_$TsunamiForecastImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$TsunamiForecastImplToJson( - this, - ); + return _$$TsunamiForecastImplToJson(this); } } abstract class _TsunamiForecast implements TsunamiForecast { - const factory _TsunamiForecast( - {required final String code, - required final String name, - required final String kind, - required final String lastKind, - required final TsunamiForecastFirstHeight? firstHeight, - required final TsunamiForecastMaxHeight? maxHeight, - required final List? stations}) = - _$TsunamiForecastImpl; + const factory _TsunamiForecast({ + required final String code, + required final String name, + required final String kind, + required final String lastKind, + required final TsunamiForecastFirstHeight? firstHeight, + required final TsunamiForecastMaxHeight? maxHeight, + required final List? stations, + }) = _$TsunamiForecastImpl; factory _TsunamiForecast.fromJson(Map json) = _$TsunamiForecastImpl.fromJson; @@ -1756,7 +1895,8 @@ abstract class _TsunamiForecast implements TsunamiForecast { } TsunamiForecastFirstHeight _$TsunamiForecastFirstHeightFromJson( - Map json) { + Map json, +) { return _TsunamiForecastFirstHeight.fromJson(json); } @@ -1773,23 +1913,31 @@ mixin _$TsunamiForecastFirstHeight { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $TsunamiForecastFirstHeightCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $TsunamiForecastFirstHeightCopyWith<$Res> { - factory $TsunamiForecastFirstHeightCopyWith(TsunamiForecastFirstHeight value, - $Res Function(TsunamiForecastFirstHeight) then) = - _$TsunamiForecastFirstHeightCopyWithImpl<$Res, - TsunamiForecastFirstHeight>; + factory $TsunamiForecastFirstHeightCopyWith( + TsunamiForecastFirstHeight value, + $Res Function(TsunamiForecastFirstHeight) then, + ) = + _$TsunamiForecastFirstHeightCopyWithImpl< + $Res, + TsunamiForecastFirstHeight + >; @useResult - $Res call( - {DateTime? arrivalTime, TsunamiForecastFirstHeightCondition? condition}); + $Res call({ + DateTime? arrivalTime, + TsunamiForecastFirstHeightCondition? condition, + }); } /// @nodoc -class _$TsunamiForecastFirstHeightCopyWithImpl<$Res, - $Val extends TsunamiForecastFirstHeight> +class _$TsunamiForecastFirstHeightCopyWithImpl< + $Res, + $Val extends TsunamiForecastFirstHeight +> implements $TsunamiForecastFirstHeightCopyWith<$Res> { _$TsunamiForecastFirstHeightCopyWithImpl(this._value, this._then); @@ -1802,20 +1950,22 @@ class _$TsunamiForecastFirstHeightCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? arrivalTime = freezed, - Object? condition = freezed, - }) { - return _then(_value.copyWith( - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiForecastFirstHeightCondition?, - ) as $Val); + $Res call({Object? arrivalTime = freezed, Object? condition = freezed}) { + return _then( + _value.copyWith( + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiForecastFirstHeightCondition?, + ) + as $Val, + ); } } @@ -1823,43 +1973,49 @@ class _$TsunamiForecastFirstHeightCopyWithImpl<$Res, abstract class _$$TsunamiForecastFirstHeightImplCopyWith<$Res> implements $TsunamiForecastFirstHeightCopyWith<$Res> { factory _$$TsunamiForecastFirstHeightImplCopyWith( - _$TsunamiForecastFirstHeightImpl value, - $Res Function(_$TsunamiForecastFirstHeightImpl) then) = - __$$TsunamiForecastFirstHeightImplCopyWithImpl<$Res>; + _$TsunamiForecastFirstHeightImpl value, + $Res Function(_$TsunamiForecastFirstHeightImpl) then, + ) = __$$TsunamiForecastFirstHeightImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {DateTime? arrivalTime, TsunamiForecastFirstHeightCondition? condition}); + $Res call({ + DateTime? arrivalTime, + TsunamiForecastFirstHeightCondition? condition, + }); } /// @nodoc class __$$TsunamiForecastFirstHeightImplCopyWithImpl<$Res> - extends _$TsunamiForecastFirstHeightCopyWithImpl<$Res, - _$TsunamiForecastFirstHeightImpl> + extends + _$TsunamiForecastFirstHeightCopyWithImpl< + $Res, + _$TsunamiForecastFirstHeightImpl + > implements _$$TsunamiForecastFirstHeightImplCopyWith<$Res> { __$$TsunamiForecastFirstHeightImplCopyWithImpl( - _$TsunamiForecastFirstHeightImpl _value, - $Res Function(_$TsunamiForecastFirstHeightImpl) _then) - : super(_value, _then); + _$TsunamiForecastFirstHeightImpl _value, + $Res Function(_$TsunamiForecastFirstHeightImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiForecastFirstHeight /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? arrivalTime = freezed, - Object? condition = freezed, - }) { - return _then(_$TsunamiForecastFirstHeightImpl( - arrivalTime: freezed == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiForecastFirstHeightCondition?, - )); + $Res call({Object? arrivalTime = freezed, Object? condition = freezed}) { + return _then( + _$TsunamiForecastFirstHeightImpl( + arrivalTime: + freezed == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiForecastFirstHeightCondition?, + ), + ); } } @@ -1867,12 +2023,14 @@ class __$$TsunamiForecastFirstHeightImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiForecastFirstHeightImpl implements _TsunamiForecastFirstHeight { - const _$TsunamiForecastFirstHeightImpl( - {required this.arrivalTime, required this.condition}); + const _$TsunamiForecastFirstHeightImpl({ + required this.arrivalTime, + required this.condition, + }); factory _$TsunamiForecastFirstHeightImpl.fromJson( - Map json) => - _$$TsunamiForecastFirstHeightImplFromJson(json); + Map json, + ) => _$$TsunamiForecastFirstHeightImplFromJson(json); @override final DateTime? arrivalTime; @@ -1905,23 +2063,22 @@ class _$TsunamiForecastFirstHeightImpl implements _TsunamiForecastFirstHeight { @override @pragma('vm:prefer-inline') _$$TsunamiForecastFirstHeightImplCopyWith<_$TsunamiForecastFirstHeightImpl> - get copyWith => __$$TsunamiForecastFirstHeightImplCopyWithImpl< - _$TsunamiForecastFirstHeightImpl>(this, _$identity); + get copyWith => __$$TsunamiForecastFirstHeightImplCopyWithImpl< + _$TsunamiForecastFirstHeightImpl + >(this, _$identity); @override Map toJson() { - return _$$TsunamiForecastFirstHeightImplToJson( - this, - ); + return _$$TsunamiForecastFirstHeightImplToJson(this); } } abstract class _TsunamiForecastFirstHeight implements TsunamiForecastFirstHeight { - const factory _TsunamiForecastFirstHeight( - {required final DateTime? arrivalTime, - required final TsunamiForecastFirstHeightCondition? condition}) = - _$TsunamiForecastFirstHeightImpl; + const factory _TsunamiForecastFirstHeight({ + required final DateTime? arrivalTime, + required final TsunamiForecastFirstHeightCondition? condition, + }) = _$TsunamiForecastFirstHeightImpl; factory _TsunamiForecastFirstHeight.fromJson(Map json) = _$TsunamiForecastFirstHeightImpl.fromJson; @@ -1936,11 +2093,12 @@ abstract class _TsunamiForecastFirstHeight @override @JsonKey(includeFromJson: false, includeToJson: false) _$$TsunamiForecastFirstHeightImplCopyWith<_$TsunamiForecastFirstHeightImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } TsunamiForecastMaxHeight _$TsunamiForecastMaxHeightFromJson( - Map json) { + Map json, +) { return _TsunamiForecastMaxHeight.fromJson(json); } @@ -1966,17 +2124,23 @@ mixin _$TsunamiForecastMaxHeight { /// @nodoc abstract class $TsunamiForecastMaxHeightCopyWith<$Res> { - factory $TsunamiForecastMaxHeightCopyWith(TsunamiForecastMaxHeight value, - $Res Function(TsunamiForecastMaxHeight) then) = - _$TsunamiForecastMaxHeightCopyWithImpl<$Res, TsunamiForecastMaxHeight>; + factory $TsunamiForecastMaxHeightCopyWith( + TsunamiForecastMaxHeight value, + $Res Function(TsunamiForecastMaxHeight) then, + ) = _$TsunamiForecastMaxHeightCopyWithImpl<$Res, TsunamiForecastMaxHeight>; @useResult - $Res call( - {double? value, bool? isOver, TsunamiMaxHeightCondition? condition}); + $Res call({ + double? value, + bool? isOver, + TsunamiMaxHeightCondition? condition, + }); } /// @nodoc -class _$TsunamiForecastMaxHeightCopyWithImpl<$Res, - $Val extends TsunamiForecastMaxHeight> +class _$TsunamiForecastMaxHeightCopyWithImpl< + $Res, + $Val extends TsunamiForecastMaxHeight +> implements $TsunamiForecastMaxHeightCopyWith<$Res> { _$TsunamiForecastMaxHeightCopyWithImpl(this._value, this._then); @@ -1994,20 +2158,26 @@ class _$TsunamiForecastMaxHeightCopyWithImpl<$Res, Object? isOver = freezed, Object? condition = freezed, }) { - return _then(_value.copyWith( - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as double?, - isOver: freezed == isOver - ? _value.isOver - : isOver // ignore: cast_nullable_to_non_nullable - as bool?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiMaxHeightCondition?, - ) as $Val); + return _then( + _value.copyWith( + value: + freezed == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as double?, + isOver: + freezed == isOver + ? _value.isOver + : isOver // ignore: cast_nullable_to_non_nullable + as bool?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiMaxHeightCondition?, + ) + as $Val, + ); } } @@ -2015,24 +2185,30 @@ class _$TsunamiForecastMaxHeightCopyWithImpl<$Res, abstract class _$$TsunamiForecastMaxHeightImplCopyWith<$Res> implements $TsunamiForecastMaxHeightCopyWith<$Res> { factory _$$TsunamiForecastMaxHeightImplCopyWith( - _$TsunamiForecastMaxHeightImpl value, - $Res Function(_$TsunamiForecastMaxHeightImpl) then) = - __$$TsunamiForecastMaxHeightImplCopyWithImpl<$Res>; + _$TsunamiForecastMaxHeightImpl value, + $Res Function(_$TsunamiForecastMaxHeightImpl) then, + ) = __$$TsunamiForecastMaxHeightImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {double? value, bool? isOver, TsunamiMaxHeightCondition? condition}); + $Res call({ + double? value, + bool? isOver, + TsunamiMaxHeightCondition? condition, + }); } /// @nodoc class __$$TsunamiForecastMaxHeightImplCopyWithImpl<$Res> - extends _$TsunamiForecastMaxHeightCopyWithImpl<$Res, - _$TsunamiForecastMaxHeightImpl> + extends + _$TsunamiForecastMaxHeightCopyWithImpl< + $Res, + _$TsunamiForecastMaxHeightImpl + > implements _$$TsunamiForecastMaxHeightImplCopyWith<$Res> { __$$TsunamiForecastMaxHeightImplCopyWithImpl( - _$TsunamiForecastMaxHeightImpl _value, - $Res Function(_$TsunamiForecastMaxHeightImpl) _then) - : super(_value, _then); + _$TsunamiForecastMaxHeightImpl _value, + $Res Function(_$TsunamiForecastMaxHeightImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiForecastMaxHeight /// with the given fields replaced by the non-null parameter values. @@ -2043,20 +2219,25 @@ class __$$TsunamiForecastMaxHeightImplCopyWithImpl<$Res> Object? isOver = freezed, Object? condition = freezed, }) { - return _then(_$TsunamiForecastMaxHeightImpl( - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as double?, - isOver: freezed == isOver - ? _value.isOver - : isOver // ignore: cast_nullable_to_non_nullable - as bool?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiMaxHeightCondition?, - )); + return _then( + _$TsunamiForecastMaxHeightImpl( + value: + freezed == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as double?, + isOver: + freezed == isOver + ? _value.isOver + : isOver // ignore: cast_nullable_to_non_nullable + as bool?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiMaxHeightCondition?, + ), + ); } } @@ -2064,8 +2245,11 @@ class __$$TsunamiForecastMaxHeightImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiForecastMaxHeightImpl implements _TsunamiForecastMaxHeight { - const _$TsunamiForecastMaxHeightImpl( - {required this.value, required this.isOver, required this.condition}); + const _$TsunamiForecastMaxHeightImpl({ + required this.value, + required this.isOver, + required this.condition, + }); factory _$TsunamiForecastMaxHeightImpl.fromJson(Map json) => _$$TsunamiForecastMaxHeightImplFromJson(json); @@ -2106,23 +2290,22 @@ class _$TsunamiForecastMaxHeightImpl implements _TsunamiForecastMaxHeight { @override @pragma('vm:prefer-inline') _$$TsunamiForecastMaxHeightImplCopyWith<_$TsunamiForecastMaxHeightImpl> - get copyWith => __$$TsunamiForecastMaxHeightImplCopyWithImpl< - _$TsunamiForecastMaxHeightImpl>(this, _$identity); + get copyWith => __$$TsunamiForecastMaxHeightImplCopyWithImpl< + _$TsunamiForecastMaxHeightImpl + >(this, _$identity); @override Map toJson() { - return _$$TsunamiForecastMaxHeightImplToJson( - this, - ); + return _$$TsunamiForecastMaxHeightImplToJson(this); } } abstract class _TsunamiForecastMaxHeight implements TsunamiForecastMaxHeight { - const factory _TsunamiForecastMaxHeight( - {required final double? value, - required final bool? isOver, - required final TsunamiMaxHeightCondition? condition}) = - _$TsunamiForecastMaxHeightImpl; + const factory _TsunamiForecastMaxHeight({ + required final double? value, + required final bool? isOver, + required final TsunamiMaxHeightCondition? condition, + }) = _$TsunamiForecastMaxHeightImpl; factory _TsunamiForecastMaxHeight.fromJson(Map json) = _$TsunamiForecastMaxHeightImpl.fromJson; @@ -2142,11 +2325,12 @@ abstract class _TsunamiForecastMaxHeight implements TsunamiForecastMaxHeight { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$TsunamiForecastMaxHeightImplCopyWith<_$TsunamiForecastMaxHeightImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } TsunamiForecastStation _$TsunamiForecastStationFromJson( - Map json) { + Map json, +) { return _TsunamiForecastStation.fromJson(json); } @@ -2171,21 +2355,25 @@ mixin _$TsunamiForecastStation { /// @nodoc abstract class $TsunamiForecastStationCopyWith<$Res> { - factory $TsunamiForecastStationCopyWith(TsunamiForecastStation value, - $Res Function(TsunamiForecastStation) then) = - _$TsunamiForecastStationCopyWithImpl<$Res, TsunamiForecastStation>; + factory $TsunamiForecastStationCopyWith( + TsunamiForecastStation value, + $Res Function(TsunamiForecastStation) then, + ) = _$TsunamiForecastStationCopyWithImpl<$Res, TsunamiForecastStation>; @useResult - $Res call( - {String code, - String name, - DateTime highTideTime, - DateTime? firstHeightTime, - TsunamiForecastFirstHeightCondition? condition}); + $Res call({ + String code, + String name, + DateTime highTideTime, + DateTime? firstHeightTime, + TsunamiForecastFirstHeightCondition? condition, + }); } /// @nodoc -class _$TsunamiForecastStationCopyWithImpl<$Res, - $Val extends TsunamiForecastStation> +class _$TsunamiForecastStationCopyWithImpl< + $Res, + $Val extends TsunamiForecastStation +> implements $TsunamiForecastStationCopyWith<$Res> { _$TsunamiForecastStationCopyWithImpl(this._value, this._then); @@ -2205,28 +2393,36 @@ class _$TsunamiForecastStationCopyWithImpl<$Res, Object? firstHeightTime = freezed, Object? condition = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - highTideTime: null == highTideTime - ? _value.highTideTime - : highTideTime // ignore: cast_nullable_to_non_nullable - as DateTime, - firstHeightTime: freezed == firstHeightTime - ? _value.firstHeightTime - : firstHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiForecastFirstHeightCondition?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + highTideTime: + null == highTideTime + ? _value.highTideTime + : highTideTime // ignore: cast_nullable_to_non_nullable + as DateTime, + firstHeightTime: + freezed == firstHeightTime + ? _value.firstHeightTime + : firstHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiForecastFirstHeightCondition?, + ) + as $Val, + ); } } @@ -2234,28 +2430,29 @@ class _$TsunamiForecastStationCopyWithImpl<$Res, abstract class _$$TsunamiForecastStationImplCopyWith<$Res> implements $TsunamiForecastStationCopyWith<$Res> { factory _$$TsunamiForecastStationImplCopyWith( - _$TsunamiForecastStationImpl value, - $Res Function(_$TsunamiForecastStationImpl) then) = - __$$TsunamiForecastStationImplCopyWithImpl<$Res>; + _$TsunamiForecastStationImpl value, + $Res Function(_$TsunamiForecastStationImpl) then, + ) = __$$TsunamiForecastStationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - DateTime highTideTime, - DateTime? firstHeightTime, - TsunamiForecastFirstHeightCondition? condition}); + $Res call({ + String code, + String name, + DateTime highTideTime, + DateTime? firstHeightTime, + TsunamiForecastFirstHeightCondition? condition, + }); } /// @nodoc class __$$TsunamiForecastStationImplCopyWithImpl<$Res> - extends _$TsunamiForecastStationCopyWithImpl<$Res, - _$TsunamiForecastStationImpl> + extends + _$TsunamiForecastStationCopyWithImpl<$Res, _$TsunamiForecastStationImpl> implements _$$TsunamiForecastStationImplCopyWith<$Res> { __$$TsunamiForecastStationImplCopyWithImpl( - _$TsunamiForecastStationImpl _value, - $Res Function(_$TsunamiForecastStationImpl) _then) - : super(_value, _then); + _$TsunamiForecastStationImpl _value, + $Res Function(_$TsunamiForecastStationImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiForecastStation /// with the given fields replaced by the non-null parameter values. @@ -2268,28 +2465,35 @@ class __$$TsunamiForecastStationImplCopyWithImpl<$Res> Object? firstHeightTime = freezed, Object? condition = freezed, }) { - return _then(_$TsunamiForecastStationImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - highTideTime: null == highTideTime - ? _value.highTideTime - : highTideTime // ignore: cast_nullable_to_non_nullable - as DateTime, - firstHeightTime: freezed == firstHeightTime - ? _value.firstHeightTime - : firstHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiForecastFirstHeightCondition?, - )); + return _then( + _$TsunamiForecastStationImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + highTideTime: + null == highTideTime + ? _value.highTideTime + : highTideTime // ignore: cast_nullable_to_non_nullable + as DateTime, + firstHeightTime: + freezed == firstHeightTime + ? _value.firstHeightTime + : firstHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiForecastFirstHeightCondition?, + ), + ); } } @@ -2297,12 +2501,13 @@ class __$$TsunamiForecastStationImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiForecastStationImpl implements _TsunamiForecastStation { - const _$TsunamiForecastStationImpl( - {required this.code, - required this.name, - required this.highTideTime, - required this.firstHeightTime, - required this.condition}); + const _$TsunamiForecastStationImpl({ + required this.code, + required this.name, + required this.highTideTime, + required this.firstHeightTime, + required this.condition, + }); factory _$TsunamiForecastStationImpl.fromJson(Map json) => _$$TsunamiForecastStationImplFromJson(json); @@ -2341,7 +2546,13 @@ class _$TsunamiForecastStationImpl implements _TsunamiForecastStation { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, code, name, highTideTime, firstHeightTime, condition); + runtimeType, + code, + name, + highTideTime, + firstHeightTime, + condition, + ); /// Create a copy of TsunamiForecastStation /// with the given fields replaced by the non-null parameter values. @@ -2349,25 +2560,26 @@ class _$TsunamiForecastStationImpl implements _TsunamiForecastStation { @override @pragma('vm:prefer-inline') _$$TsunamiForecastStationImplCopyWith<_$TsunamiForecastStationImpl> - get copyWith => __$$TsunamiForecastStationImplCopyWithImpl< - _$TsunamiForecastStationImpl>(this, _$identity); + get copyWith => + __$$TsunamiForecastStationImplCopyWithImpl<_$TsunamiForecastStationImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$TsunamiForecastStationImplToJson( - this, - ); + return _$$TsunamiForecastStationImplToJson(this); } } abstract class _TsunamiForecastStation implements TsunamiForecastStation { - const factory _TsunamiForecastStation( - {required final String code, - required final String name, - required final DateTime highTideTime, - required final DateTime? firstHeightTime, - required final TsunamiForecastFirstHeightCondition? condition}) = - _$TsunamiForecastStationImpl; + const factory _TsunamiForecastStation({ + required final String code, + required final String name, + required final DateTime highTideTime, + required final DateTime? firstHeightTime, + required final TsunamiForecastFirstHeightCondition? condition, + }) = _$TsunamiForecastStationImpl; factory _TsunamiForecastStation.fromJson(Map json) = _$TsunamiForecastStationImpl.fromJson; @@ -2388,7 +2600,7 @@ abstract class _TsunamiForecastStation implements TsunamiForecastStation { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$TsunamiForecastStationImplCopyWith<_$TsunamiForecastStationImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } TsunamiObservation _$TsunamiObservationFromJson(Map json) { @@ -2415,11 +2627,15 @@ mixin _$TsunamiObservation { /// @nodoc abstract class $TsunamiObservationCopyWith<$Res> { factory $TsunamiObservationCopyWith( - TsunamiObservation value, $Res Function(TsunamiObservation) then) = - _$TsunamiObservationCopyWithImpl<$Res, TsunamiObservation>; + TsunamiObservation value, + $Res Function(TsunamiObservation) then, + ) = _$TsunamiObservationCopyWithImpl<$Res, TsunamiObservation>; @useResult - $Res call( - {String? code, String? name, List stations}); + $Res call({ + String? code, + String? name, + List stations, + }); } /// @nodoc @@ -2441,42 +2657,53 @@ class _$TsunamiObservationCopyWithImpl<$Res, $Val extends TsunamiObservation> Object? name = freezed, Object? stations = null, }) { - return _then(_value.copyWith( - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - stations: null == stations - ? _value.stations - : stations // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + code: + freezed == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String?, + name: + freezed == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String?, + stations: + null == stations + ? _value.stations + : stations // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TsunamiObservationImplCopyWith<$Res> implements $TsunamiObservationCopyWith<$Res> { - factory _$$TsunamiObservationImplCopyWith(_$TsunamiObservationImpl value, - $Res Function(_$TsunamiObservationImpl) then) = - __$$TsunamiObservationImplCopyWithImpl<$Res>; + factory _$$TsunamiObservationImplCopyWith( + _$TsunamiObservationImpl value, + $Res Function(_$TsunamiObservationImpl) then, + ) = __$$TsunamiObservationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String? code, String? name, List stations}); + $Res call({ + String? code, + String? name, + List stations, + }); } /// @nodoc class __$$TsunamiObservationImplCopyWithImpl<$Res> extends _$TsunamiObservationCopyWithImpl<$Res, _$TsunamiObservationImpl> implements _$$TsunamiObservationImplCopyWith<$Res> { - __$$TsunamiObservationImplCopyWithImpl(_$TsunamiObservationImpl _value, - $Res Function(_$TsunamiObservationImpl) _then) - : super(_value, _then); + __$$TsunamiObservationImplCopyWithImpl( + _$TsunamiObservationImpl _value, + $Res Function(_$TsunamiObservationImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiObservation /// with the given fields replaced by the non-null parameter values. @@ -2487,20 +2714,25 @@ class __$$TsunamiObservationImplCopyWithImpl<$Res> Object? name = freezed, Object? stations = null, }) { - return _then(_$TsunamiObservationImpl( - code: freezed == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String?, - name: freezed == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String?, - stations: null == stations - ? _value._stations - : stations // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$TsunamiObservationImpl( + code: + freezed == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String?, + name: + freezed == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String?, + stations: + null == stations + ? _value._stations + : stations // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -2508,11 +2740,11 @@ class __$$TsunamiObservationImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiObservationImpl implements _TsunamiObservation { - const _$TsunamiObservationImpl( - {required this.code, - required this.name, - required final List stations}) - : _stations = stations; + const _$TsunamiObservationImpl({ + required this.code, + required this.name, + required final List stations, + }) : _stations = stations; factory _$TsunamiObservationImpl.fromJson(Map json) => _$$TsunamiObservationImplFromJson(json); @@ -2547,7 +2779,11 @@ class _$TsunamiObservationImpl implements _TsunamiObservation { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, code, name, const DeepCollectionEquality().hash(_stations)); + runtimeType, + code, + name, + const DeepCollectionEquality().hash(_stations), + ); /// Create a copy of TsunamiObservation /// with the given fields replaced by the non-null parameter values. @@ -2556,22 +2792,22 @@ class _$TsunamiObservationImpl implements _TsunamiObservation { @pragma('vm:prefer-inline') _$$TsunamiObservationImplCopyWith<_$TsunamiObservationImpl> get copyWith => __$$TsunamiObservationImplCopyWithImpl<_$TsunamiObservationImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$TsunamiObservationImplToJson( - this, - ); + return _$$TsunamiObservationImplToJson(this); } } abstract class _TsunamiObservation implements TsunamiObservation { - const factory _TsunamiObservation( - {required final String? code, - required final String? name, - required final List stations}) = - _$TsunamiObservationImpl; + const factory _TsunamiObservation({ + required final String? code, + required final String? name, + required final List stations, + }) = _$TsunamiObservationImpl; factory _TsunamiObservation.fromJson(Map json) = _$TsunamiObservationImpl.fromJson; @@ -2592,7 +2828,8 @@ abstract class _TsunamiObservation implements TsunamiObservation { } TsunamiObservationStation _$TsunamiObservationStationFromJson( - Map json) { + Map json, +) { return _TsunamiObservationStation.fromJson(json); } @@ -2626,25 +2863,29 @@ mixin _$TsunamiObservationStation { /// @nodoc abstract class $TsunamiObservationStationCopyWith<$Res> { - factory $TsunamiObservationStationCopyWith(TsunamiObservationStation value, - $Res Function(TsunamiObservationStation) then) = - _$TsunamiObservationStationCopyWithImpl<$Res, TsunamiObservationStation>; + factory $TsunamiObservationStationCopyWith( + TsunamiObservationStation value, + $Res Function(TsunamiObservationStation) then, + ) = _$TsunamiObservationStationCopyWithImpl<$Res, TsunamiObservationStation>; @useResult - $Res call( - {String code, - String name, - DateTime? firstHeightArrivalTime, - TsunamiObservationStationFirstHeightIntial? firstHeightInitial, - DateTime? maxHeightTime, - double? maxHeightValue, - bool? maxHeightIsOver, - bool? maxHeightIsRising, - TsunamiObservationStationCondition? condition}); -} - -/// @nodoc -class _$TsunamiObservationStationCopyWithImpl<$Res, - $Val extends TsunamiObservationStation> + $Res call({ + String code, + String name, + DateTime? firstHeightArrivalTime, + TsunamiObservationStationFirstHeightIntial? firstHeightInitial, + DateTime? maxHeightTime, + double? maxHeightValue, + bool? maxHeightIsOver, + bool? maxHeightIsRising, + TsunamiObservationStationCondition? condition, + }); +} + +/// @nodoc +class _$TsunamiObservationStationCopyWithImpl< + $Res, + $Val extends TsunamiObservationStation +> implements $TsunamiObservationStationCopyWith<$Res> { _$TsunamiObservationStationCopyWithImpl(this._value, this._then); @@ -2668,44 +2909,56 @@ class _$TsunamiObservationStationCopyWithImpl<$Res, Object? maxHeightIsRising = freezed, Object? condition = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - firstHeightArrivalTime: freezed == firstHeightArrivalTime - ? _value.firstHeightArrivalTime - : firstHeightArrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - firstHeightInitial: freezed == firstHeightInitial - ? _value.firstHeightInitial - : firstHeightInitial // ignore: cast_nullable_to_non_nullable - as TsunamiObservationStationFirstHeightIntial?, - maxHeightTime: freezed == maxHeightTime - ? _value.maxHeightTime - : maxHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - maxHeightValue: freezed == maxHeightValue - ? _value.maxHeightValue - : maxHeightValue // ignore: cast_nullable_to_non_nullable - as double?, - maxHeightIsOver: freezed == maxHeightIsOver - ? _value.maxHeightIsOver - : maxHeightIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - maxHeightIsRising: freezed == maxHeightIsRising - ? _value.maxHeightIsRising - : maxHeightIsRising // ignore: cast_nullable_to_non_nullable - as bool?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiObservationStationCondition?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + firstHeightArrivalTime: + freezed == firstHeightArrivalTime + ? _value.firstHeightArrivalTime + : firstHeightArrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + firstHeightInitial: + freezed == firstHeightInitial + ? _value.firstHeightInitial + : firstHeightInitial // ignore: cast_nullable_to_non_nullable + as TsunamiObservationStationFirstHeightIntial?, + maxHeightTime: + freezed == maxHeightTime + ? _value.maxHeightTime + : maxHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + maxHeightValue: + freezed == maxHeightValue + ? _value.maxHeightValue + : maxHeightValue // ignore: cast_nullable_to_non_nullable + as double?, + maxHeightIsOver: + freezed == maxHeightIsOver + ? _value.maxHeightIsOver + : maxHeightIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + maxHeightIsRising: + freezed == maxHeightIsRising + ? _value.maxHeightIsRising + : maxHeightIsRising // ignore: cast_nullable_to_non_nullable + as bool?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiObservationStationCondition?, + ) + as $Val, + ); } } @@ -2713,32 +2966,36 @@ class _$TsunamiObservationStationCopyWithImpl<$Res, abstract class _$$TsunamiObservationStationImplCopyWith<$Res> implements $TsunamiObservationStationCopyWith<$Res> { factory _$$TsunamiObservationStationImplCopyWith( - _$TsunamiObservationStationImpl value, - $Res Function(_$TsunamiObservationStationImpl) then) = - __$$TsunamiObservationStationImplCopyWithImpl<$Res>; + _$TsunamiObservationStationImpl value, + $Res Function(_$TsunamiObservationStationImpl) then, + ) = __$$TsunamiObservationStationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - DateTime? firstHeightArrivalTime, - TsunamiObservationStationFirstHeightIntial? firstHeightInitial, - DateTime? maxHeightTime, - double? maxHeightValue, - bool? maxHeightIsOver, - bool? maxHeightIsRising, - TsunamiObservationStationCondition? condition}); + $Res call({ + String code, + String name, + DateTime? firstHeightArrivalTime, + TsunamiObservationStationFirstHeightIntial? firstHeightInitial, + DateTime? maxHeightTime, + double? maxHeightValue, + bool? maxHeightIsOver, + bool? maxHeightIsRising, + TsunamiObservationStationCondition? condition, + }); } /// @nodoc class __$$TsunamiObservationStationImplCopyWithImpl<$Res> - extends _$TsunamiObservationStationCopyWithImpl<$Res, - _$TsunamiObservationStationImpl> + extends + _$TsunamiObservationStationCopyWithImpl< + $Res, + _$TsunamiObservationStationImpl + > implements _$$TsunamiObservationStationImplCopyWith<$Res> { __$$TsunamiObservationStationImplCopyWithImpl( - _$TsunamiObservationStationImpl _value, - $Res Function(_$TsunamiObservationStationImpl) _then) - : super(_value, _then); + _$TsunamiObservationStationImpl _value, + $Res Function(_$TsunamiObservationStationImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiObservationStation /// with the given fields replaced by the non-null parameter values. @@ -2755,44 +3012,55 @@ class __$$TsunamiObservationStationImplCopyWithImpl<$Res> Object? maxHeightIsRising = freezed, Object? condition = freezed, }) { - return _then(_$TsunamiObservationStationImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - firstHeightArrivalTime: freezed == firstHeightArrivalTime - ? _value.firstHeightArrivalTime - : firstHeightArrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - firstHeightInitial: freezed == firstHeightInitial - ? _value.firstHeightInitial - : firstHeightInitial // ignore: cast_nullable_to_non_nullable - as TsunamiObservationStationFirstHeightIntial?, - maxHeightTime: freezed == maxHeightTime - ? _value.maxHeightTime - : maxHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - maxHeightValue: freezed == maxHeightValue - ? _value.maxHeightValue - : maxHeightValue // ignore: cast_nullable_to_non_nullable - as double?, - maxHeightIsOver: freezed == maxHeightIsOver - ? _value.maxHeightIsOver - : maxHeightIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - maxHeightIsRising: freezed == maxHeightIsRising - ? _value.maxHeightIsRising - : maxHeightIsRising // ignore: cast_nullable_to_non_nullable - as bool?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as TsunamiObservationStationCondition?, - )); + return _then( + _$TsunamiObservationStationImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + firstHeightArrivalTime: + freezed == firstHeightArrivalTime + ? _value.firstHeightArrivalTime + : firstHeightArrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + firstHeightInitial: + freezed == firstHeightInitial + ? _value.firstHeightInitial + : firstHeightInitial // ignore: cast_nullable_to_non_nullable + as TsunamiObservationStationFirstHeightIntial?, + maxHeightTime: + freezed == maxHeightTime + ? _value.maxHeightTime + : maxHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + maxHeightValue: + freezed == maxHeightValue + ? _value.maxHeightValue + : maxHeightValue // ignore: cast_nullable_to_non_nullable + as double?, + maxHeightIsOver: + freezed == maxHeightIsOver + ? _value.maxHeightIsOver + : maxHeightIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + maxHeightIsRising: + freezed == maxHeightIsRising + ? _value.maxHeightIsRising + : maxHeightIsRising // ignore: cast_nullable_to_non_nullable + as bool?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as TsunamiObservationStationCondition?, + ), + ); } } @@ -2800,16 +3068,17 @@ class __$$TsunamiObservationStationImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiObservationStationImpl implements _TsunamiObservationStation { - const _$TsunamiObservationStationImpl( - {required this.code, - required this.name, - required this.firstHeightArrivalTime, - required this.firstHeightInitial, - required this.maxHeightTime, - required this.maxHeightValue, - required this.maxHeightIsOver, - required this.maxHeightIsRising, - required this.condition}); + const _$TsunamiObservationStationImpl({ + required this.code, + required this.name, + required this.firstHeightArrivalTime, + required this.firstHeightInitial, + required this.maxHeightTime, + required this.maxHeightValue, + required this.maxHeightIsOver, + required this.maxHeightIsRising, + required this.condition, + }); factory _$TsunamiObservationStationImpl.fromJson(Map json) => _$$TsunamiObservationStationImplFromJson(json); @@ -2868,16 +3137,17 @@ class _$TsunamiObservationStationImpl implements _TsunamiObservationStation { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - code, - name, - firstHeightArrivalTime, - firstHeightInitial, - maxHeightTime, - maxHeightValue, - maxHeightIsOver, - maxHeightIsRising, - condition); + runtimeType, + code, + name, + firstHeightArrivalTime, + firstHeightInitial, + maxHeightTime, + maxHeightValue, + maxHeightIsOver, + maxHeightIsRising, + condition, + ); /// Create a copy of TsunamiObservationStation /// with the given fields replaced by the non-null parameter values. @@ -2885,30 +3155,29 @@ class _$TsunamiObservationStationImpl implements _TsunamiObservationStation { @override @pragma('vm:prefer-inline') _$$TsunamiObservationStationImplCopyWith<_$TsunamiObservationStationImpl> - get copyWith => __$$TsunamiObservationStationImplCopyWithImpl< - _$TsunamiObservationStationImpl>(this, _$identity); + get copyWith => __$$TsunamiObservationStationImplCopyWithImpl< + _$TsunamiObservationStationImpl + >(this, _$identity); @override Map toJson() { - return _$$TsunamiObservationStationImplToJson( - this, - ); + return _$$TsunamiObservationStationImplToJson(this); } } abstract class _TsunamiObservationStation implements TsunamiObservationStation { - const factory _TsunamiObservationStation( - {required final String code, - required final String name, - required final DateTime? firstHeightArrivalTime, - required final TsunamiObservationStationFirstHeightIntial? - firstHeightInitial, - required final DateTime? maxHeightTime, - required final double? maxHeightValue, - required final bool? maxHeightIsOver, - required final bool? maxHeightIsRising, - required final TsunamiObservationStationCondition? condition}) = - _$TsunamiObservationStationImpl; + const factory _TsunamiObservationStation({ + required final String code, + required final String name, + required final DateTime? firstHeightArrivalTime, + required final TsunamiObservationStationFirstHeightIntial? + firstHeightInitial, + required final DateTime? maxHeightTime, + required final double? maxHeightValue, + required final bool? maxHeightIsOver, + required final bool? maxHeightIsRising, + required final TsunamiObservationStationCondition? condition, + }) = _$TsunamiObservationStationImpl; factory _TsunamiObservationStation.fromJson(Map json) = _$TsunamiObservationStationImpl.fromJson; @@ -2941,7 +3210,7 @@ abstract class _TsunamiObservationStation implements TsunamiObservationStation { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$TsunamiObservationStationImplCopyWith<_$TsunamiObservationStationImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } TsunamiEstimation _$TsunamiEstimationFromJson(Map json) { @@ -2960,7 +3229,7 @@ mixin _$TsunamiEstimation { bool? get maxHeightIsOver => throw _privateConstructorUsedError; TsunamiMaxHeightCondition? get maxHeightCondition => throw _privateConstructorUsedError; // 津波警報以上でまだ津波の観測値が小さい場合に出現する -// *津波観測中* + // *津波観測中* bool? get isObserving => throw _privateConstructorUsedError; /// Serializes this TsunamiEstimation to a JSON map. @@ -2976,19 +3245,21 @@ mixin _$TsunamiEstimation { /// @nodoc abstract class $TsunamiEstimationCopyWith<$Res> { factory $TsunamiEstimationCopyWith( - TsunamiEstimation value, $Res Function(TsunamiEstimation) then) = - _$TsunamiEstimationCopyWithImpl<$Res, TsunamiEstimation>; + TsunamiEstimation value, + $Res Function(TsunamiEstimation) then, + ) = _$TsunamiEstimationCopyWithImpl<$Res, TsunamiEstimation>; @useResult - $Res call( - {String code, - String name, - DateTime? firstHeightTime, - TsunamiEstimationFirstHeightCondition? firstHeightCondition, - DateTime? maxHeightTime, - double? maxHeightValue, - bool? maxHeightIsOver, - TsunamiMaxHeightCondition? maxHeightCondition, - bool? isObserving}); + $Res call({ + String code, + String name, + DateTime? firstHeightTime, + TsunamiEstimationFirstHeightCondition? firstHeightCondition, + DateTime? maxHeightTime, + double? maxHeightValue, + bool? maxHeightIsOver, + TsunamiMaxHeightCondition? maxHeightCondition, + bool? isObserving, + }); } /// @nodoc @@ -3016,74 +3287,89 @@ class _$TsunamiEstimationCopyWithImpl<$Res, $Val extends TsunamiEstimation> Object? maxHeightCondition = freezed, Object? isObserving = freezed, }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - firstHeightTime: freezed == firstHeightTime - ? _value.firstHeightTime - : firstHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - firstHeightCondition: freezed == firstHeightCondition - ? _value.firstHeightCondition - : firstHeightCondition // ignore: cast_nullable_to_non_nullable - as TsunamiEstimationFirstHeightCondition?, - maxHeightTime: freezed == maxHeightTime - ? _value.maxHeightTime - : maxHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - maxHeightValue: freezed == maxHeightValue - ? _value.maxHeightValue - : maxHeightValue // ignore: cast_nullable_to_non_nullable - as double?, - maxHeightIsOver: freezed == maxHeightIsOver - ? _value.maxHeightIsOver - : maxHeightIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - maxHeightCondition: freezed == maxHeightCondition - ? _value.maxHeightCondition - : maxHeightCondition // ignore: cast_nullable_to_non_nullable - as TsunamiMaxHeightCondition?, - isObserving: freezed == isObserving - ? _value.isObserving - : isObserving // ignore: cast_nullable_to_non_nullable - as bool?, - ) as $Val); + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + firstHeightTime: + freezed == firstHeightTime + ? _value.firstHeightTime + : firstHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + firstHeightCondition: + freezed == firstHeightCondition + ? _value.firstHeightCondition + : firstHeightCondition // ignore: cast_nullable_to_non_nullable + as TsunamiEstimationFirstHeightCondition?, + maxHeightTime: + freezed == maxHeightTime + ? _value.maxHeightTime + : maxHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + maxHeightValue: + freezed == maxHeightValue + ? _value.maxHeightValue + : maxHeightValue // ignore: cast_nullable_to_non_nullable + as double?, + maxHeightIsOver: + freezed == maxHeightIsOver + ? _value.maxHeightIsOver + : maxHeightIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + maxHeightCondition: + freezed == maxHeightCondition + ? _value.maxHeightCondition + : maxHeightCondition // ignore: cast_nullable_to_non_nullable + as TsunamiMaxHeightCondition?, + isObserving: + freezed == isObserving + ? _value.isObserving + : isObserving // ignore: cast_nullable_to_non_nullable + as bool?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TsunamiEstimationImplCopyWith<$Res> implements $TsunamiEstimationCopyWith<$Res> { - factory _$$TsunamiEstimationImplCopyWith(_$TsunamiEstimationImpl value, - $Res Function(_$TsunamiEstimationImpl) then) = - __$$TsunamiEstimationImplCopyWithImpl<$Res>; + factory _$$TsunamiEstimationImplCopyWith( + _$TsunamiEstimationImpl value, + $Res Function(_$TsunamiEstimationImpl) then, + ) = __$$TsunamiEstimationImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String code, - String name, - DateTime? firstHeightTime, - TsunamiEstimationFirstHeightCondition? firstHeightCondition, - DateTime? maxHeightTime, - double? maxHeightValue, - bool? maxHeightIsOver, - TsunamiMaxHeightCondition? maxHeightCondition, - bool? isObserving}); + $Res call({ + String code, + String name, + DateTime? firstHeightTime, + TsunamiEstimationFirstHeightCondition? firstHeightCondition, + DateTime? maxHeightTime, + double? maxHeightValue, + bool? maxHeightIsOver, + TsunamiMaxHeightCondition? maxHeightCondition, + bool? isObserving, + }); } /// @nodoc class __$$TsunamiEstimationImplCopyWithImpl<$Res> extends _$TsunamiEstimationCopyWithImpl<$Res, _$TsunamiEstimationImpl> implements _$$TsunamiEstimationImplCopyWith<$Res> { - __$$TsunamiEstimationImplCopyWithImpl(_$TsunamiEstimationImpl _value, - $Res Function(_$TsunamiEstimationImpl) _then) - : super(_value, _then); + __$$TsunamiEstimationImplCopyWithImpl( + _$TsunamiEstimationImpl _value, + $Res Function(_$TsunamiEstimationImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiEstimation /// with the given fields replaced by the non-null parameter values. @@ -3100,44 +3386,55 @@ class __$$TsunamiEstimationImplCopyWithImpl<$Res> Object? maxHeightCondition = freezed, Object? isObserving = freezed, }) { - return _then(_$TsunamiEstimationImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - firstHeightTime: freezed == firstHeightTime - ? _value.firstHeightTime - : firstHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - firstHeightCondition: freezed == firstHeightCondition - ? _value.firstHeightCondition - : firstHeightCondition // ignore: cast_nullable_to_non_nullable - as TsunamiEstimationFirstHeightCondition?, - maxHeightTime: freezed == maxHeightTime - ? _value.maxHeightTime - : maxHeightTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - maxHeightValue: freezed == maxHeightValue - ? _value.maxHeightValue - : maxHeightValue // ignore: cast_nullable_to_non_nullable - as double?, - maxHeightIsOver: freezed == maxHeightIsOver - ? _value.maxHeightIsOver - : maxHeightIsOver // ignore: cast_nullable_to_non_nullable - as bool?, - maxHeightCondition: freezed == maxHeightCondition - ? _value.maxHeightCondition - : maxHeightCondition // ignore: cast_nullable_to_non_nullable - as TsunamiMaxHeightCondition?, - isObserving: freezed == isObserving - ? _value.isObserving - : isObserving // ignore: cast_nullable_to_non_nullable - as bool?, - )); + return _then( + _$TsunamiEstimationImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + firstHeightTime: + freezed == firstHeightTime + ? _value.firstHeightTime + : firstHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + firstHeightCondition: + freezed == firstHeightCondition + ? _value.firstHeightCondition + : firstHeightCondition // ignore: cast_nullable_to_non_nullable + as TsunamiEstimationFirstHeightCondition?, + maxHeightTime: + freezed == maxHeightTime + ? _value.maxHeightTime + : maxHeightTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + maxHeightValue: + freezed == maxHeightValue + ? _value.maxHeightValue + : maxHeightValue // ignore: cast_nullable_to_non_nullable + as double?, + maxHeightIsOver: + freezed == maxHeightIsOver + ? _value.maxHeightIsOver + : maxHeightIsOver // ignore: cast_nullable_to_non_nullable + as bool?, + maxHeightCondition: + freezed == maxHeightCondition + ? _value.maxHeightCondition + : maxHeightCondition // ignore: cast_nullable_to_non_nullable + as TsunamiMaxHeightCondition?, + isObserving: + freezed == isObserving + ? _value.isObserving + : isObserving // ignore: cast_nullable_to_non_nullable + as bool?, + ), + ); } } @@ -3145,16 +3442,17 @@ class __$$TsunamiEstimationImplCopyWithImpl<$Res> @JsonSerializable(fieldRename: FieldRename.none) class _$TsunamiEstimationImpl implements _TsunamiEstimation { - const _$TsunamiEstimationImpl( - {required this.code, - required this.name, - required this.firstHeightTime, - required this.firstHeightCondition, - required this.maxHeightTime, - required this.maxHeightValue, - required this.maxHeightIsOver, - required this.maxHeightCondition, - required this.isObserving}); + const _$TsunamiEstimationImpl({ + required this.code, + required this.name, + required this.firstHeightTime, + required this.firstHeightCondition, + required this.maxHeightTime, + required this.maxHeightValue, + required this.maxHeightIsOver, + required this.maxHeightCondition, + required this.isObserving, + }); factory _$TsunamiEstimationImpl.fromJson(Map json) => _$$TsunamiEstimationImplFromJson(json); @@ -3175,8 +3473,8 @@ class _$TsunamiEstimationImpl implements _TsunamiEstimation { final bool? maxHeightIsOver; @override final TsunamiMaxHeightCondition? maxHeightCondition; -// 津波警報以上でまだ津波の観測値が小さい場合に出現する -// *津波観測中* + // 津波警報以上でまだ津波の観測値が小さい場合に出現する + // *津波観測中* @override final bool? isObserving; @@ -3211,16 +3509,17 @@ class _$TsunamiEstimationImpl implements _TsunamiEstimation { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - code, - name, - firstHeightTime, - firstHeightCondition, - maxHeightTime, - maxHeightValue, - maxHeightIsOver, - maxHeightCondition, - isObserving); + runtimeType, + code, + name, + firstHeightTime, + firstHeightCondition, + maxHeightTime, + maxHeightValue, + maxHeightIsOver, + maxHeightCondition, + isObserving, + ); /// Create a copy of TsunamiEstimation /// with the given fields replaced by the non-null parameter values. @@ -3229,28 +3528,28 @@ class _$TsunamiEstimationImpl implements _TsunamiEstimation { @pragma('vm:prefer-inline') _$$TsunamiEstimationImplCopyWith<_$TsunamiEstimationImpl> get copyWith => __$$TsunamiEstimationImplCopyWithImpl<_$TsunamiEstimationImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$TsunamiEstimationImplToJson( - this, - ); + return _$$TsunamiEstimationImplToJson(this); } } abstract class _TsunamiEstimation implements TsunamiEstimation { - const factory _TsunamiEstimation( - {required final String code, - required final String name, - required final DateTime? firstHeightTime, - required final TsunamiEstimationFirstHeightCondition? - firstHeightCondition, - required final DateTime? maxHeightTime, - required final double? maxHeightValue, - required final bool? maxHeightIsOver, - required final TsunamiMaxHeightCondition? maxHeightCondition, - required final bool? isObserving}) = _$TsunamiEstimationImpl; + const factory _TsunamiEstimation({ + required final String code, + required final String name, + required final DateTime? firstHeightTime, + required final TsunamiEstimationFirstHeightCondition? firstHeightCondition, + required final DateTime? maxHeightTime, + required final double? maxHeightValue, + required final bool? maxHeightIsOver, + required final TsunamiMaxHeightCondition? maxHeightCondition, + required final bool? isObserving, + }) = _$TsunamiEstimationImpl; factory _TsunamiEstimation.fromJson(Map json) = _$TsunamiEstimationImpl.fromJson; @@ -3270,9 +3569,8 @@ abstract class _TsunamiEstimation implements TsunamiEstimation { @override bool? get maxHeightIsOver; @override - TsunamiMaxHeightCondition? - get maxHeightCondition; // 津波警報以上でまだ津波の観測値が小さい場合に出現する -// *津波観測中* + TsunamiMaxHeightCondition? get maxHeightCondition; // 津波警報以上でまだ津波の観測値が小さい場合に出現する + // *津波観測中* @override bool? get isObserving; @@ -3308,14 +3606,16 @@ mixin _$PublicBodyVTSE41 { /// @nodoc abstract class $PublicBodyVTSE41CopyWith<$Res> { factory $PublicBodyVTSE41CopyWith( - PublicBodyVTSE41 value, $Res Function(PublicBodyVTSE41) then) = - _$PublicBodyVTSE41CopyWithImpl<$Res, PublicBodyVTSE41>; + PublicBodyVTSE41 value, + $Res Function(PublicBodyVTSE41) then, + ) = _$PublicBodyVTSE41CopyWithImpl<$Res, PublicBodyVTSE41>; @useResult - $Res call( - {PublicBodyVTSE41Tsunami tsunami, - List earthquakes, - String? text, - Comment? comment}); + $Res call({ + PublicBodyVTSE41Tsunami tsunami, + List earthquakes, + String? text, + Comment? comment, + }); $PublicBodyVTSE41TsunamiCopyWith<$Res> get tsunami; $CommentCopyWith<$Res>? get comment; @@ -3341,24 +3641,31 @@ class _$PublicBodyVTSE41CopyWithImpl<$Res, $Val extends PublicBodyVTSE41> Object? text = freezed, Object? comment = freezed, }) { - return _then(_value.copyWith( - tsunami: null == tsunami - ? _value.tsunami - : tsunami // ignore: cast_nullable_to_non_nullable - as PublicBodyVTSE41Tsunami, - earthquakes: null == earthquakes - ? _value.earthquakes - : earthquakes // ignore: cast_nullable_to_non_nullable - as List, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - comment: freezed == comment - ? _value.comment - : comment // ignore: cast_nullable_to_non_nullable - as Comment?, - ) as $Val); + return _then( + _value.copyWith( + tsunami: + null == tsunami + ? _value.tsunami + : tsunami // ignore: cast_nullable_to_non_nullable + as PublicBodyVTSE41Tsunami, + earthquakes: + null == earthquakes + ? _value.earthquakes + : earthquakes // ignore: cast_nullable_to_non_nullable + as List, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + comment: + freezed == comment + ? _value.comment + : comment // ignore: cast_nullable_to_non_nullable + as Comment?, + ) + as $Val, + ); } /// Create a copy of PublicBodyVTSE41 @@ -3389,16 +3696,18 @@ class _$PublicBodyVTSE41CopyWithImpl<$Res, $Val extends PublicBodyVTSE41> /// @nodoc abstract class _$$PublicBodyVTSE41ImplCopyWith<$Res> implements $PublicBodyVTSE41CopyWith<$Res> { - factory _$$PublicBodyVTSE41ImplCopyWith(_$PublicBodyVTSE41Impl value, - $Res Function(_$PublicBodyVTSE41Impl) then) = - __$$PublicBodyVTSE41ImplCopyWithImpl<$Res>; + factory _$$PublicBodyVTSE41ImplCopyWith( + _$PublicBodyVTSE41Impl value, + $Res Function(_$PublicBodyVTSE41Impl) then, + ) = __$$PublicBodyVTSE41ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {PublicBodyVTSE41Tsunami tsunami, - List earthquakes, - String? text, - Comment? comment}); + $Res call({ + PublicBodyVTSE41Tsunami tsunami, + List earthquakes, + String? text, + Comment? comment, + }); @override $PublicBodyVTSE41TsunamiCopyWith<$Res> get tsunami; @@ -3410,9 +3719,10 @@ abstract class _$$PublicBodyVTSE41ImplCopyWith<$Res> class __$$PublicBodyVTSE41ImplCopyWithImpl<$Res> extends _$PublicBodyVTSE41CopyWithImpl<$Res, _$PublicBodyVTSE41Impl> implements _$$PublicBodyVTSE41ImplCopyWith<$Res> { - __$$PublicBodyVTSE41ImplCopyWithImpl(_$PublicBodyVTSE41Impl _value, - $Res Function(_$PublicBodyVTSE41Impl) _then) - : super(_value, _then); + __$$PublicBodyVTSE41ImplCopyWithImpl( + _$PublicBodyVTSE41Impl _value, + $Res Function(_$PublicBodyVTSE41Impl) _then, + ) : super(_value, _then); /// Create a copy of PublicBodyVTSE41 /// with the given fields replaced by the non-null parameter values. @@ -3424,36 +3734,42 @@ class __$$PublicBodyVTSE41ImplCopyWithImpl<$Res> Object? text = freezed, Object? comment = freezed, }) { - return _then(_$PublicBodyVTSE41Impl( - tsunami: null == tsunami - ? _value.tsunami - : tsunami // ignore: cast_nullable_to_non_nullable - as PublicBodyVTSE41Tsunami, - earthquakes: null == earthquakes - ? _value._earthquakes - : earthquakes // ignore: cast_nullable_to_non_nullable - as List, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - comment: freezed == comment - ? _value.comment - : comment // ignore: cast_nullable_to_non_nullable - as Comment?, - )); + return _then( + _$PublicBodyVTSE41Impl( + tsunami: + null == tsunami + ? _value.tsunami + : tsunami // ignore: cast_nullable_to_non_nullable + as PublicBodyVTSE41Tsunami, + earthquakes: + null == earthquakes + ? _value._earthquakes + : earthquakes // ignore: cast_nullable_to_non_nullable + as List, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + comment: + freezed == comment + ? _value.comment + : comment // ignore: cast_nullable_to_non_nullable + as Comment?, + ), + ); } } /// @nodoc @JsonSerializable() class _$PublicBodyVTSE41Impl implements _PublicBodyVTSE41 { - const _$PublicBodyVTSE41Impl( - {required this.tsunami, - required final List earthquakes, - required this.text, - required this.comment}) - : _earthquakes = earthquakes; + const _$PublicBodyVTSE41Impl({ + required this.tsunami, + required final List earthquakes, + required this.text, + required this.comment, + }) : _earthquakes = earthquakes; factory _$PublicBodyVTSE41Impl.fromJson(Map json) => _$$PublicBodyVTSE41ImplFromJson(json); @@ -3484,16 +3800,23 @@ class _$PublicBodyVTSE41Impl implements _PublicBodyVTSE41 { (other.runtimeType == runtimeType && other is _$PublicBodyVTSE41Impl && (identical(other.tsunami, tsunami) || other.tsunami == tsunami) && - const DeepCollectionEquality() - .equals(other._earthquakes, _earthquakes) && + const DeepCollectionEquality().equals( + other._earthquakes, + _earthquakes, + ) && (identical(other.text, text) || other.text == text) && (identical(other.comment, comment) || other.comment == comment)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, tsunami, - const DeepCollectionEquality().hash(_earthquakes), text, comment); + int get hashCode => Object.hash( + runtimeType, + tsunami, + const DeepCollectionEquality().hash(_earthquakes), + text, + comment, + ); /// Create a copy of PublicBodyVTSE41 /// with the given fields replaced by the non-null parameter values. @@ -3502,22 +3825,23 @@ class _$PublicBodyVTSE41Impl implements _PublicBodyVTSE41 { @pragma('vm:prefer-inline') _$$PublicBodyVTSE41ImplCopyWith<_$PublicBodyVTSE41Impl> get copyWith => __$$PublicBodyVTSE41ImplCopyWithImpl<_$PublicBodyVTSE41Impl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$PublicBodyVTSE41ImplToJson( - this, - ); + return _$$PublicBodyVTSE41ImplToJson(this); } } abstract class _PublicBodyVTSE41 implements PublicBodyVTSE41 { - const factory _PublicBodyVTSE41( - {required final PublicBodyVTSE41Tsunami tsunami, - required final List earthquakes, - required final String? text, - required final Comment? comment}) = _$PublicBodyVTSE41Impl; + const factory _PublicBodyVTSE41({ + required final PublicBodyVTSE41Tsunami tsunami, + required final List earthquakes, + required final String? text, + required final Comment? comment, + }) = _$PublicBodyVTSE41Impl; factory _PublicBodyVTSE41.fromJson(Map json) = _$PublicBodyVTSE41Impl.fromJson; @@ -3563,14 +3887,16 @@ mixin _$PublicBodyVTSE51 { /// @nodoc abstract class $PublicBodyVTSE51CopyWith<$Res> { factory $PublicBodyVTSE51CopyWith( - PublicBodyVTSE51 value, $Res Function(PublicBodyVTSE51) then) = - _$PublicBodyVTSE51CopyWithImpl<$Res, PublicBodyVTSE51>; + PublicBodyVTSE51 value, + $Res Function(PublicBodyVTSE51) then, + ) = _$PublicBodyVTSE51CopyWithImpl<$Res, PublicBodyVTSE51>; @useResult - $Res call( - {PublicBodyVTSE51Tsunami tsunami, - List earthquakes, - String? text, - Comment? comment}); + $Res call({ + PublicBodyVTSE51Tsunami tsunami, + List earthquakes, + String? text, + Comment? comment, + }); $PublicBodyVTSE51TsunamiCopyWith<$Res> get tsunami; $CommentCopyWith<$Res>? get comment; @@ -3596,24 +3922,31 @@ class _$PublicBodyVTSE51CopyWithImpl<$Res, $Val extends PublicBodyVTSE51> Object? text = freezed, Object? comment = freezed, }) { - return _then(_value.copyWith( - tsunami: null == tsunami - ? _value.tsunami - : tsunami // ignore: cast_nullable_to_non_nullable - as PublicBodyVTSE51Tsunami, - earthquakes: null == earthquakes - ? _value.earthquakes - : earthquakes // ignore: cast_nullable_to_non_nullable - as List, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - comment: freezed == comment - ? _value.comment - : comment // ignore: cast_nullable_to_non_nullable - as Comment?, - ) as $Val); + return _then( + _value.copyWith( + tsunami: + null == tsunami + ? _value.tsunami + : tsunami // ignore: cast_nullable_to_non_nullable + as PublicBodyVTSE51Tsunami, + earthquakes: + null == earthquakes + ? _value.earthquakes + : earthquakes // ignore: cast_nullable_to_non_nullable + as List, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + comment: + freezed == comment + ? _value.comment + : comment // ignore: cast_nullable_to_non_nullable + as Comment?, + ) + as $Val, + ); } /// Create a copy of PublicBodyVTSE51 @@ -3644,16 +3977,18 @@ class _$PublicBodyVTSE51CopyWithImpl<$Res, $Val extends PublicBodyVTSE51> /// @nodoc abstract class _$$PublicBodyVTSE51ImplCopyWith<$Res> implements $PublicBodyVTSE51CopyWith<$Res> { - factory _$$PublicBodyVTSE51ImplCopyWith(_$PublicBodyVTSE51Impl value, - $Res Function(_$PublicBodyVTSE51Impl) then) = - __$$PublicBodyVTSE51ImplCopyWithImpl<$Res>; + factory _$$PublicBodyVTSE51ImplCopyWith( + _$PublicBodyVTSE51Impl value, + $Res Function(_$PublicBodyVTSE51Impl) then, + ) = __$$PublicBodyVTSE51ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {PublicBodyVTSE51Tsunami tsunami, - List earthquakes, - String? text, - Comment? comment}); + $Res call({ + PublicBodyVTSE51Tsunami tsunami, + List earthquakes, + String? text, + Comment? comment, + }); @override $PublicBodyVTSE51TsunamiCopyWith<$Res> get tsunami; @@ -3665,9 +4000,10 @@ abstract class _$$PublicBodyVTSE51ImplCopyWith<$Res> class __$$PublicBodyVTSE51ImplCopyWithImpl<$Res> extends _$PublicBodyVTSE51CopyWithImpl<$Res, _$PublicBodyVTSE51Impl> implements _$$PublicBodyVTSE51ImplCopyWith<$Res> { - __$$PublicBodyVTSE51ImplCopyWithImpl(_$PublicBodyVTSE51Impl _value, - $Res Function(_$PublicBodyVTSE51Impl) _then) - : super(_value, _then); + __$$PublicBodyVTSE51ImplCopyWithImpl( + _$PublicBodyVTSE51Impl _value, + $Res Function(_$PublicBodyVTSE51Impl) _then, + ) : super(_value, _then); /// Create a copy of PublicBodyVTSE51 /// with the given fields replaced by the non-null parameter values. @@ -3679,36 +4015,42 @@ class __$$PublicBodyVTSE51ImplCopyWithImpl<$Res> Object? text = freezed, Object? comment = freezed, }) { - return _then(_$PublicBodyVTSE51Impl( - tsunami: null == tsunami - ? _value.tsunami - : tsunami // ignore: cast_nullable_to_non_nullable - as PublicBodyVTSE51Tsunami, - earthquakes: null == earthquakes - ? _value._earthquakes - : earthquakes // ignore: cast_nullable_to_non_nullable - as List, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - comment: freezed == comment - ? _value.comment - : comment // ignore: cast_nullable_to_non_nullable - as Comment?, - )); + return _then( + _$PublicBodyVTSE51Impl( + tsunami: + null == tsunami + ? _value.tsunami + : tsunami // ignore: cast_nullable_to_non_nullable + as PublicBodyVTSE51Tsunami, + earthquakes: + null == earthquakes + ? _value._earthquakes + : earthquakes // ignore: cast_nullable_to_non_nullable + as List, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + comment: + freezed == comment + ? _value.comment + : comment // ignore: cast_nullable_to_non_nullable + as Comment?, + ), + ); } } /// @nodoc @JsonSerializable() class _$PublicBodyVTSE51Impl implements _PublicBodyVTSE51 { - const _$PublicBodyVTSE51Impl( - {required this.tsunami, - required final List earthquakes, - required this.text, - required this.comment}) - : _earthquakes = earthquakes; + const _$PublicBodyVTSE51Impl({ + required this.tsunami, + required final List earthquakes, + required this.text, + required this.comment, + }) : _earthquakes = earthquakes; factory _$PublicBodyVTSE51Impl.fromJson(Map json) => _$$PublicBodyVTSE51ImplFromJson(json); @@ -3739,16 +4081,23 @@ class _$PublicBodyVTSE51Impl implements _PublicBodyVTSE51 { (other.runtimeType == runtimeType && other is _$PublicBodyVTSE51Impl && (identical(other.tsunami, tsunami) || other.tsunami == tsunami) && - const DeepCollectionEquality() - .equals(other._earthquakes, _earthquakes) && + const DeepCollectionEquality().equals( + other._earthquakes, + _earthquakes, + ) && (identical(other.text, text) || other.text == text) && (identical(other.comment, comment) || other.comment == comment)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, tsunami, - const DeepCollectionEquality().hash(_earthquakes), text, comment); + int get hashCode => Object.hash( + runtimeType, + tsunami, + const DeepCollectionEquality().hash(_earthquakes), + text, + comment, + ); /// Create a copy of PublicBodyVTSE51 /// with the given fields replaced by the non-null parameter values. @@ -3757,22 +4106,23 @@ class _$PublicBodyVTSE51Impl implements _PublicBodyVTSE51 { @pragma('vm:prefer-inline') _$$PublicBodyVTSE51ImplCopyWith<_$PublicBodyVTSE51Impl> get copyWith => __$$PublicBodyVTSE51ImplCopyWithImpl<_$PublicBodyVTSE51Impl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$PublicBodyVTSE51ImplToJson( - this, - ); + return _$$PublicBodyVTSE51ImplToJson(this); } } abstract class _PublicBodyVTSE51 implements PublicBodyVTSE51 { - const factory _PublicBodyVTSE51( - {required final PublicBodyVTSE51Tsunami tsunami, - required final List earthquakes, - required final String? text, - required final Comment? comment}) = _$PublicBodyVTSE51Impl; + const factory _PublicBodyVTSE51({ + required final PublicBodyVTSE51Tsunami tsunami, + required final List earthquakes, + required final String? text, + required final Comment? comment, + }) = _$PublicBodyVTSE51Impl; factory _PublicBodyVTSE51.fromJson(Map json) = _$PublicBodyVTSE51Impl.fromJson; @@ -3818,14 +4168,16 @@ mixin _$PublicBodyVTSE52 { /// @nodoc abstract class $PublicBodyVTSE52CopyWith<$Res> { factory $PublicBodyVTSE52CopyWith( - PublicBodyVTSE52 value, $Res Function(PublicBodyVTSE52) then) = - _$PublicBodyVTSE52CopyWithImpl<$Res, PublicBodyVTSE52>; + PublicBodyVTSE52 value, + $Res Function(PublicBodyVTSE52) then, + ) = _$PublicBodyVTSE52CopyWithImpl<$Res, PublicBodyVTSE52>; @useResult - $Res call( - {PublicBodyVTSE52Tsunami tsunami, - List earthquakes, - String? text, - Comment? comment}); + $Res call({ + PublicBodyVTSE52Tsunami tsunami, + List earthquakes, + String? text, + Comment? comment, + }); $PublicBodyVTSE52TsunamiCopyWith<$Res> get tsunami; $CommentCopyWith<$Res>? get comment; @@ -3851,24 +4203,31 @@ class _$PublicBodyVTSE52CopyWithImpl<$Res, $Val extends PublicBodyVTSE52> Object? text = freezed, Object? comment = freezed, }) { - return _then(_value.copyWith( - tsunami: null == tsunami - ? _value.tsunami - : tsunami // ignore: cast_nullable_to_non_nullable - as PublicBodyVTSE52Tsunami, - earthquakes: null == earthquakes - ? _value.earthquakes - : earthquakes // ignore: cast_nullable_to_non_nullable - as List, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - comment: freezed == comment - ? _value.comment - : comment // ignore: cast_nullable_to_non_nullable - as Comment?, - ) as $Val); + return _then( + _value.copyWith( + tsunami: + null == tsunami + ? _value.tsunami + : tsunami // ignore: cast_nullable_to_non_nullable + as PublicBodyVTSE52Tsunami, + earthquakes: + null == earthquakes + ? _value.earthquakes + : earthquakes // ignore: cast_nullable_to_non_nullable + as List, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + comment: + freezed == comment + ? _value.comment + : comment // ignore: cast_nullable_to_non_nullable + as Comment?, + ) + as $Val, + ); } /// Create a copy of PublicBodyVTSE52 @@ -3899,16 +4258,18 @@ class _$PublicBodyVTSE52CopyWithImpl<$Res, $Val extends PublicBodyVTSE52> /// @nodoc abstract class _$$PublicBodyVTSE52ImplCopyWith<$Res> implements $PublicBodyVTSE52CopyWith<$Res> { - factory _$$PublicBodyVTSE52ImplCopyWith(_$PublicBodyVTSE52Impl value, - $Res Function(_$PublicBodyVTSE52Impl) then) = - __$$PublicBodyVTSE52ImplCopyWithImpl<$Res>; + factory _$$PublicBodyVTSE52ImplCopyWith( + _$PublicBodyVTSE52Impl value, + $Res Function(_$PublicBodyVTSE52Impl) then, + ) = __$$PublicBodyVTSE52ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {PublicBodyVTSE52Tsunami tsunami, - List earthquakes, - String? text, - Comment? comment}); + $Res call({ + PublicBodyVTSE52Tsunami tsunami, + List earthquakes, + String? text, + Comment? comment, + }); @override $PublicBodyVTSE52TsunamiCopyWith<$Res> get tsunami; @@ -3920,9 +4281,10 @@ abstract class _$$PublicBodyVTSE52ImplCopyWith<$Res> class __$$PublicBodyVTSE52ImplCopyWithImpl<$Res> extends _$PublicBodyVTSE52CopyWithImpl<$Res, _$PublicBodyVTSE52Impl> implements _$$PublicBodyVTSE52ImplCopyWith<$Res> { - __$$PublicBodyVTSE52ImplCopyWithImpl(_$PublicBodyVTSE52Impl _value, - $Res Function(_$PublicBodyVTSE52Impl) _then) - : super(_value, _then); + __$$PublicBodyVTSE52ImplCopyWithImpl( + _$PublicBodyVTSE52Impl _value, + $Res Function(_$PublicBodyVTSE52Impl) _then, + ) : super(_value, _then); /// Create a copy of PublicBodyVTSE52 /// with the given fields replaced by the non-null parameter values. @@ -3934,36 +4296,42 @@ class __$$PublicBodyVTSE52ImplCopyWithImpl<$Res> Object? text = freezed, Object? comment = freezed, }) { - return _then(_$PublicBodyVTSE52Impl( - tsunami: null == tsunami - ? _value.tsunami - : tsunami // ignore: cast_nullable_to_non_nullable - as PublicBodyVTSE52Tsunami, - earthquakes: null == earthquakes - ? _value._earthquakes - : earthquakes // ignore: cast_nullable_to_non_nullable - as List, - text: freezed == text - ? _value.text - : text // ignore: cast_nullable_to_non_nullable - as String?, - comment: freezed == comment - ? _value.comment - : comment // ignore: cast_nullable_to_non_nullable - as Comment?, - )); + return _then( + _$PublicBodyVTSE52Impl( + tsunami: + null == tsunami + ? _value.tsunami + : tsunami // ignore: cast_nullable_to_non_nullable + as PublicBodyVTSE52Tsunami, + earthquakes: + null == earthquakes + ? _value._earthquakes + : earthquakes // ignore: cast_nullable_to_non_nullable + as List, + text: + freezed == text + ? _value.text + : text // ignore: cast_nullable_to_non_nullable + as String?, + comment: + freezed == comment + ? _value.comment + : comment // ignore: cast_nullable_to_non_nullable + as Comment?, + ), + ); } } /// @nodoc @JsonSerializable() class _$PublicBodyVTSE52Impl implements _PublicBodyVTSE52 { - const _$PublicBodyVTSE52Impl( - {required this.tsunami, - required final List earthquakes, - required this.text, - required this.comment}) - : _earthquakes = earthquakes; + const _$PublicBodyVTSE52Impl({ + required this.tsunami, + required final List earthquakes, + required this.text, + required this.comment, + }) : _earthquakes = earthquakes; factory _$PublicBodyVTSE52Impl.fromJson(Map json) => _$$PublicBodyVTSE52ImplFromJson(json); @@ -3994,16 +4362,23 @@ class _$PublicBodyVTSE52Impl implements _PublicBodyVTSE52 { (other.runtimeType == runtimeType && other is _$PublicBodyVTSE52Impl && (identical(other.tsunami, tsunami) || other.tsunami == tsunami) && - const DeepCollectionEquality() - .equals(other._earthquakes, _earthquakes) && + const DeepCollectionEquality().equals( + other._earthquakes, + _earthquakes, + ) && (identical(other.text, text) || other.text == text) && (identical(other.comment, comment) || other.comment == comment)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, tsunami, - const DeepCollectionEquality().hash(_earthquakes), text, comment); + int get hashCode => Object.hash( + runtimeType, + tsunami, + const DeepCollectionEquality().hash(_earthquakes), + text, + comment, + ); /// Create a copy of PublicBodyVTSE52 /// with the given fields replaced by the non-null parameter values. @@ -4012,22 +4387,23 @@ class _$PublicBodyVTSE52Impl implements _PublicBodyVTSE52 { @pragma('vm:prefer-inline') _$$PublicBodyVTSE52ImplCopyWith<_$PublicBodyVTSE52Impl> get copyWith => __$$PublicBodyVTSE52ImplCopyWithImpl<_$PublicBodyVTSE52Impl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$PublicBodyVTSE52ImplToJson( - this, - ); + return _$$PublicBodyVTSE52ImplToJson(this); } } abstract class _PublicBodyVTSE52 implements PublicBodyVTSE52 { - const factory _PublicBodyVTSE52( - {required final PublicBodyVTSE52Tsunami tsunami, - required final List earthquakes, - required final String? text, - required final Comment? comment}) = _$PublicBodyVTSE52Impl; + const factory _PublicBodyVTSE52({ + required final PublicBodyVTSE52Tsunami tsunami, + required final List earthquakes, + required final String? text, + required final Comment? comment, + }) = _$PublicBodyVTSE52Impl; factory _PublicBodyVTSE52.fromJson(Map json) = _$PublicBodyVTSE52Impl.fromJson; @@ -4073,14 +4449,16 @@ mixin _$Earthquake { /// @nodoc abstract class $EarthquakeCopyWith<$Res> { factory $EarthquakeCopyWith( - Earthquake value, $Res Function(Earthquake) then) = - _$EarthquakeCopyWithImpl<$Res, Earthquake>; + Earthquake value, + $Res Function(Earthquake) then, + ) = _$EarthquakeCopyWithImpl<$Res, Earthquake>; @useResult - $Res call( - {DateTime originTime, - DateTime arrivalTime, - EarthquakeHypocenter hypocenter, - EarthquakeMagnitude magnitude}); + $Res call({ + DateTime originTime, + DateTime arrivalTime, + EarthquakeHypocenter hypocenter, + EarthquakeMagnitude magnitude, + }); $EarthquakeHypocenterCopyWith<$Res> get hypocenter; $EarthquakeMagnitudeCopyWith<$Res> get magnitude; @@ -4106,24 +4484,31 @@ class _$EarthquakeCopyWithImpl<$Res, $Val extends Earthquake> Object? hypocenter = null, Object? magnitude = null, }) { - return _then(_value.copyWith( - originTime: null == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime, - arrivalTime: null == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime, - hypocenter: null == hypocenter - ? _value.hypocenter - : hypocenter // ignore: cast_nullable_to_non_nullable - as EarthquakeHypocenter, - magnitude: null == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as EarthquakeMagnitude, - ) as $Val); + return _then( + _value.copyWith( + originTime: + null == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime, + arrivalTime: + null == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime, + hypocenter: + null == hypocenter + ? _value.hypocenter + : hypocenter // ignore: cast_nullable_to_non_nullable + as EarthquakeHypocenter, + magnitude: + null == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as EarthquakeMagnitude, + ) + as $Val, + ); } /// Create a copy of Earthquake @@ -4151,15 +4536,17 @@ class _$EarthquakeCopyWithImpl<$Res, $Val extends Earthquake> abstract class _$$EarthquakeImplCopyWith<$Res> implements $EarthquakeCopyWith<$Res> { factory _$$EarthquakeImplCopyWith( - _$EarthquakeImpl value, $Res Function(_$EarthquakeImpl) then) = - __$$EarthquakeImplCopyWithImpl<$Res>; + _$EarthquakeImpl value, + $Res Function(_$EarthquakeImpl) then, + ) = __$$EarthquakeImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {DateTime originTime, - DateTime arrivalTime, - EarthquakeHypocenter hypocenter, - EarthquakeMagnitude magnitude}); + $Res call({ + DateTime originTime, + DateTime arrivalTime, + EarthquakeHypocenter hypocenter, + EarthquakeMagnitude magnitude, + }); @override $EarthquakeHypocenterCopyWith<$Res> get hypocenter; @@ -4172,8 +4559,9 @@ class __$$EarthquakeImplCopyWithImpl<$Res> extends _$EarthquakeCopyWithImpl<$Res, _$EarthquakeImpl> implements _$$EarthquakeImplCopyWith<$Res> { __$$EarthquakeImplCopyWithImpl( - _$EarthquakeImpl _value, $Res Function(_$EarthquakeImpl) _then) - : super(_value, _then); + _$EarthquakeImpl _value, + $Res Function(_$EarthquakeImpl) _then, + ) : super(_value, _then); /// Create a copy of Earthquake /// with the given fields replaced by the non-null parameter values. @@ -4185,35 +4573,42 @@ class __$$EarthquakeImplCopyWithImpl<$Res> Object? hypocenter = null, Object? magnitude = null, }) { - return _then(_$EarthquakeImpl( - originTime: null == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime, - arrivalTime: null == arrivalTime - ? _value.arrivalTime - : arrivalTime // ignore: cast_nullable_to_non_nullable - as DateTime, - hypocenter: null == hypocenter - ? _value.hypocenter - : hypocenter // ignore: cast_nullable_to_non_nullable - as EarthquakeHypocenter, - magnitude: null == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as EarthquakeMagnitude, - )); + return _then( + _$EarthquakeImpl( + originTime: + null == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime, + arrivalTime: + null == arrivalTime + ? _value.arrivalTime + : arrivalTime // ignore: cast_nullable_to_non_nullable + as DateTime, + hypocenter: + null == hypocenter + ? _value.hypocenter + : hypocenter // ignore: cast_nullable_to_non_nullable + as EarthquakeHypocenter, + magnitude: + null == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as EarthquakeMagnitude, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeImpl implements _Earthquake { - const _$EarthquakeImpl( - {required this.originTime, - required this.arrivalTime, - required this.hypocenter, - required this.magnitude}); + const _$EarthquakeImpl({ + required this.originTime, + required this.arrivalTime, + required this.hypocenter, + required this.magnitude, + }); factory _$EarthquakeImpl.fromJson(Map json) => _$$EarthquakeImplFromJson(json); @@ -4262,18 +4657,17 @@ class _$EarthquakeImpl implements _Earthquake { @override Map toJson() { - return _$$EarthquakeImplToJson( - this, - ); + return _$$EarthquakeImplToJson(this); } } abstract class _Earthquake implements Earthquake { - const factory _Earthquake( - {required final DateTime originTime, - required final DateTime arrivalTime, - required final EarthquakeHypocenter hypocenter, - required final EarthquakeMagnitude magnitude}) = _$EarthquakeImpl; + const factory _Earthquake({ + required final DateTime originTime, + required final DateTime arrivalTime, + required final EarthquakeHypocenter hypocenter, + required final EarthquakeMagnitude magnitude, + }) = _$EarthquakeImpl; factory _Earthquake.fromJson(Map json) = _$EarthquakeImpl.fromJson; @@ -4321,24 +4715,28 @@ mixin _$EarthquakeHypocenter { /// @nodoc abstract class $EarthquakeHypocenterCopyWith<$Res> { - factory $EarthquakeHypocenterCopyWith(EarthquakeHypocenter value, - $Res Function(EarthquakeHypocenter) then) = - _$EarthquakeHypocenterCopyWithImpl<$Res, EarthquakeHypocenter>; + factory $EarthquakeHypocenterCopyWith( + EarthquakeHypocenter value, + $Res Function(EarthquakeHypocenter) then, + ) = _$EarthquakeHypocenterCopyWithImpl<$Res, EarthquakeHypocenter>; @useResult - $Res call( - {String name, - String code, - int? depth, - EarthquakeHypocenterDetailed? detailed, - EarthquakeHypocenterCoordinate? coordinate}); + $Res call({ + String name, + String code, + int? depth, + EarthquakeHypocenterDetailed? detailed, + EarthquakeHypocenterCoordinate? coordinate, + }); $EarthquakeHypocenterDetailedCopyWith<$Res>? get detailed; $EarthquakeHypocenterCoordinateCopyWith<$Res>? get coordinate; } /// @nodoc -class _$EarthquakeHypocenterCopyWithImpl<$Res, - $Val extends EarthquakeHypocenter> +class _$EarthquakeHypocenterCopyWithImpl< + $Res, + $Val extends EarthquakeHypocenter +> implements $EarthquakeHypocenterCopyWith<$Res> { _$EarthquakeHypocenterCopyWithImpl(this._value, this._then); @@ -4358,28 +4756,36 @@ class _$EarthquakeHypocenterCopyWithImpl<$Res, Object? detailed = freezed, Object? coordinate = freezed, }) { - return _then(_value.copyWith( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - detailed: freezed == detailed - ? _value.detailed - : detailed // ignore: cast_nullable_to_non_nullable - as EarthquakeHypocenterDetailed?, - coordinate: freezed == coordinate - ? _value.coordinate - : coordinate // ignore: cast_nullable_to_non_nullable - as EarthquakeHypocenterCoordinate?, - ) as $Val); + return _then( + _value.copyWith( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + detailed: + freezed == detailed + ? _value.detailed + : detailed // ignore: cast_nullable_to_non_nullable + as EarthquakeHypocenterDetailed?, + coordinate: + freezed == coordinate + ? _value.coordinate + : coordinate // ignore: cast_nullable_to_non_nullable + as EarthquakeHypocenterCoordinate?, + ) + as $Val, + ); } /// Create a copy of EarthquakeHypocenter @@ -4391,8 +4797,9 @@ class _$EarthquakeHypocenterCopyWithImpl<$Res, return null; } - return $EarthquakeHypocenterDetailedCopyWith<$Res>(_value.detailed!, - (value) { + return $EarthquakeHypocenterDetailedCopyWith<$Res>(_value.detailed!, ( + value, + ) { return _then(_value.copyWith(detailed: value) as $Val); }); } @@ -4406,8 +4813,9 @@ class _$EarthquakeHypocenterCopyWithImpl<$Res, return null; } - return $EarthquakeHypocenterCoordinateCopyWith<$Res>(_value.coordinate!, - (value) { + return $EarthquakeHypocenterCoordinateCopyWith<$Res>(_value.coordinate!, ( + value, + ) { return _then(_value.copyWith(coordinate: value) as $Val); }); } @@ -4416,17 +4824,19 @@ class _$EarthquakeHypocenterCopyWithImpl<$Res, /// @nodoc abstract class _$$EarthquakeHypocenterImplCopyWith<$Res> implements $EarthquakeHypocenterCopyWith<$Res> { - factory _$$EarthquakeHypocenterImplCopyWith(_$EarthquakeHypocenterImpl value, - $Res Function(_$EarthquakeHypocenterImpl) then) = - __$$EarthquakeHypocenterImplCopyWithImpl<$Res>; + factory _$$EarthquakeHypocenterImplCopyWith( + _$EarthquakeHypocenterImpl value, + $Res Function(_$EarthquakeHypocenterImpl) then, + ) = __$$EarthquakeHypocenterImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String name, - String code, - int? depth, - EarthquakeHypocenterDetailed? detailed, - EarthquakeHypocenterCoordinate? coordinate}); + $Res call({ + String name, + String code, + int? depth, + EarthquakeHypocenterDetailed? detailed, + EarthquakeHypocenterCoordinate? coordinate, + }); @override $EarthquakeHypocenterDetailedCopyWith<$Res>? get detailed; @@ -4438,9 +4848,10 @@ abstract class _$$EarthquakeHypocenterImplCopyWith<$Res> class __$$EarthquakeHypocenterImplCopyWithImpl<$Res> extends _$EarthquakeHypocenterCopyWithImpl<$Res, _$EarthquakeHypocenterImpl> implements _$$EarthquakeHypocenterImplCopyWith<$Res> { - __$$EarthquakeHypocenterImplCopyWithImpl(_$EarthquakeHypocenterImpl _value, - $Res Function(_$EarthquakeHypocenterImpl) _then) - : super(_value, _then); + __$$EarthquakeHypocenterImplCopyWithImpl( + _$EarthquakeHypocenterImpl _value, + $Res Function(_$EarthquakeHypocenterImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHypocenter /// with the given fields replaced by the non-null parameter values. @@ -4453,40 +4864,48 @@ class __$$EarthquakeHypocenterImplCopyWithImpl<$Res> Object? detailed = freezed, Object? coordinate = freezed, }) { - return _then(_$EarthquakeHypocenterImpl( - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - detailed: freezed == detailed - ? _value.detailed - : detailed // ignore: cast_nullable_to_non_nullable - as EarthquakeHypocenterDetailed?, - coordinate: freezed == coordinate - ? _value.coordinate - : coordinate // ignore: cast_nullable_to_non_nullable - as EarthquakeHypocenterCoordinate?, - )); + return _then( + _$EarthquakeHypocenterImpl( + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + detailed: + freezed == detailed + ? _value.detailed + : detailed // ignore: cast_nullable_to_non_nullable + as EarthquakeHypocenterDetailed?, + coordinate: + freezed == coordinate + ? _value.coordinate + : coordinate // ignore: cast_nullable_to_non_nullable + as EarthquakeHypocenterCoordinate?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeHypocenterImpl implements _EarthquakeHypocenter { - const _$EarthquakeHypocenterImpl( - {required this.name, - required this.code, - required this.depth, - required this.detailed, - required this.coordinate}); + const _$EarthquakeHypocenterImpl({ + required this.name, + required this.code, + required this.depth, + required this.detailed, + required this.coordinate, + }); factory _$EarthquakeHypocenterImpl.fromJson(Map json) => _$$EarthquakeHypocenterImplFromJson(json); @@ -4532,26 +4951,26 @@ class _$EarthquakeHypocenterImpl implements _EarthquakeHypocenter { @override @pragma('vm:prefer-inline') _$$EarthquakeHypocenterImplCopyWith<_$EarthquakeHypocenterImpl> - get copyWith => - __$$EarthquakeHypocenterImplCopyWithImpl<_$EarthquakeHypocenterImpl>( - this, _$identity); + get copyWith => + __$$EarthquakeHypocenterImplCopyWithImpl<_$EarthquakeHypocenterImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeHypocenterImplToJson( - this, - ); + return _$$EarthquakeHypocenterImplToJson(this); } } abstract class _EarthquakeHypocenter implements EarthquakeHypocenter { - const factory _EarthquakeHypocenter( - {required final String name, - required final String code, - required final int? depth, - required final EarthquakeHypocenterDetailed? detailed, - required final EarthquakeHypocenterCoordinate? coordinate}) = - _$EarthquakeHypocenterImpl; + const factory _EarthquakeHypocenter({ + required final String name, + required final String code, + required final int? depth, + required final EarthquakeHypocenterDetailed? detailed, + required final EarthquakeHypocenterCoordinate? coordinate, + }) = _$EarthquakeHypocenterImpl; factory _EarthquakeHypocenter.fromJson(Map json) = _$EarthquakeHypocenterImpl.fromJson; @@ -4572,11 +4991,12 @@ abstract class _EarthquakeHypocenter implements EarthquakeHypocenter { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHypocenterImplCopyWith<_$EarthquakeHypocenterImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } EarthquakeHypocenterDetailed _$EarthquakeHypocenterDetailedFromJson( - Map json) { + Map json, +) { return _EarthquakeHypocenterDetailed.fromJson(json); } @@ -4592,23 +5012,28 @@ mixin _$EarthquakeHypocenterDetailed { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHypocenterDetailedCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHypocenterDetailedCopyWith<$Res> { factory $EarthquakeHypocenterDetailedCopyWith( - EarthquakeHypocenterDetailed value, - $Res Function(EarthquakeHypocenterDetailed) then) = - _$EarthquakeHypocenterDetailedCopyWithImpl<$Res, - EarthquakeHypocenterDetailed>; + EarthquakeHypocenterDetailed value, + $Res Function(EarthquakeHypocenterDetailed) then, + ) = + _$EarthquakeHypocenterDetailedCopyWithImpl< + $Res, + EarthquakeHypocenterDetailed + >; @useResult $Res call({String code, String name}); } /// @nodoc -class _$EarthquakeHypocenterDetailedCopyWithImpl<$Res, - $Val extends EarthquakeHypocenterDetailed> +class _$EarthquakeHypocenterDetailedCopyWithImpl< + $Res, + $Val extends EarthquakeHypocenterDetailed +> implements $EarthquakeHypocenterDetailedCopyWith<$Res> { _$EarthquakeHypocenterDetailedCopyWithImpl(this._value, this._then); @@ -4621,20 +5046,22 @@ class _$EarthquakeHypocenterDetailedCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? name = null, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? code = null, Object? name = null}) { + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -4642,9 +5069,9 @@ class _$EarthquakeHypocenterDetailedCopyWithImpl<$Res, abstract class _$$EarthquakeHypocenterDetailedImplCopyWith<$Res> implements $EarthquakeHypocenterDetailedCopyWith<$Res> { factory _$$EarthquakeHypocenterDetailedImplCopyWith( - _$EarthquakeHypocenterDetailedImpl value, - $Res Function(_$EarthquakeHypocenterDetailedImpl) then) = - __$$EarthquakeHypocenterDetailedImplCopyWithImpl<$Res>; + _$EarthquakeHypocenterDetailedImpl value, + $Res Function(_$EarthquakeHypocenterDetailedImpl) then, + ) = __$$EarthquakeHypocenterDetailedImplCopyWithImpl<$Res>; @override @useResult $Res call({String code, String name}); @@ -4652,32 +5079,36 @@ abstract class _$$EarthquakeHypocenterDetailedImplCopyWith<$Res> /// @nodoc class __$$EarthquakeHypocenterDetailedImplCopyWithImpl<$Res> - extends _$EarthquakeHypocenterDetailedCopyWithImpl<$Res, - _$EarthquakeHypocenterDetailedImpl> + extends + _$EarthquakeHypocenterDetailedCopyWithImpl< + $Res, + _$EarthquakeHypocenterDetailedImpl + > implements _$$EarthquakeHypocenterDetailedImplCopyWith<$Res> { __$$EarthquakeHypocenterDetailedImplCopyWithImpl( - _$EarthquakeHypocenterDetailedImpl _value, - $Res Function(_$EarthquakeHypocenterDetailedImpl) _then) - : super(_value, _then); + _$EarthquakeHypocenterDetailedImpl _value, + $Res Function(_$EarthquakeHypocenterDetailedImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHypocenterDetailed /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? name = null, - }) { - return _then(_$EarthquakeHypocenterDetailedImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? code = null, Object? name = null}) { + return _then( + _$EarthquakeHypocenterDetailedImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } @@ -4685,12 +5116,14 @@ class __$$EarthquakeHypocenterDetailedImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeHypocenterDetailedImpl implements _EarthquakeHypocenterDetailed { - const _$EarthquakeHypocenterDetailedImpl( - {required this.code, required this.name}); + const _$EarthquakeHypocenterDetailedImpl({ + required this.code, + required this.name, + }); factory _$EarthquakeHypocenterDetailedImpl.fromJson( - Map json) => - _$$EarthquakeHypocenterDetailedImplFromJson(json); + Map json, + ) => _$$EarthquakeHypocenterDetailedImplFromJson(json); @override final String code; @@ -4721,23 +5154,24 @@ class _$EarthquakeHypocenterDetailedImpl @override @pragma('vm:prefer-inline') _$$EarthquakeHypocenterDetailedImplCopyWith< - _$EarthquakeHypocenterDetailedImpl> - get copyWith => __$$EarthquakeHypocenterDetailedImplCopyWithImpl< - _$EarthquakeHypocenterDetailedImpl>(this, _$identity); + _$EarthquakeHypocenterDetailedImpl + > + get copyWith => __$$EarthquakeHypocenterDetailedImplCopyWithImpl< + _$EarthquakeHypocenterDetailedImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeHypocenterDetailedImplToJson( - this, - ); + return _$$EarthquakeHypocenterDetailedImplToJson(this); } } abstract class _EarthquakeHypocenterDetailed implements EarthquakeHypocenterDetailed { - const factory _EarthquakeHypocenterDetailed( - {required final String code, - required final String name}) = _$EarthquakeHypocenterDetailedImpl; + const factory _EarthquakeHypocenterDetailed({ + required final String code, + required final String name, + }) = _$EarthquakeHypocenterDetailedImpl; factory _EarthquakeHypocenterDetailed.fromJson(Map json) = _$EarthquakeHypocenterDetailedImpl.fromJson; @@ -4752,12 +5186,14 @@ abstract class _EarthquakeHypocenterDetailed @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHypocenterDetailedImplCopyWith< - _$EarthquakeHypocenterDetailedImpl> - get copyWith => throw _privateConstructorUsedError; + _$EarthquakeHypocenterDetailedImpl + > + get copyWith => throw _privateConstructorUsedError; } EarthquakeHypocenterCoordinate _$EarthquakeHypocenterCoordinateFromJson( - Map json) { + Map json, +) { return _EarthquakeHypocenterCoordinate.fromJson(json); } @@ -4773,23 +5209,28 @@ mixin _$EarthquakeHypocenterCoordinate { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $EarthquakeHypocenterCoordinateCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $EarthquakeHypocenterCoordinateCopyWith<$Res> { factory $EarthquakeHypocenterCoordinateCopyWith( - EarthquakeHypocenterCoordinate value, - $Res Function(EarthquakeHypocenterCoordinate) then) = - _$EarthquakeHypocenterCoordinateCopyWithImpl<$Res, - EarthquakeHypocenterCoordinate>; + EarthquakeHypocenterCoordinate value, + $Res Function(EarthquakeHypocenterCoordinate) then, + ) = + _$EarthquakeHypocenterCoordinateCopyWithImpl< + $Res, + EarthquakeHypocenterCoordinate + >; @useResult $Res call({double lat, double lon}); } /// @nodoc -class _$EarthquakeHypocenterCoordinateCopyWithImpl<$Res, - $Val extends EarthquakeHypocenterCoordinate> +class _$EarthquakeHypocenterCoordinateCopyWithImpl< + $Res, + $Val extends EarthquakeHypocenterCoordinate +> implements $EarthquakeHypocenterCoordinateCopyWith<$Res> { _$EarthquakeHypocenterCoordinateCopyWithImpl(this._value, this._then); @@ -4802,20 +5243,22 @@ class _$EarthquakeHypocenterCoordinateCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? lat = null, - Object? lon = null, - }) { - return _then(_value.copyWith( - lat: null == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double, - lon: null == lon - ? _value.lon - : lon // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + $Res call({Object? lat = null, Object? lon = null}) { + return _then( + _value.copyWith( + lat: + null == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double, + lon: + null == lon + ? _value.lon + : lon // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } } @@ -4823,9 +5266,9 @@ class _$EarthquakeHypocenterCoordinateCopyWithImpl<$Res, abstract class _$$EarthquakeHypocenterCoordinateImplCopyWith<$Res> implements $EarthquakeHypocenterCoordinateCopyWith<$Res> { factory _$$EarthquakeHypocenterCoordinateImplCopyWith( - _$EarthquakeHypocenterCoordinateImpl value, - $Res Function(_$EarthquakeHypocenterCoordinateImpl) then) = - __$$EarthquakeHypocenterCoordinateImplCopyWithImpl<$Res>; + _$EarthquakeHypocenterCoordinateImpl value, + $Res Function(_$EarthquakeHypocenterCoordinateImpl) then, + ) = __$$EarthquakeHypocenterCoordinateImplCopyWithImpl<$Res>; @override @useResult $Res call({double lat, double lon}); @@ -4833,32 +5276,36 @@ abstract class _$$EarthquakeHypocenterCoordinateImplCopyWith<$Res> /// @nodoc class __$$EarthquakeHypocenterCoordinateImplCopyWithImpl<$Res> - extends _$EarthquakeHypocenterCoordinateCopyWithImpl<$Res, - _$EarthquakeHypocenterCoordinateImpl> + extends + _$EarthquakeHypocenterCoordinateCopyWithImpl< + $Res, + _$EarthquakeHypocenterCoordinateImpl + > implements _$$EarthquakeHypocenterCoordinateImplCopyWith<$Res> { __$$EarthquakeHypocenterCoordinateImplCopyWithImpl( - _$EarthquakeHypocenterCoordinateImpl _value, - $Res Function(_$EarthquakeHypocenterCoordinateImpl) _then) - : super(_value, _then); + _$EarthquakeHypocenterCoordinateImpl _value, + $Res Function(_$EarthquakeHypocenterCoordinateImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeHypocenterCoordinate /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? lat = null, - Object? lon = null, - }) { - return _then(_$EarthquakeHypocenterCoordinateImpl( - lat: null == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double, - lon: null == lon - ? _value.lon - : lon // ignore: cast_nullable_to_non_nullable - as double, - )); + $Res call({Object? lat = null, Object? lon = null}) { + return _then( + _$EarthquakeHypocenterCoordinateImpl( + lat: + null == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double, + lon: + null == lon + ? _value.lon + : lon // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } @@ -4866,12 +5313,14 @@ class __$$EarthquakeHypocenterCoordinateImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeHypocenterCoordinateImpl implements _EarthquakeHypocenterCoordinate { - const _$EarthquakeHypocenterCoordinateImpl( - {required this.lat, required this.lon}); + const _$EarthquakeHypocenterCoordinateImpl({ + required this.lat, + required this.lon, + }); factory _$EarthquakeHypocenterCoordinateImpl.fromJson( - Map json) => - _$$EarthquakeHypocenterCoordinateImplFromJson(json); + Map json, + ) => _$$EarthquakeHypocenterCoordinateImplFromJson(json); @override final double lat; @@ -4902,23 +5351,24 @@ class _$EarthquakeHypocenterCoordinateImpl @override @pragma('vm:prefer-inline') _$$EarthquakeHypocenterCoordinateImplCopyWith< - _$EarthquakeHypocenterCoordinateImpl> - get copyWith => __$$EarthquakeHypocenterCoordinateImplCopyWithImpl< - _$EarthquakeHypocenterCoordinateImpl>(this, _$identity); + _$EarthquakeHypocenterCoordinateImpl + > + get copyWith => __$$EarthquakeHypocenterCoordinateImplCopyWithImpl< + _$EarthquakeHypocenterCoordinateImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeHypocenterCoordinateImplToJson( - this, - ); + return _$$EarthquakeHypocenterCoordinateImplToJson(this); } } abstract class _EarthquakeHypocenterCoordinate implements EarthquakeHypocenterCoordinate { - const factory _EarthquakeHypocenterCoordinate( - {required final double lat, - required final double lon}) = _$EarthquakeHypocenterCoordinateImpl; + const factory _EarthquakeHypocenterCoordinate({ + required final double lat, + required final double lon, + }) = _$EarthquakeHypocenterCoordinateImpl; factory _EarthquakeHypocenterCoordinate.fromJson(Map json) = _$EarthquakeHypocenterCoordinateImpl.fromJson; @@ -4933,8 +5383,9 @@ abstract class _EarthquakeHypocenterCoordinate @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeHypocenterCoordinateImplCopyWith< - _$EarthquakeHypocenterCoordinateImpl> - get copyWith => throw _privateConstructorUsedError; + _$EarthquakeHypocenterCoordinateImpl + > + get copyWith => throw _privateConstructorUsedError; } EarthquakeMagnitude _$EarthquakeMagnitudeFromJson(Map json) { @@ -4960,8 +5411,9 @@ mixin _$EarthquakeMagnitude { /// @nodoc abstract class $EarthquakeMagnitudeCopyWith<$Res> { factory $EarthquakeMagnitudeCopyWith( - EarthquakeMagnitude value, $Res Function(EarthquakeMagnitude) then) = - _$EarthquakeMagnitudeCopyWithImpl<$Res, EarthquakeMagnitude>; + EarthquakeMagnitude value, + $Res Function(EarthquakeMagnitude) then, + ) = _$EarthquakeMagnitudeCopyWithImpl<$Res, EarthquakeMagnitude>; @useResult $Res call({double? value, EarthquakeMagnitudeCondition? condition}); } @@ -4980,29 +5432,32 @@ class _$EarthquakeMagnitudeCopyWithImpl<$Res, $Val extends EarthquakeMagnitude> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? value = freezed, - Object? condition = freezed, - }) { - return _then(_value.copyWith( - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as double?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as EarthquakeMagnitudeCondition?, - ) as $Val); + $Res call({Object? value = freezed, Object? condition = freezed}) { + return _then( + _value.copyWith( + value: + freezed == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as double?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as EarthquakeMagnitudeCondition?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeMagnitudeImplCopyWith<$Res> implements $EarthquakeMagnitudeCopyWith<$Res> { - factory _$$EarthquakeMagnitudeImplCopyWith(_$EarthquakeMagnitudeImpl value, - $Res Function(_$EarthquakeMagnitudeImpl) then) = - __$$EarthquakeMagnitudeImplCopyWithImpl<$Res>; + factory _$$EarthquakeMagnitudeImplCopyWith( + _$EarthquakeMagnitudeImpl value, + $Res Function(_$EarthquakeMagnitudeImpl) then, + ) = __$$EarthquakeMagnitudeImplCopyWithImpl<$Res>; @override @useResult $Res call({double? value, EarthquakeMagnitudeCondition? condition}); @@ -5012,36 +5467,40 @@ abstract class _$$EarthquakeMagnitudeImplCopyWith<$Res> class __$$EarthquakeMagnitudeImplCopyWithImpl<$Res> extends _$EarthquakeMagnitudeCopyWithImpl<$Res, _$EarthquakeMagnitudeImpl> implements _$$EarthquakeMagnitudeImplCopyWith<$Res> { - __$$EarthquakeMagnitudeImplCopyWithImpl(_$EarthquakeMagnitudeImpl _value, - $Res Function(_$EarthquakeMagnitudeImpl) _then) - : super(_value, _then); + __$$EarthquakeMagnitudeImplCopyWithImpl( + _$EarthquakeMagnitudeImpl _value, + $Res Function(_$EarthquakeMagnitudeImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeMagnitude /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? value = freezed, - Object? condition = freezed, - }) { - return _then(_$EarthquakeMagnitudeImpl( - value: freezed == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as double?, - condition: freezed == condition - ? _value.condition - : condition // ignore: cast_nullable_to_non_nullable - as EarthquakeMagnitudeCondition?, - )); + $Res call({Object? value = freezed, Object? condition = freezed}) { + return _then( + _$EarthquakeMagnitudeImpl( + value: + freezed == value + ? _value.value + : value // ignore: cast_nullable_to_non_nullable + as double?, + condition: + freezed == condition + ? _value.condition + : condition // ignore: cast_nullable_to_non_nullable + as EarthquakeMagnitudeCondition?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeMagnitudeImpl implements _EarthquakeMagnitude { - const _$EarthquakeMagnitudeImpl( - {required this.value, required this.condition}); + const _$EarthquakeMagnitudeImpl({ + required this.value, + required this.condition, + }); factory _$EarthquakeMagnitudeImpl.fromJson(Map json) => _$$EarthquakeMagnitudeImplFromJson(json); @@ -5077,21 +5536,21 @@ class _$EarthquakeMagnitudeImpl implements _EarthquakeMagnitude { @pragma('vm:prefer-inline') _$$EarthquakeMagnitudeImplCopyWith<_$EarthquakeMagnitudeImpl> get copyWith => __$$EarthquakeMagnitudeImplCopyWithImpl<_$EarthquakeMagnitudeImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeMagnitudeImplToJson( - this, - ); + return _$$EarthquakeMagnitudeImplToJson(this); } } abstract class _EarthquakeMagnitude implements EarthquakeMagnitude { - const factory _EarthquakeMagnitude( - {required final double? value, - required final EarthquakeMagnitudeCondition? condition}) = - _$EarthquakeMagnitudeImpl; + const factory _EarthquakeMagnitude({ + required final double? value, + required final EarthquakeMagnitudeCondition? condition, + }) = _$EarthquakeMagnitudeImpl; factory _EarthquakeMagnitude.fromJson(Map json) = _$EarthquakeMagnitudeImpl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v1/tsunami.g.dart b/packages/eqapi_types/lib/src/model/v1/tsunami.g.dart index deb019b3..3bc6ab31 100644 --- a/packages/eqapi_types/lib/src/model/v1/tsunami.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/tsunami.g.dart @@ -18,15 +18,21 @@ _$_TsunamiV1BaseImpl _$$_TsunamiV1BaseImplFromJson(Map json) => headline: $checkedConvert('headline', (v) => v as String?), id: $checkedConvert('id', (v) => (v as num).toInt()), infoType: $checkedConvert('info_type', (v) => v as String), - pressAt: - $checkedConvert('press_at', (v) => DateTime.parse(v as String)), - reportAt: - $checkedConvert('report_at', (v) => DateTime.parse(v as String)), + pressAt: $checkedConvert( + 'press_at', + (v) => DateTime.parse(v as String), + ), + reportAt: $checkedConvert( + 'report_at', + (v) => DateTime.parse(v as String), + ), serialNo: $checkedConvert('serial_no', (v) => (v as num?)?.toInt()), status: $checkedConvert('status', (v) => v as String), type: $checkedConvert('type', (v) => v as String), - validAt: $checkedConvert('valid_at', - (v) => v == null ? null : DateTime.parse(v as String)), + validAt: $checkedConvert( + 'valid_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), ); return val; }, @@ -36,243 +42,224 @@ _$_TsunamiV1BaseImpl _$$_TsunamiV1BaseImplFromJson(Map json) => 'pressAt': 'press_at', 'reportAt': 'report_at', 'serialNo': 'serial_no', - 'validAt': 'valid_at' + 'validAt': 'valid_at', }, ); Map _$$_TsunamiV1BaseImplToJson( - _$_TsunamiV1BaseImpl instance) => - { - 'event_id': instance.eventId, - 'headline': instance.headline, - 'id': instance.id, - 'info_type': instance.infoType, - 'press_at': instance.pressAt.toIso8601String(), - 'report_at': instance.reportAt.toIso8601String(), - 'serial_no': instance.serialNo, - 'status': instance.status, - 'type': instance.type, - 'valid_at': instance.validAt?.toIso8601String(), - }; + _$_TsunamiV1BaseImpl instance, +) => { + 'event_id': instance.eventId, + 'headline': instance.headline, + 'id': instance.id, + 'info_type': instance.infoType, + 'press_at': instance.pressAt.toIso8601String(), + 'report_at': instance.reportAt.toIso8601String(), + 'serial_no': instance.serialNo, + 'status': instance.status, + 'type': instance.type, + 'valid_at': instance.validAt?.toIso8601String(), +}; _$CommentImpl _$$CommentImplFromJson(Map json) => - $checkedCreate( - r'_$CommentImpl', - json, - ($checkedConvert) { - final val = _$CommentImpl( - free: $checkedConvert('free', (v) => v as String?), - warning: $checkedConvert( - 'warning', - (v) => v == null + $checkedCreate(r'_$CommentImpl', json, ($checkedConvert) { + final val = _$CommentImpl( + free: $checkedConvert('free', (v) => v as String?), + warning: $checkedConvert( + 'warning', + (v) => + v == null ? null - : CommentWarning.fromJson(v as Map)), - ); - return val; - }, - ); + : CommentWarning.fromJson(v as Map), + ), + ); + return val; + }); Map _$$CommentImplToJson(_$CommentImpl instance) => - { - 'free': instance.free, - 'warning': instance.warning, - }; + {'free': instance.free, 'warning': instance.warning}; _$CommentWarningImpl _$$CommentWarningImplFromJson(Map json) => - $checkedCreate( - r'_$CommentWarningImpl', - json, - ($checkedConvert) { - final val = _$CommentWarningImpl( - text: $checkedConvert('text', (v) => v as String), - codes: $checkedConvert('codes', - (v) => (v as List).map((e) => e as String).toList()), - ); - return val; - }, - ); + $checkedCreate(r'_$CommentWarningImpl', json, ($checkedConvert) { + final val = _$CommentWarningImpl( + text: $checkedConvert('text', (v) => v as String), + codes: $checkedConvert( + 'codes', + (v) => (v as List).map((e) => e as String).toList(), + ), + ); + return val; + }); Map _$$CommentWarningImplToJson( - _$CommentWarningImpl instance) => - { - 'text': instance.text, - 'codes': instance.codes, - }; + _$CommentWarningImpl instance, +) => {'text': instance.text, 'codes': instance.codes}; _$CancelBodyImpl _$$CancelBodyImplFromJson(Map json) => - $checkedCreate( - r'_$CancelBodyImpl', - json, - ($checkedConvert) { - final val = _$CancelBodyImpl( - text: $checkedConvert('text', (v) => v as String), - ); - return val; - }, - ); + $checkedCreate(r'_$CancelBodyImpl', json, ($checkedConvert) { + final val = _$CancelBodyImpl( + text: $checkedConvert('text', (v) => v as String), + ); + return val; + }); Map _$$CancelBodyImplToJson(_$CancelBodyImpl instance) => - { - 'text': instance.text, - }; + {'text': instance.text}; _$PublicBodyVTSE41TsunamiImpl _$$PublicBodyVTSE41TsunamiImplFromJson( - Map json) => - $checkedCreate( - r'_$PublicBodyVTSE41TsunamiImpl', - json, - ($checkedConvert) { - final val = _$PublicBodyVTSE41TsunamiImpl( - forecasts: $checkedConvert( - 'forecasts', - (v) => (v as List) - .map((e) => - TsunamiForecast.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$PublicBodyVTSE41TsunamiImpl', json, ($checkedConvert) { + final val = _$PublicBodyVTSE41TsunamiImpl( + forecasts: $checkedConvert( + 'forecasts', + (v) => + (v as List) + .map((e) => TsunamiForecast.fromJson(e as Map)) + .toList(), + ), + ); + return val; +}); Map _$$PublicBodyVTSE41TsunamiImplToJson( - _$PublicBodyVTSE41TsunamiImpl instance) => - { - 'forecasts': instance.forecasts, - }; + _$PublicBodyVTSE41TsunamiImpl instance, +) => {'forecasts': instance.forecasts}; _$PublicBodyVTSE51TsunamiImpl _$$PublicBodyVTSE51TsunamiImplFromJson( - Map json) => - $checkedCreate( - r'_$PublicBodyVTSE51TsunamiImpl', - json, - ($checkedConvert) { - final val = _$PublicBodyVTSE51TsunamiImpl( - forecasts: $checkedConvert( - 'forecasts', - (v) => (v as List) - .map((e) => - TsunamiForecast.fromJson(e as Map)) - .toList()), - observations: $checkedConvert( - 'observations', - (v) => (v as List?) - ?.map((e) => - TsunamiObservation.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$PublicBodyVTSE51TsunamiImpl', json, ($checkedConvert) { + final val = _$PublicBodyVTSE51TsunamiImpl( + forecasts: $checkedConvert( + 'forecasts', + (v) => + (v as List) + .map((e) => TsunamiForecast.fromJson(e as Map)) + .toList(), + ), + observations: $checkedConvert( + 'observations', + (v) => + (v as List?) + ?.map( + (e) => TsunamiObservation.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; +}); Map _$$PublicBodyVTSE51TsunamiImplToJson( - _$PublicBodyVTSE51TsunamiImpl instance) => - { - 'forecasts': instance.forecasts, - 'observations': instance.observations, - }; + _$PublicBodyVTSE51TsunamiImpl instance, +) => { + 'forecasts': instance.forecasts, + 'observations': instance.observations, +}; _$PublicBodyVTSE52TsunamiImpl _$$PublicBodyVTSE52TsunamiImplFromJson( - Map json) => - $checkedCreate( - r'_$PublicBodyVTSE52TsunamiImpl', - json, - ($checkedConvert) { - final val = _$PublicBodyVTSE52TsunamiImpl( - observations: $checkedConvert( - 'observations', - (v) => (v as List?) - ?.map((e) => - TsunamiObservation.fromJson(e as Map)) - .toList()), - estimations: $checkedConvert( - 'estimations', - (v) => (v as List) - .map((e) => - TsunamiEstimation.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$PublicBodyVTSE52TsunamiImpl', json, ($checkedConvert) { + final val = _$PublicBodyVTSE52TsunamiImpl( + observations: $checkedConvert( + 'observations', + (v) => + (v as List?) + ?.map( + (e) => TsunamiObservation.fromJson(e as Map), + ) + .toList(), + ), + estimations: $checkedConvert( + 'estimations', + (v) => + (v as List) + .map((e) => TsunamiEstimation.fromJson(e as Map)) + .toList(), + ), + ); + return val; +}); Map _$$PublicBodyVTSE52TsunamiImplToJson( - _$PublicBodyVTSE52TsunamiImpl instance) => - { - 'observations': instance.observations, - 'estimations': instance.estimations, - }; + _$PublicBodyVTSE52TsunamiImpl instance, +) => { + 'observations': instance.observations, + 'estimations': instance.estimations, +}; _$TsunamiForecastImpl _$$TsunamiForecastImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiForecastImpl', - json, - ($checkedConvert) { - final val = _$TsunamiForecastImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - kind: $checkedConvert('kind', (v) => v as String), - lastKind: $checkedConvert('lastKind', (v) => v as String), - firstHeight: $checkedConvert( - 'firstHeight', - (v) => v == null - ? null - : TsunamiForecastFirstHeight.fromJson( - v as Map)), - maxHeight: $checkedConvert( - 'maxHeight', - (v) => v == null - ? null - : TsunamiForecastMaxHeight.fromJson( - v as Map)), - stations: $checkedConvert( - 'stations', - (v) => (v as List?) - ?.map((e) => TsunamiForecastStation.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiForecastImpl', json, ($checkedConvert) { + final val = _$TsunamiForecastImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + kind: $checkedConvert('kind', (v) => v as String), + lastKind: $checkedConvert('lastKind', (v) => v as String), + firstHeight: $checkedConvert( + 'firstHeight', + (v) => + v == null + ? null + : TsunamiForecastFirstHeight.fromJson(v as Map), + ), + maxHeight: $checkedConvert( + 'maxHeight', + (v) => + v == null + ? null + : TsunamiForecastMaxHeight.fromJson(v as Map), + ), + stations: $checkedConvert( + 'stations', + (v) => + (v as List?) + ?.map( + (e) => + TsunamiForecastStation.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; +}); Map _$$TsunamiForecastImplToJson( - _$TsunamiForecastImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'kind': instance.kind, - 'lastKind': instance.lastKind, - 'firstHeight': instance.firstHeight, - 'maxHeight': instance.maxHeight, - 'stations': instance.stations, - }; + _$TsunamiForecastImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'kind': instance.kind, + 'lastKind': instance.lastKind, + 'firstHeight': instance.firstHeight, + 'maxHeight': instance.maxHeight, + 'stations': instance.stations, +}; _$TsunamiForecastFirstHeightImpl _$$TsunamiForecastFirstHeightImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiForecastFirstHeightImpl', - json, - ($checkedConvert) { - final val = _$TsunamiForecastFirstHeightImpl( - arrivalTime: $checkedConvert('arrivalTime', - (v) => v == null ? null : DateTime.parse(v as String)), - condition: $checkedConvert( - 'condition', - (v) => $enumDecodeNullable( - _$TsunamiForecastFirstHeightConditionEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiForecastFirstHeightImpl', json, ( + $checkedConvert, +) { + final val = _$TsunamiForecastFirstHeightImpl( + arrivalTime: $checkedConvert( + 'arrivalTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + condition: $checkedConvert( + 'condition', + (v) => + $enumDecodeNullable(_$TsunamiForecastFirstHeightConditionEnumMap, v), + ), + ); + return val; +}); Map _$$TsunamiForecastFirstHeightImplToJson( - _$TsunamiForecastFirstHeightImpl instance) => - { - 'arrivalTime': instance.arrivalTime?.toIso8601String(), - 'condition': - _$TsunamiForecastFirstHeightConditionEnumMap[instance.condition], - }; + _$TsunamiForecastFirstHeightImpl instance, +) => { + 'arrivalTime': instance.arrivalTime?.toIso8601String(), + 'condition': _$TsunamiForecastFirstHeightConditionEnumMap[instance.condition], +}; const _$TsunamiForecastFirstHeightConditionEnumMap = { TsunamiForecastFirstHeightCondition.arrival: '津波到達中と推測', @@ -281,30 +268,26 @@ const _$TsunamiForecastFirstHeightConditionEnumMap = { }; _$TsunamiForecastMaxHeightImpl _$$TsunamiForecastMaxHeightImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiForecastMaxHeightImpl', - json, - ($checkedConvert) { - final val = _$TsunamiForecastMaxHeightImpl( - value: $checkedConvert('value', (v) => (v as num?)?.toDouble()), - isOver: $checkedConvert('isOver', (v) => v as bool?), - condition: $checkedConvert( - 'condition', - (v) => - $enumDecodeNullable(_$TsunamiMaxHeightConditionEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiForecastMaxHeightImpl', json, ($checkedConvert) { + final val = _$TsunamiForecastMaxHeightImpl( + value: $checkedConvert('value', (v) => (v as num?)?.toDouble()), + isOver: $checkedConvert('isOver', (v) => v as bool?), + condition: $checkedConvert( + 'condition', + (v) => $enumDecodeNullable(_$TsunamiMaxHeightConditionEnumMap, v), + ), + ); + return val; +}); Map _$$TsunamiForecastMaxHeightImplToJson( - _$TsunamiForecastMaxHeightImpl instance) => - { - 'value': instance.value, - 'isOver': instance.isOver, - 'condition': _$TsunamiMaxHeightConditionEnumMap[instance.condition], - }; + _$TsunamiForecastMaxHeightImpl instance, +) => { + 'value': instance.value, + 'isOver': instance.isOver, + 'condition': _$TsunamiMaxHeightConditionEnumMap[instance.condition], +}; const _$TsunamiMaxHeightConditionEnumMap = { TsunamiMaxHeightCondition.high: '高い', @@ -312,114 +295,120 @@ const _$TsunamiMaxHeightConditionEnumMap = { }; _$TsunamiForecastStationImpl _$$TsunamiForecastStationImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiForecastStationImpl', - json, - ($checkedConvert) { - final val = _$TsunamiForecastStationImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - highTideTime: $checkedConvert( - 'highTideTime', (v) => DateTime.parse(v as String)), - firstHeightTime: $checkedConvert('firstHeightTime', - (v) => v == null ? null : DateTime.parse(v as String)), - condition: $checkedConvert( - 'condition', - (v) => $enumDecodeNullable( - _$TsunamiForecastFirstHeightConditionEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiForecastStationImpl', json, ($checkedConvert) { + final val = _$TsunamiForecastStationImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + highTideTime: $checkedConvert( + 'highTideTime', + (v) => DateTime.parse(v as String), + ), + firstHeightTime: $checkedConvert( + 'firstHeightTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + condition: $checkedConvert( + 'condition', + (v) => + $enumDecodeNullable(_$TsunamiForecastFirstHeightConditionEnumMap, v), + ), + ); + return val; +}); Map _$$TsunamiForecastStationImplToJson( - _$TsunamiForecastStationImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'highTideTime': instance.highTideTime.toIso8601String(), - 'firstHeightTime': instance.firstHeightTime?.toIso8601String(), - 'condition': - _$TsunamiForecastFirstHeightConditionEnumMap[instance.condition], - }; + _$TsunamiForecastStationImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'highTideTime': instance.highTideTime.toIso8601String(), + 'firstHeightTime': instance.firstHeightTime?.toIso8601String(), + 'condition': _$TsunamiForecastFirstHeightConditionEnumMap[instance.condition], +}; _$TsunamiObservationImpl _$$TsunamiObservationImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiObservationImpl', - json, - ($checkedConvert) { - final val = _$TsunamiObservationImpl( - code: $checkedConvert('code', (v) => v as String?), - name: $checkedConvert('name', (v) => v as String?), - stations: $checkedConvert( - 'stations', - (v) => (v as List) - .map((e) => TsunamiObservationStation.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiObservationImpl', json, ($checkedConvert) { + final val = _$TsunamiObservationImpl( + code: $checkedConvert('code', (v) => v as String?), + name: $checkedConvert('name', (v) => v as String?), + stations: $checkedConvert( + 'stations', + (v) => + (v as List) + .map( + (e) => TsunamiObservationStation.fromJson( + e as Map, + ), + ) + .toList(), + ), + ); + return val; +}); Map _$$TsunamiObservationImplToJson( - _$TsunamiObservationImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'stations': instance.stations, - }; + _$TsunamiObservationImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'stations': instance.stations, +}; _$TsunamiObservationStationImpl _$$TsunamiObservationStationImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiObservationStationImpl', - json, - ($checkedConvert) { - final val = _$TsunamiObservationStationImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - firstHeightArrivalTime: $checkedConvert('firstHeightArrivalTime', - (v) => v == null ? null : DateTime.parse(v as String)), - firstHeightInitial: $checkedConvert( - 'firstHeightInitial', - (v) => $enumDecodeNullable( - _$TsunamiObservationStationFirstHeightIntialEnumMap, v)), - maxHeightTime: $checkedConvert('maxHeightTime', - (v) => v == null ? null : DateTime.parse(v as String)), - maxHeightValue: - $checkedConvert('maxHeightValue', (v) => (v as num?)?.toDouble()), - maxHeightIsOver: - $checkedConvert('maxHeightIsOver', (v) => v as bool?), - maxHeightIsRising: - $checkedConvert('maxHeightIsRising', (v) => v as bool?), - condition: $checkedConvert( - 'condition', - (v) => $enumDecodeNullable( - _$TsunamiObservationStationConditionEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiObservationStationImpl', json, ( + $checkedConvert, +) { + final val = _$TsunamiObservationStationImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + firstHeightArrivalTime: $checkedConvert( + 'firstHeightArrivalTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + firstHeightInitial: $checkedConvert( + 'firstHeightInitial', + (v) => $enumDecodeNullable( + _$TsunamiObservationStationFirstHeightIntialEnumMap, + v, + ), + ), + maxHeightTime: $checkedConvert( + 'maxHeightTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + maxHeightValue: $checkedConvert( + 'maxHeightValue', + (v) => (v as num?)?.toDouble(), + ), + maxHeightIsOver: $checkedConvert('maxHeightIsOver', (v) => v as bool?), + maxHeightIsRising: $checkedConvert('maxHeightIsRising', (v) => v as bool?), + condition: $checkedConvert( + 'condition', + (v) => + $enumDecodeNullable(_$TsunamiObservationStationConditionEnumMap, v), + ), + ); + return val; +}); Map _$$TsunamiObservationStationImplToJson( - _$TsunamiObservationStationImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'firstHeightArrivalTime': - instance.firstHeightArrivalTime?.toIso8601String(), - 'firstHeightInitial': _$TsunamiObservationStationFirstHeightIntialEnumMap[ - instance.firstHeightInitial], - 'maxHeightTime': instance.maxHeightTime?.toIso8601String(), - 'maxHeightValue': instance.maxHeightValue, - 'maxHeightIsOver': instance.maxHeightIsOver, - 'maxHeightIsRising': instance.maxHeightIsRising, - 'condition': - _$TsunamiObservationStationConditionEnumMap[instance.condition], - }; + _$TsunamiObservationStationImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'firstHeightArrivalTime': instance.firstHeightArrivalTime?.toIso8601String(), + 'firstHeightInitial': + _$TsunamiObservationStationFirstHeightIntialEnumMap[instance + .firstHeightInitial], + 'maxHeightTime': instance.maxHeightTime?.toIso8601String(), + 'maxHeightValue': instance.maxHeightValue, + 'maxHeightIsOver': instance.maxHeightIsOver, + 'maxHeightIsRising': instance.maxHeightIsRising, + 'condition': _$TsunamiObservationStationConditionEnumMap[instance.condition], +}; const _$TsunamiObservationStationFirstHeightIntialEnumMap = { TsunamiObservationStationFirstHeightIntial.push: '押し', @@ -433,163 +422,159 @@ const _$TsunamiObservationStationConditionEnumMap = { }; _$TsunamiEstimationImpl _$$TsunamiEstimationImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiEstimationImpl', - json, - ($checkedConvert) { - final val = _$TsunamiEstimationImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - firstHeightTime: $checkedConvert('firstHeightTime', - (v) => v == null ? null : DateTime.parse(v as String)), - firstHeightCondition: $checkedConvert( - 'firstHeightCondition', - (v) => $enumDecodeNullable( - _$TsunamiEstimationFirstHeightConditionEnumMap, v)), - maxHeightTime: $checkedConvert('maxHeightTime', - (v) => v == null ? null : DateTime.parse(v as String)), - maxHeightValue: - $checkedConvert('maxHeightValue', (v) => (v as num?)?.toDouble()), - maxHeightIsOver: - $checkedConvert('maxHeightIsOver', (v) => v as bool?), - maxHeightCondition: $checkedConvert( - 'maxHeightCondition', - (v) => - $enumDecodeNullable(_$TsunamiMaxHeightConditionEnumMap, v)), - isObserving: $checkedConvert('isObserving', (v) => v as bool?), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiEstimationImpl', json, ($checkedConvert) { + final val = _$TsunamiEstimationImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + firstHeightTime: $checkedConvert( + 'firstHeightTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + firstHeightCondition: $checkedConvert( + 'firstHeightCondition', + (v) => $enumDecodeNullable( + _$TsunamiEstimationFirstHeightConditionEnumMap, + v, + ), + ), + maxHeightTime: $checkedConvert( + 'maxHeightTime', + (v) => v == null ? null : DateTime.parse(v as String), + ), + maxHeightValue: $checkedConvert( + 'maxHeightValue', + (v) => (v as num?)?.toDouble(), + ), + maxHeightIsOver: $checkedConvert('maxHeightIsOver', (v) => v as bool?), + maxHeightCondition: $checkedConvert( + 'maxHeightCondition', + (v) => $enumDecodeNullable(_$TsunamiMaxHeightConditionEnumMap, v), + ), + isObserving: $checkedConvert('isObserving', (v) => v as bool?), + ); + return val; +}); Map _$$TsunamiEstimationImplToJson( - _$TsunamiEstimationImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'firstHeightTime': instance.firstHeightTime?.toIso8601String(), - 'firstHeightCondition': _$TsunamiEstimationFirstHeightConditionEnumMap[ - instance.firstHeightCondition], - 'maxHeightTime': instance.maxHeightTime?.toIso8601String(), - 'maxHeightValue': instance.maxHeightValue, - 'maxHeightIsOver': instance.maxHeightIsOver, - 'maxHeightCondition': - _$TsunamiMaxHeightConditionEnumMap[instance.maxHeightCondition], - 'isObserving': instance.isObserving, - }; + _$TsunamiEstimationImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'firstHeightTime': instance.firstHeightTime?.toIso8601String(), + 'firstHeightCondition': + _$TsunamiEstimationFirstHeightConditionEnumMap[instance + .firstHeightCondition], + 'maxHeightTime': instance.maxHeightTime?.toIso8601String(), + 'maxHeightValue': instance.maxHeightValue, + 'maxHeightIsOver': instance.maxHeightIsOver, + 'maxHeightCondition': + _$TsunamiMaxHeightConditionEnumMap[instance.maxHeightCondition], + 'isObserving': instance.isObserving, +}; const _$TsunamiEstimationFirstHeightConditionEnumMap = { TsunamiEstimationFirstHeightCondition.alreadyArrived: '早いところでは既に津波到達と推定', }; _$PublicBodyVTSE41Impl _$$PublicBodyVTSE41ImplFromJson( - Map json) => - $checkedCreate( - r'_$PublicBodyVTSE41Impl', - json, - ($checkedConvert) { - final val = _$PublicBodyVTSE41Impl( - tsunami: $checkedConvert( - 'tsunami', - (v) => - PublicBodyVTSE41Tsunami.fromJson(v as Map)), - earthquakes: $checkedConvert( - 'earthquakes', - (v) => (v as List) - .map((e) => Earthquake.fromJson(e as Map)) - .toList()), - text: $checkedConvert('text', (v) => v as String?), - comment: $checkedConvert( - 'comment', - (v) => v == null - ? null - : Comment.fromJson(v as Map)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$PublicBodyVTSE41Impl', json, ($checkedConvert) { + final val = _$PublicBodyVTSE41Impl( + tsunami: $checkedConvert( + 'tsunami', + (v) => PublicBodyVTSE41Tsunami.fromJson(v as Map), + ), + earthquakes: $checkedConvert( + 'earthquakes', + (v) => + (v as List) + .map((e) => Earthquake.fromJson(e as Map)) + .toList(), + ), + text: $checkedConvert('text', (v) => v as String?), + comment: $checkedConvert( + 'comment', + (v) => v == null ? null : Comment.fromJson(v as Map), + ), + ); + return val; +}); Map _$$PublicBodyVTSE41ImplToJson( - _$PublicBodyVTSE41Impl instance) => - { - 'tsunami': instance.tsunami, - 'earthquakes': instance.earthquakes, - 'text': instance.text, - 'comment': instance.comment, - }; + _$PublicBodyVTSE41Impl instance, +) => { + 'tsunami': instance.tsunami, + 'earthquakes': instance.earthquakes, + 'text': instance.text, + 'comment': instance.comment, +}; _$PublicBodyVTSE51Impl _$$PublicBodyVTSE51ImplFromJson( - Map json) => - $checkedCreate( - r'_$PublicBodyVTSE51Impl', - json, - ($checkedConvert) { - final val = _$PublicBodyVTSE51Impl( - tsunami: $checkedConvert( - 'tsunami', - (v) => - PublicBodyVTSE51Tsunami.fromJson(v as Map)), - earthquakes: $checkedConvert( - 'earthquakes', - (v) => (v as List) - .map((e) => Earthquake.fromJson(e as Map)) - .toList()), - text: $checkedConvert('text', (v) => v as String?), - comment: $checkedConvert( - 'comment', - (v) => v == null - ? null - : Comment.fromJson(v as Map)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$PublicBodyVTSE51Impl', json, ($checkedConvert) { + final val = _$PublicBodyVTSE51Impl( + tsunami: $checkedConvert( + 'tsunami', + (v) => PublicBodyVTSE51Tsunami.fromJson(v as Map), + ), + earthquakes: $checkedConvert( + 'earthquakes', + (v) => + (v as List) + .map((e) => Earthquake.fromJson(e as Map)) + .toList(), + ), + text: $checkedConvert('text', (v) => v as String?), + comment: $checkedConvert( + 'comment', + (v) => v == null ? null : Comment.fromJson(v as Map), + ), + ); + return val; +}); Map _$$PublicBodyVTSE51ImplToJson( - _$PublicBodyVTSE51Impl instance) => - { - 'tsunami': instance.tsunami, - 'earthquakes': instance.earthquakes, - 'text': instance.text, - 'comment': instance.comment, - }; + _$PublicBodyVTSE51Impl instance, +) => { + 'tsunami': instance.tsunami, + 'earthquakes': instance.earthquakes, + 'text': instance.text, + 'comment': instance.comment, +}; _$PublicBodyVTSE52Impl _$$PublicBodyVTSE52ImplFromJson( - Map json) => - $checkedCreate( - r'_$PublicBodyVTSE52Impl', - json, - ($checkedConvert) { - final val = _$PublicBodyVTSE52Impl( - tsunami: $checkedConvert( - 'tsunami', - (v) => - PublicBodyVTSE52Tsunami.fromJson(v as Map)), - earthquakes: $checkedConvert( - 'earthquakes', - (v) => (v as List) - .map((e) => Earthquake.fromJson(e as Map)) - .toList()), - text: $checkedConvert('text', (v) => v as String?), - comment: $checkedConvert( - 'comment', - (v) => v == null - ? null - : Comment.fromJson(v as Map)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$PublicBodyVTSE52Impl', json, ($checkedConvert) { + final val = _$PublicBodyVTSE52Impl( + tsunami: $checkedConvert( + 'tsunami', + (v) => PublicBodyVTSE52Tsunami.fromJson(v as Map), + ), + earthquakes: $checkedConvert( + 'earthquakes', + (v) => + (v as List) + .map((e) => Earthquake.fromJson(e as Map)) + .toList(), + ), + text: $checkedConvert('text', (v) => v as String?), + comment: $checkedConvert( + 'comment', + (v) => v == null ? null : Comment.fromJson(v as Map), + ), + ); + return val; +}); Map _$$PublicBodyVTSE52ImplToJson( - _$PublicBodyVTSE52Impl instance) => - { - 'tsunami': instance.tsunami, - 'earthquakes': instance.earthquakes, - 'text': instance.text, - 'comment': instance.comment, - }; + _$PublicBodyVTSE52Impl instance, +) => { + 'tsunami': instance.tsunami, + 'earthquakes': instance.earthquakes, + 'text': instance.text, + 'comment': instance.comment, +}; _$EarthquakeImpl _$$EarthquakeImplFromJson(Map json) => $checkedCreate( @@ -598,19 +583,27 @@ _$EarthquakeImpl _$$EarthquakeImplFromJson(Map json) => ($checkedConvert) { final val = _$EarthquakeImpl( originTime: $checkedConvert( - 'origin_time', (v) => DateTime.parse(v as String)), + 'origin_time', + (v) => DateTime.parse(v as String), + ), arrivalTime: $checkedConvert( - 'arrival_time', (v) => DateTime.parse(v as String)), - hypocenter: $checkedConvert('hypocenter', - (v) => EarthquakeHypocenter.fromJson(v as Map)), - magnitude: $checkedConvert('magnitude', - (v) => EarthquakeMagnitude.fromJson(v as Map)), + 'arrival_time', + (v) => DateTime.parse(v as String), + ), + hypocenter: $checkedConvert( + 'hypocenter', + (v) => EarthquakeHypocenter.fromJson(v as Map), + ), + magnitude: $checkedConvert( + 'magnitude', + (v) => EarthquakeMagnitude.fromJson(v as Map), + ), ); return val; }, fieldKeyMap: const { 'originTime': 'origin_time', - 'arrivalTime': 'arrival_time' + 'arrivalTime': 'arrival_time', }, ); @@ -623,107 +616,95 @@ Map _$$EarthquakeImplToJson(_$EarthquakeImpl instance) => }; _$EarthquakeHypocenterImpl _$$EarthquakeHypocenterImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeHypocenterImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeHypocenterImpl( - name: $checkedConvert('name', (v) => v as String), - code: $checkedConvert('code', (v) => v as String), - depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), - detailed: $checkedConvert( - 'detailed', - (v) => v == null - ? null - : EarthquakeHypocenterDetailed.fromJson( - v as Map)), - coordinate: $checkedConvert( - 'coordinate', - (v) => v == null - ? null - : EarthquakeHypocenterCoordinate.fromJson( - v as Map)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EarthquakeHypocenterImpl', json, ($checkedConvert) { + final val = _$EarthquakeHypocenterImpl( + name: $checkedConvert('name', (v) => v as String), + code: $checkedConvert('code', (v) => v as String), + depth: $checkedConvert('depth', (v) => (v as num?)?.toInt()), + detailed: $checkedConvert( + 'detailed', + (v) => + v == null + ? null + : EarthquakeHypocenterDetailed.fromJson( + v as Map, + ), + ), + coordinate: $checkedConvert( + 'coordinate', + (v) => + v == null + ? null + : EarthquakeHypocenterCoordinate.fromJson( + v as Map, + ), + ), + ); + return val; +}); Map _$$EarthquakeHypocenterImplToJson( - _$EarthquakeHypocenterImpl instance) => - { - 'name': instance.name, - 'code': instance.code, - 'depth': instance.depth, - 'detailed': instance.detailed, - 'coordinate': instance.coordinate, - }; + _$EarthquakeHypocenterImpl instance, +) => { + 'name': instance.name, + 'code': instance.code, + 'depth': instance.depth, + 'detailed': instance.detailed, + 'coordinate': instance.coordinate, +}; _$EarthquakeHypocenterDetailedImpl _$$EarthquakeHypocenterDetailedImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeHypocenterDetailedImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeHypocenterDetailedImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EarthquakeHypocenterDetailedImpl', json, ( + $checkedConvert, +) { + final val = _$EarthquakeHypocenterDetailedImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + ); + return val; +}); Map _$$EarthquakeHypocenterDetailedImplToJson( - _$EarthquakeHypocenterDetailedImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - }; + _$EarthquakeHypocenterDetailedImpl instance, +) => {'code': instance.code, 'name': instance.name}; _$EarthquakeHypocenterCoordinateImpl - _$$EarthquakeHypocenterCoordinateImplFromJson(Map json) => - $checkedCreate( - r'_$EarthquakeHypocenterCoordinateImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeHypocenterCoordinateImpl( - lat: $checkedConvert('lat', (v) => (v as num).toDouble()), - lon: $checkedConvert('lon', (v) => (v as num).toDouble()), - ); - return val; - }, - ); +_$$EarthquakeHypocenterCoordinateImplFromJson(Map json) => + $checkedCreate(r'_$EarthquakeHypocenterCoordinateImpl', json, ( + $checkedConvert, + ) { + final val = _$EarthquakeHypocenterCoordinateImpl( + lat: $checkedConvert('lat', (v) => (v as num).toDouble()), + lon: $checkedConvert('lon', (v) => (v as num).toDouble()), + ); + return val; + }); Map _$$EarthquakeHypocenterCoordinateImplToJson( - _$EarthquakeHypocenterCoordinateImpl instance) => - { - 'lat': instance.lat, - 'lon': instance.lon, - }; + _$EarthquakeHypocenterCoordinateImpl instance, +) => {'lat': instance.lat, 'lon': instance.lon}; _$EarthquakeMagnitudeImpl _$$EarthquakeMagnitudeImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeMagnitudeImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeMagnitudeImpl( - value: $checkedConvert('value', (v) => (v as num?)?.toDouble()), - condition: $checkedConvert( - 'condition', - (v) => $enumDecodeNullable( - _$EarthquakeMagnitudeConditionEnumMap, v)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EarthquakeMagnitudeImpl', json, ($checkedConvert) { + final val = _$EarthquakeMagnitudeImpl( + value: $checkedConvert('value', (v) => (v as num?)?.toDouble()), + condition: $checkedConvert( + 'condition', + (v) => $enumDecodeNullable(_$EarthquakeMagnitudeConditionEnumMap, v), + ), + ); + return val; +}); Map _$$EarthquakeMagnitudeImplToJson( - _$EarthquakeMagnitudeImpl instance) => - { - 'value': instance.value, - 'condition': _$EarthquakeMagnitudeConditionEnumMap[instance.condition], - }; + _$EarthquakeMagnitudeImpl instance, +) => { + 'value': instance.value, + 'condition': _$EarthquakeMagnitudeConditionEnumMap[instance.condition], +}; const _$EarthquakeMagnitudeConditionEnumMap = { EarthquakeMagnitudeCondition.unknown: 'M不明', diff --git a/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.dart b/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.dart index 9b245c0d..430b3b87 100644 --- a/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.dart +++ b/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.dart @@ -17,10 +17,8 @@ sealed class RealtimePostgresChangesPayloadBase { Map json, ) { final eventTypeStr = json['eventType'].toString(); - final eventType = - RealtimePostgresChangesListenEvent.values.firstWhereOrNull( - (e) => e.value == eventTypeStr, - ); + final eventType = RealtimePostgresChangesListenEvent.values + .firstWhereOrNull((e) => e.value == eventTypeStr); if (eventType == null) { throw ArgumentError.value( eventTypeStr, @@ -33,128 +31,127 @@ sealed class RealtimePostgresChangesPayloadBase { (e) => e.tableName == tableStr, ); if (table == null) { - throw ArgumentError.value( - tableStr, - 'json["table"]', - 'Invalid value', - ); + throw ArgumentError.value(tableStr, 'json["table"]', 'Invalid value'); } return switch (eventType) { RealtimePostgresChangesListenEvent.insert => switch (table) { - PublicTable.earthquake => - RealtimePostgresInsertPayload.fromJson( - json, - (v) => EarthquakeV1.fromJson(v! as Map), - ), - PublicTable.eew => RealtimePostgresInsertPayload.fromJson( - json, - (v) => EewV1.fromJson(v! as Map), - ), - PublicTable.information => - RealtimePostgresInsertPayload.fromJson( - json, - (v) => InformationV1.fromJson(v! as Map), - ), - PublicTable.intensitySubDivision => - RealtimePostgresInsertPayload.fromJson( - json, - (v) => IntensitySubDivision.fromJson(v! as Map), - ), - PublicTable.telegram => - RealtimePostgresInsertPayload.fromJson( - json, - (v) => TelegramV1.fromJson(v! as Map), - ), - PublicTable.tsunami => - RealtimePostgresInsertPayload.fromJson( - json, - (v) => TsunamiV1.fromJson(v! as Map), - ), - PublicTable.shakeDetectionEvents => RealtimePostgresInsertPayload< - ShakeDetectionWebSocketTelegram>.fromJson( - json, - (v) => ShakeDetectionWebSocketTelegram.fromJson( - v! as Map, - ), - ), - }, + PublicTable.earthquake => + RealtimePostgresInsertPayload.fromJson( + json, + (v) => EarthquakeV1.fromJson(v! as Map), + ), + PublicTable.eew => RealtimePostgresInsertPayload.fromJson( + json, + (v) => EewV1.fromJson(v! as Map), + ), + PublicTable.information => + RealtimePostgresInsertPayload.fromJson( + json, + (v) => InformationV1.fromJson(v! as Map), + ), + PublicTable.intensitySubDivision => + RealtimePostgresInsertPayload.fromJson( + json, + (v) => IntensitySubDivision.fromJson(v! as Map), + ), + PublicTable.telegram => + RealtimePostgresInsertPayload.fromJson( + json, + (v) => TelegramV1.fromJson(v! as Map), + ), + PublicTable.tsunami => + RealtimePostgresInsertPayload.fromJson( + json, + (v) => TsunamiV1.fromJson(v! as Map), + ), + PublicTable.shakeDetectionEvents => RealtimePostgresInsertPayload< + ShakeDetectionWebSocketTelegram + >.fromJson( + json, + (v) => ShakeDetectionWebSocketTelegram.fromJson( + v! as Map, + ), + ), + }, RealtimePostgresChangesListenEvent.update => switch (table) { - PublicTable.earthquake => - RealtimePostgresUpdatePayload.fromJson( - json, - (v) => EarthquakeV1.fromJson(v! as Map), - ), - PublicTable.eew => RealtimePostgresUpdatePayload.fromJson( - json, - (v) => EewV1.fromJson(v! as Map), - ), - PublicTable.information => - RealtimePostgresUpdatePayload.fromJson( - json, - (v) => InformationV1.fromJson(v! as Map), - ), - PublicTable.intensitySubDivision => - RealtimePostgresUpdatePayload.fromJson( - json, - (v) => IntensitySubDivision.fromJson(v! as Map), - ), - PublicTable.telegram => - RealtimePostgresUpdatePayload.fromJson( - json, - (v) => TelegramV1.fromJson(v! as Map), - ), - PublicTable.tsunami => - RealtimePostgresUpdatePayload.fromJson( - json, - (v) => TsunamiV1.fromJson(v! as Map), - ), - PublicTable.shakeDetectionEvents => RealtimePostgresUpdatePayload< - ShakeDetectionWebSocketTelegram>.fromJson( - json, - (v) => ShakeDetectionWebSocketTelegram.fromJson( - v! as Map, - ), - ), - }, + PublicTable.earthquake => + RealtimePostgresUpdatePayload.fromJson( + json, + (v) => EarthquakeV1.fromJson(v! as Map), + ), + PublicTable.eew => RealtimePostgresUpdatePayload.fromJson( + json, + (v) => EewV1.fromJson(v! as Map), + ), + PublicTable.information => + RealtimePostgresUpdatePayload.fromJson( + json, + (v) => InformationV1.fromJson(v! as Map), + ), + PublicTable.intensitySubDivision => + RealtimePostgresUpdatePayload.fromJson( + json, + (v) => IntensitySubDivision.fromJson(v! as Map), + ), + PublicTable.telegram => + RealtimePostgresUpdatePayload.fromJson( + json, + (v) => TelegramV1.fromJson(v! as Map), + ), + PublicTable.tsunami => + RealtimePostgresUpdatePayload.fromJson( + json, + (v) => TsunamiV1.fromJson(v! as Map), + ), + PublicTable.shakeDetectionEvents => RealtimePostgresUpdatePayload< + ShakeDetectionWebSocketTelegram + >.fromJson( + json, + (v) => ShakeDetectionWebSocketTelegram.fromJson( + v! as Map, + ), + ), + }, RealtimePostgresChangesListenEvent.delete => switch (table) { - PublicTable.earthquake => - RealtimePostgresDeletePayload.fromJson( - json, - (v) => EarthquakeV1.fromJson(v! as Map), - ), - PublicTable.eew => RealtimePostgresDeletePayload.fromJson( - json, - (v) => EewV1.fromJson(v! as Map), - ), - PublicTable.information => - RealtimePostgresDeletePayload.fromJson( - json, - (v) => InformationV1.fromJson(v! as Map), - ), - PublicTable.intensitySubDivision => - RealtimePostgresDeletePayload.fromJson( - json, - (v) => IntensitySubDivision.fromJson(v! as Map), - ), - PublicTable.telegram => - RealtimePostgresDeletePayload.fromJson( - json, - (v) => TelegramV1.fromJson(v! as Map), - ), - PublicTable.tsunami => - RealtimePostgresDeletePayload.fromJson( - json, - (v) => TsunamiV1.fromJson(v! as Map), - ), - PublicTable.shakeDetectionEvents => RealtimePostgresDeletePayload< - ShakeDetectionWebSocketTelegram>.fromJson( - json, - (v) => ShakeDetectionWebSocketTelegram.fromJson( - v! as Map, - ), - ), - } + PublicTable.earthquake => + RealtimePostgresDeletePayload.fromJson( + json, + (v) => EarthquakeV1.fromJson(v! as Map), + ), + PublicTable.eew => RealtimePostgresDeletePayload.fromJson( + json, + (v) => EewV1.fromJson(v! as Map), + ), + PublicTable.information => + RealtimePostgresDeletePayload.fromJson( + json, + (v) => InformationV1.fromJson(v! as Map), + ), + PublicTable.intensitySubDivision => + RealtimePostgresDeletePayload.fromJson( + json, + (v) => IntensitySubDivision.fromJson(v! as Map), + ), + PublicTable.telegram => + RealtimePostgresDeletePayload.fromJson( + json, + (v) => TelegramV1.fromJson(v! as Map), + ), + PublicTable.tsunami => + RealtimePostgresDeletePayload.fromJson( + json, + (v) => TsunamiV1.fromJson(v! as Map), + ), + PublicTable.shakeDetectionEvents => RealtimePostgresDeletePayload< + ShakeDetectionWebSocketTelegram + >.fromJson( + json, + (v) => ShakeDetectionWebSocketTelegram.fromJson( + v! as Map, + ), + ), + }, }; } @@ -174,8 +171,7 @@ enum PublicTable { intensitySubDivision('intensity_sub_division'), telegram('telegram'), tsunami('tsunami'), - shakeDetectionEvents('shake_detection_events'), - ; + shakeDetectionEvents('shake_detection_events'); const PublicTable(this.tableName); final String tableName; @@ -198,8 +194,7 @@ class RealtimePostgresInsertPayload factory RealtimePostgresInsertPayload.fromJson( Map json, T Function(Object?) fromJsonT, - ) => - _$RealtimePostgresInsertPayloadFromJson(json, fromJsonT); + ) => _$RealtimePostgresInsertPayloadFromJson(json, fromJsonT); static const RealtimePostgresChangesListenEvent eventType = RealtimePostgresChangesListenEvent.insert; @@ -226,8 +221,7 @@ class RealtimePostgresUpdatePayload factory RealtimePostgresUpdatePayload.fromJson( Map json, T Function(Object?) fromJsonT, - ) => - _$RealtimePostgresUpdatePayloadFromJson(json, fromJsonT); + ) => _$RealtimePostgresUpdatePayloadFromJson(json, fromJsonT); static const RealtimePostgresChangesListenEvent eventType = RealtimePostgresChangesListenEvent.update; @@ -252,8 +246,7 @@ class RealtimePostgresDeletePayload factory RealtimePostgresDeletePayload.fromJson( Map json, T Function(Object?) fromJsonT, - ) => - _$RealtimePostgresDeletePayloadFromJson(json, fromJsonT); + ) => _$RealtimePostgresDeletePayloadFromJson(json, fromJsonT); static const RealtimePostgresChangesListenEvent eventType = RealtimePostgresChangesListenEvent.delete; @@ -264,8 +257,7 @@ class RealtimePostgresDeletePayload enum RealtimePostgresChangesListenEvent { insert('INSERT'), update('UPDATE'), - delete('DELETE'), - ; + delete('DELETE'); const RealtimePostgresChangesListenEvent(this.value); final String value; diff --git a/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.freezed.dart b/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.freezed.dart index 872aa450..639135d1 100644 --- a/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.freezed.dart @@ -12,11 +12,12 @@ part of 'realtime_postgres_changes_payload.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); -RealtimePostgresInsertPayload - _$RealtimePostgresInsertPayloadFromJson( - Map json, T Function(Object?) fromJsonT) { +RealtimePostgresInsertPayload _$RealtimePostgresInsertPayloadFromJson< + T extends V1Database +>(Map json, T Function(Object?) fromJsonT) { return _RealtimePostgresInsertPayload.fromJson(json, fromJsonT); } @@ -37,29 +38,39 @@ mixin _$RealtimePostgresInsertPayload { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $RealtimePostgresInsertPayloadCopyWith> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $RealtimePostgresInsertPayloadCopyWith { +abstract class $RealtimePostgresInsertPayloadCopyWith< + T extends V1Database, + $Res +> { factory $RealtimePostgresInsertPayloadCopyWith( - RealtimePostgresInsertPayload value, - $Res Function(RealtimePostgresInsertPayload) then) = - _$RealtimePostgresInsertPayloadCopyWithImpl>; + RealtimePostgresInsertPayload value, + $Res Function(RealtimePostgresInsertPayload) then, + ) = + _$RealtimePostgresInsertPayloadCopyWithImpl< + T, + $Res, + RealtimePostgresInsertPayload + >; @useResult - $Res call( - {String schema, - String table, - DateTime commitTimestamp, - List? errors, - @JsonKey(name: 'new') T newData}); + $Res call({ + String schema, + String table, + DateTime commitTimestamp, + List? errors, + @JsonKey(name: 'new') T newData, + }); } /// @nodoc -class _$RealtimePostgresInsertPayloadCopyWithImpl> +class _$RealtimePostgresInsertPayloadCopyWithImpl< + T extends V1Database, + $Res, + $Val extends RealtimePostgresInsertPayload +> implements $RealtimePostgresInsertPayloadCopyWith { _$RealtimePostgresInsertPayloadCopyWithImpl(this._value, this._then); @@ -79,59 +90,76 @@ class _$RealtimePostgresInsertPayloadCopyWithImpl?, - newData: null == newData - ? _value.newData - : newData // ignore: cast_nullable_to_non_nullable - as T, - ) as $Val); + return _then( + _value.copyWith( + schema: + null == schema + ? _value.schema + : schema // ignore: cast_nullable_to_non_nullable + as String, + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as String, + commitTimestamp: + null == commitTimestamp + ? _value.commitTimestamp + : commitTimestamp // ignore: cast_nullable_to_non_nullable + as DateTime, + errors: + freezed == errors + ? _value.errors + : errors // ignore: cast_nullable_to_non_nullable + as List?, + newData: + null == newData + ? _value.newData + : newData // ignore: cast_nullable_to_non_nullable + as T, + ) + as $Val, + ); } } /// @nodoc abstract class _$$RealtimePostgresInsertPayloadImplCopyWith< - T extends V1Database, - $Res> implements $RealtimePostgresInsertPayloadCopyWith { + T extends V1Database, + $Res +> + implements $RealtimePostgresInsertPayloadCopyWith { factory _$$RealtimePostgresInsertPayloadImplCopyWith( - _$RealtimePostgresInsertPayloadImpl value, - $Res Function(_$RealtimePostgresInsertPayloadImpl) then) = - __$$RealtimePostgresInsertPayloadImplCopyWithImpl; + _$RealtimePostgresInsertPayloadImpl value, + $Res Function(_$RealtimePostgresInsertPayloadImpl) then, + ) = __$$RealtimePostgresInsertPayloadImplCopyWithImpl; @override @useResult - $Res call( - {String schema, - String table, - DateTime commitTimestamp, - List? errors, - @JsonKey(name: 'new') T newData}); + $Res call({ + String schema, + String table, + DateTime commitTimestamp, + List? errors, + @JsonKey(name: 'new') T newData, + }); } /// @nodoc -class __$$RealtimePostgresInsertPayloadImplCopyWithImpl - extends _$RealtimePostgresInsertPayloadCopyWithImpl> +class __$$RealtimePostgresInsertPayloadImplCopyWithImpl< + T extends V1Database, + $Res +> + extends + _$RealtimePostgresInsertPayloadCopyWithImpl< + T, + $Res, + _$RealtimePostgresInsertPayloadImpl + > implements _$$RealtimePostgresInsertPayloadImplCopyWith { __$$RealtimePostgresInsertPayloadImplCopyWithImpl( - _$RealtimePostgresInsertPayloadImpl _value, - $Res Function(_$RealtimePostgresInsertPayloadImpl) _then) - : super(_value, _then); + _$RealtimePostgresInsertPayloadImpl _value, + $Res Function(_$RealtimePostgresInsertPayloadImpl) _then, + ) : super(_value, _then); /// Create a copy of RealtimePostgresInsertPayload /// with the given fields replaced by the non-null parameter values. @@ -144,28 +172,35 @@ class __$$RealtimePostgresInsertPayloadImplCopyWithImpl( - schema: null == schema - ? _value.schema - : schema // ignore: cast_nullable_to_non_nullable - as String, - table: null == table - ? _value.table - : table // ignore: cast_nullable_to_non_nullable - as String, - commitTimestamp: null == commitTimestamp - ? _value.commitTimestamp - : commitTimestamp // ignore: cast_nullable_to_non_nullable - as DateTime, - errors: freezed == errors - ? _value._errors - : errors // ignore: cast_nullable_to_non_nullable - as List?, - newData: null == newData - ? _value.newData - : newData // ignore: cast_nullable_to_non_nullable - as T, - )); + return _then( + _$RealtimePostgresInsertPayloadImpl( + schema: + null == schema + ? _value.schema + : schema // ignore: cast_nullable_to_non_nullable + as String, + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as String, + commitTimestamp: + null == commitTimestamp + ? _value.commitTimestamp + : commitTimestamp // ignore: cast_nullable_to_non_nullable + as DateTime, + errors: + freezed == errors + ? _value._errors + : errors // ignore: cast_nullable_to_non_nullable + as List?, + newData: + null == newData + ? _value.newData + : newData // ignore: cast_nullable_to_non_nullable + as T, + ), + ); } } @@ -173,17 +208,18 @@ class __$$RealtimePostgresInsertPayloadImplCopyWithImpl implements _RealtimePostgresInsertPayload { - const _$RealtimePostgresInsertPayloadImpl( - {required this.schema, - required this.table, - required this.commitTimestamp, - required final List? errors, - @JsonKey(name: 'new') required this.newData}) - : _errors = errors; + const _$RealtimePostgresInsertPayloadImpl({ + required this.schema, + required this.table, + required this.commitTimestamp, + required final List? errors, + @JsonKey(name: 'new') required this.newData, + }) : _errors = errors; factory _$RealtimePostgresInsertPayloadImpl.fromJson( - Map json, T Function(Object?) fromJsonT) => - _$$RealtimePostgresInsertPayloadImplFromJson(json, fromJsonT); + Map json, + T Function(Object?) fromJsonT, + ) => _$$RealtimePostgresInsertPayloadImplFromJson(json, fromJsonT); @override final String schema; @@ -226,22 +262,27 @@ class _$RealtimePostgresInsertPayloadImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - schema, - table, - commitTimestamp, - const DeepCollectionEquality().hash(_errors), - const DeepCollectionEquality().hash(newData)); + runtimeType, + schema, + table, + commitTimestamp, + const DeepCollectionEquality().hash(_errors), + const DeepCollectionEquality().hash(newData), + ); /// Create a copy of RealtimePostgresInsertPayload /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RealtimePostgresInsertPayloadImplCopyWith> - get copyWith => __$$RealtimePostgresInsertPayloadImplCopyWithImpl>(this, _$identity); + _$$RealtimePostgresInsertPayloadImplCopyWith< + T, + _$RealtimePostgresInsertPayloadImpl + > + get copyWith => __$$RealtimePostgresInsertPayloadImplCopyWithImpl< + T, + _$RealtimePostgresInsertPayloadImpl + >(this, _$identity); @override Map toJson(Object? Function(T) toJsonT) { @@ -251,17 +292,18 @@ class _$RealtimePostgresInsertPayloadImpl abstract class _RealtimePostgresInsertPayload implements RealtimePostgresInsertPayload { - const factory _RealtimePostgresInsertPayload( - {required final String schema, - required final String table, - required final DateTime commitTimestamp, - required final List? errors, - @JsonKey(name: 'new') required final T newData}) = - _$RealtimePostgresInsertPayloadImpl; + const factory _RealtimePostgresInsertPayload({ + required final String schema, + required final String table, + required final DateTime commitTimestamp, + required final List? errors, + @JsonKey(name: 'new') required final T newData, + }) = _$RealtimePostgresInsertPayloadImpl; factory _RealtimePostgresInsertPayload.fromJson( - Map json, T Function(Object?) fromJsonT) = - _$RealtimePostgresInsertPayloadImpl.fromJson; + Map json, + T Function(Object?) fromJsonT, + ) = _$RealtimePostgresInsertPayloadImpl.fromJson; @override String get schema; @@ -279,14 +321,16 @@ abstract class _RealtimePostgresInsertPayload /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RealtimePostgresInsertPayloadImplCopyWith> - get copyWith => throw _privateConstructorUsedError; + _$$RealtimePostgresInsertPayloadImplCopyWith< + T, + _$RealtimePostgresInsertPayloadImpl + > + get copyWith => throw _privateConstructorUsedError; } -RealtimePostgresUpdatePayload - _$RealtimePostgresUpdatePayloadFromJson( - Map json, T Function(Object?) fromJsonT) { +RealtimePostgresUpdatePayload _$RealtimePostgresUpdatePayloadFromJson< + T extends V1Database +>(Map json, T Function(Object?) fromJsonT) { return _RealtimePostgresUpdatePayload.fromJson(json, fromJsonT); } @@ -310,30 +354,40 @@ mixin _$RealtimePostgresUpdatePayload { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $RealtimePostgresUpdatePayloadCopyWith> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $RealtimePostgresUpdatePayloadCopyWith { +abstract class $RealtimePostgresUpdatePayloadCopyWith< + T extends V1Database, + $Res +> { factory $RealtimePostgresUpdatePayloadCopyWith( - RealtimePostgresUpdatePayload value, - $Res Function(RealtimePostgresUpdatePayload) then) = - _$RealtimePostgresUpdatePayloadCopyWithImpl>; + RealtimePostgresUpdatePayload value, + $Res Function(RealtimePostgresUpdatePayload) then, + ) = + _$RealtimePostgresUpdatePayloadCopyWithImpl< + T, + $Res, + RealtimePostgresUpdatePayload + >; @useResult - $Res call( - {String schema, - String table, - DateTime commitTimestamp, - List? errors, - @JsonKey(name: 'new') T newData, - Map? old}); + $Res call({ + String schema, + String table, + DateTime commitTimestamp, + List? errors, + @JsonKey(name: 'new') T newData, + Map? old, + }); } /// @nodoc -class _$RealtimePostgresUpdatePayloadCopyWithImpl> +class _$RealtimePostgresUpdatePayloadCopyWithImpl< + T extends V1Database, + $Res, + $Val extends RealtimePostgresUpdatePayload +> implements $RealtimePostgresUpdatePayloadCopyWith { _$RealtimePostgresUpdatePayloadCopyWithImpl(this._value, this._then); @@ -354,64 +408,82 @@ class _$RealtimePostgresUpdatePayloadCopyWithImpl?, - newData: null == newData - ? _value.newData - : newData // ignore: cast_nullable_to_non_nullable - as T, - old: freezed == old - ? _value.old - : old // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); + return _then( + _value.copyWith( + schema: + null == schema + ? _value.schema + : schema // ignore: cast_nullable_to_non_nullable + as String, + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as String, + commitTimestamp: + null == commitTimestamp + ? _value.commitTimestamp + : commitTimestamp // ignore: cast_nullable_to_non_nullable + as DateTime, + errors: + freezed == errors + ? _value.errors + : errors // ignore: cast_nullable_to_non_nullable + as List?, + newData: + null == newData + ? _value.newData + : newData // ignore: cast_nullable_to_non_nullable + as T, + old: + freezed == old + ? _value.old + : old // ignore: cast_nullable_to_non_nullable + as Map?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$RealtimePostgresUpdatePayloadImplCopyWith< - T extends V1Database, - $Res> implements $RealtimePostgresUpdatePayloadCopyWith { + T extends V1Database, + $Res +> + implements $RealtimePostgresUpdatePayloadCopyWith { factory _$$RealtimePostgresUpdatePayloadImplCopyWith( - _$RealtimePostgresUpdatePayloadImpl value, - $Res Function(_$RealtimePostgresUpdatePayloadImpl) then) = - __$$RealtimePostgresUpdatePayloadImplCopyWithImpl; + _$RealtimePostgresUpdatePayloadImpl value, + $Res Function(_$RealtimePostgresUpdatePayloadImpl) then, + ) = __$$RealtimePostgresUpdatePayloadImplCopyWithImpl; @override @useResult - $Res call( - {String schema, - String table, - DateTime commitTimestamp, - List? errors, - @JsonKey(name: 'new') T newData, - Map? old}); + $Res call({ + String schema, + String table, + DateTime commitTimestamp, + List? errors, + @JsonKey(name: 'new') T newData, + Map? old, + }); } /// @nodoc -class __$$RealtimePostgresUpdatePayloadImplCopyWithImpl - extends _$RealtimePostgresUpdatePayloadCopyWithImpl> +class __$$RealtimePostgresUpdatePayloadImplCopyWithImpl< + T extends V1Database, + $Res +> + extends + _$RealtimePostgresUpdatePayloadCopyWithImpl< + T, + $Res, + _$RealtimePostgresUpdatePayloadImpl + > implements _$$RealtimePostgresUpdatePayloadImplCopyWith { __$$RealtimePostgresUpdatePayloadImplCopyWithImpl( - _$RealtimePostgresUpdatePayloadImpl _value, - $Res Function(_$RealtimePostgresUpdatePayloadImpl) _then) - : super(_value, _then); + _$RealtimePostgresUpdatePayloadImpl _value, + $Res Function(_$RealtimePostgresUpdatePayloadImpl) _then, + ) : super(_value, _then); /// Create a copy of RealtimePostgresUpdatePayload /// with the given fields replaced by the non-null parameter values. @@ -425,32 +497,40 @@ class __$$RealtimePostgresUpdatePayloadImplCopyWithImpl( - schema: null == schema - ? _value.schema - : schema // ignore: cast_nullable_to_non_nullable - as String, - table: null == table - ? _value.table - : table // ignore: cast_nullable_to_non_nullable - as String, - commitTimestamp: null == commitTimestamp - ? _value.commitTimestamp - : commitTimestamp // ignore: cast_nullable_to_non_nullable - as DateTime, - errors: freezed == errors - ? _value._errors - : errors // ignore: cast_nullable_to_non_nullable - as List?, - newData: null == newData - ? _value.newData - : newData // ignore: cast_nullable_to_non_nullable - as T, - old: freezed == old - ? _value._old - : old // ignore: cast_nullable_to_non_nullable - as Map?, - )); + return _then( + _$RealtimePostgresUpdatePayloadImpl( + schema: + null == schema + ? _value.schema + : schema // ignore: cast_nullable_to_non_nullable + as String, + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as String, + commitTimestamp: + null == commitTimestamp + ? _value.commitTimestamp + : commitTimestamp // ignore: cast_nullable_to_non_nullable + as DateTime, + errors: + freezed == errors + ? _value._errors + : errors // ignore: cast_nullable_to_non_nullable + as List?, + newData: + null == newData + ? _value.newData + : newData // ignore: cast_nullable_to_non_nullable + as T, + old: + freezed == old + ? _value._old + : old // ignore: cast_nullable_to_non_nullable + as Map?, + ), + ); } } @@ -458,19 +538,20 @@ class __$$RealtimePostgresUpdatePayloadImplCopyWithImpl implements _RealtimePostgresUpdatePayload { - const _$RealtimePostgresUpdatePayloadImpl( - {required this.schema, - required this.table, - required this.commitTimestamp, - required final List? errors, - @JsonKey(name: 'new') required this.newData, - required final Map? old}) - : _errors = errors, - _old = old; + const _$RealtimePostgresUpdatePayloadImpl({ + required this.schema, + required this.table, + required this.commitTimestamp, + required final List? errors, + @JsonKey(name: 'new') required this.newData, + required final Map? old, + }) : _errors = errors, + _old = old; factory _$RealtimePostgresUpdatePayloadImpl.fromJson( - Map json, T Function(Object?) fromJsonT) => - _$$RealtimePostgresUpdatePayloadImplFromJson(json, fromJsonT); + Map json, + T Function(Object?) fromJsonT, + ) => _$$RealtimePostgresUpdatePayloadImplFromJson(json, fromJsonT); @override final String schema; @@ -527,23 +608,28 @@ class _$RealtimePostgresUpdatePayloadImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - schema, - table, - commitTimestamp, - const DeepCollectionEquality().hash(_errors), - const DeepCollectionEquality().hash(newData), - const DeepCollectionEquality().hash(_old)); + runtimeType, + schema, + table, + commitTimestamp, + const DeepCollectionEquality().hash(_errors), + const DeepCollectionEquality().hash(newData), + const DeepCollectionEquality().hash(_old), + ); /// Create a copy of RealtimePostgresUpdatePayload /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RealtimePostgresUpdatePayloadImplCopyWith> - get copyWith => __$$RealtimePostgresUpdatePayloadImplCopyWithImpl>(this, _$identity); + _$$RealtimePostgresUpdatePayloadImplCopyWith< + T, + _$RealtimePostgresUpdatePayloadImpl + > + get copyWith => __$$RealtimePostgresUpdatePayloadImplCopyWithImpl< + T, + _$RealtimePostgresUpdatePayloadImpl + >(this, _$identity); @override Map toJson(Object? Function(T) toJsonT) { @@ -553,18 +639,19 @@ class _$RealtimePostgresUpdatePayloadImpl abstract class _RealtimePostgresUpdatePayload implements RealtimePostgresUpdatePayload { - const factory _RealtimePostgresUpdatePayload( - {required final String schema, - required final String table, - required final DateTime commitTimestamp, - required final List? errors, - @JsonKey(name: 'new') required final T newData, - required final Map? old}) = - _$RealtimePostgresUpdatePayloadImpl; + const factory _RealtimePostgresUpdatePayload({ + required final String schema, + required final String table, + required final DateTime commitTimestamp, + required final List? errors, + @JsonKey(name: 'new') required final T newData, + required final Map? old, + }) = _$RealtimePostgresUpdatePayloadImpl; factory _RealtimePostgresUpdatePayload.fromJson( - Map json, T Function(Object?) fromJsonT) = - _$RealtimePostgresUpdatePayloadImpl.fromJson; + Map json, + T Function(Object?) fromJsonT, + ) = _$RealtimePostgresUpdatePayloadImpl.fromJson; @override String get schema; @@ -586,14 +673,16 @@ abstract class _RealtimePostgresUpdatePayload /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RealtimePostgresUpdatePayloadImplCopyWith> - get copyWith => throw _privateConstructorUsedError; + _$$RealtimePostgresUpdatePayloadImplCopyWith< + T, + _$RealtimePostgresUpdatePayloadImpl + > + get copyWith => throw _privateConstructorUsedError; } -RealtimePostgresDeletePayload - _$RealtimePostgresDeletePayloadFromJson( - Map json, T Function(Object?) fromJsonT) { +RealtimePostgresDeletePayload _$RealtimePostgresDeletePayloadFromJson< + T extends V1Database +>(Map json, T Function(Object?) fromJsonT) { return _RealtimePostgresDeletePayload.fromJson(json, fromJsonT); } @@ -615,29 +704,39 @@ mixin _$RealtimePostgresDeletePayload { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $RealtimePostgresDeletePayloadCopyWith> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $RealtimePostgresDeletePayloadCopyWith { +abstract class $RealtimePostgresDeletePayloadCopyWith< + T extends V1Database, + $Res +> { factory $RealtimePostgresDeletePayloadCopyWith( - RealtimePostgresDeletePayload value, - $Res Function(RealtimePostgresDeletePayload) then) = - _$RealtimePostgresDeletePayloadCopyWithImpl>; + RealtimePostgresDeletePayload value, + $Res Function(RealtimePostgresDeletePayload) then, + ) = + _$RealtimePostgresDeletePayloadCopyWithImpl< + T, + $Res, + RealtimePostgresDeletePayload + >; @useResult - $Res call( - {String schema, - String table, - DateTime commitTimestamp, - List? errors, - Map? old}); + $Res call({ + String schema, + String table, + DateTime commitTimestamp, + List? errors, + Map? old, + }); } /// @nodoc -class _$RealtimePostgresDeletePayloadCopyWithImpl> +class _$RealtimePostgresDeletePayloadCopyWithImpl< + T extends V1Database, + $Res, + $Val extends RealtimePostgresDeletePayload +> implements $RealtimePostgresDeletePayloadCopyWith { _$RealtimePostgresDeletePayloadCopyWithImpl(this._value, this._then); @@ -657,59 +756,76 @@ class _$RealtimePostgresDeletePayloadCopyWithImpl?, - old: freezed == old - ? _value.old - : old // ignore: cast_nullable_to_non_nullable - as Map?, - ) as $Val); + return _then( + _value.copyWith( + schema: + null == schema + ? _value.schema + : schema // ignore: cast_nullable_to_non_nullable + as String, + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as String, + commitTimestamp: + null == commitTimestamp + ? _value.commitTimestamp + : commitTimestamp // ignore: cast_nullable_to_non_nullable + as DateTime, + errors: + freezed == errors + ? _value.errors + : errors // ignore: cast_nullable_to_non_nullable + as List?, + old: + freezed == old + ? _value.old + : old // ignore: cast_nullable_to_non_nullable + as Map?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$RealtimePostgresDeletePayloadImplCopyWith< - T extends V1Database, - $Res> implements $RealtimePostgresDeletePayloadCopyWith { + T extends V1Database, + $Res +> + implements $RealtimePostgresDeletePayloadCopyWith { factory _$$RealtimePostgresDeletePayloadImplCopyWith( - _$RealtimePostgresDeletePayloadImpl value, - $Res Function(_$RealtimePostgresDeletePayloadImpl) then) = - __$$RealtimePostgresDeletePayloadImplCopyWithImpl; + _$RealtimePostgresDeletePayloadImpl value, + $Res Function(_$RealtimePostgresDeletePayloadImpl) then, + ) = __$$RealtimePostgresDeletePayloadImplCopyWithImpl; @override @useResult - $Res call( - {String schema, - String table, - DateTime commitTimestamp, - List? errors, - Map? old}); + $Res call({ + String schema, + String table, + DateTime commitTimestamp, + List? errors, + Map? old, + }); } /// @nodoc -class __$$RealtimePostgresDeletePayloadImplCopyWithImpl - extends _$RealtimePostgresDeletePayloadCopyWithImpl> +class __$$RealtimePostgresDeletePayloadImplCopyWithImpl< + T extends V1Database, + $Res +> + extends + _$RealtimePostgresDeletePayloadCopyWithImpl< + T, + $Res, + _$RealtimePostgresDeletePayloadImpl + > implements _$$RealtimePostgresDeletePayloadImplCopyWith { __$$RealtimePostgresDeletePayloadImplCopyWithImpl( - _$RealtimePostgresDeletePayloadImpl _value, - $Res Function(_$RealtimePostgresDeletePayloadImpl) _then) - : super(_value, _then); + _$RealtimePostgresDeletePayloadImpl _value, + $Res Function(_$RealtimePostgresDeletePayloadImpl) _then, + ) : super(_value, _then); /// Create a copy of RealtimePostgresDeletePayload /// with the given fields replaced by the non-null parameter values. @@ -722,28 +838,35 @@ class __$$RealtimePostgresDeletePayloadImplCopyWithImpl( - schema: null == schema - ? _value.schema - : schema // ignore: cast_nullable_to_non_nullable - as String, - table: null == table - ? _value.table - : table // ignore: cast_nullable_to_non_nullable - as String, - commitTimestamp: null == commitTimestamp - ? _value.commitTimestamp - : commitTimestamp // ignore: cast_nullable_to_non_nullable - as DateTime, - errors: freezed == errors - ? _value._errors - : errors // ignore: cast_nullable_to_non_nullable - as List?, - old: freezed == old - ? _value._old - : old // ignore: cast_nullable_to_non_nullable - as Map?, - )); + return _then( + _$RealtimePostgresDeletePayloadImpl( + schema: + null == schema + ? _value.schema + : schema // ignore: cast_nullable_to_non_nullable + as String, + table: + null == table + ? _value.table + : table // ignore: cast_nullable_to_non_nullable + as String, + commitTimestamp: + null == commitTimestamp + ? _value.commitTimestamp + : commitTimestamp // ignore: cast_nullable_to_non_nullable + as DateTime, + errors: + freezed == errors + ? _value._errors + : errors // ignore: cast_nullable_to_non_nullable + as List?, + old: + freezed == old + ? _value._old + : old // ignore: cast_nullable_to_non_nullable + as Map?, + ), + ); } } @@ -751,18 +874,19 @@ class __$$RealtimePostgresDeletePayloadImplCopyWithImpl implements _RealtimePostgresDeletePayload { - const _$RealtimePostgresDeletePayloadImpl( - {required this.schema, - required this.table, - required this.commitTimestamp, - required final List? errors, - required final Map? old}) - : _errors = errors, - _old = old; + const _$RealtimePostgresDeletePayloadImpl({ + required this.schema, + required this.table, + required this.commitTimestamp, + required final List? errors, + required final Map? old, + }) : _errors = errors, + _old = old; factory _$RealtimePostgresDeletePayloadImpl.fromJson( - Map json, T Function(Object?) fromJsonT) => - _$$RealtimePostgresDeletePayloadImplFromJson(json, fromJsonT); + Map json, + T Function(Object?) fromJsonT, + ) => _$$RealtimePostgresDeletePayloadImplFromJson(json, fromJsonT); @override final String schema; @@ -814,22 +938,27 @@ class _$RealtimePostgresDeletePayloadImpl @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - schema, - table, - commitTimestamp, - const DeepCollectionEquality().hash(_errors), - const DeepCollectionEquality().hash(_old)); + runtimeType, + schema, + table, + commitTimestamp, + const DeepCollectionEquality().hash(_errors), + const DeepCollectionEquality().hash(_old), + ); /// Create a copy of RealtimePostgresDeletePayload /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$RealtimePostgresDeletePayloadImplCopyWith> - get copyWith => __$$RealtimePostgresDeletePayloadImplCopyWithImpl>(this, _$identity); + _$$RealtimePostgresDeletePayloadImplCopyWith< + T, + _$RealtimePostgresDeletePayloadImpl + > + get copyWith => __$$RealtimePostgresDeletePayloadImplCopyWithImpl< + T, + _$RealtimePostgresDeletePayloadImpl + >(this, _$identity); @override Map toJson(Object? Function(T) toJsonT) { @@ -839,17 +968,18 @@ class _$RealtimePostgresDeletePayloadImpl abstract class _RealtimePostgresDeletePayload implements RealtimePostgresDeletePayload { - const factory _RealtimePostgresDeletePayload( - {required final String schema, - required final String table, - required final DateTime commitTimestamp, - required final List? errors, - required final Map? old}) = - _$RealtimePostgresDeletePayloadImpl; + const factory _RealtimePostgresDeletePayload({ + required final String schema, + required final String table, + required final DateTime commitTimestamp, + required final List? errors, + required final Map? old, + }) = _$RealtimePostgresDeletePayloadImpl; factory _RealtimePostgresDeletePayload.fromJson( - Map json, T Function(Object?) fromJsonT) = - _$RealtimePostgresDeletePayloadImpl.fromJson; + Map json, + T Function(Object?) fromJsonT, + ) = _$RealtimePostgresDeletePayloadImpl.fromJson; @override String get schema; @@ -868,7 +998,9 @@ abstract class _RealtimePostgresDeletePayload /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) - _$$RealtimePostgresDeletePayloadImplCopyWith> - get copyWith => throw _privateConstructorUsedError; + _$$RealtimePostgresDeletePayloadImplCopyWith< + T, + _$RealtimePostgresDeletePayloadImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.g.dart b/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.g.dart index b16111d4..8b38674e 100644 --- a/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/websocket/realtime_postgres_changes_payload.g.dart @@ -9,123 +9,117 @@ part of 'realtime_postgres_changes_payload.dart'; // ************************************************************************** _$RealtimePostgresInsertPayloadImpl - _$$RealtimePostgresInsertPayloadImplFromJson( +_$$RealtimePostgresInsertPayloadImplFromJson( Map json, T Function(Object? json) fromJsonT, -) => - $checkedCreate( - r'_$RealtimePostgresInsertPayloadImpl', - json, - ($checkedConvert) { - final val = _$RealtimePostgresInsertPayloadImpl( - schema: $checkedConvert('schema', (v) => v as String), - table: $checkedConvert('table', (v) => v as String), - commitTimestamp: $checkedConvert( - 'commit_timestamp', (v) => DateTime.parse(v as String)), - errors: $checkedConvert( - 'errors', - (v) => - (v as List?)?.map((e) => e as String).toList()), - newData: $checkedConvert('new', (v) => fromJsonT(v)), - ); - return val; - }, - fieldKeyMap: const { - 'commitTimestamp': 'commit_timestamp', - 'newData': 'new' - }, - ); +) => $checkedCreate( + r'_$RealtimePostgresInsertPayloadImpl', + json, + ($checkedConvert) { + final val = _$RealtimePostgresInsertPayloadImpl( + schema: $checkedConvert('schema', (v) => v as String), + table: $checkedConvert('table', (v) => v as String), + commitTimestamp: $checkedConvert( + 'commit_timestamp', + (v) => DateTime.parse(v as String), + ), + errors: $checkedConvert( + 'errors', + (v) => (v as List?)?.map((e) => e as String).toList(), + ), + newData: $checkedConvert('new', (v) => fromJsonT(v)), + ); + return val; + }, + fieldKeyMap: const {'commitTimestamp': 'commit_timestamp', 'newData': 'new'}, +); Map - _$$RealtimePostgresInsertPayloadImplToJson( +_$$RealtimePostgresInsertPayloadImplToJson( _$RealtimePostgresInsertPayloadImpl instance, Object? Function(T value) toJsonT, -) => - { - 'schema': instance.schema, - 'table': instance.table, - 'commit_timestamp': instance.commitTimestamp.toIso8601String(), - 'errors': instance.errors, - 'new': toJsonT(instance.newData), - }; +) => { + 'schema': instance.schema, + 'table': instance.table, + 'commit_timestamp': instance.commitTimestamp.toIso8601String(), + 'errors': instance.errors, + 'new': toJsonT(instance.newData), +}; _$RealtimePostgresUpdatePayloadImpl - _$$RealtimePostgresUpdatePayloadImplFromJson( +_$$RealtimePostgresUpdatePayloadImplFromJson( Map json, T Function(Object? json) fromJsonT, -) => - $checkedCreate( - r'_$RealtimePostgresUpdatePayloadImpl', - json, - ($checkedConvert) { - final val = _$RealtimePostgresUpdatePayloadImpl( - schema: $checkedConvert('schema', (v) => v as String), - table: $checkedConvert('table', (v) => v as String), - commitTimestamp: $checkedConvert( - 'commit_timestamp', (v) => DateTime.parse(v as String)), - errors: $checkedConvert( - 'errors', - (v) => - (v as List?)?.map((e) => e as String).toList()), - newData: $checkedConvert('new', (v) => fromJsonT(v)), - old: $checkedConvert('old', (v) => v as Map?), - ); - return val; - }, - fieldKeyMap: const { - 'commitTimestamp': 'commit_timestamp', - 'newData': 'new' - }, - ); +) => $checkedCreate( + r'_$RealtimePostgresUpdatePayloadImpl', + json, + ($checkedConvert) { + final val = _$RealtimePostgresUpdatePayloadImpl( + schema: $checkedConvert('schema', (v) => v as String), + table: $checkedConvert('table', (v) => v as String), + commitTimestamp: $checkedConvert( + 'commit_timestamp', + (v) => DateTime.parse(v as String), + ), + errors: $checkedConvert( + 'errors', + (v) => (v as List?)?.map((e) => e as String).toList(), + ), + newData: $checkedConvert('new', (v) => fromJsonT(v)), + old: $checkedConvert('old', (v) => v as Map?), + ); + return val; + }, + fieldKeyMap: const {'commitTimestamp': 'commit_timestamp', 'newData': 'new'}, +); Map - _$$RealtimePostgresUpdatePayloadImplToJson( +_$$RealtimePostgresUpdatePayloadImplToJson( _$RealtimePostgresUpdatePayloadImpl instance, Object? Function(T value) toJsonT, -) => - { - 'schema': instance.schema, - 'table': instance.table, - 'commit_timestamp': instance.commitTimestamp.toIso8601String(), - 'errors': instance.errors, - 'new': toJsonT(instance.newData), - 'old': instance.old, - }; +) => { + 'schema': instance.schema, + 'table': instance.table, + 'commit_timestamp': instance.commitTimestamp.toIso8601String(), + 'errors': instance.errors, + 'new': toJsonT(instance.newData), + 'old': instance.old, +}; _$RealtimePostgresDeletePayloadImpl - _$$RealtimePostgresDeletePayloadImplFromJson( +_$$RealtimePostgresDeletePayloadImplFromJson( Map json, T Function(Object? json) fromJsonT, -) => - $checkedCreate( - r'_$RealtimePostgresDeletePayloadImpl', - json, - ($checkedConvert) { - final val = _$RealtimePostgresDeletePayloadImpl( - schema: $checkedConvert('schema', (v) => v as String), - table: $checkedConvert('table', (v) => v as String), - commitTimestamp: $checkedConvert( - 'commit_timestamp', (v) => DateTime.parse(v as String)), - errors: $checkedConvert( - 'errors', - (v) => - (v as List?)?.map((e) => e as String).toList()), - old: $checkedConvert('old', (v) => v as Map?), - ); - return val; - }, - fieldKeyMap: const {'commitTimestamp': 'commit_timestamp'}, - ); +) => $checkedCreate( + r'_$RealtimePostgresDeletePayloadImpl', + json, + ($checkedConvert) { + final val = _$RealtimePostgresDeletePayloadImpl( + schema: $checkedConvert('schema', (v) => v as String), + table: $checkedConvert('table', (v) => v as String), + commitTimestamp: $checkedConvert( + 'commit_timestamp', + (v) => DateTime.parse(v as String), + ), + errors: $checkedConvert( + 'errors', + (v) => (v as List?)?.map((e) => e as String).toList(), + ), + old: $checkedConvert('old', (v) => v as Map?), + ); + return val; + }, + fieldKeyMap: const {'commitTimestamp': 'commit_timestamp'}, +); Map - _$$RealtimePostgresDeletePayloadImplToJson( +_$$RealtimePostgresDeletePayloadImplToJson( _$RealtimePostgresDeletePayloadImpl instance, Object? Function(T value) toJsonT, -) => - { - 'schema': instance.schema, - 'table': instance.table, - 'commit_timestamp': instance.commitTimestamp.toIso8601String(), - 'errors': instance.errors, - 'old': instance.old, - }; +) => { + 'schema': instance.schema, + 'table': instance.table, + 'commit_timestamp': instance.commitTimestamp.toIso8601String(), + 'errors': instance.errors, + 'old': instance.old, +}; diff --git a/packages/eqapi_types/lib/src/model/v3/information_v3.dart b/packages/eqapi_types/lib/src/model/v3/information_v3.dart index 3bda79ea..8f9c0d05 100644 --- a/packages/eqapi_types/lib/src/model/v3/information_v3.dart +++ b/packages/eqapi_types/lib/src/model/v3/information_v3.dart @@ -5,9 +5,8 @@ part 'information_v3.g.dart'; @freezed class InformationV3Result with _$InformationV3Result { - const factory InformationV3Result({ - required List items, - }) = _InformationV3Result; + const factory InformationV3Result({required List items}) = + _InformationV3Result; factory InformationV3Result.fromJson(Map json) => _$InformationV3ResultFromJson(json); @@ -32,19 +31,13 @@ class InformationV3 with _$InformationV3 { enum Author { developer('開発者'), jma('気象庁'), - unknown('不明'), - ; + unknown('不明'); const Author(this.name); final String name; } -enum Level { - info, - warning, - critical, - ; -} +enum Level { info, warning, critical } String tagToString(List tag) { return tag.join(','); diff --git a/packages/eqapi_types/lib/src/model/v3/information_v3.freezed.dart b/packages/eqapi_types/lib/src/model/v3/information_v3.freezed.dart index ae6b7c56..7ad510bf 100644 --- a/packages/eqapi_types/lib/src/model/v3/information_v3.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v3/information_v3.freezed.dart @@ -12,7 +12,8 @@ part of 'information_v3.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); InformationV3Result _$InformationV3ResultFromJson(Map json) { return _InformationV3Result.fromJson(json); @@ -35,8 +36,9 @@ mixin _$InformationV3Result { /// @nodoc abstract class $InformationV3ResultCopyWith<$Res> { factory $InformationV3ResultCopyWith( - InformationV3Result value, $Res Function(InformationV3Result) then) = - _$InformationV3ResultCopyWithImpl<$Res, InformationV3Result>; + InformationV3Result value, + $Res Function(InformationV3Result) then, + ) = _$InformationV3ResultCopyWithImpl<$Res, InformationV3Result>; @useResult $Res call({List items}); } @@ -55,24 +57,27 @@ class _$InformationV3ResultCopyWithImpl<$Res, $Val extends InformationV3Result> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? items = null, - }) { - return _then(_value.copyWith( - items: null == items - ? _value.items - : items // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + $Res call({Object? items = null}) { + return _then( + _value.copyWith( + items: + null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$InformationV3ResultImplCopyWith<$Res> implements $InformationV3ResultCopyWith<$Res> { - factory _$$InformationV3ResultImplCopyWith(_$InformationV3ResultImpl value, - $Res Function(_$InformationV3ResultImpl) then) = - __$$InformationV3ResultImplCopyWithImpl<$Res>; + factory _$$InformationV3ResultImplCopyWith( + _$InformationV3ResultImpl value, + $Res Function(_$InformationV3ResultImpl) then, + ) = __$$InformationV3ResultImplCopyWithImpl<$Res>; @override @useResult $Res call({List items}); @@ -82,23 +87,25 @@ abstract class _$$InformationV3ResultImplCopyWith<$Res> class __$$InformationV3ResultImplCopyWithImpl<$Res> extends _$InformationV3ResultCopyWithImpl<$Res, _$InformationV3ResultImpl> implements _$$InformationV3ResultImplCopyWith<$Res> { - __$$InformationV3ResultImplCopyWithImpl(_$InformationV3ResultImpl _value, - $Res Function(_$InformationV3ResultImpl) _then) - : super(_value, _then); + __$$InformationV3ResultImplCopyWithImpl( + _$InformationV3ResultImpl _value, + $Res Function(_$InformationV3ResultImpl) _then, + ) : super(_value, _then); /// Create a copy of InformationV3Result /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? items = null, - }) { - return _then(_$InformationV3ResultImpl( - items: null == items - ? _value._items - : items // ignore: cast_nullable_to_non_nullable - as List, - )); + $Res call({Object? items = null}) { + return _then( + _$InformationV3ResultImpl( + items: + null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } @@ -106,7 +113,7 @@ class __$$InformationV3ResultImplCopyWithImpl<$Res> @JsonSerializable() class _$InformationV3ResultImpl implements _InformationV3Result { const _$InformationV3ResultImpl({required final List items}) - : _items = items; + : _items = items; factory _$InformationV3ResultImpl.fromJson(Map json) => _$$InformationV3ResultImplFromJson(json); @@ -144,19 +151,20 @@ class _$InformationV3ResultImpl implements _InformationV3Result { @pragma('vm:prefer-inline') _$$InformationV3ResultImplCopyWith<_$InformationV3ResultImpl> get copyWith => __$$InformationV3ResultImplCopyWithImpl<_$InformationV3ResultImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$InformationV3ResultImplToJson( - this, - ); + return _$$InformationV3ResultImplToJson(this); } } abstract class _InformationV3Result implements InformationV3Result { - const factory _InformationV3Result( - {required final List items}) = _$InformationV3ResultImpl; + const factory _InformationV3Result({ + required final List items, + }) = _$InformationV3ResultImpl; factory _InformationV3Result.fromJson(Map json) = _$InformationV3ResultImpl.fromJson; @@ -202,17 +210,19 @@ mixin _$InformationV3 { /// @nodoc abstract class $InformationV3CopyWith<$Res> { factory $InformationV3CopyWith( - InformationV3 value, $Res Function(InformationV3) then) = - _$InformationV3CopyWithImpl<$Res, InformationV3>; + InformationV3 value, + $Res Function(InformationV3) then, + ) = _$InformationV3CopyWithImpl<$Res, InformationV3>; @useResult - $Res call( - {int id, - String title, - String body, - @JsonKey(unknownEnumValue: Author.unknown) Author author, - @JsonKey(name: 'createdAt') DateTime createdAt, - @JsonKey(unknownEnumValue: Level.info) Level level, - int? eventId}); + $Res call({ + int id, + String title, + String body, + @JsonKey(unknownEnumValue: Author.unknown) Author author, + @JsonKey(name: 'createdAt') DateTime createdAt, + @JsonKey(unknownEnumValue: Level.info) Level level, + int? eventId, + }); } /// @nodoc @@ -238,36 +248,46 @@ class _$InformationV3CopyWithImpl<$Res, $Val extends InformationV3> Object? level = null, Object? eventId = freezed, }) { - return _then(_value.copyWith( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - body: null == body - ? _value.body - : body // ignore: cast_nullable_to_non_nullable - as String, - author: null == author - ? _value.author - : author // ignore: cast_nullable_to_non_nullable - as Author, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - level: null == level - ? _value.level - : level // ignore: cast_nullable_to_non_nullable - as Level, - eventId: freezed == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int?, - ) as $Val); + return _then( + _value.copyWith( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + body: + null == body + ? _value.body + : body // ignore: cast_nullable_to_non_nullable + as String, + author: + null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + level: + null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as Level, + eventId: + freezed == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int?, + ) + as $Val, + ); } } @@ -275,18 +295,20 @@ class _$InformationV3CopyWithImpl<$Res, $Val extends InformationV3> abstract class _$$InformationV3ImplCopyWith<$Res> implements $InformationV3CopyWith<$Res> { factory _$$InformationV3ImplCopyWith( - _$InformationV3Impl value, $Res Function(_$InformationV3Impl) then) = - __$$InformationV3ImplCopyWithImpl<$Res>; + _$InformationV3Impl value, + $Res Function(_$InformationV3Impl) then, + ) = __$$InformationV3ImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int id, - String title, - String body, - @JsonKey(unknownEnumValue: Author.unknown) Author author, - @JsonKey(name: 'createdAt') DateTime createdAt, - @JsonKey(unknownEnumValue: Level.info) Level level, - int? eventId}); + $Res call({ + int id, + String title, + String body, + @JsonKey(unknownEnumValue: Author.unknown) Author author, + @JsonKey(name: 'createdAt') DateTime createdAt, + @JsonKey(unknownEnumValue: Level.info) Level level, + int? eventId, + }); } /// @nodoc @@ -294,8 +316,9 @@ class __$$InformationV3ImplCopyWithImpl<$Res> extends _$InformationV3CopyWithImpl<$Res, _$InformationV3Impl> implements _$$InformationV3ImplCopyWith<$Res> { __$$InformationV3ImplCopyWithImpl( - _$InformationV3Impl _value, $Res Function(_$InformationV3Impl) _then) - : super(_value, _then); + _$InformationV3Impl _value, + $Res Function(_$InformationV3Impl) _then, + ) : super(_value, _then); /// Create a copy of InformationV3 /// with the given fields replaced by the non-null parameter values. @@ -310,50 +333,60 @@ class __$$InformationV3ImplCopyWithImpl<$Res> Object? level = null, Object? eventId = freezed, }) { - return _then(_$InformationV3Impl( - id: null == id - ? _value.id - : id // ignore: cast_nullable_to_non_nullable - as int, - title: null == title - ? _value.title - : title // ignore: cast_nullable_to_non_nullable - as String, - body: null == body - ? _value.body - : body // ignore: cast_nullable_to_non_nullable - as String, - author: null == author - ? _value.author - : author // ignore: cast_nullable_to_non_nullable - as Author, - createdAt: null == createdAt - ? _value.createdAt - : createdAt // ignore: cast_nullable_to_non_nullable - as DateTime, - level: null == level - ? _value.level - : level // ignore: cast_nullable_to_non_nullable - as Level, - eventId: freezed == eventId - ? _value.eventId - : eventId // ignore: cast_nullable_to_non_nullable - as int?, - )); + return _then( + _$InformationV3Impl( + id: + null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + title: + null == title + ? _value.title + : title // ignore: cast_nullable_to_non_nullable + as String, + body: + null == body + ? _value.body + : body // ignore: cast_nullable_to_non_nullable + as String, + author: + null == author + ? _value.author + : author // ignore: cast_nullable_to_non_nullable + as Author, + createdAt: + null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + level: + null == level + ? _value.level + : level // ignore: cast_nullable_to_non_nullable + as Level, + eventId: + freezed == eventId + ? _value.eventId + : eventId // ignore: cast_nullable_to_non_nullable + as int?, + ), + ); } } /// @nodoc @JsonSerializable() class _$InformationV3Impl implements _InformationV3 { - const _$InformationV3Impl( - {required this.id, - required this.title, - required this.body, - @JsonKey(unknownEnumValue: Author.unknown) required this.author, - @JsonKey(name: 'createdAt') required this.createdAt, - @JsonKey(unknownEnumValue: Level.info) required this.level, - required this.eventId}); + const _$InformationV3Impl({ + required this.id, + required this.title, + required this.body, + @JsonKey(unknownEnumValue: Author.unknown) required this.author, + @JsonKey(name: 'createdAt') required this.createdAt, + @JsonKey(unknownEnumValue: Level.info) required this.level, + required this.eventId, + }); factory _$InformationV3Impl.fromJson(Map json) => _$$InformationV3ImplFromJson(json); @@ -399,7 +432,15 @@ class _$InformationV3Impl implements _InformationV3 { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, id, title, body, author, createdAt, level, eventId); + runtimeType, + id, + title, + body, + author, + createdAt, + level, + eventId, + ); /// Create a copy of InformationV3 /// with the given fields replaced by the non-null parameter values. @@ -411,21 +452,20 @@ class _$InformationV3Impl implements _InformationV3 { @override Map toJson() { - return _$$InformationV3ImplToJson( - this, - ); + return _$$InformationV3ImplToJson(this); } } abstract class _InformationV3 implements InformationV3 { - const factory _InformationV3( - {required final int id, - required final String title, - required final String body, - @JsonKey(unknownEnumValue: Author.unknown) required final Author author, - @JsonKey(name: 'createdAt') required final DateTime createdAt, - @JsonKey(unknownEnumValue: Level.info) required final Level level, - required final int? eventId}) = _$InformationV3Impl; + const factory _InformationV3({ + required final int id, + required final String title, + required final String body, + @JsonKey(unknownEnumValue: Author.unknown) required final Author author, + @JsonKey(name: 'createdAt') required final DateTime createdAt, + @JsonKey(unknownEnumValue: Level.info) required final Level level, + required final int? eventId, + }) = _$InformationV3Impl; factory _InformationV3.fromJson(Map json) = _$InformationV3Impl.fromJson; diff --git a/packages/eqapi_types/lib/src/model/v3/information_v3.g.dart b/packages/eqapi_types/lib/src/model/v3/information_v3.g.dart index 188d21ee..e6a455f1 100644 --- a/packages/eqapi_types/lib/src/model/v3/information_v3.g.dart +++ b/packages/eqapi_types/lib/src/model/v3/information_v3.g.dart @@ -9,51 +9,46 @@ part of 'information_v3.dart'; // ************************************************************************** _$InformationV3ResultImpl _$$InformationV3ResultImplFromJson( - Map json) => - $checkedCreate( - r'_$InformationV3ResultImpl', - json, - ($checkedConvert) { - final val = _$InformationV3ResultImpl( - items: $checkedConvert( - 'items', - (v) => (v as List) - .map((e) => InformationV3.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$InformationV3ResultImpl', json, ($checkedConvert) { + final val = _$InformationV3ResultImpl( + items: $checkedConvert( + 'items', + (v) => + (v as List) + .map((e) => InformationV3.fromJson(e as Map)) + .toList(), + ), + ); + return val; +}); Map _$$InformationV3ResultImplToJson( - _$InformationV3ResultImpl instance) => - { - 'items': instance.items, - }; + _$InformationV3ResultImpl instance, +) => {'items': instance.items}; _$InformationV3Impl _$$InformationV3ImplFromJson(Map json) => - $checkedCreate( - r'_$InformationV3Impl', - json, - ($checkedConvert) { - final val = _$InformationV3Impl( - id: $checkedConvert('id', (v) => (v as num).toInt()), - title: $checkedConvert('title', (v) => v as String), - body: $checkedConvert('body', (v) => v as String), - author: $checkedConvert( - 'author', - (v) => $enumDecode(_$AuthorEnumMap, v, - unknownValue: Author.unknown)), - createdAt: - $checkedConvert('createdAt', (v) => DateTime.parse(v as String)), - level: $checkedConvert('level', - (v) => $enumDecode(_$LevelEnumMap, v, unknownValue: Level.info)), - eventId: $checkedConvert('event_id', (v) => (v as num?)?.toInt()), - ); - return val; - }, - fieldKeyMap: const {'eventId': 'event_id'}, - ); + $checkedCreate(r'_$InformationV3Impl', json, ($checkedConvert) { + final val = _$InformationV3Impl( + id: $checkedConvert('id', (v) => (v as num).toInt()), + title: $checkedConvert('title', (v) => v as String), + body: $checkedConvert('body', (v) => v as String), + author: $checkedConvert( + 'author', + (v) => $enumDecode(_$AuthorEnumMap, v, unknownValue: Author.unknown), + ), + createdAt: $checkedConvert( + 'createdAt', + (v) => DateTime.parse(v as String), + ), + level: $checkedConvert( + 'level', + (v) => $enumDecode(_$LevelEnumMap, v, unknownValue: Level.info), + ), + eventId: $checkedConvert('event_id', (v) => (v as num?)?.toInt()), + ); + return val; + }, fieldKeyMap: const {'eventId': 'event_id'}); Map _$$InformationV3ImplToJson(_$InformationV3Impl instance) => { diff --git a/packages/eqapi_types/test/src/model/v1/earthquake_test.dart b/packages/eqapi_types/test/src/model/v1/earthquake_test.dart index c25350ca..a007e284 100644 --- a/packages/eqapi_types/test/src/model/v1/earthquake_test.dart +++ b/packages/eqapi_types/test/src/model/v1/earthquake_test.dart @@ -4,117 +4,105 @@ import 'package:eqapi_types/eqapi_types.dart'; import 'package:test/test.dart'; void main() { - group( - 'EarthquakeV1', - () { - final json = { - 'event_id': 20240222185554, - 'status': '通常', - 'magnitude': 2, - 'magnitude_condition': null, - 'max_intensity': '1', - 'max_lpgm_intensity': null, - 'depth': 10, - 'latitude': 37.5, - 'longitude': 137.2, - 'epicenter_code': 390, - 'epicenter_detail_code': null, - 'arrival_time': '2024-02-22T09:55:00.000Z', - 'origin_time': '2024-02-22T09:55:00.000Z', - 'headline': '22日18時55分ころ、地震がありました。', - 'text': 'この地震による津波の心配はありません。', - 'max_intensity_region_ids': [390], - 'intensity_regions': [ - {'code': '390', 'name': '石川県能登', 'maxInt': '1'}, - ], - 'intensity_prefectures': [ - {'code': '17', 'name': '石川県', 'maxInt': '1'}, - ], - 'intensity_cities': [ - {'code': '1720500', 'name': '珠洲市', 'maxInt': '1'}, - ], - 'intensity_stations': [ - {'code': '1720521', 'name': '珠洲市大谷町*', 'maxInt': '1'}, - ], - 'lpgm_intensity_prefectures': null, - 'lpgm_intensity_regions': null, - 'lpgm_intenstiy_stations': null, - }; - test( - 'fromJsonが正常に動作すること', - () { - // Arrange - // Act - final object = EarthquakeV1.fromJson(json); - // Assert - expect(object, isNotNull); - expect(object.eventId, 20240222185554); - expect(object.status, '通常'); - expect(object.magnitude, 2); - expect(object.magnitudeCondition, null); - expect(object.maxIntensity, JmaIntensity.one); - expect(object.maxLpgmIntensity, null); - expect(object.depth, 10); - expect(object.latitude, 37.5); - expect(object.longitude, 137.2); - expect(object.epicenterCode, 390); - expect(object.epicenterDetailCode, null); - expect( - object.arrivalTime, - DateTime.parse('2024-02-22T09:55:00.000Z'), - ); - expect( - object.originTime, - DateTime.parse('2024-02-22T09:55:00.000Z'), - ); - expect(object.headline, '22日18時55分ころ、地震がありました。'); - expect(object.text, 'この地震による津波の心配はありません。'); - expect(object.maxIntensityRegionIds, [390]); - expect( - object.intensityRegions?.first, - const ObservedRegionIntensity( - code: '390', - name: '石川県能登', - intensity: JmaIntensity.one, - ), - ); - expect( - object.intensityPrefectures?.first, - const ObservedRegionIntensity( - code: '17', - name: '石川県', - intensity: JmaIntensity.one, - ), - ); - expect( - object.intensityCities?.first, - const ObservedRegionIntensity( - code: '1720500', - name: '珠洲市', - intensity: JmaIntensity.one, - ), - ); - expect( - object.intensityStations?.first, - const ObservedRegionIntensity( - code: '1720521', - name: '珠洲市大谷町*', - intensity: JmaIntensity.one, - ), - ); - expect(object.lpgmIntensityPrefectures, null); - expect(object.lpgmIntensityRegions, null); - expect(object.lpgmIntenstiyStations, null); - }, + group('EarthquakeV1', () { + final json = { + 'event_id': 20240222185554, + 'status': '通常', + 'magnitude': 2, + 'magnitude_condition': null, + 'max_intensity': '1', + 'max_lpgm_intensity': null, + 'depth': 10, + 'latitude': 37.5, + 'longitude': 137.2, + 'epicenter_code': 390, + 'epicenter_detail_code': null, + 'arrival_time': '2024-02-22T09:55:00.000Z', + 'origin_time': '2024-02-22T09:55:00.000Z', + 'headline': '22日18時55分ころ、地震がありました。', + 'text': 'この地震による津波の心配はありません。', + 'max_intensity_region_ids': [390], + 'intensity_regions': [ + {'code': '390', 'name': '石川県能登', 'maxInt': '1'}, + ], + 'intensity_prefectures': [ + {'code': '17', 'name': '石川県', 'maxInt': '1'}, + ], + 'intensity_cities': [ + {'code': '1720500', 'name': '珠洲市', 'maxInt': '1'}, + ], + 'intensity_stations': [ + {'code': '1720521', 'name': '珠洲市大谷町*', 'maxInt': '1'}, + ], + 'lpgm_intensity_prefectures': null, + 'lpgm_intensity_regions': null, + 'lpgm_intenstiy_stations': null, + }; + test('fromJsonが正常に動作すること', () { + // Arrange + // Act + final object = EarthquakeV1.fromJson(json); + // Assert + expect(object, isNotNull); + expect(object.eventId, 20240222185554); + expect(object.status, '通常'); + expect(object.magnitude, 2); + expect(object.magnitudeCondition, null); + expect(object.maxIntensity, JmaIntensity.one); + expect(object.maxLpgmIntensity, null); + expect(object.depth, 10); + expect(object.latitude, 37.5); + expect(object.longitude, 137.2); + expect(object.epicenterCode, 390); + expect(object.epicenterDetailCode, null); + expect(object.arrivalTime, DateTime.parse('2024-02-22T09:55:00.000Z')); + expect(object.originTime, DateTime.parse('2024-02-22T09:55:00.000Z')); + expect(object.headline, '22日18時55分ころ、地震がありました。'); + expect(object.text, 'この地震による津波の心配はありません。'); + expect(object.maxIntensityRegionIds, [390]); + expect( + object.intensityRegions?.first, + const ObservedRegionIntensity( + code: '390', + name: '石川県能登', + intensity: JmaIntensity.one, + ), ); - test('fromJsonの元JSONは、toJsonで再変換できること', () { - // Arrange - final object = EarthquakeV1.fromJson(json); - // Act - final json2 = jsonEncode(object.toJson()); - // Assert - expect(json, jsonDecode(json2)); - }); - }, - ); + expect( + object.intensityPrefectures?.first, + const ObservedRegionIntensity( + code: '17', + name: '石川県', + intensity: JmaIntensity.one, + ), + ); + expect( + object.intensityCities?.first, + const ObservedRegionIntensity( + code: '1720500', + name: '珠洲市', + intensity: JmaIntensity.one, + ), + ); + expect( + object.intensityStations?.first, + const ObservedRegionIntensity( + code: '1720521', + name: '珠洲市大谷町*', + intensity: JmaIntensity.one, + ), + ); + expect(object.lpgmIntensityPrefectures, null); + expect(object.lpgmIntensityRegions, null); + expect(object.lpgmIntenstiyStations, null); + }); + test('fromJsonの元JSONは、toJsonで再変換できること', () { + // Arrange + final object = EarthquakeV1.fromJson(json); + // Act + final json2 = jsonEncode(object.toJson()); + // Assert + expect(json, jsonDecode(json2)); + }); + }); } diff --git a/packages/eqapi_types/test/src/model/v1/shake_detection_event_test.dart b/packages/eqapi_types/test/src/model/v1/shake_detection_event_test.dart index 91f3ca73..533dbe99 100644 --- a/packages/eqapi_types/test/src/model/v1/shake_detection_event_test.dart +++ b/packages/eqapi_types/test/src/model/v1/shake_detection_event_test.dart @@ -2,54 +2,51 @@ import 'package:eqapi_types/eqapi_types.dart'; import 'package:test/test.dart'; void main() { - group( - 'ShakeDetectionEvent.fromJson', - () { - const json = { - 'id': 13, - 'event_id': '4fde0e4b-7781-4ba3-988c-9a3563c1ef02', - 'serial_no': 10, - 'created_at': '2024-09-03T01:14:26.9+09:00', - 'inserted_at': '2024-09-03T01:14:58.12969+09:00', - 'max_intensity': '1', - 'regions': [ - { - 'name': '石川県', - 'points': [ - {'code': 'ISKH05', 'intensity': '1'}, - ], - 'maxIntensity': '1', - } - ], - 'top_left': {'latitude': 37.0426, 'longitude': 136.7176}, - 'bottom_right': {'latitude': 37.3924, 'longitude': 137.1471}, - 'point_count': 1, - }; + group('ShakeDetectionEvent.fromJson', () { + const json = { + 'id': 13, + 'event_id': '4fde0e4b-7781-4ba3-988c-9a3563c1ef02', + 'serial_no': 10, + 'created_at': '2024-09-03T01:14:26.9+09:00', + 'inserted_at': '2024-09-03T01:14:58.12969+09:00', + 'max_intensity': '1', + 'regions': [ + { + 'name': '石川県', + 'points': [ + {'code': 'ISKH05', 'intensity': '1'}, + ], + 'maxIntensity': '1', + }, + ], + 'top_left': {'latitude': 37.0426, 'longitude': 136.7176}, + 'bottom_right': {'latitude': 37.3924, 'longitude': 137.1471}, + 'point_count': 1, + }; - test('正常系', () { - final event = ShakeDetectionEvent.fromJson(json); - expect(event.id, 13); - expect(event.eventId, '4fde0e4b-7781-4ba3-988c-9a3563c1ef02'); - expect(event.serialNo, 10); - expect(event.createdAt, DateTime.parse('2024-09-03T01:14:26.9+09:00')); - expect( - event.insertedAt, - DateTime.parse('2024-09-03T01:14:58.12969+09:00'), - ); - expect(event.maxIntensity, JmaIntensity.one); - expect(event.regions, [ - const ShakeDetectionRegion( - name: '石川県', - maxIntensity: JmaForecastIntensity.one, - points: [ - ShakeDetectionPoint( - code: 'ISKH05', - intensity: JmaForecastIntensity.one, - ), - ], - ), - ]); - }); - }, - ); + test('正常系', () { + final event = ShakeDetectionEvent.fromJson(json); + expect(event.id, 13); + expect(event.eventId, '4fde0e4b-7781-4ba3-988c-9a3563c1ef02'); + expect(event.serialNo, 10); + expect(event.createdAt, DateTime.parse('2024-09-03T01:14:26.9+09:00')); + expect( + event.insertedAt, + DateTime.parse('2024-09-03T01:14:58.12969+09:00'), + ); + expect(event.maxIntensity, JmaIntensity.one); + expect(event.regions, [ + const ShakeDetectionRegion( + name: '石川県', + maxIntensity: JmaForecastIntensity.one, + points: [ + ShakeDetectionPoint( + code: 'ISKH05', + intensity: JmaForecastIntensity.one, + ), + ], + ), + ]); + }); + }); } diff --git a/packages/eqapi_types/test/src/model/v1/websocket/realtime_postgres_changes_payload_test.dart b/packages/eqapi_types/test/src/model/v1/websocket/realtime_postgres_changes_payload_test.dart index ee5c1364..34087f07 100644 --- a/packages/eqapi_types/test/src/model/v1/websocket/realtime_postgres_changes_payload_test.dart +++ b/packages/eqapi_types/test/src/model/v1/websocket/realtime_postgres_changes_payload_test.dart @@ -7,97 +7,80 @@ void main() { 'commit_timestamp': '2021-10-01T00:00:00Z', 'errors': [], }; - group( - 'INSERT', - () { - final insertPayload = { - ...basePayload, - 'eventType': 'INSERT', - 'old': {}, + group('INSERT', () { + final insertPayload = { + ...basePayload, + 'eventType': 'INSERT', + 'old': {}, + }; + test('EEW insert', () { + final payload = { + ...insertPayload, + 'table': 'eew', + 'new': { + 'id': 1009, + 'event_id': 20240329001440, + 'type': '緊急地震速報(地震動予報)', + 'schema_type': 'eew-information', + 'status': '通常', + 'info_type': '発表', + 'serial_no': 1, + 'headline': null, + 'is_canceled': false, + 'is_warning': false, + 'is_last_info': false, + 'origin_time': '2024-03-29T00:14:33+09:00', + 'arrival_time': '2024-03-29T00:14:40+09:00', + 'hypo_name': '能登半島沖', + 'depth': 20, + 'latitude': 37.3, + 'longitude': 136.4, + 'magnitude': 3.5, + 'forecast_max_intensity': '2', + 'forecast_max_lpgm_intensity': '0', + 'regions': [], + 'forecast_max_intensity_is_over': null, + 'forecast_max_lpgm_intensity_is_over': null, + 'report_time': '2024-03-29T00:14:33+09:00', + }, }; - test('EEW insert', () { - final payload = { - ...insertPayload, - 'table': 'eew', - 'new': { - 'id': 1009, - 'event_id': 20240329001440, - 'type': '緊急地震速報(地震動予報)', - 'schema_type': 'eew-information', - 'status': '通常', - 'info_type': '発表', - 'serial_no': 1, - 'headline': null, - 'is_canceled': false, - 'is_warning': false, - 'is_last_info': false, - 'origin_time': '2024-03-29T00:14:33+09:00', - 'arrival_time': '2024-03-29T00:14:40+09:00', - 'hypo_name': '能登半島沖', - 'depth': 20, - 'latitude': 37.3, - 'longitude': 136.4, - 'magnitude': 3.5, - 'forecast_max_intensity': '2', - 'forecast_max_lpgm_intensity': '0', - 'regions': [], - 'forecast_max_intensity_is_over': null, - 'forecast_max_lpgm_intensity_is_over': null, - 'report_time': '2024-03-29T00:14:33+09:00', - }, - }; - final result = RealtimePostgresChangesPayloadBase.fromJson(payload); - expect(result, isA>()); - }); + final result = RealtimePostgresChangesPayloadBase.fromJson(payload); + expect(result, isA>()); + }); - test( - 'ShakeDetectionEvent insert', - () { - final payload = { - ...insertPayload, - 'new': { - 'events': [ + test('ShakeDetectionEvent insert', () { + final payload = { + ...insertPayload, + 'new': { + 'events': [ + { + 'id': '59490fd7-2029-4e5e-85f9-0bbde3e70083', + 'created_at': '2024-09-03T02:58:33.9009509', + 'point_count': 1, + 'max_intensity': '0', + 'regions': [ { - 'id': '59490fd7-2029-4e5e-85f9-0bbde3e70083', - 'created_at': '2024-09-03T02:58:33.9009509', - 'point_count': 1, - 'max_intensity': '0', - 'regions': [ - { - 'name': '愛知県', - 'maxIntensity': '0', - 'points': [ - { - 'intensity': '0', - 'code': 'AICH18', - } - ], - } + 'name': '愛知県', + 'maxIntensity': '0', + 'points': [ + {'intensity': '0', 'code': 'AICH18'}, ], - 'top_left': { - 'latitude': 34.9635, - 'longitude': 136.7847, - }, - 'bottom_right': { - 'latitude': 36.1537, - 'longitude': 137.7268, - }, - } + }, ], + 'top_left': {'latitude': 34.9635, 'longitude': 136.7847}, + 'bottom_right': {'latitude': 36.1537, 'longitude': 137.7268}, }, - 'schema': 'public', - 'table': 'shake_detection_events', - 'errors': [], - }; - final result = RealtimePostgresChangesPayloadBase.fromJson(payload); - expect( - result, - isA< - RealtimePostgresInsertPayload< - ShakeDetectionWebSocketTelegram>>(), - ); + ], }, + 'schema': 'public', + 'table': 'shake_detection_events', + 'errors': [], + }; + final result = RealtimePostgresChangesPayloadBase.fromJson(payload); + expect( + result, + isA>(), ); - }, - ); + }); + }); } diff --git a/packages/extensions/lib/src/color.dart b/packages/extensions/lib/src/color.dart index 10ec24d8..572603bf 100644 --- a/packages/extensions/lib/src/color.dart +++ b/packages/extensions/lib/src/color.dart @@ -2,9 +2,7 @@ import 'dart:ui'; extension ColorEx on Color { int get sRgbValue { - final sRgb = withValues( - colorSpace: ColorSpace.sRGB, - ); + final sRgb = withValues(colorSpace: ColorSpace.sRGB); final r = (sRgb.r * 255).toInt(); final g = (sRgb.g * 255).toInt(); final b = (sRgb.b * 255).toInt(); diff --git a/packages/jma_code_table_converter_internal/lib/jma_code_table_converter_internal.dart b/packages/jma_code_table_converter_internal/lib/jma_code_table_converter_internal.dart index 9f2ed6fe..e35ba697 100644 --- a/packages/jma_code_table_converter_internal/lib/jma_code_table_converter_internal.dart +++ b/packages/jma_code_table_converter_internal/lib/jma_code_table_converter_internal.dart @@ -69,10 +69,7 @@ class JmaCodeTableConverter { return AreaEpicenter( items: [ for (final e in data) - AreaEpicenter_AreaEpicenterItem( - code: e[0], - name: e[1], - ), + AreaEpicenter_AreaEpicenterItem(code: e[0], name: e[1]), ], ); } @@ -103,10 +100,7 @@ class JmaCodeTableConverter { return AreaEpicenterDetail( items: [ for (final e in data) - AreaEpicenterDetail_AreaEpicenterDetailItem( - code: e[0], - name: e[1], - ), + AreaEpicenterDetail_AreaEpicenterDetailItem(code: e[0], name: e[1]), ], ); } diff --git a/packages/jma_map/bin/jma_map_protobuf_gen.dart b/packages/jma_map/bin/jma_map_protobuf_gen.dart index 658f55c6..9d202401 100644 --- a/packages/jma_map/bin/jma_map_protobuf_gen.dart +++ b/packages/jma_map/bin/jma_map_protobuf_gen.dart @@ -19,20 +19,11 @@ Future main() async { final jmaMapData = await _parseGeoJsonToJmaMap(json); print(jmaMapData.length); - jmaMapDataList.add( - JmaMap_JmaMapData( - mapType: target, - data: jmaMapData, - ), - ); + jmaMapDataList.add(JmaMap_JmaMapData(mapType: target, data: jmaMapData)); } // dump to file final file = File('out.pb'); - await file.writeAsBytes( - JmaMap( - data: jmaMapDataList, - ).writeToBuffer(), - ); + await file.writeAsBytes(JmaMap(data: jmaMapDataList).writeToBuffer()); } Future> _parseGeoJsonToJmaMap( @@ -42,14 +33,13 @@ Future> _parseGeoJsonToJmaMap( final features = geojson['features'] as List; for (final feature in features) { final json = feature as Map; - if (json - case { - 'geometry': { - 'type': final String geometryType, - 'coordinates': final List coordinates, - }, - 'properties': final Map properties, - }) { + if (json case { + 'geometry': { + 'type': final String geometryType, + 'coordinates': final List coordinates, + }, + 'properties': final Map properties, + }) { final latLngs = []; if (geometryType == 'Polygon') { for (final lists in coordinates) { @@ -57,12 +47,7 @@ Future> _parseGeoJsonToJmaMap( final ld = list as List; final lat = ld[1] as double; final lng = ld[0] as double; - latLngs.add( - LatLng( - lat: lat, - lng: lng, - ), - ); + latLngs.add(LatLng(lat: lat, lng: lng)); } } } else if (geometryType == 'MultiPolygon') { @@ -72,12 +57,7 @@ Future> _parseGeoJsonToJmaMap( final ld = l as List; final lat = ld[1] as double; final lng = ld[0] as double; - latLngs.add( - LatLng( - lat: lat, - lng: lng, - ), - ); + latLngs.add(LatLng(lat: lat, lng: lng)); } } } @@ -87,12 +67,7 @@ Future> _parseGeoJsonToJmaMap( final ld = list as List; final lat = ld[1] as double; final lng = ld[0] as double; - latLngs.add( - LatLng( - lat: lat, - lng: lng, - ), - ); + latLngs.add(LatLng(lat: lat, lng: lng)); } } } else if (geometryType == 'LineString') { @@ -100,12 +75,7 @@ Future> _parseGeoJsonToJmaMap( final ld = list as List; final lat = ld[1] as double; final lng = ld[0] as double; - latLngs.add( - LatLng( - lat: lat, - lng: lng, - ), - ); + latLngs.add(LatLng(lat: lat, lng: lng)); } } else { throw Exception('Unknown geometry type: $geometryType'); @@ -113,15 +83,18 @@ Future> _parseGeoJsonToJmaMap( final bbox = latLngs.toLatLngBounds; var skipFlag = false; final property = JmaMap_JmaMapData_JmaMapDataItem_Property( - code: properties['code'] as String? ?? + code: + properties['code'] as String? ?? properties['regioncode'] as String? ?? (() { skipFlag = true; print('Unknown code: $properties'); }()), - name: properties['name'] as String? ?? + name: + properties['name'] as String? ?? (throw Exception('Unknown name: $properties')), - nameKana: properties['namekana'] as String? ?? + nameKana: + properties['namekana'] as String? ?? (() { skipFlag = true; print('Unknown nameKana: $properties'); @@ -131,10 +104,7 @@ Future> _parseGeoJsonToJmaMap( continue; } results.add( - JmaMap_JmaMapData_JmaMapDataItem( - bounds: bbox, - property: property, - ), + JmaMap_JmaMapData_JmaMapDataItem(bounds: bbox, property: property), ); } else { throw Exception('Unknown feature: $json'); @@ -160,14 +130,8 @@ extension LatLngListEx on List { southWestLng = min(southWestLng, latLng.lng); } final latLngBounds = LatLngBounds( - northEast: LatLng( - lat: northEastLat, - lng: northEastLng, - ), - southWest: LatLng( - lat: southWestLat, - lng: southWestLng, - ), + northEast: LatLng(lat: northEastLat, lng: northEastLng), + southWest: LatLng(lat: southWestLat, lng: southWestLng), ); return latLngBounds; } @@ -175,13 +139,12 @@ extension LatLngListEx on List { extension JmaMapTypeConverter on JmaMap_JmaMapData_JmaMapType { String get toFileName => switch (this) { - JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_E => - 'areaForecastLocalE', - JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_EEW => - 'areaForecastLocalEew', - JmaMap_JmaMapData_JmaMapType.AREA_INFORMATION_CITY => - 'areaInformationCityQuake', - JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI => 'areaTsunami', - _ => throw UnimplementedError(), - }; + JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_E => 'areaForecastLocalE', + JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_EEW => + 'areaForecastLocalEew', + JmaMap_JmaMapData_JmaMapType.AREA_INFORMATION_CITY => + 'areaInformationCityQuake', + JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI => 'areaTsunami', + _ => throw UnimplementedError(), + }; } diff --git a/packages/jma_parameter_api_client/lib/jma_parameter_api_client.dart b/packages/jma_parameter_api_client/lib/jma_parameter_api_client.dart index 3a25c55e..70ff7361 100644 --- a/packages/jma_parameter_api_client/lib/jma_parameter_api_client.dart +++ b/packages/jma_parameter_api_client/lib/jma_parameter_api_client.dart @@ -12,15 +12,12 @@ part 'jma_parameter_api_client.g.dart'; class JmaParameterApiClient { JmaParameterApiClient({required Dio client}) - : _client = _JmaParameterApiClient(client); + : _client = _JmaParameterApiClient(client); final _JmaParameterApiClient _client; - Future< - ({ - EarthquakeParameter parameter, - String? etag, - })> getEarthquakeParameter() async { + Future<({EarthquakeParameter parameter, String? etag})> + getEarthquakeParameter() async { final res = await _client.getEarthquakeParameter(); return ( parameter: EarthquakeParameter.fromBuffer(res.data), @@ -33,11 +30,8 @@ class JmaParameterApiClient { return response.response.headers.value('etag'); } - Future< - ({ - TsunamiParameter parameter, - String? etag, - })> getTsunamiParameter() async { + Future<({TsunamiParameter parameter, String? etag})> + getTsunamiParameter() async { final response = await _client.getTsunamiParameter(); return ( parameter: TsunamiParameter.fromBuffer(response.data), diff --git a/packages/jma_parameter_api_client/lib/jma_parameter_api_client.g.dart b/packages/jma_parameter_api_client/lib/jma_parameter_api_client.g.dart index f25dfb57..b75a8323 100644 --- a/packages/jma_parameter_api_client/lib/jma_parameter_api_client.g.dart +++ b/packages/jma_parameter_api_client/lib/jma_parameter_api_client.g.dart @@ -11,11 +11,7 @@ part of 'jma_parameter_api_client.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class __JmaParameterApiClient implements _JmaParameterApiClient { - __JmaParameterApiClient( - this._dio, { - this.baseUrl, - this.errorLogger, - }); + __JmaParameterApiClient(this._dio, {this.baseUrl, this.errorLogger}); final Dio _dio; @@ -29,23 +25,21 @@ class __JmaParameterApiClient implements _JmaParameterApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/parameter/earthquake', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/parameter/earthquake', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -64,22 +58,16 @@ class __JmaParameterApiClient implements _JmaParameterApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'HEAD', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/parameter/earthquake', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'HEAD', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/parameter/earthquake', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch(_options); final httpResponse = HttpResponse(null, _result); return httpResponse; @@ -91,23 +79,21 @@ class __JmaParameterApiClient implements _JmaParameterApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/parameter/tsunami', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/parameter/tsunami', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -126,22 +112,16 @@ class __JmaParameterApiClient implements _JmaParameterApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'HEAD', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/parameter/tsunami', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options(method: 'HEAD', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/parameter/tsunami', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch(_options); final httpResponse = HttpResponse(null, _result); return httpResponse; @@ -160,10 +140,7 @@ class __JmaParameterApiClient implements _JmaParameterApiClient { return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart b/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart index 47a92374..c70f017c 100644 --- a/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart +++ b/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart @@ -11,10 +11,7 @@ Future fromDmdataEarthquakeParameter( dmdata.EarthquakeParameter parameter, ) async { final itemsFuture = parameter.items.map((e) async { - final arv = await getArv( - latitude: e.latitude, - longitude: e.longitude, - ); + final arv = await getArv(latitude: e.latitude, longitude: e.longitude); return ( e, EarthquakeParameterStationItem( @@ -23,7 +20,7 @@ Future fromDmdataEarthquakeParameter( latitude: e.latitude, longitude: e.longitude, arv400: arv, - ) + ), ); }); // 直列実行 @@ -33,16 +30,9 @@ Future fromDmdataEarthquakeParameter( items.add(await item); } - final itemsGroupByRegion = items.groupListsBy( - (e) => e.$1.region, - ); + final itemsGroupByRegion = items.groupListsBy((e) => e.$1.region); final itemsGroupByRegionAndCity = itemsGroupByRegion.map( - (key, value) => MapEntry( - key, - value.groupListsBy( - (e) => e.$1.city, - ), - ), + (key, value) => MapEntry(key, value.groupListsBy((e) => e.$1.city)), ); print('itemsGroupByRegionAndCity: ${itemsGroupByRegionAndCity.length}'); final regions = itemsGroupByRegionAndCity.entries.map( @@ -53,17 +43,13 @@ Future fromDmdataEarthquakeParameter( (e) => EarthquakeParameterCityItem( code: e.key.code, name: e.key.name, - stations: e.value.map( - (e) => e.$2, - ), + stations: e.value.map((e) => e.$2), ), ), ), ); print('regions: ${regions.length}'); - return EarthquakeParameter( - regions: regions, - ); + return EarthquakeParameter(regions: regions); } Future getArv({ @@ -76,28 +62,31 @@ Future getArv({ print('Cache hit!: $cacheFile'); final json = jsonDecode(await cacheFile.readAsString()) as Map; - final arvStr = (((json['features'] as List?)?.first - as Map?)?['properties'] - as Map?)?['ARV'] as String?; + final arvStr = + (((json['features'] as List?)?.first + as Map?)?['properties'] + as Map?)?['ARV'] + as String?; final arv = double.tryParse(arvStr.toString()); return arv; } print('Cache miss!: $cacheFile'); final response = await http.get( Uri.parse( - 'https://www.j-shis.bosai.go.jp/map/api/sstrct/V2/meshinfo.geojson' - '?position=$longitude,$latitude' - '&epsg=4326'), + 'https://www.j-shis.bosai.go.jp/map/api/sstrct/V2/meshinfo.geojson' + '?position=$longitude,$latitude' + '&epsg=4326', + ), ); final json = jsonDecode(response.body) as Map; print(json); - final arvStr = (((json['features'] as List?)?.first - as Map?)?['properties'] - as Map?)?['ARV'] as String?; + final arvStr = + (((json['features'] as List?)?.first + as Map?)?['properties'] + as Map?)?['ARV'] + as String?; final arv = double.tryParse(arvStr.toString()); - cacheFile.writeAsStringSync( - jsonEncode(json), - ); + cacheFile.writeAsStringSync(jsonEncode(json)); print('ARV: $arv'); return null; } diff --git a/packages/jma_parameter_converter_internal/lib/dmdata/common.freezed.dart b/packages/jma_parameter_converter_internal/lib/dmdata/common.freezed.dart index c8db02c5..9c2553ab 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/common.freezed.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/common.freezed.dart @@ -12,7 +12,8 @@ part of 'common.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); ParameterRegion _$ParameterRegionFromJson(Map json) { return _ParameterRegion.fromJson(json); @@ -37,8 +38,9 @@ mixin _$ParameterRegion { /// @nodoc abstract class $ParameterRegionCopyWith<$Res> { factory $ParameterRegionCopyWith( - ParameterRegion value, $Res Function(ParameterRegion) then) = - _$ParameterRegionCopyWithImpl<$Res, ParameterRegion>; + ParameterRegion value, + $Res Function(ParameterRegion) then, + ) = _$ParameterRegionCopyWithImpl<$Res, ParameterRegion>; @useResult $Res call({String code, String name, String kana}); } @@ -57,34 +59,37 @@ class _$ParameterRegionCopyWithImpl<$Res, $Val extends ParameterRegion> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? name = null, - Object? kana = null, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? code = null, Object? name = null, Object? kana = null}) { + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ParameterRegionImplCopyWith<$Res> implements $ParameterRegionCopyWith<$Res> { - factory _$$ParameterRegionImplCopyWith(_$ParameterRegionImpl value, - $Res Function(_$ParameterRegionImpl) then) = - __$$ParameterRegionImplCopyWithImpl<$Res>; + factory _$$ParameterRegionImplCopyWith( + _$ParameterRegionImpl value, + $Res Function(_$ParameterRegionImpl) then, + ) = __$$ParameterRegionImplCopyWithImpl<$Res>; @override @useResult $Res call({String code, String name, String kana}); @@ -95,40 +100,45 @@ class __$$ParameterRegionImplCopyWithImpl<$Res> extends _$ParameterRegionCopyWithImpl<$Res, _$ParameterRegionImpl> implements _$$ParameterRegionImplCopyWith<$Res> { __$$ParameterRegionImplCopyWithImpl( - _$ParameterRegionImpl _value, $Res Function(_$ParameterRegionImpl) _then) - : super(_value, _then); + _$ParameterRegionImpl _value, + $Res Function(_$ParameterRegionImpl) _then, + ) : super(_value, _then); /// Create a copy of ParameterRegion /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? name = null, - Object? kana = null, - }) { - return _then(_$ParameterRegionImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? code = null, Object? name = null, Object? kana = null}) { + return _then( + _$ParameterRegionImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$ParameterRegionImpl implements _ParameterRegion { - const _$ParameterRegionImpl( - {required this.code, required this.name, required this.kana}); + const _$ParameterRegionImpl({ + required this.code, + required this.name, + required this.kana, + }); factory _$ParameterRegionImpl.fromJson(Map json) => _$$ParameterRegionImplFromJson(json); @@ -166,21 +176,22 @@ class _$ParameterRegionImpl implements _ParameterRegion { @pragma('vm:prefer-inline') _$$ParameterRegionImplCopyWith<_$ParameterRegionImpl> get copyWith => __$$ParameterRegionImplCopyWithImpl<_$ParameterRegionImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$ParameterRegionImplToJson( - this, - ); + return _$$ParameterRegionImplToJson(this); } } abstract class _ParameterRegion implements ParameterRegion { - const factory _ParameterRegion( - {required final String code, - required final String name, - required final String kana}) = _$ParameterRegionImpl; + const factory _ParameterRegion({ + required final String code, + required final String name, + required final String kana, + }) = _$ParameterRegionImpl; factory _ParameterRegion.fromJson(Map json) = _$ParameterRegionImpl.fromJson; @@ -223,8 +234,9 @@ mixin _$ParameterCity { /// @nodoc abstract class $ParameterCityCopyWith<$Res> { factory $ParameterCityCopyWith( - ParameterCity value, $Res Function(ParameterCity) then) = - _$ParameterCityCopyWithImpl<$Res, ParameterCity>; + ParameterCity value, + $Res Function(ParameterCity) then, + ) = _$ParameterCityCopyWithImpl<$Res, ParameterCity>; @useResult $Res call({String code, String name, String kana}); } @@ -243,25 +255,27 @@ class _$ParameterCityCopyWithImpl<$Res, $Val extends ParameterCity> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? name = null, - Object? kana = null, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - ) as $Val); + $Res call({Object? code = null, Object? name = null, Object? kana = null}) { + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + ) + as $Val, + ); } } @@ -269,8 +283,9 @@ class _$ParameterCityCopyWithImpl<$Res, $Val extends ParameterCity> abstract class _$$ParameterCityImplCopyWith<$Res> implements $ParameterCityCopyWith<$Res> { factory _$$ParameterCityImplCopyWith( - _$ParameterCityImpl value, $Res Function(_$ParameterCityImpl) then) = - __$$ParameterCityImplCopyWithImpl<$Res>; + _$ParameterCityImpl value, + $Res Function(_$ParameterCityImpl) then, + ) = __$$ParameterCityImplCopyWithImpl<$Res>; @override @useResult $Res call({String code, String name, String kana}); @@ -281,40 +296,45 @@ class __$$ParameterCityImplCopyWithImpl<$Res> extends _$ParameterCityCopyWithImpl<$Res, _$ParameterCityImpl> implements _$$ParameterCityImplCopyWith<$Res> { __$$ParameterCityImplCopyWithImpl( - _$ParameterCityImpl _value, $Res Function(_$ParameterCityImpl) _then) - : super(_value, _then); + _$ParameterCityImpl _value, + $Res Function(_$ParameterCityImpl) _then, + ) : super(_value, _then); /// Create a copy of ParameterCity /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? name = null, - Object? kana = null, - }) { - return _then(_$ParameterCityImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - )); + $Res call({Object? code = null, Object? name = null, Object? kana = null}) { + return _then( + _$ParameterCityImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + ), + ); } } /// @nodoc @JsonSerializable() class _$ParameterCityImpl implements _ParameterCity { - const _$ParameterCityImpl( - {required this.code, required this.name, required this.kana}); + const _$ParameterCityImpl({ + required this.code, + required this.name, + required this.kana, + }); factory _$ParameterCityImpl.fromJson(Map json) => _$$ParameterCityImplFromJson(json); @@ -355,17 +375,16 @@ class _$ParameterCityImpl implements _ParameterCity { @override Map toJson() { - return _$$ParameterCityImplToJson( - this, - ); + return _$$ParameterCityImplToJson(this); } } abstract class _ParameterCity implements ParameterCity { - const factory _ParameterCity( - {required final String code, - required final String name, - required final String kana}) = _$ParameterCityImpl; + const factory _ParameterCity({ + required final String code, + required final String name, + required final String kana, + }) = _$ParameterCityImpl; factory _ParameterCity.fromJson(Map json) = _$ParameterCityImpl.fromJson; diff --git a/packages/jma_parameter_converter_internal/lib/dmdata/common.g.dart b/packages/jma_parameter_converter_internal/lib/dmdata/common.g.dart index e866247b..9f2d5875 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/common.g.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/common.g.dart @@ -9,41 +9,33 @@ part of 'common.dart'; // ************************************************************************** _$ParameterRegionImpl _$$ParameterRegionImplFromJson( - Map json) => - $checkedCreate( - r'_$ParameterRegionImpl', - json, - ($checkedConvert) { - final val = _$ParameterRegionImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - kana: $checkedConvert('kana', (v) => v as String), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$ParameterRegionImpl', json, ($checkedConvert) { + final val = _$ParameterRegionImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + kana: $checkedConvert('kana', (v) => v as String), + ); + return val; +}); Map _$$ParameterRegionImplToJson( - _$ParameterRegionImpl instance) => - { - 'code': instance.code, - 'name': instance.name, - 'kana': instance.kana, - }; + _$ParameterRegionImpl instance, +) => { + 'code': instance.code, + 'name': instance.name, + 'kana': instance.kana, +}; _$ParameterCityImpl _$$ParameterCityImplFromJson(Map json) => - $checkedCreate( - r'_$ParameterCityImpl', - json, - ($checkedConvert) { - final val = _$ParameterCityImpl( - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - kana: $checkedConvert('kana', (v) => v as String), - ); - return val; - }, - ); + $checkedCreate(r'_$ParameterCityImpl', json, ($checkedConvert) { + final val = _$ParameterCityImpl( + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + kana: $checkedConvert('kana', (v) => v as String), + ); + return val; + }); Map _$$ParameterCityImplToJson(_$ParameterCityImpl instance) => { diff --git a/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.freezed.dart b/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.freezed.dart index 6b501284..9dbb6256 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.freezed.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.freezed.dart @@ -12,7 +12,8 @@ part of 'earthquake.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); EarthquakeParameter _$EarthquakeParameterFromJson(Map json) { return _EarthquakeParameter.fromJson(json); @@ -40,16 +41,18 @@ mixin _$EarthquakeParameter { /// @nodoc abstract class $EarthquakeParameterCopyWith<$Res> { factory $EarthquakeParameterCopyWith( - EarthquakeParameter value, $Res Function(EarthquakeParameter) then) = - _$EarthquakeParameterCopyWithImpl<$Res, EarthquakeParameter>; + EarthquakeParameter value, + $Res Function(EarthquakeParameter) then, + ) = _$EarthquakeParameterCopyWithImpl<$Res, EarthquakeParameter>; @useResult - $Res call( - {String responseId, - DateTime responseTime, - String status, - DateTime changeTime, - String version, - List items}); + $Res call({ + String responseId, + DateTime responseTime, + String status, + DateTime changeTime, + String version, + List items, + }); } /// @nodoc @@ -74,59 +77,71 @@ class _$EarthquakeParameterCopyWithImpl<$Res, $Val extends EarthquakeParameter> Object? version = null, Object? items = null, }) { - return _then(_value.copyWith( - responseId: null == responseId - ? _value.responseId - : responseId // ignore: cast_nullable_to_non_nullable - as String, - responseTime: null == responseTime - ? _value.responseTime - : responseTime // ignore: cast_nullable_to_non_nullable - as DateTime, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - changeTime: null == changeTime - ? _value.changeTime - : changeTime // ignore: cast_nullable_to_non_nullable - as DateTime, - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String, - items: null == items - ? _value.items - : items // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + responseId: + null == responseId + ? _value.responseId + : responseId // ignore: cast_nullable_to_non_nullable + as String, + responseTime: + null == responseTime + ? _value.responseTime + : responseTime // ignore: cast_nullable_to_non_nullable + as DateTime, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + changeTime: + null == changeTime + ? _value.changeTime + : changeTime // ignore: cast_nullable_to_non_nullable + as DateTime, + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + items: + null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$EarthquakeParameterImplCopyWith<$Res> implements $EarthquakeParameterCopyWith<$Res> { - factory _$$EarthquakeParameterImplCopyWith(_$EarthquakeParameterImpl value, - $Res Function(_$EarthquakeParameterImpl) then) = - __$$EarthquakeParameterImplCopyWithImpl<$Res>; + factory _$$EarthquakeParameterImplCopyWith( + _$EarthquakeParameterImpl value, + $Res Function(_$EarthquakeParameterImpl) then, + ) = __$$EarthquakeParameterImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String responseId, - DateTime responseTime, - String status, - DateTime changeTime, - String version, - List items}); + $Res call({ + String responseId, + DateTime responseTime, + String status, + DateTime changeTime, + String version, + List items, + }); } /// @nodoc class __$$EarthquakeParameterImplCopyWithImpl<$Res> extends _$EarthquakeParameterCopyWithImpl<$Res, _$EarthquakeParameterImpl> implements _$$EarthquakeParameterImplCopyWith<$Res> { - __$$EarthquakeParameterImplCopyWithImpl(_$EarthquakeParameterImpl _value, - $Res Function(_$EarthquakeParameterImpl) _then) - : super(_value, _then); + __$$EarthquakeParameterImplCopyWithImpl( + _$EarthquakeParameterImpl _value, + $Res Function(_$EarthquakeParameterImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeParameter /// with the given fields replaced by the non-null parameter values. @@ -140,46 +155,54 @@ class __$$EarthquakeParameterImplCopyWithImpl<$Res> Object? version = null, Object? items = null, }) { - return _then(_$EarthquakeParameterImpl( - responseId: null == responseId - ? _value.responseId - : responseId // ignore: cast_nullable_to_non_nullable - as String, - responseTime: null == responseTime - ? _value.responseTime - : responseTime // ignore: cast_nullable_to_non_nullable - as DateTime, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - changeTime: null == changeTime - ? _value.changeTime - : changeTime // ignore: cast_nullable_to_non_nullable - as DateTime, - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String, - items: null == items - ? _value._items - : items // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$EarthquakeParameterImpl( + responseId: + null == responseId + ? _value.responseId + : responseId // ignore: cast_nullable_to_non_nullable + as String, + responseTime: + null == responseTime + ? _value.responseTime + : responseTime // ignore: cast_nullable_to_non_nullable + as DateTime, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + changeTime: + null == changeTime + ? _value.changeTime + : changeTime // ignore: cast_nullable_to_non_nullable + as DateTime, + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + items: + null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeParameterImpl implements _EarthquakeParameter { - const _$EarthquakeParameterImpl( - {required this.responseId, - required this.responseTime, - required this.status, - required this.changeTime, - required this.version, - required final List items}) - : _items = items; + const _$EarthquakeParameterImpl({ + required this.responseId, + required this.responseTime, + required this.status, + required this.changeTime, + required this.version, + required final List items, + }) : _items = items; factory _$EarthquakeParameterImpl.fromJson(Map json) => _$$EarthquakeParameterImplFromJson(json); @@ -225,8 +248,15 @@ class _$EarthquakeParameterImpl implements _EarthquakeParameter { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, responseId, responseTime, status, - changeTime, version, const DeepCollectionEquality().hash(_items)); + int get hashCode => Object.hash( + runtimeType, + responseId, + responseTime, + status, + changeTime, + version, + const DeepCollectionEquality().hash(_items), + ); /// Create a copy of EarthquakeParameter /// with the given fields replaced by the non-null parameter values. @@ -235,25 +265,25 @@ class _$EarthquakeParameterImpl implements _EarthquakeParameter { @pragma('vm:prefer-inline') _$$EarthquakeParameterImplCopyWith<_$EarthquakeParameterImpl> get copyWith => __$$EarthquakeParameterImplCopyWithImpl<_$EarthquakeParameterImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$EarthquakeParameterImplToJson( - this, - ); + return _$$EarthquakeParameterImplToJson(this); } } abstract class _EarthquakeParameter implements EarthquakeParameter { - const factory _EarthquakeParameter( - {required final String responseId, - required final DateTime responseTime, - required final String status, - required final DateTime changeTime, - required final String version, - required final List items}) = - _$EarthquakeParameterImpl; + const factory _EarthquakeParameter({ + required final String responseId, + required final DateTime responseTime, + required final String status, + required final DateTime changeTime, + required final String version, + required final List items, + }) = _$EarthquakeParameterImpl; factory _EarthquakeParameter.fromJson(Map json) = _$EarthquakeParameterImpl.fromJson; @@ -280,7 +310,8 @@ abstract class _EarthquakeParameter implements EarthquakeParameter { } EarthquakeParmaeterItem _$EarthquakeParmaeterItemFromJson( - Map json) { + Map json, +) { return _EarthquakeParmaeterItem.fromJson(json); } @@ -311,31 +342,35 @@ mixin _$EarthquakeParmaeterItem { /// @nodoc abstract class $EarthquakeParmaeterItemCopyWith<$Res> { - factory $EarthquakeParmaeterItemCopyWith(EarthquakeParmaeterItem value, - $Res Function(EarthquakeParmaeterItem) then) = - _$EarthquakeParmaeterItemCopyWithImpl<$Res, EarthquakeParmaeterItem>; + factory $EarthquakeParmaeterItemCopyWith( + EarthquakeParmaeterItem value, + $Res Function(EarthquakeParmaeterItem) then, + ) = _$EarthquakeParmaeterItemCopyWithImpl<$Res, EarthquakeParmaeterItem>; @useResult - $Res call( - {ParameterRegion region, - ParameterCity city, - String noCode, - String code, - String name, - String kana, - String status, - String owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double longitude}); + $Res call({ + ParameterRegion region, + ParameterCity city, + String noCode, + String code, + String name, + String kana, + String status, + String owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double longitude, + }); $ParameterRegionCopyWith<$Res> get region; $ParameterCityCopyWith<$Res> get city; } /// @nodoc -class _$EarthquakeParmaeterItemCopyWithImpl<$Res, - $Val extends EarthquakeParmaeterItem> +class _$EarthquakeParmaeterItemCopyWithImpl< + $Res, + $Val extends EarthquakeParmaeterItem +> implements $EarthquakeParmaeterItemCopyWith<$Res> { _$EarthquakeParmaeterItemCopyWithImpl(this._value, this._then); @@ -360,48 +395,61 @@ class _$EarthquakeParmaeterItemCopyWithImpl<$Res, Object? latitude = null, Object? longitude = null, }) { - return _then(_value.copyWith( - region: null == region - ? _value.region - : region // ignore: cast_nullable_to_non_nullable - as ParameterRegion, - city: null == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as ParameterCity, - noCode: null == noCode - ? _value.noCode - : noCode // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - owner: null == owner - ? _value.owner - : owner // ignore: cast_nullable_to_non_nullable - as String, - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + return _then( + _value.copyWith( + region: + null == region + ? _value.region + : region // ignore: cast_nullable_to_non_nullable + as ParameterRegion, + city: + null == city + ? _value.city + : city // ignore: cast_nullable_to_non_nullable + as ParameterCity, + noCode: + null == noCode + ? _value.noCode + : noCode // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + owner: + null == owner + ? _value.owner + : owner // ignore: cast_nullable_to_non_nullable + as String, + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } /// Create a copy of EarthquakeParmaeterItem @@ -429,24 +477,25 @@ class _$EarthquakeParmaeterItemCopyWithImpl<$Res, abstract class _$$EarthquakeParmaeterItemImplCopyWith<$Res> implements $EarthquakeParmaeterItemCopyWith<$Res> { factory _$$EarthquakeParmaeterItemImplCopyWith( - _$EarthquakeParmaeterItemImpl value, - $Res Function(_$EarthquakeParmaeterItemImpl) then) = - __$$EarthquakeParmaeterItemImplCopyWithImpl<$Res>; + _$EarthquakeParmaeterItemImpl value, + $Res Function(_$EarthquakeParmaeterItemImpl) then, + ) = __$$EarthquakeParmaeterItemImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {ParameterRegion region, - ParameterCity city, - String noCode, - String code, - String name, - String kana, - String status, - String owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double longitude}); + $Res call({ + ParameterRegion region, + ParameterCity city, + String noCode, + String code, + String name, + String kana, + String status, + String owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double longitude, + }); @override $ParameterRegionCopyWith<$Res> get region; @@ -456,13 +505,16 @@ abstract class _$$EarthquakeParmaeterItemImplCopyWith<$Res> /// @nodoc class __$$EarthquakeParmaeterItemImplCopyWithImpl<$Res> - extends _$EarthquakeParmaeterItemCopyWithImpl<$Res, - _$EarthquakeParmaeterItemImpl> + extends + _$EarthquakeParmaeterItemCopyWithImpl< + $Res, + _$EarthquakeParmaeterItemImpl + > implements _$$EarthquakeParmaeterItemImplCopyWith<$Res> { __$$EarthquakeParmaeterItemImplCopyWithImpl( - _$EarthquakeParmaeterItemImpl _value, - $Res Function(_$EarthquakeParmaeterItemImpl) _then) - : super(_value, _then); + _$EarthquakeParmaeterItemImpl _value, + $Res Function(_$EarthquakeParmaeterItemImpl) _then, + ) : super(_value, _then); /// Create a copy of EarthquakeParmaeterItem /// with the given fields replaced by the non-null parameter values. @@ -480,67 +532,80 @@ class __$$EarthquakeParmaeterItemImplCopyWithImpl<$Res> Object? latitude = null, Object? longitude = null, }) { - return _then(_$EarthquakeParmaeterItemImpl( - region: null == region - ? _value.region - : region // ignore: cast_nullable_to_non_nullable - as ParameterRegion, - city: null == city - ? _value.city - : city // ignore: cast_nullable_to_non_nullable - as ParameterCity, - noCode: null == noCode - ? _value.noCode - : noCode // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - owner: null == owner - ? _value.owner - : owner // ignore: cast_nullable_to_non_nullable - as String, - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - )); + return _then( + _$EarthquakeParmaeterItemImpl( + region: + null == region + ? _value.region + : region // ignore: cast_nullable_to_non_nullable + as ParameterRegion, + city: + null == city + ? _value.city + : city // ignore: cast_nullable_to_non_nullable + as ParameterCity, + noCode: + null == noCode + ? _value.noCode + : noCode // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + owner: + null == owner + ? _value.owner + : owner // ignore: cast_nullable_to_non_nullable + as String, + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } /// @nodoc @JsonSerializable() class _$EarthquakeParmaeterItemImpl implements _EarthquakeParmaeterItem { - const _$EarthquakeParmaeterItemImpl( - {required this.region, - required this.city, - required this.noCode, - required this.code, - required this.name, - required this.kana, - required this.status, - required this.owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required this.latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required this.longitude}); + const _$EarthquakeParmaeterItemImpl({ + required this.region, + required this.city, + required this.noCode, + required this.code, + required this.name, + required this.kana, + required this.status, + required this.owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required this.latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required this.longitude, + }); factory _$EarthquakeParmaeterItemImpl.fromJson(Map json) => _$$EarthquakeParmaeterItemImplFromJson(json); @@ -594,8 +659,19 @@ class _$EarthquakeParmaeterItemImpl implements _EarthquakeParmaeterItem { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, region, city, noCode, code, name, - kana, status, owner, latitude, longitude); + int get hashCode => Object.hash( + runtimeType, + region, + city, + noCode, + code, + name, + kana, + status, + owner, + latitude, + longitude, + ); /// Create a copy of EarthquakeParmaeterItem /// with the given fields replaced by the non-null parameter values. @@ -603,31 +679,31 @@ class _$EarthquakeParmaeterItemImpl implements _EarthquakeParmaeterItem { @override @pragma('vm:prefer-inline') _$$EarthquakeParmaeterItemImplCopyWith<_$EarthquakeParmaeterItemImpl> - get copyWith => __$$EarthquakeParmaeterItemImplCopyWithImpl< - _$EarthquakeParmaeterItemImpl>(this, _$identity); + get copyWith => __$$EarthquakeParmaeterItemImplCopyWithImpl< + _$EarthquakeParmaeterItemImpl + >(this, _$identity); @override Map toJson() { - return _$$EarthquakeParmaeterItemImplToJson( - this, - ); + return _$$EarthquakeParmaeterItemImplToJson(this); } } abstract class _EarthquakeParmaeterItem implements EarthquakeParmaeterItem { - const factory _EarthquakeParmaeterItem( - {required final ParameterRegion region, - required final ParameterCity city, - required final String noCode, - required final String code, - required final String name, - required final String kana, - required final String status, - required final String owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required final double latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required final double longitude}) = _$EarthquakeParmaeterItemImpl; + const factory _EarthquakeParmaeterItem({ + required final ParameterRegion region, + required final ParameterCity city, + required final String noCode, + required final String code, + required final String name, + required final String kana, + required final String status, + required final String owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required final double latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required final double longitude, + }) = _$EarthquakeParmaeterItemImpl; factory _EarthquakeParmaeterItem.fromJson(Map json) = _$EarthquakeParmaeterItemImpl.fromJson; @@ -660,5 +736,5 @@ abstract class _EarthquakeParmaeterItem implements EarthquakeParmaeterItem { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$EarthquakeParmaeterItemImplCopyWith<_$EarthquakeParmaeterItemImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart b/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart index ffcd08a6..ec2723f0 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart @@ -9,78 +9,83 @@ part of 'earthquake.dart'; // ************************************************************************** _$EarthquakeParameterImpl _$$EarthquakeParameterImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeParameterImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeParameterImpl( - responseId: $checkedConvert('responseId', (v) => v as String), - responseTime: $checkedConvert( - 'responseTime', (v) => DateTime.parse(v as String)), - status: $checkedConvert('status', (v) => v as String), - changeTime: - $checkedConvert('changeTime', (v) => DateTime.parse(v as String)), - version: $checkedConvert('version', (v) => v as String), - items: $checkedConvert( - 'items', - (v) => (v as List) - .map((e) => EarthquakeParmaeterItem.fromJson( - e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EarthquakeParameterImpl', json, ($checkedConvert) { + final val = _$EarthquakeParameterImpl( + responseId: $checkedConvert('responseId', (v) => v as String), + responseTime: $checkedConvert( + 'responseTime', + (v) => DateTime.parse(v as String), + ), + status: $checkedConvert('status', (v) => v as String), + changeTime: $checkedConvert( + 'changeTime', + (v) => DateTime.parse(v as String), + ), + version: $checkedConvert('version', (v) => v as String), + items: $checkedConvert( + 'items', + (v) => + (v as List) + .map( + (e) => + EarthquakeParmaeterItem.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; +}); Map _$$EarthquakeParameterImplToJson( - _$EarthquakeParameterImpl instance) => - { - 'responseId': instance.responseId, - 'responseTime': instance.responseTime.toIso8601String(), - 'status': instance.status, - 'changeTime': instance.changeTime.toIso8601String(), - 'version': instance.version, - 'items': instance.items, - }; + _$EarthquakeParameterImpl instance, +) => { + 'responseId': instance.responseId, + 'responseTime': instance.responseTime.toIso8601String(), + 'status': instance.status, + 'changeTime': instance.changeTime.toIso8601String(), + 'version': instance.version, + 'items': instance.items, +}; _$EarthquakeParmaeterItemImpl _$$EarthquakeParmaeterItemImplFromJson( - Map json) => - $checkedCreate( - r'_$EarthquakeParmaeterItemImpl', - json, - ($checkedConvert) { - final val = _$EarthquakeParmaeterItemImpl( - region: $checkedConvert('region', - (v) => ParameterRegion.fromJson(v as Map)), - city: $checkedConvert( - 'city', (v) => ParameterCity.fromJson(v as Map)), - noCode: $checkedConvert('noCode', (v) => v as String), - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - kana: $checkedConvert('kana', (v) => v as String), - status: $checkedConvert('status', (v) => v as String), - owner: $checkedConvert('owner', (v) => v as String), - latitude: - $checkedConvert('latitude', (v) => doubleFromString(v as String)), - longitude: $checkedConvert( - 'longitude', (v) => doubleFromString(v as String)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$EarthquakeParmaeterItemImpl', json, ($checkedConvert) { + final val = _$EarthquakeParmaeterItemImpl( + region: $checkedConvert( + 'region', + (v) => ParameterRegion.fromJson(v as Map), + ), + city: $checkedConvert( + 'city', + (v) => ParameterCity.fromJson(v as Map), + ), + noCode: $checkedConvert('noCode', (v) => v as String), + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + kana: $checkedConvert('kana', (v) => v as String), + status: $checkedConvert('status', (v) => v as String), + owner: $checkedConvert('owner', (v) => v as String), + latitude: $checkedConvert('latitude', (v) => doubleFromString(v as String)), + longitude: $checkedConvert( + 'longitude', + (v) => doubleFromString(v as String), + ), + ); + return val; +}); Map _$$EarthquakeParmaeterItemImplToJson( - _$EarthquakeParmaeterItemImpl instance) => - { - 'region': instance.region, - 'city': instance.city, - 'noCode': instance.noCode, - 'code': instance.code, - 'name': instance.name, - 'kana': instance.kana, - 'status': instance.status, - 'owner': instance.owner, - 'latitude': doubleToString(instance.latitude), - 'longitude': doubleToString(instance.longitude), - }; + _$EarthquakeParmaeterItemImpl instance, +) => { + 'region': instance.region, + 'city': instance.city, + 'noCode': instance.noCode, + 'code': instance.code, + 'name': instance.name, + 'kana': instance.kana, + 'status': instance.status, + 'owner': instance.owner, + 'latitude': doubleToString(instance.latitude), + 'longitude': doubleToString(instance.longitude), +}; diff --git a/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.freezed.dart b/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.freezed.dart index 219235df..2521e9bd 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.freezed.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.freezed.dart @@ -12,7 +12,8 @@ part of 'tsunami.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); TsunamiParameter _$TsunamiParameterFromJson(Map json) { return _TsunamiParameter.fromJson(json); @@ -40,16 +41,18 @@ mixin _$TsunamiParameter { /// @nodoc abstract class $TsunamiParameterCopyWith<$Res> { factory $TsunamiParameterCopyWith( - TsunamiParameter value, $Res Function(TsunamiParameter) then) = - _$TsunamiParameterCopyWithImpl<$Res, TsunamiParameter>; + TsunamiParameter value, + $Res Function(TsunamiParameter) then, + ) = _$TsunamiParameterCopyWithImpl<$Res, TsunamiParameter>; @useResult - $Res call( - {String responseId, - DateTime responseTime, - String status, - DateTime changeTime, - String version, - List items}); + $Res call({ + String responseId, + DateTime responseTime, + String status, + DateTime changeTime, + String version, + List items, + }); } /// @nodoc @@ -74,59 +77,71 @@ class _$TsunamiParameterCopyWithImpl<$Res, $Val extends TsunamiParameter> Object? version = null, Object? items = null, }) { - return _then(_value.copyWith( - responseId: null == responseId - ? _value.responseId - : responseId // ignore: cast_nullable_to_non_nullable - as String, - responseTime: null == responseTime - ? _value.responseTime - : responseTime // ignore: cast_nullable_to_non_nullable - as DateTime, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - changeTime: null == changeTime - ? _value.changeTime - : changeTime // ignore: cast_nullable_to_non_nullable - as DateTime, - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String, - items: null == items - ? _value.items - : items // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); + return _then( + _value.copyWith( + responseId: + null == responseId + ? _value.responseId + : responseId // ignore: cast_nullable_to_non_nullable + as String, + responseTime: + null == responseTime + ? _value.responseTime + : responseTime // ignore: cast_nullable_to_non_nullable + as DateTime, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + changeTime: + null == changeTime + ? _value.changeTime + : changeTime // ignore: cast_nullable_to_non_nullable + as DateTime, + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + items: + null == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TsunamiParameterImplCopyWith<$Res> implements $TsunamiParameterCopyWith<$Res> { - factory _$$TsunamiParameterImplCopyWith(_$TsunamiParameterImpl value, - $Res Function(_$TsunamiParameterImpl) then) = - __$$TsunamiParameterImplCopyWithImpl<$Res>; + factory _$$TsunamiParameterImplCopyWith( + _$TsunamiParameterImpl value, + $Res Function(_$TsunamiParameterImpl) then, + ) = __$$TsunamiParameterImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String responseId, - DateTime responseTime, - String status, - DateTime changeTime, - String version, - List items}); + $Res call({ + String responseId, + DateTime responseTime, + String status, + DateTime changeTime, + String version, + List items, + }); } /// @nodoc class __$$TsunamiParameterImplCopyWithImpl<$Res> extends _$TsunamiParameterCopyWithImpl<$Res, _$TsunamiParameterImpl> implements _$$TsunamiParameterImplCopyWith<$Res> { - __$$TsunamiParameterImplCopyWithImpl(_$TsunamiParameterImpl _value, - $Res Function(_$TsunamiParameterImpl) _then) - : super(_value, _then); + __$$TsunamiParameterImplCopyWithImpl( + _$TsunamiParameterImpl _value, + $Res Function(_$TsunamiParameterImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiParameter /// with the given fields replaced by the non-null parameter values. @@ -140,46 +155,54 @@ class __$$TsunamiParameterImplCopyWithImpl<$Res> Object? version = null, Object? items = null, }) { - return _then(_$TsunamiParameterImpl( - responseId: null == responseId - ? _value.responseId - : responseId // ignore: cast_nullable_to_non_nullable - as String, - responseTime: null == responseTime - ? _value.responseTime - : responseTime // ignore: cast_nullable_to_non_nullable - as DateTime, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, - changeTime: null == changeTime - ? _value.changeTime - : changeTime // ignore: cast_nullable_to_non_nullable - as DateTime, - version: null == version - ? _value.version - : version // ignore: cast_nullable_to_non_nullable - as String, - items: null == items - ? _value._items - : items // ignore: cast_nullable_to_non_nullable - as List, - )); + return _then( + _$TsunamiParameterImpl( + responseId: + null == responseId + ? _value.responseId + : responseId // ignore: cast_nullable_to_non_nullable + as String, + responseTime: + null == responseTime + ? _value.responseTime + : responseTime // ignore: cast_nullable_to_non_nullable + as DateTime, + status: + null == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String, + changeTime: + null == changeTime + ? _value.changeTime + : changeTime // ignore: cast_nullable_to_non_nullable + as DateTime, + version: + null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as String, + items: + null == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List, + ), + ); } } /// @nodoc @JsonSerializable() class _$TsunamiParameterImpl implements _TsunamiParameter { - const _$TsunamiParameterImpl( - {required this.responseId, - required this.responseTime, - required this.status, - required this.changeTime, - required this.version, - required final List items}) - : _items = items; + const _$TsunamiParameterImpl({ + required this.responseId, + required this.responseTime, + required this.status, + required this.changeTime, + required this.version, + required final List items, + }) : _items = items; factory _$TsunamiParameterImpl.fromJson(Map json) => _$$TsunamiParameterImplFromJson(json); @@ -225,8 +248,15 @@ class _$TsunamiParameterImpl implements _TsunamiParameter { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, responseId, responseTime, status, - changeTime, version, const DeepCollectionEquality().hash(_items)); + int get hashCode => Object.hash( + runtimeType, + responseId, + responseTime, + status, + changeTime, + version, + const DeepCollectionEquality().hash(_items), + ); /// Create a copy of TsunamiParameter /// with the given fields replaced by the non-null parameter values. @@ -235,25 +265,25 @@ class _$TsunamiParameterImpl implements _TsunamiParameter { @pragma('vm:prefer-inline') _$$TsunamiParameterImplCopyWith<_$TsunamiParameterImpl> get copyWith => __$$TsunamiParameterImplCopyWithImpl<_$TsunamiParameterImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$TsunamiParameterImplToJson( - this, - ); + return _$$TsunamiParameterImplToJson(this); } } abstract class _TsunamiParameter implements TsunamiParameter { - const factory _TsunamiParameter( - {required final String responseId, - required final DateTime responseTime, - required final String status, - required final DateTime changeTime, - required final String version, - required final List items}) = - _$TsunamiParameterImpl; + const factory _TsunamiParameter({ + required final String responseId, + required final DateTime responseTime, + required final String status, + required final DateTime changeTime, + required final String version, + required final List items, + }) = _$TsunamiParameterImpl; factory _TsunamiParameter.fromJson(Map json) = _$TsunamiParameterImpl.fromJson; @@ -308,26 +338,30 @@ mixin _$TsunamiParameterItem { /// @nodoc abstract class $TsunamiParameterItemCopyWith<$Res> { - factory $TsunamiParameterItemCopyWith(TsunamiParameterItem value, - $Res Function(TsunamiParameterItem) then) = - _$TsunamiParameterItemCopyWithImpl<$Res, TsunamiParameterItem>; + factory $TsunamiParameterItemCopyWith( + TsunamiParameterItem value, + $Res Function(TsunamiParameterItem) then, + ) = _$TsunamiParameterItemCopyWithImpl<$Res, TsunamiParameterItem>; @useResult - $Res call( - {String? area, - String prefecture, - String code, - String name, - String kana, - String owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double longitude}); + $Res call({ + String? area, + String prefecture, + String code, + String name, + String kana, + String owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double longitude, + }); } /// @nodoc -class _$TsunamiParameterItemCopyWithImpl<$Res, - $Val extends TsunamiParameterItem> +class _$TsunamiParameterItemCopyWithImpl< + $Res, + $Val extends TsunamiParameterItem +> implements $TsunamiParameterItemCopyWith<$Res> { _$TsunamiParameterItemCopyWithImpl(this._value, this._then); @@ -350,71 +384,85 @@ class _$TsunamiParameterItemCopyWithImpl<$Res, Object? latitude = null, Object? longitude = null, }) { - return _then(_value.copyWith( - area: freezed == area - ? _value.area - : area // ignore: cast_nullable_to_non_nullable - as String?, - prefecture: null == prefecture - ? _value.prefecture - : prefecture // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - owner: null == owner - ? _value.owner - : owner // ignore: cast_nullable_to_non_nullable - as String, - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - ) as $Val); + return _then( + _value.copyWith( + area: + freezed == area + ? _value.area + : area // ignore: cast_nullable_to_non_nullable + as String?, + prefecture: + null == prefecture + ? _value.prefecture + : prefecture // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + owner: + null == owner + ? _value.owner + : owner // ignore: cast_nullable_to_non_nullable + as String, + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ) + as $Val, + ); } } /// @nodoc abstract class _$$TsunamiParameterItemImplCopyWith<$Res> implements $TsunamiParameterItemCopyWith<$Res> { - factory _$$TsunamiParameterItemImplCopyWith(_$TsunamiParameterItemImpl value, - $Res Function(_$TsunamiParameterItemImpl) then) = - __$$TsunamiParameterItemImplCopyWithImpl<$Res>; + factory _$$TsunamiParameterItemImplCopyWith( + _$TsunamiParameterItemImpl value, + $Res Function(_$TsunamiParameterItemImpl) then, + ) = __$$TsunamiParameterItemImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String? area, - String prefecture, - String code, - String name, - String kana, - String owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - double longitude}); + $Res call({ + String? area, + String prefecture, + String code, + String name, + String kana, + String owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + double longitude, + }); } /// @nodoc class __$$TsunamiParameterItemImplCopyWithImpl<$Res> extends _$TsunamiParameterItemCopyWithImpl<$Res, _$TsunamiParameterItemImpl> implements _$$TsunamiParameterItemImplCopyWith<$Res> { - __$$TsunamiParameterItemImplCopyWithImpl(_$TsunamiParameterItemImpl _value, - $Res Function(_$TsunamiParameterItemImpl) _then) - : super(_value, _then); + __$$TsunamiParameterItemImplCopyWithImpl( + _$TsunamiParameterItemImpl _value, + $Res Function(_$TsunamiParameterItemImpl) _then, + ) : super(_value, _then); /// Create a copy of TsunamiParameterItem /// with the given fields replaced by the non-null parameter values. @@ -430,57 +478,68 @@ class __$$TsunamiParameterItemImplCopyWithImpl<$Res> Object? latitude = null, Object? longitude = null, }) { - return _then(_$TsunamiParameterItemImpl( - area: freezed == area - ? _value.area - : area // ignore: cast_nullable_to_non_nullable - as String?, - prefecture: null == prefecture - ? _value.prefecture - : prefecture // ignore: cast_nullable_to_non_nullable - as String, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - name: null == name - ? _value.name - : name // ignore: cast_nullable_to_non_nullable - as String, - kana: null == kana - ? _value.kana - : kana // ignore: cast_nullable_to_non_nullable - as String, - owner: null == owner - ? _value.owner - : owner // ignore: cast_nullable_to_non_nullable - as String, - latitude: null == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double, - longitude: null == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double, - )); + return _then( + _$TsunamiParameterItemImpl( + area: + freezed == area + ? _value.area + : area // ignore: cast_nullable_to_non_nullable + as String?, + prefecture: + null == prefecture + ? _value.prefecture + : prefecture // ignore: cast_nullable_to_non_nullable + as String, + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + name: + null == name + ? _value.name + : name // ignore: cast_nullable_to_non_nullable + as String, + kana: + null == kana + ? _value.kana + : kana // ignore: cast_nullable_to_non_nullable + as String, + owner: + null == owner + ? _value.owner + : owner // ignore: cast_nullable_to_non_nullable + as String, + latitude: + null == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double, + longitude: + null == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double, + ), + ); } } /// @nodoc @JsonSerializable() class _$TsunamiParameterItemImpl implements _TsunamiParameterItem { - const _$TsunamiParameterItemImpl( - {required this.area, - required this.prefecture, - required this.code, - required this.name, - required this.kana, - required this.owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required this.latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required this.longitude}); + const _$TsunamiParameterItemImpl({ + required this.area, + required this.prefecture, + required this.code, + required this.name, + required this.kana, + required this.owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required this.latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required this.longitude, + }); factory _$TsunamiParameterItemImpl.fromJson(Map json) => _$$TsunamiParameterItemImplFromJson(json); @@ -529,8 +588,17 @@ class _$TsunamiParameterItemImpl implements _TsunamiParameterItem { @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, area, prefecture, code, name, - kana, owner, latitude, longitude); + int get hashCode => Object.hash( + runtimeType, + area, + prefecture, + code, + name, + kana, + owner, + latitude, + longitude, + ); /// Create a copy of TsunamiParameterItem /// with the given fields replaced by the non-null parameter values. @@ -538,30 +606,31 @@ class _$TsunamiParameterItemImpl implements _TsunamiParameterItem { @override @pragma('vm:prefer-inline') _$$TsunamiParameterItemImplCopyWith<_$TsunamiParameterItemImpl> - get copyWith => - __$$TsunamiParameterItemImplCopyWithImpl<_$TsunamiParameterItemImpl>( - this, _$identity); + get copyWith => + __$$TsunamiParameterItemImplCopyWithImpl<_$TsunamiParameterItemImpl>( + this, + _$identity, + ); @override Map toJson() { - return _$$TsunamiParameterItemImplToJson( - this, - ); + return _$$TsunamiParameterItemImplToJson(this); } } abstract class _TsunamiParameterItem implements TsunamiParameterItem { - const factory _TsunamiParameterItem( - {required final String? area, - required final String prefecture, - required final String code, - required final String name, - required final String kana, - required final String owner, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required final double latitude, - @JsonKey(fromJson: doubleFromString, toJson: doubleToString) - required final double longitude}) = _$TsunamiParameterItemImpl; + const factory _TsunamiParameterItem({ + required final String? area, + required final String prefecture, + required final String code, + required final String name, + required final String kana, + required final String owner, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required final double latitude, + @JsonKey(fromJson: doubleFromString, toJson: doubleToString) + required final double longitude, + }) = _$TsunamiParameterItemImpl; factory _TsunamiParameterItem.fromJson(Map json) = _$TsunamiParameterItemImpl.fromJson; @@ -590,5 +659,5 @@ abstract class _TsunamiParameterItem implements TsunamiParameterItem { @override @JsonKey(includeFromJson: false, includeToJson: false) _$$TsunamiParameterItemImplCopyWith<_$TsunamiParameterItemImpl> - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.g.dart b/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.g.dart index 585a6007..9a75f3e4 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.g.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.g.dart @@ -9,72 +9,72 @@ part of 'tsunami.dart'; // ************************************************************************** _$TsunamiParameterImpl _$$TsunamiParameterImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiParameterImpl', - json, - ($checkedConvert) { - final val = _$TsunamiParameterImpl( - responseId: $checkedConvert('responseId', (v) => v as String), - responseTime: $checkedConvert( - 'responseTime', (v) => DateTime.parse(v as String)), - status: $checkedConvert('status', (v) => v as String), - changeTime: - $checkedConvert('changeTime', (v) => DateTime.parse(v as String)), - version: $checkedConvert('version', (v) => v as String), - items: $checkedConvert( - 'items', - (v) => (v as List) - .map((e) => - TsunamiParameterItem.fromJson(e as Map)) - .toList()), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiParameterImpl', json, ($checkedConvert) { + final val = _$TsunamiParameterImpl( + responseId: $checkedConvert('responseId', (v) => v as String), + responseTime: $checkedConvert( + 'responseTime', + (v) => DateTime.parse(v as String), + ), + status: $checkedConvert('status', (v) => v as String), + changeTime: $checkedConvert( + 'changeTime', + (v) => DateTime.parse(v as String), + ), + version: $checkedConvert('version', (v) => v as String), + items: $checkedConvert( + 'items', + (v) => + (v as List) + .map( + (e) => TsunamiParameterItem.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; +}); Map _$$TsunamiParameterImplToJson( - _$TsunamiParameterImpl instance) => - { - 'responseId': instance.responseId, - 'responseTime': instance.responseTime.toIso8601String(), - 'status': instance.status, - 'changeTime': instance.changeTime.toIso8601String(), - 'version': instance.version, - 'items': instance.items, - }; + _$TsunamiParameterImpl instance, +) => { + 'responseId': instance.responseId, + 'responseTime': instance.responseTime.toIso8601String(), + 'status': instance.status, + 'changeTime': instance.changeTime.toIso8601String(), + 'version': instance.version, + 'items': instance.items, +}; _$TsunamiParameterItemImpl _$$TsunamiParameterItemImplFromJson( - Map json) => - $checkedCreate( - r'_$TsunamiParameterItemImpl', - json, - ($checkedConvert) { - final val = _$TsunamiParameterItemImpl( - area: $checkedConvert('area', (v) => v as String?), - prefecture: $checkedConvert('prefecture', (v) => v as String), - code: $checkedConvert('code', (v) => v as String), - name: $checkedConvert('name', (v) => v as String), - kana: $checkedConvert('kana', (v) => v as String), - owner: $checkedConvert('owner', (v) => v as String), - latitude: - $checkedConvert('latitude', (v) => doubleFromString(v as String)), - longitude: $checkedConvert( - 'longitude', (v) => doubleFromString(v as String)), - ); - return val; - }, - ); + Map json, +) => $checkedCreate(r'_$TsunamiParameterItemImpl', json, ($checkedConvert) { + final val = _$TsunamiParameterItemImpl( + area: $checkedConvert('area', (v) => v as String?), + prefecture: $checkedConvert('prefecture', (v) => v as String), + code: $checkedConvert('code', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + kana: $checkedConvert('kana', (v) => v as String), + owner: $checkedConvert('owner', (v) => v as String), + latitude: $checkedConvert('latitude', (v) => doubleFromString(v as String)), + longitude: $checkedConvert( + 'longitude', + (v) => doubleFromString(v as String), + ), + ); + return val; +}); Map _$$TsunamiParameterItemImplToJson( - _$TsunamiParameterItemImpl instance) => - { - 'area': instance.area, - 'prefecture': instance.prefecture, - 'code': instance.code, - 'name': instance.name, - 'kana': instance.kana, - 'owner': instance.owner, - 'latitude': doubleToString(instance.latitude), - 'longitude': doubleToString(instance.longitude), - }; + _$TsunamiParameterItemImpl instance, +) => { + 'area': instance.area, + 'prefecture': instance.prefecture, + 'code': instance.code, + 'name': instance.name, + 'kana': instance.kana, + 'owner': instance.owner, + 'latitude': doubleToString(instance.latitude), + 'longitude': doubleToString(instance.longitude), +}; diff --git a/packages/kyoshin_monitor_api/bin/kyoshin_monitor_api.dart b/packages/kyoshin_monitor_api/bin/kyoshin_monitor_api.dart index cac07b51..0d89e621 100644 --- a/packages/kyoshin_monitor_api/bin/kyoshin_monitor_api.dart +++ b/packages/kyoshin_monitor_api/bin/kyoshin_monitor_api.dart @@ -5,10 +5,8 @@ import 'package:dio/dio.dart'; import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; void main(List args) async { - final runner = CommandRunner( - 'kmoni', - '強震モニタのデータをダウンロードするCLIツール', - )..addCommand(DownloadCommand()); + final runner = CommandRunner('kmoni', '強震モニタのデータをダウンロードするCLIツール') + ..addCommand(DownloadCommand()); await runner.run(args); } @@ -34,18 +32,12 @@ class DownloadCommand extends Command { 'datetime', abbr: 'd', help: '日時を指定します (yyyyMMddHHmmss形式)', - defaultsTo: DateTime.now() - .subtract( - const Duration(seconds: 10), - ) - .toIso8601String(), + defaultsTo: + DateTime.now() + .subtract(const Duration(seconds: 10)) + .toIso8601String(), ) - ..addOption( - 'output', - abbr: 'o', - help: '出力ファイル名を指定します', - mandatory: true, - ); + ..addOption('output', abbr: 'o', help: '出力ファイル名を指定します', mandatory: true); } @override @@ -62,31 +54,30 @@ class DownloadCommand extends Command { final layer = RealtimeLayer.values.firstWhere( (e) => e.urlString == argResults!['layer'] as String, ); - final datetime = DateTime.parse( - argResults!['datetime'] as String, - ); + final datetime = DateTime.parse(argResults!['datetime'] as String); final output = argResults!['output'] as String; final dio = Dio(); final lpgmKyoshinMonitorWebApiDataSource = LpgmKyoshinMonitorWebApiDataSource( - client: LpgmKyoshinMonitorWebApiClient(dio), - ); + client: LpgmKyoshinMonitorWebApiClient(dio), + ); final kyoshinMonitorWebApiDataSource = KyoshinMonitorWebApiDataSource( client: KyoshinMonitorWebApiClient(dio), ); try { - final data = type.isLpgm - ? await lpgmKyoshinMonitorWebApiDataSource.getRealtimeImageData( - type, - layer, - datetime, - ) - : await kyoshinMonitorWebApiDataSource.getRealtimeImageData( - type: type, - layer: layer, - dateTime: datetime, - ); + final data = + type.isLpgm + ? await lpgmKyoshinMonitorWebApiDataSource.getRealtimeImageData( + type, + layer, + datetime, + ) + : await kyoshinMonitorWebApiDataSource.getRealtimeImageData( + type: type, + layer: layer, + dateTime: datetime, + ); await File(output).writeAsBytes(data); print('ダウンロードが完了しました: $output'); } on Exception catch (e) { diff --git a/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.dart b/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.dart index 24382f0b..63aa427c 100644 --- a/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.dart +++ b/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.dart @@ -27,9 +27,7 @@ abstract class KyoshinMonitorWebApiClient { /// [theme] 白(w), グレー(b) @GET('/data/map_img/CommonImg/base_map_{theme}.gif') @DioResponseType(ResponseType.bytes) - Future> getBaseMapImageData({ - @Path('theme') required String theme, - }); + Future> getBaseMapImageData({@Path('theme') required String theme}); /// スケール /// @@ -48,9 +46,7 @@ abstract class KyoshinMonitorWebApiClient { /// /// [dateTime] 日付(yyyyMMddHHmmss) @GET('/webservice/hypo/eew/{dateTime}.json') - Future getJsonEew({ - @Path('dateTime') required String dateTime, - }); + Future getJsonEew({@Path('dateTime') required String dateTime}); /// PsWaveImg /// diff --git a/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.g.dart b/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.g.dart index bbe7eadb..f339d976 100644 --- a/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/api/kyoshin_monitor_web_api_client.g.dart @@ -11,11 +11,7 @@ part of 'kyoshin_monitor_web_api_client.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { - _KyoshinMonitorWebApiClient( - this._dio, { - this.baseUrl, - this.errorLogger, - }) { + _KyoshinMonitorWebApiClient(this._dio, {this.baseUrl, this.errorLogger}) { baseUrl ??= 'http://www.kmoni.bosai.go.jp'; } @@ -31,22 +27,16 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/webservice/server/pros/latest.json', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/webservice/server/pros/latest.json', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late DataTime _value; try { @@ -64,22 +54,16 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/webservice/maintenance/message.json', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/webservice/maintenance/message.json', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late MaintenanceMessage _value; try { @@ -97,23 +81,21 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/data/map_img/CommonImg/base_map_${theme}.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/data/map_img/CommonImg/base_map_${theme}.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -135,23 +117,21 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/data/map_img/ScaleImg/nied_${type}_${layer}_${theme}_scale.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/data/map_img/ScaleImg/nied_${type}_${layer}_${theme}_scale.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -169,22 +149,16 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/webservice/hypo/eew/${dateTime}.json', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/webservice/hypo/eew/${dateTime}.json', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late Eew _value; try { @@ -205,23 +179,21 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/data/map_img/PSWaveImg/eew/${date}/${dateTime}.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/data/map_img/PSWaveImg/eew/${date}/${dateTime}.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -244,23 +216,21 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/data/map_img/RealTimeImg/${type}_${layer}/${date}/${dateTime}.${type}_${layer}.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/data/map_img/RealTimeImg/${type}_${layer}/${date}/${dateTime}.${type}_${layer}.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -281,23 +251,21 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/data/map_img/EstShindoImg/eew/${date}/${dateTime}.eew.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/data/map_img/EstShindoImg/eew/${date}/${dateTime}.eew.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -322,10 +290,7 @@ class _KyoshinMonitorWebApiClient implements KyoshinMonitorWebApiClient { return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.dart b/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.dart index 1259a9e4..40ba75f3 100644 --- a/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.dart +++ b/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.dart @@ -6,19 +6,15 @@ part 'lpgm_kyoshin_monitor_web_api_client.g.dart'; @RestApi(baseUrl: 'https://www.lmoni.bosai.go.jp') abstract class LpgmKyoshinMonitorWebApiClient { - factory LpgmKyoshinMonitorWebApiClient( - Dio dio, { - String baseUrl, - }) = _LpgmKyoshinMonitorWebApiClient; + factory LpgmKyoshinMonitorWebApiClient(Dio dio, {String baseUrl}) = + _LpgmKyoshinMonitorWebApiClient; /// ベース画像 /// /// [theme] 白(w), グレー(b) @GET('/monitor/data/data/map_img/CommonImg/base_map_{theme}.gif') @DioResponseType(ResponseType.bytes) - Future> getBaseMapImageData({ - @Path('theme') required String theme, - }); + Future> getBaseMapImageData({@Path('theme') required String theme}); /// スケール /// @@ -39,9 +35,7 @@ abstract class LpgmKyoshinMonitorWebApiClient { /// /// [dateTime] 日付(yyyyMMddHHmmss) @GET('/monitor/webservice/hypo/eew/{dateTime}.json') - Future getJsonEew({ - @Path('dateTime') required String dateTime, - }); + Future getJsonEew({@Path('dateTime') required String dateTime}); /// PsWaveImg /// diff --git a/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.g.dart b/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.g.dart index d8bc033e..12b6c624 100644 --- a/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/api/lpgm_kyoshin_monitor_web_api_client.g.dart @@ -12,11 +12,7 @@ part of 'lpgm_kyoshin_monitor_web_api_client.dart'; class _LpgmKyoshinMonitorWebApiClient implements LpgmKyoshinMonitorWebApiClient { - _LpgmKyoshinMonitorWebApiClient( - this._dio, { - this.baseUrl, - this.errorLogger, - }) { + _LpgmKyoshinMonitorWebApiClient(this._dio, {this.baseUrl, this.errorLogger}) { baseUrl ??= 'https://www.lmoni.bosai.go.jp'; } @@ -32,23 +28,21 @@ class _LpgmKyoshinMonitorWebApiClient final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/monitor/data/data/map_img/CommonImg/base_map_${theme}.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/monitor/data/data/map_img/CommonImg/base_map_${theme}.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -70,23 +64,21 @@ class _LpgmKyoshinMonitorWebApiClient final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/monitor/data/data/map_img/ScaleImg2/nied_${type}_${layer}_${theme}_scale.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/monitor/data/data/map_img/ScaleImg2/nied_${type}_${layer}_${theme}_scale.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -104,22 +96,16 @@ class _LpgmKyoshinMonitorWebApiClient final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( - method: 'GET', - headers: _headers, - extra: _extra, - ) - .compose( - _dio.options, - '/monitor/webservice/hypo/eew/${dateTime}.json', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/monitor/webservice/hypo/eew/${dateTime}.json', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late Eew _value; try { @@ -140,23 +126,21 @@ class _LpgmKyoshinMonitorWebApiClient final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/monitor/data/data/map_img/PSWaveImg/eew/${date}/${dateTime}_eew.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/monitor/data/data/map_img/PSWaveImg/eew/${date}/${dateTime}_eew.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -179,23 +163,21 @@ class _LpgmKyoshinMonitorWebApiClient final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType>(Options( - method: 'GET', - headers: _headers, - extra: _extra, - responseType: ResponseType.bytes, - ) - .compose( - _dio.options, - '/monitor/data/data/map_img/RealTimeImg/${type}_${layer}/${date}/${dateTime}.${type}_${layer}.gif', - queryParameters: queryParameters, - data: _data, - ) - .copyWith( - baseUrl: _combineBaseUrls( - _dio.options.baseUrl, - baseUrl, - ))); + final _options = _setStreamType>( + Options( + method: 'GET', + headers: _headers, + extra: _extra, + responseType: ResponseType.bytes, + ) + .compose( + _dio.options, + '/monitor/data/data/map_img/RealTimeImg/${type}_${layer}/${date}/${dateTime}.${type}_${layer}.gif', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); final _result = await _dio.fetch>(_options); late List _value; try { @@ -220,10 +202,7 @@ class _LpgmKyoshinMonitorWebApiClient return requestOptions; } - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { + String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/kyoshin_monitor_api/lib/src/data_source/kyoshin_monitor_web_api_data_source.dart b/packages/kyoshin_monitor_api/lib/src/data_source/kyoshin_monitor_web_api_data_source.dart index 075b612e..b20815ed 100644 --- a/packages/kyoshin_monitor_api/lib/src/data_source/kyoshin_monitor_web_api_data_source.dart +++ b/packages/kyoshin_monitor_api/lib/src/data_source/kyoshin_monitor_web_api_data_source.dart @@ -5,9 +5,8 @@ import 'package:kyoshin_monitor_api/src/model/web_api/data_time.dart'; import 'package:kyoshin_monitor_api/src/model/web_api/maintenance_message.dart'; class KyoshinMonitorWebApiDataSource { - KyoshinMonitorWebApiDataSource({ - required KyoshinMonitorWebApiClient client, - }) : _client = client; + KyoshinMonitorWebApiDataSource({required KyoshinMonitorWebApiClient client}) + : _client = client; final KyoshinMonitorWebApiClient _client; @@ -27,12 +26,11 @@ class KyoshinMonitorWebApiDataSource { RealtimeDataType type, RealtimeLayer layer, BaseMapTheme theme, - ) async => - _client.getScaleImageData( - type: type.urlString, - layer: layer.urlString, - theme: theme.urlString, - ); + ) async => _client.getScaleImageData( + type: type.urlString, + layer: layer.urlString, + theme: theme.urlString, + ); /// PsWaveImg Future> getPsWaveImageData(DateTime dateTime) async => @@ -133,8 +131,7 @@ enum RealtimeDataType { /// 階級データ(周期7秒台) /// Lpgm系列でのみ利用可 - abrsp7s('階級データ(周期7秒台)', 'abrsp7s', true), - ; + abrsp7s('階級データ(周期7秒台)', 'abrsp7s', true); // ignore: avoid_positional_boolean_parameters const RealtimeDataType(this.displayName, this.urlString, this.isLpgm); @@ -156,10 +153,7 @@ enum RealtimeLayer { /// 地下 underground('地下', 'b'); - const RealtimeLayer( - this.displayName, - this.urlString, - ); + const RealtimeLayer(this.displayName, this.urlString); /// 表示名 final String displayName; diff --git a/packages/kyoshin_monitor_api/lib/src/data_source/lpgm_kyoshin_monitor_web_api_data_source.dart b/packages/kyoshin_monitor_api/lib/src/data_source/lpgm_kyoshin_monitor_web_api_data_source.dart index 7b7d7894..260875f8 100644 --- a/packages/kyoshin_monitor_api/lib/src/data_source/lpgm_kyoshin_monitor_web_api_data_source.dart +++ b/packages/kyoshin_monitor_api/lib/src/data_source/lpgm_kyoshin_monitor_web_api_data_source.dart @@ -18,12 +18,11 @@ class LpgmKyoshinMonitorWebApiDataSource { RealtimeDataType type, RealtimeLayer layer, BaseMapTheme theme, - ) async => - _client.getScaleImageData( - type: type.urlString, - layer: layer.urlString, - theme: theme.urlString, - ); + ) async => _client.getScaleImageData( + type: type.urlString, + layer: layer.urlString, + theme: theme.urlString, + ); /// PsWaveImg Future> getPsWaveImageData(DateTime dateTime) async => @@ -37,13 +36,12 @@ class LpgmKyoshinMonitorWebApiDataSource { RealtimeDataType type, RealtimeLayer layer, DateTime dateTime, - ) async => - _client.getRealtimeImageData( - type: type.urlString, - layer: layer.urlString, - date: dateFormat.format(dateTime), - dateTime: dateTimeFormat.format(dateTime), - ); + ) async => _client.getRealtimeImageData( + type: type.urlString, + layer: layer.urlString, + date: dateFormat.format(dateTime), + dateTime: dateTimeFormat.format(dateTime), + ); static DateFormat get dateFormat => DateFormat('yyyyMMdd'); static DateFormat get dateTimeFormat => DateFormat('yyyyMMddHHmmss'); diff --git a/packages/kyoshin_monitor_api/lib/src/model/app_api/prefecture.dart b/packages/kyoshin_monitor_api/lib/src/model/app_api/prefecture.dart index 7be762ca..c7cf37e4 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/app_api/prefecture.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/app_api/prefecture.dart @@ -147,10 +147,7 @@ enum Prefecture { /// 不明 unknown(shortName: '不明', longName: '不明'); - const Prefecture({ - required this.shortName, - required this.longName, - }); + const Prefecture({required this.shortName, required this.longName}); /// 短縮名 final String shortName; diff --git a/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.freezed.dart index b7d9ad3b..90e103cc 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.freezed.dart @@ -12,7 +12,8 @@ part of 'real_time_data.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); RealTimeData _$RealTimeDataFromJson(Map json) { return _RealTimeData.fromJson(json); @@ -42,18 +43,20 @@ mixin _$RealTimeData { /// @nodoc abstract class $RealTimeDataCopyWith<$Res> { factory $RealTimeDataCopyWith( - RealTimeData value, $Res Function(RealTimeData) then) = - _$RealTimeDataCopyWithImpl<$Res, RealTimeData>; + RealTimeData value, + $Res Function(RealTimeData) then, + ) = _$RealTimeDataCopyWithImpl<$Res, RealTimeData>; @useResult - $Res call( - {DateTime? dateTime, - String? packetType, - String? kyoshinType, - String? baseData, - String? baseSerialNo, - List? items, - Result? result, - Security? security}); + $Res call({ + DateTime? dateTime, + String? packetType, + String? kyoshinType, + String? baseData, + String? baseSerialNo, + List? items, + Result? result, + Security? security, + }); $ResultCopyWith<$Res>? get result; $SecurityCopyWith<$Res>? get security; @@ -83,40 +86,51 @@ class _$RealTimeDataCopyWithImpl<$Res, $Val extends RealTimeData> Object? result = freezed, Object? security = freezed, }) { - return _then(_value.copyWith( - dateTime: freezed == dateTime - ? _value.dateTime - : dateTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - packetType: freezed == packetType - ? _value.packetType - : packetType // ignore: cast_nullable_to_non_nullable - as String?, - kyoshinType: freezed == kyoshinType - ? _value.kyoshinType - : kyoshinType // ignore: cast_nullable_to_non_nullable - as String?, - baseData: freezed == baseData - ? _value.baseData - : baseData // ignore: cast_nullable_to_non_nullable - as String?, - baseSerialNo: freezed == baseSerialNo - ? _value.baseSerialNo - : baseSerialNo // ignore: cast_nullable_to_non_nullable - as String?, - items: freezed == items - ? _value.items - : items // ignore: cast_nullable_to_non_nullable - as List?, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - ) as $Val); + return _then( + _value.copyWith( + dateTime: + freezed == dateTime + ? _value.dateTime + : dateTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + packetType: + freezed == packetType + ? _value.packetType + : packetType // ignore: cast_nullable_to_non_nullable + as String?, + kyoshinType: + freezed == kyoshinType + ? _value.kyoshinType + : kyoshinType // ignore: cast_nullable_to_non_nullable + as String?, + baseData: + freezed == baseData + ? _value.baseData + : baseData // ignore: cast_nullable_to_non_nullable + as String?, + baseSerialNo: + freezed == baseSerialNo + ? _value.baseSerialNo + : baseSerialNo // ignore: cast_nullable_to_non_nullable + as String?, + items: + freezed == items + ? _value.items + : items // ignore: cast_nullable_to_non_nullable + as List?, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + ) + as $Val, + ); } /// Create a copy of RealTimeData @@ -152,19 +166,21 @@ class _$RealTimeDataCopyWithImpl<$Res, $Val extends RealTimeData> abstract class _$$RealTimeDataImplCopyWith<$Res> implements $RealTimeDataCopyWith<$Res> { factory _$$RealTimeDataImplCopyWith( - _$RealTimeDataImpl value, $Res Function(_$RealTimeDataImpl) then) = - __$$RealTimeDataImplCopyWithImpl<$Res>; + _$RealTimeDataImpl value, + $Res Function(_$RealTimeDataImpl) then, + ) = __$$RealTimeDataImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {DateTime? dateTime, - String? packetType, - String? kyoshinType, - String? baseData, - String? baseSerialNo, - List? items, - Result? result, - Security? security}); + $Res call({ + DateTime? dateTime, + String? packetType, + String? kyoshinType, + String? baseData, + String? baseSerialNo, + List? items, + Result? result, + Security? security, + }); @override $ResultCopyWith<$Res>? get result; @@ -177,8 +193,9 @@ class __$$RealTimeDataImplCopyWithImpl<$Res> extends _$RealTimeDataCopyWithImpl<$Res, _$RealTimeDataImpl> implements _$$RealTimeDataImplCopyWith<$Res> { __$$RealTimeDataImplCopyWithImpl( - _$RealTimeDataImpl _value, $Res Function(_$RealTimeDataImpl) _then) - : super(_value, _then); + _$RealTimeDataImpl _value, + $Res Function(_$RealTimeDataImpl) _then, + ) : super(_value, _then); /// Create a copy of RealTimeData /// with the given fields replaced by the non-null parameter values. @@ -194,56 +211,66 @@ class __$$RealTimeDataImplCopyWithImpl<$Res> Object? result = freezed, Object? security = freezed, }) { - return _then(_$RealTimeDataImpl( - dateTime: freezed == dateTime - ? _value.dateTime - : dateTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - packetType: freezed == packetType - ? _value.packetType - : packetType // ignore: cast_nullable_to_non_nullable - as String?, - kyoshinType: freezed == kyoshinType - ? _value.kyoshinType - : kyoshinType // ignore: cast_nullable_to_non_nullable - as String?, - baseData: freezed == baseData - ? _value.baseData - : baseData // ignore: cast_nullable_to_non_nullable - as String?, - baseSerialNo: freezed == baseSerialNo - ? _value.baseSerialNo - : baseSerialNo // ignore: cast_nullable_to_non_nullable - as String?, - items: freezed == items - ? _value._items - : items // ignore: cast_nullable_to_non_nullable - as List?, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - )); + return _then( + _$RealTimeDataImpl( + dateTime: + freezed == dateTime + ? _value.dateTime + : dateTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + packetType: + freezed == packetType + ? _value.packetType + : packetType // ignore: cast_nullable_to_non_nullable + as String?, + kyoshinType: + freezed == kyoshinType + ? _value.kyoshinType + : kyoshinType // ignore: cast_nullable_to_non_nullable + as String?, + baseData: + freezed == baseData + ? _value.baseData + : baseData // ignore: cast_nullable_to_non_nullable + as String?, + baseSerialNo: + freezed == baseSerialNo + ? _value.baseSerialNo + : baseSerialNo // ignore: cast_nullable_to_non_nullable + as String?, + items: + freezed == items + ? _value._items + : items // ignore: cast_nullable_to_non_nullable + as List?, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + ), + ); } } /// @nodoc @JsonSerializable() class _$RealTimeDataImpl implements _RealTimeData { - const _$RealTimeDataImpl( - {required this.dateTime, - required this.packetType, - required this.kyoshinType, - required this.baseData, - required this.baseSerialNo, - required final List? items, - required this.result, - required this.security}) - : _items = items; + const _$RealTimeDataImpl({ + required this.dateTime, + required this.packetType, + required this.kyoshinType, + required this.baseData, + required this.baseSerialNo, + required final List? items, + required this.result, + required this.security, + }) : _items = items; factory _$RealTimeDataImpl.fromJson(Map json) => _$$RealTimeDataImplFromJson(json); @@ -302,15 +329,16 @@ class _$RealTimeDataImpl implements _RealTimeData { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - dateTime, - packetType, - kyoshinType, - baseData, - baseSerialNo, - const DeepCollectionEquality().hash(_items), - result, - security); + runtimeType, + dateTime, + packetType, + kyoshinType, + baseData, + baseSerialNo, + const DeepCollectionEquality().hash(_items), + result, + security, + ); /// Create a copy of RealTimeData /// with the given fields replaced by the non-null parameter values. @@ -322,22 +350,21 @@ class _$RealTimeDataImpl implements _RealTimeData { @override Map toJson() { - return _$$RealTimeDataImplToJson( - this, - ); + return _$$RealTimeDataImplToJson(this); } } abstract class _RealTimeData implements RealTimeData { - const factory _RealTimeData( - {required final DateTime? dateTime, - required final String? packetType, - required final String? kyoshinType, - required final String? baseData, - required final String? baseSerialNo, - required final List? items, - required final Result? result, - required final Security? security}) = _$RealTimeDataImpl; + const factory _RealTimeData({ + required final DateTime? dateTime, + required final String? packetType, + required final String? kyoshinType, + required final String? baseData, + required final String? baseSerialNo, + required final List? items, + required final Result? result, + required final Security? security, + }) = _$RealTimeDataImpl; factory _RealTimeData.fromJson(Map json) = _$RealTimeDataImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.g.dart b/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.g.dart index 855758d1..787b63a4 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/app_api/real_time_data.g.dart @@ -8,44 +8,45 @@ part of 'real_time_data.dart'; // JsonSerializableGenerator // ************************************************************************** -_$RealTimeDataImpl _$$RealTimeDataImplFromJson(Map json) => - $checkedCreate( - r'_$RealTimeDataImpl', - json, - ($checkedConvert) { - final val = _$RealTimeDataImpl( - dateTime: $checkedConvert('date_time', - (v) => v == null ? null : DateTime.parse(v as String)), - packetType: $checkedConvert('packet_type', (v) => v as String?), - kyoshinType: $checkedConvert('kyoshin_type', (v) => v as String?), - baseData: $checkedConvert('base_data', (v) => v as String?), - baseSerialNo: $checkedConvert('base_serial_no', (v) => v as String?), - items: $checkedConvert( - 'items', - (v) => (v as List?) - ?.map((e) => (e as num?)?.toDouble()) - .toList()), - result: $checkedConvert( - 'result', - (v) => v == null - ? null - : Result.fromJson(v as Map)), - security: $checkedConvert( - 'security', - (v) => v == null - ? null - : Security.fromJson(v as Map)), - ); - return val; - }, - fieldKeyMap: const { - 'dateTime': 'date_time', - 'packetType': 'packet_type', - 'kyoshinType': 'kyoshin_type', - 'baseData': 'base_data', - 'baseSerialNo': 'base_serial_no' - }, +_$RealTimeDataImpl _$$RealTimeDataImplFromJson( + Map json, +) => $checkedCreate( + r'_$RealTimeDataImpl', + json, + ($checkedConvert) { + final val = _$RealTimeDataImpl( + dateTime: $checkedConvert( + 'date_time', + (v) => v == null ? null : DateTime.parse(v as String), + ), + packetType: $checkedConvert('packet_type', (v) => v as String?), + kyoshinType: $checkedConvert('kyoshin_type', (v) => v as String?), + baseData: $checkedConvert('base_data', (v) => v as String?), + baseSerialNo: $checkedConvert('base_serial_no', (v) => v as String?), + items: $checkedConvert( + 'items', + (v) => + (v as List?)?.map((e) => (e as num?)?.toDouble()).toList(), + ), + result: $checkedConvert( + 'result', + (v) => v == null ? null : Result.fromJson(v as Map), + ), + security: $checkedConvert( + 'security', + (v) => v == null ? null : Security.fromJson(v as Map), + ), ); + return val; + }, + fieldKeyMap: const { + 'dateTime': 'date_time', + 'packetType': 'packet_type', + 'kyoshinType': 'kyoshin_type', + 'baseData': 'base_data', + 'baseSerialNo': 'base_serial_no', + }, +); Map _$$RealTimeDataImplToJson(_$RealTimeDataImpl instance) => { diff --git a/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.freezed.dart index 9a707c9a..357760d9 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.freezed.dart @@ -12,7 +12,8 @@ part of 'site_list.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); SiteList _$SiteListFromJson(Map json) { return _SiteList.fromJson(json); @@ -51,12 +52,13 @@ abstract class $SiteListCopyWith<$Res> { factory $SiteListCopyWith(SiteList value, $Res Function(SiteList) then) = _$SiteListCopyWithImpl<$Res, SiteList>; @useResult - $Res call( - {@JsonKey(name: 'items') List? sites, - Security? security, - String? dataTime, - Result? result, - String? serialNo}); + $Res call({ + @JsonKey(name: 'items') List? sites, + Security? security, + String? dataTime, + Result? result, + String? serialNo, + }); $SecurityCopyWith<$Res>? get security; $ResultCopyWith<$Res>? get result; @@ -83,28 +85,36 @@ class _$SiteListCopyWithImpl<$Res, $Val extends SiteList> Object? result = freezed, Object? serialNo = freezed, }) { - return _then(_value.copyWith( - sites: freezed == sites - ? _value.sites - : sites // ignore: cast_nullable_to_non_nullable - as List?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - dataTime: freezed == dataTime - ? _value.dataTime - : dataTime // ignore: cast_nullable_to_non_nullable - as String?, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + sites: + freezed == sites + ? _value.sites + : sites // ignore: cast_nullable_to_non_nullable + as List?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + dataTime: + freezed == dataTime + ? _value.dataTime + : dataTime // ignore: cast_nullable_to_non_nullable + as String?, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } /// Create a copy of SiteList @@ -140,16 +150,18 @@ class _$SiteListCopyWithImpl<$Res, $Val extends SiteList> abstract class _$$SiteListImplCopyWith<$Res> implements $SiteListCopyWith<$Res> { factory _$$SiteListImplCopyWith( - _$SiteListImpl value, $Res Function(_$SiteListImpl) then) = - __$$SiteListImplCopyWithImpl<$Res>; + _$SiteListImpl value, + $Res Function(_$SiteListImpl) then, + ) = __$$SiteListImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(name: 'items') List? sites, - Security? security, - String? dataTime, - Result? result, - String? serialNo}); + $Res call({ + @JsonKey(name: 'items') List? sites, + Security? security, + String? dataTime, + Result? result, + String? serialNo, + }); @override $SecurityCopyWith<$Res>? get security; @@ -162,8 +174,9 @@ class __$$SiteListImplCopyWithImpl<$Res> extends _$SiteListCopyWithImpl<$Res, _$SiteListImpl> implements _$$SiteListImplCopyWith<$Res> { __$$SiteListImplCopyWithImpl( - _$SiteListImpl _value, $Res Function(_$SiteListImpl) _then) - : super(_value, _then); + _$SiteListImpl _value, + $Res Function(_$SiteListImpl) _then, + ) : super(_value, _then); /// Create a copy of SiteList /// with the given fields replaced by the non-null parameter values. @@ -176,41 +189,48 @@ class __$$SiteListImplCopyWithImpl<$Res> Object? result = freezed, Object? serialNo = freezed, }) { - return _then(_$SiteListImpl( - sites: freezed == sites - ? _value._sites - : sites // ignore: cast_nullable_to_non_nullable - as List?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - dataTime: freezed == dataTime - ? _value.dataTime - : dataTime // ignore: cast_nullable_to_non_nullable - as String?, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - serialNo: freezed == serialNo - ? _value.serialNo - : serialNo // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$SiteListImpl( + sites: + freezed == sites + ? _value._sites + : sites // ignore: cast_nullable_to_non_nullable + as List?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + dataTime: + freezed == dataTime + ? _value.dataTime + : dataTime // ignore: cast_nullable_to_non_nullable + as String?, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + serialNo: + freezed == serialNo + ? _value.serialNo + : serialNo // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$SiteListImpl implements _SiteList { - const _$SiteListImpl( - {@JsonKey(name: 'items') final List? sites, - this.security, - this.dataTime, - this.result, - this.serialNo}) - : _sites = sites; + const _$SiteListImpl({ + @JsonKey(name: 'items') final List? sites, + this.security, + this.dataTime, + this.result, + this.serialNo, + }) : _sites = sites; factory _$SiteListImpl.fromJson(Map json) => _$$SiteListImplFromJson(json); @@ -268,12 +288,13 @@ class _$SiteListImpl implements _SiteList { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_sites), - security, - dataTime, - result, - serialNo); + runtimeType, + const DeepCollectionEquality().hash(_sites), + security, + dataTime, + result, + serialNo, + ); /// Create a copy of SiteList /// with the given fields replaced by the non-null parameter values. @@ -285,19 +306,18 @@ class _$SiteListImpl implements _SiteList { @override Map toJson() { - return _$$SiteListImplToJson( - this, - ); + return _$$SiteListImplToJson(this); } } abstract class _SiteList implements SiteList { - const factory _SiteList( - {@JsonKey(name: 'items') final List? sites, - final Security? security, - final String? dataTime, - final Result? result, - final String? serialNo}) = _$SiteListImpl; + const factory _SiteList({ + @JsonKey(name: 'items') final List? sites, + final Security? security, + final String? dataTime, + final Result? result, + final String? serialNo, + }) = _$SiteListImpl; factory _SiteList.fromJson(Map json) = _$SiteListImpl.fromJson; @@ -371,13 +391,14 @@ abstract class $SiteCopyWith<$Res> { factory $SiteCopyWith(Site value, $Res Function(Site) then) = _$SiteCopyWithImpl<$Res, Site>; @useResult - $Res call( - {int? muni, - int? siteidx, - @JsonKey(name: 'pref') int? prefectureId, - @JsonKey(name: 'siteid') String? siteId, - double? lat, - double? lng}); + $Res call({ + int? muni, + int? siteidx, + @JsonKey(name: 'pref') int? prefectureId, + @JsonKey(name: 'siteid') String? siteId, + double? lat, + double? lng, + }); } /// @nodoc @@ -402,49 +423,60 @@ class _$SiteCopyWithImpl<$Res, $Val extends Site> Object? lat = freezed, Object? lng = freezed, }) { - return _then(_value.copyWith( - muni: freezed == muni - ? _value.muni - : muni // ignore: cast_nullable_to_non_nullable - as int?, - siteidx: freezed == siteidx - ? _value.siteidx - : siteidx // ignore: cast_nullable_to_non_nullable - as int?, - prefectureId: freezed == prefectureId - ? _value.prefectureId - : prefectureId // ignore: cast_nullable_to_non_nullable - as int?, - siteId: freezed == siteId - ? _value.siteId - : siteId // ignore: cast_nullable_to_non_nullable - as String?, - lat: freezed == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double?, - lng: freezed == lng - ? _value.lng - : lng // ignore: cast_nullable_to_non_nullable - as double?, - ) as $Val); + return _then( + _value.copyWith( + muni: + freezed == muni + ? _value.muni + : muni // ignore: cast_nullable_to_non_nullable + as int?, + siteidx: + freezed == siteidx + ? _value.siteidx + : siteidx // ignore: cast_nullable_to_non_nullable + as int?, + prefectureId: + freezed == prefectureId + ? _value.prefectureId + : prefectureId // ignore: cast_nullable_to_non_nullable + as int?, + siteId: + freezed == siteId + ? _value.siteId + : siteId // ignore: cast_nullable_to_non_nullable + as String?, + lat: + freezed == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double?, + lng: + freezed == lng + ? _value.lng + : lng // ignore: cast_nullable_to_non_nullable + as double?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$SiteImplCopyWith<$Res> implements $SiteCopyWith<$Res> { factory _$$SiteImplCopyWith( - _$SiteImpl value, $Res Function(_$SiteImpl) then) = - __$$SiteImplCopyWithImpl<$Res>; + _$SiteImpl value, + $Res Function(_$SiteImpl) then, + ) = __$$SiteImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {int? muni, - int? siteidx, - @JsonKey(name: 'pref') int? prefectureId, - @JsonKey(name: 'siteid') String? siteId, - double? lat, - double? lng}); + $Res call({ + int? muni, + int? siteidx, + @JsonKey(name: 'pref') int? prefectureId, + @JsonKey(name: 'siteid') String? siteId, + double? lat, + double? lng, + }); } /// @nodoc @@ -452,7 +484,7 @@ class __$$SiteImplCopyWithImpl<$Res> extends _$SiteCopyWithImpl<$Res, _$SiteImpl> implements _$$SiteImplCopyWith<$Res> { __$$SiteImplCopyWithImpl(_$SiteImpl _value, $Res Function(_$SiteImpl) _then) - : super(_value, _then); + : super(_value, _then); /// Create a copy of Site /// with the given fields replaced by the non-null parameter values. @@ -466,46 +498,54 @@ class __$$SiteImplCopyWithImpl<$Res> Object? lat = freezed, Object? lng = freezed, }) { - return _then(_$SiteImpl( - muni: freezed == muni - ? _value.muni - : muni // ignore: cast_nullable_to_non_nullable - as int?, - siteidx: freezed == siteidx - ? _value.siteidx - : siteidx // ignore: cast_nullable_to_non_nullable - as int?, - prefectureId: freezed == prefectureId - ? _value.prefectureId - : prefectureId // ignore: cast_nullable_to_non_nullable - as int?, - siteId: freezed == siteId - ? _value.siteId - : siteId // ignore: cast_nullable_to_non_nullable - as String?, - lat: freezed == lat - ? _value.lat - : lat // ignore: cast_nullable_to_non_nullable - as double?, - lng: freezed == lng - ? _value.lng - : lng // ignore: cast_nullable_to_non_nullable - as double?, - )); + return _then( + _$SiteImpl( + muni: + freezed == muni + ? _value.muni + : muni // ignore: cast_nullable_to_non_nullable + as int?, + siteidx: + freezed == siteidx + ? _value.siteidx + : siteidx // ignore: cast_nullable_to_non_nullable + as int?, + prefectureId: + freezed == prefectureId + ? _value.prefectureId + : prefectureId // ignore: cast_nullable_to_non_nullable + as int?, + siteId: + freezed == siteId + ? _value.siteId + : siteId // ignore: cast_nullable_to_non_nullable + as String?, + lat: + freezed == lat + ? _value.lat + : lat // ignore: cast_nullable_to_non_nullable + as double?, + lng: + freezed == lng + ? _value.lng + : lng // ignore: cast_nullable_to_non_nullable + as double?, + ), + ); } } /// @nodoc @JsonSerializable() class _$SiteImpl extends _Site { - const _$SiteImpl( - {this.muni, - this.siteidx, - @JsonKey(name: 'pref') this.prefectureId, - @JsonKey(name: 'siteid') this.siteId, - this.lat, - this.lng}) - : super._(); + const _$SiteImpl({ + this.muni, + this.siteidx, + @JsonKey(name: 'pref') this.prefectureId, + @JsonKey(name: 'siteid') this.siteId, + this.lat, + this.lng, + }) : super._(); factory _$SiteImpl.fromJson(Map json) => _$$SiteImplFromJson(json); @@ -570,20 +610,19 @@ class _$SiteImpl extends _Site { @override Map toJson() { - return _$$SiteImplToJson( - this, - ); + return _$$SiteImplToJson(this); } } abstract class _Site extends Site { - const factory _Site( - {final int? muni, - final int? siteidx, - @JsonKey(name: 'pref') final int? prefectureId, - @JsonKey(name: 'siteid') final String? siteId, - final double? lat, - final double? lng}) = _$SiteImpl; + const factory _Site({ + final int? muni, + final int? siteidx, + @JsonKey(name: 'pref') final int? prefectureId, + @JsonKey(name: 'siteid') final String? siteId, + final double? lat, + final double? lng, + }) = _$SiteImpl; const _Site._() : super._(); factory _Site.fromJson(Map json) = _$SiteImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.g.dart b/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.g.dart index 5ecf6089..3b1d427a 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/app_api/site_list.g.dart @@ -8,38 +8,39 @@ part of 'site_list.dart'; // JsonSerializableGenerator // ************************************************************************** -_$SiteListImpl _$$SiteListImplFromJson(Map json) => - $checkedCreate( - r'_$SiteListImpl', - json, - ($checkedConvert) { - final val = _$SiteListImpl( - sites: $checkedConvert( - 'items', - (v) => (v as List?) - ?.map((e) => Site.fromJson(e as Map)) - .toList()), - security: $checkedConvert( - 'security', - (v) => v == null - ? null - : Security.fromJson(v as Map)), - dataTime: $checkedConvert('data_time', (v) => v as String?), - result: $checkedConvert( - 'result', - (v) => v == null - ? null - : Result.fromJson(v as Map)), - serialNo: $checkedConvert('serial_no', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const { - 'sites': 'items', - 'dataTime': 'data_time', - 'serialNo': 'serial_no' - }, +_$SiteListImpl _$$SiteListImplFromJson( + Map json, +) => $checkedCreate( + r'_$SiteListImpl', + json, + ($checkedConvert) { + final val = _$SiteListImpl( + sites: $checkedConvert( + 'items', + (v) => + (v as List?) + ?.map((e) => Site.fromJson(e as Map)) + .toList(), + ), + security: $checkedConvert( + 'security', + (v) => v == null ? null : Security.fromJson(v as Map), + ), + dataTime: $checkedConvert('data_time', (v) => v as String?), + result: $checkedConvert( + 'result', + (v) => v == null ? null : Result.fromJson(v as Map), + ), + serialNo: $checkedConvert('serial_no', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const { + 'sites': 'items', + 'dataTime': 'data_time', + 'serialNo': 'serial_no', + }, +); Map _$$SiteListImplToJson(_$SiteListImpl instance) => { @@ -50,22 +51,18 @@ Map _$$SiteListImplToJson(_$SiteListImpl instance) => 'serial_no': instance.serialNo, }; -_$SiteImpl _$$SiteImplFromJson(Map json) => $checkedCreate( - r'_$SiteImpl', - json, - ($checkedConvert) { - final val = _$SiteImpl( - muni: $checkedConvert('muni', (v) => (v as num?)?.toInt()), - siteidx: $checkedConvert('siteidx', (v) => (v as num?)?.toInt()), - prefectureId: $checkedConvert('pref', (v) => (v as num?)?.toInt()), - siteId: $checkedConvert('siteid', (v) => v as String?), - lat: $checkedConvert('lat', (v) => (v as num?)?.toDouble()), - lng: $checkedConvert('lng', (v) => (v as num?)?.toDouble()), - ); - return val; - }, - fieldKeyMap: const {'prefectureId': 'pref', 'siteId': 'siteid'}, - ); +_$SiteImpl _$$SiteImplFromJson(Map json) => + $checkedCreate(r'_$SiteImpl', json, ($checkedConvert) { + final val = _$SiteImpl( + muni: $checkedConvert('muni', (v) => (v as num?)?.toInt()), + siteidx: $checkedConvert('siteidx', (v) => (v as num?)?.toInt()), + prefectureId: $checkedConvert('pref', (v) => (v as num?)?.toInt()), + siteId: $checkedConvert('siteid', (v) => v as String?), + lat: $checkedConvert('lat', (v) => (v as num?)?.toDouble()), + lng: $checkedConvert('lng', (v) => (v as num?)?.toDouble()), + ); + return val; + }, fieldKeyMap: const {'prefectureId': 'pref', 'siteId': 'siteid'}); Map _$$SiteImplToJson(_$SiteImpl instance) => { diff --git a/packages/kyoshin_monitor_api/lib/src/model/result.dart b/packages/kyoshin_monitor_api/lib/src/model/result.dart index f52660fe..e858c19d 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/result.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/result.dart @@ -5,10 +5,8 @@ part 'result.g.dart'; @freezed class Result with _$Result { - const factory Result({ - required String? status, - required String? message, - }) = _Result; + const factory Result({required String? status, required String? message}) = + _Result; factory Result.fromJson(Map json) => _$ResultFromJson(json); } diff --git a/packages/kyoshin_monitor_api/lib/src/model/result.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/result.freezed.dart index 6e886c4a..848039af 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/result.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/result.freezed.dart @@ -12,7 +12,8 @@ part of 'result.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); Result _$ResultFromJson(Map json) { return _Result.fromJson(json); @@ -54,28 +55,31 @@ class _$ResultCopyWithImpl<$Res, $Val extends Result> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? status = freezed, - Object? message = freezed, - }) { - return _then(_value.copyWith( - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String?, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + $Res call({Object? status = freezed, Object? message = freezed}) { + return _then( + _value.copyWith( + status: + freezed == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String?, + message: + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } /// @nodoc abstract class _$$ResultImplCopyWith<$Res> implements $ResultCopyWith<$Res> { factory _$$ResultImplCopyWith( - _$ResultImpl value, $Res Function(_$ResultImpl) then) = - __$$ResultImplCopyWithImpl<$Res>; + _$ResultImpl value, + $Res Function(_$ResultImpl) then, + ) = __$$ResultImplCopyWithImpl<$Res>; @override @useResult $Res call({String? status, String? message}); @@ -86,27 +90,29 @@ class __$$ResultImplCopyWithImpl<$Res> extends _$ResultCopyWithImpl<$Res, _$ResultImpl> implements _$$ResultImplCopyWith<$Res> { __$$ResultImplCopyWithImpl( - _$ResultImpl _value, $Res Function(_$ResultImpl) _then) - : super(_value, _then); + _$ResultImpl _value, + $Res Function(_$ResultImpl) _then, + ) : super(_value, _then); /// Create a copy of Result /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? status = freezed, - Object? message = freezed, - }) { - return _then(_$ResultImpl( - status: freezed == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String?, - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - )); + $Res call({Object? status = freezed, Object? message = freezed}) { + return _then( + _$ResultImpl( + status: + freezed == status + ? _value.status + : status // ignore: cast_nullable_to_non_nullable + as String?, + message: + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } @@ -151,16 +157,15 @@ class _$ResultImpl implements _Result { @override Map toJson() { - return _$$ResultImplToJson( - this, - ); + return _$$ResultImplToJson(this); } } abstract class _Result implements Result { - const factory _Result( - {required final String? status, - required final String? message}) = _$ResultImpl; + const factory _Result({ + required final String? status, + required final String? message, + }) = _$ResultImpl; factory _Result.fromJson(Map json) = _$ResultImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/result.g.dart b/packages/kyoshin_monitor_api/lib/src/model/result.g.dart index 69147d1a..e40a8e9f 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/result.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/result.g.dart @@ -8,20 +8,14 @@ part of 'result.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ResultImpl _$$ResultImplFromJson(Map json) => $checkedCreate( - r'_$ResultImpl', - json, - ($checkedConvert) { - final val = _$ResultImpl( - status: $checkedConvert('status', (v) => v as String?), - message: $checkedConvert('message', (v) => v as String?), - ); - return val; - }, - ); +_$ResultImpl _$$ResultImplFromJson(Map json) => + $checkedCreate(r'_$ResultImpl', json, ($checkedConvert) { + final val = _$ResultImpl( + status: $checkedConvert('status', (v) => v as String?), + message: $checkedConvert('message', (v) => v as String?), + ); + return val; + }); Map _$$ResultImplToJson(_$ResultImpl instance) => - { - 'status': instance.status, - 'message': instance.message, - }; + {'status': instance.status, 'message': instance.message}; diff --git a/packages/kyoshin_monitor_api/lib/src/model/security.dart b/packages/kyoshin_monitor_api/lib/src/model/security.dart index aefaa972..d519db54 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/security.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/security.dart @@ -5,10 +5,8 @@ part 'security.g.dart'; @freezed class Security with _$Security { - const factory Security({ - required String? realm, - required String? hash, - }) = _Security; + const factory Security({required String? realm, required String? hash}) = + _Security; factory Security.fromJson(Map json) => _$SecurityFromJson(json); diff --git a/packages/kyoshin_monitor_api/lib/src/model/security.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/security.freezed.dart index cc62a0e9..87e82229 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/security.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/security.freezed.dart @@ -12,7 +12,8 @@ part of 'security.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); Security _$SecurityFromJson(Map json) { return _Security.fromJson(json); @@ -55,20 +56,22 @@ class _$SecurityCopyWithImpl<$Res, $Val extends Security> /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? realm = freezed, - Object? hash = freezed, - }) { - return _then(_value.copyWith( - realm: freezed == realm - ? _value.realm - : realm // ignore: cast_nullable_to_non_nullable - as String?, - hash: freezed == hash - ? _value.hash - : hash // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + $Res call({Object? realm = freezed, Object? hash = freezed}) { + return _then( + _value.copyWith( + realm: + freezed == realm + ? _value.realm + : realm // ignore: cast_nullable_to_non_nullable + as String?, + hash: + freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } } @@ -76,8 +79,9 @@ class _$SecurityCopyWithImpl<$Res, $Val extends Security> abstract class _$$SecurityImplCopyWith<$Res> implements $SecurityCopyWith<$Res> { factory _$$SecurityImplCopyWith( - _$SecurityImpl value, $Res Function(_$SecurityImpl) then) = - __$$SecurityImplCopyWithImpl<$Res>; + _$SecurityImpl value, + $Res Function(_$SecurityImpl) then, + ) = __$$SecurityImplCopyWithImpl<$Res>; @override @useResult $Res call({String? realm, String? hash}); @@ -88,27 +92,29 @@ class __$$SecurityImplCopyWithImpl<$Res> extends _$SecurityCopyWithImpl<$Res, _$SecurityImpl> implements _$$SecurityImplCopyWith<$Res> { __$$SecurityImplCopyWithImpl( - _$SecurityImpl _value, $Res Function(_$SecurityImpl) _then) - : super(_value, _then); + _$SecurityImpl _value, + $Res Function(_$SecurityImpl) _then, + ) : super(_value, _then); /// Create a copy of Security /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? realm = freezed, - Object? hash = freezed, - }) { - return _then(_$SecurityImpl( - realm: freezed == realm - ? _value.realm - : realm // ignore: cast_nullable_to_non_nullable - as String?, - hash: freezed == hash - ? _value.hash - : hash // ignore: cast_nullable_to_non_nullable - as String?, - )); + $Res call({Object? realm = freezed, Object? hash = freezed}) { + return _then( + _$SecurityImpl( + realm: + freezed == realm + ? _value.realm + : realm // ignore: cast_nullable_to_non_nullable + as String?, + hash: + freezed == hash + ? _value.hash + : hash // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } @@ -153,16 +159,15 @@ class _$SecurityImpl implements _Security { @override Map toJson() { - return _$$SecurityImplToJson( - this, - ); + return _$$SecurityImplToJson(this); } } abstract class _Security implements Security { - const factory _Security( - {required final String? realm, - required final String? hash}) = _$SecurityImpl; + const factory _Security({ + required final String? realm, + required final String? hash, + }) = _$SecurityImpl; factory _Security.fromJson(Map json) = _$SecurityImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/security.g.dart b/packages/kyoshin_monitor_api/lib/src/model/security.g.dart index 4c76b6fe..5e3886f0 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/security.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/security.g.dart @@ -9,20 +9,13 @@ part of 'security.dart'; // ************************************************************************** _$SecurityImpl _$$SecurityImplFromJson(Map json) => - $checkedCreate( - r'_$SecurityImpl', - json, - ($checkedConvert) { - final val = _$SecurityImpl( - realm: $checkedConvert('realm', (v) => v as String?), - hash: $checkedConvert('hash', (v) => v as String?), - ); - return val; - }, - ); + $checkedCreate(r'_$SecurityImpl', json, ($checkedConvert) { + final val = _$SecurityImpl( + realm: $checkedConvert('realm', (v) => v as String?), + hash: $checkedConvert('hash', (v) => v as String?), + ); + return val; + }); Map _$$SecurityImplToJson(_$SecurityImpl instance) => - { - 'realm': instance.realm, - 'hash': instance.hash, - }; + {'realm': instance.realm, 'hash': instance.hash}; diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.freezed.dart index b1e63428..b8fa87bb 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.freezed.dart @@ -12,7 +12,8 @@ part of 'data_time.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); DataTime _$DataTimeFromJson(Map json) { return _DataTime.fromJson(json); @@ -42,13 +43,14 @@ abstract class $DataTimeCopyWith<$Res> { factory $DataTimeCopyWith(DataTime value, $Res Function(DataTime) then) = _$DataTimeCopyWithImpl<$Res, DataTime>; @useResult - $Res call( - {Security? security, - Result? result, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - DateTime latestTime, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - DateTime requestTime}); + $Res call({ + Security? security, + Result? result, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + DateTime latestTime, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + DateTime requestTime, + }); $SecurityCopyWith<$Res>? get security; $ResultCopyWith<$Res>? get result; @@ -74,24 +76,31 @@ class _$DataTimeCopyWithImpl<$Res, $Val extends DataTime> Object? latestTime = null, Object? requestTime = null, }) { - return _then(_value.copyWith( - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - latestTime: null == latestTime - ? _value.latestTime - : latestTime // ignore: cast_nullable_to_non_nullable - as DateTime, - requestTime: null == requestTime - ? _value.requestTime - : requestTime // ignore: cast_nullable_to_non_nullable - as DateTime, - ) as $Val); + return _then( + _value.copyWith( + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + latestTime: + null == latestTime + ? _value.latestTime + : latestTime // ignore: cast_nullable_to_non_nullable + as DateTime, + requestTime: + null == requestTime + ? _value.requestTime + : requestTime // ignore: cast_nullable_to_non_nullable + as DateTime, + ) + as $Val, + ); } /// Create a copy of DataTime @@ -127,17 +136,19 @@ class _$DataTimeCopyWithImpl<$Res, $Val extends DataTime> abstract class _$$DataTimeImplCopyWith<$Res> implements $DataTimeCopyWith<$Res> { factory _$$DataTimeImplCopyWith( - _$DataTimeImpl value, $Res Function(_$DataTimeImpl) then) = - __$$DataTimeImplCopyWithImpl<$Res>; + _$DataTimeImpl value, + $Res Function(_$DataTimeImpl) then, + ) = __$$DataTimeImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {Security? security, - Result? result, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - DateTime latestTime, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - DateTime requestTime}); + $Res call({ + Security? security, + Result? result, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + DateTime latestTime, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + DateTime requestTime, + }); @override $SecurityCopyWith<$Res>? get security; @@ -150,8 +161,9 @@ class __$$DataTimeImplCopyWithImpl<$Res> extends _$DataTimeCopyWithImpl<$Res, _$DataTimeImpl> implements _$$DataTimeImplCopyWith<$Res> { __$$DataTimeImplCopyWithImpl( - _$DataTimeImpl _value, $Res Function(_$DataTimeImpl) _then) - : super(_value, _then); + _$DataTimeImpl _value, + $Res Function(_$DataTimeImpl) _then, + ) : super(_value, _then); /// Create a copy of DataTime /// with the given fields replaced by the non-null parameter values. @@ -163,37 +175,44 @@ class __$$DataTimeImplCopyWithImpl<$Res> Object? latestTime = null, Object? requestTime = null, }) { - return _then(_$DataTimeImpl( - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - latestTime: null == latestTime - ? _value.latestTime - : latestTime // ignore: cast_nullable_to_non_nullable - as DateTime, - requestTime: null == requestTime - ? _value.requestTime - : requestTime // ignore: cast_nullable_to_non_nullable - as DateTime, - )); + return _then( + _$DataTimeImpl( + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + latestTime: + null == latestTime + ? _value.latestTime + : latestTime // ignore: cast_nullable_to_non_nullable + as DateTime, + requestTime: + null == requestTime + ? _value.requestTime + : requestTime // ignore: cast_nullable_to_non_nullable + as DateTime, + ), + ); } } /// @nodoc @JsonSerializable() class _$DataTimeImpl implements _DataTime { - const _$DataTimeImpl( - {required this.security, - required this.result, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - required this.latestTime, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - required this.requestTime}); + const _$DataTimeImpl({ + required this.security, + required this.result, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + required this.latestTime, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + required this.requestTime, + }); factory _$DataTimeImpl.fromJson(Map json) => _$$DataTimeImplFromJson(json); @@ -243,20 +262,19 @@ class _$DataTimeImpl implements _DataTime { @override Map toJson() { - return _$$DataTimeImplToJson( - this, - ); + return _$$DataTimeImplToJson(this); } } abstract class _DataTime implements DataTime { - const factory _DataTime( - {required final Security? security, - required final Result? result, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - required final DateTime latestTime, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - required final DateTime requestTime}) = _$DataTimeImpl; + const factory _DataTime({ + required final Security? security, + required final Result? result, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + required final DateTime latestTime, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + required final DateTime requestTime, + }) = _$DataTimeImpl; factory _DataTime.fromJson(Map json) = _$DataTimeImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.g.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.g.dart index 3fea4631..3dab9ffe 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/data_time.g.dart @@ -8,34 +8,37 @@ part of 'data_time.dart'; // JsonSerializableGenerator // ************************************************************************** -_$DataTimeImpl _$$DataTimeImplFromJson(Map json) => - $checkedCreate( - r'_$DataTimeImpl', - json, - ($checkedConvert) { - final val = _$DataTimeImpl( - security: $checkedConvert( - 'security', - (v) => v == null - ? null - : Security.fromJson(v as Map)), - result: $checkedConvert( - 'result', - (v) => v == null - ? null - : Result.fromJson(v as Map)), - latestTime: $checkedConvert( - 'latest_time', (v) => dateTimeFromString(v as String)), - requestTime: $checkedConvert( - 'request_time', (v) => dateTimeFromString(v as String)), - ); - return val; - }, - fieldKeyMap: const { - 'latestTime': 'latest_time', - 'requestTime': 'request_time' - }, +_$DataTimeImpl _$$DataTimeImplFromJson( + Map json, +) => $checkedCreate( + r'_$DataTimeImpl', + json, + ($checkedConvert) { + final val = _$DataTimeImpl( + security: $checkedConvert( + 'security', + (v) => v == null ? null : Security.fromJson(v as Map), + ), + result: $checkedConvert( + 'result', + (v) => v == null ? null : Result.fromJson(v as Map), + ), + latestTime: $checkedConvert( + 'latest_time', + (v) => dateTimeFromString(v as String), + ), + requestTime: $checkedConvert( + 'request_time', + (v) => dateTimeFromString(v as String), + ), ); + return val; + }, + fieldKeyMap: const { + 'latestTime': 'latest_time', + 'requestTime': 'request_time', + }, +); Map _$$DataTimeImplToJson(_$DataTimeImpl instance) => { diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.freezed.dart index d83dd83d..d4c1cd94 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.freezed.dart @@ -12,7 +12,8 @@ part of 'eew.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); Eew _$EewFromJson(Map json) { return _Eew.fromJson(json); @@ -103,34 +104,34 @@ abstract class $EewCopyWith<$Res> { factory $EewCopyWith(Eew value, $Res Function(Eew) then) = _$EewCopyWithImpl<$Res, Eew>; @useResult - $Res call( - {Result? result, - @JsonKey( - fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) - DateTime? reportTime, - String? regionCode, - String? requestTime, - String? regionName, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - double? longitude, - @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) bool? isCancel, - @JsonKey(fromJson: depthFromString, toJson: depthToString) int? depth, - @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) - JmaIntensity? intensity, - @JsonKey(name: 'is_final', fromJson: boolFromDynamic) bool? isFinal, - @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) bool? isTraining, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - double? latitude, - @JsonKey(name: 'origin_time', fromJson: originTimeFromString) - DateTime? originTime, - Security? security, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - double? magnitude, - @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) - int? reportNum, - String? requestHypoType, - String? reportId, - @JsonKey(name: 'alertflg') String? alertFlag}); + $Res call({ + Result? result, + @JsonKey(fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) + DateTime? reportTime, + String? regionCode, + String? requestTime, + String? regionName, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + double? longitude, + @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) bool? isCancel, + @JsonKey(fromJson: depthFromString, toJson: depthToString) int? depth, + @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) + JmaIntensity? intensity, + @JsonKey(name: 'is_final', fromJson: boolFromDynamic) bool? isFinal, + @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) bool? isTraining, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + double? latitude, + @JsonKey(name: 'origin_time', fromJson: originTimeFromString) + DateTime? originTime, + Security? security, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + double? magnitude, + @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) + int? reportNum, + String? requestHypoType, + String? reportId, + @JsonKey(name: 'alertflg') String? alertFlag, + }); $ResultCopyWith<$Res>? get result; $SecurityCopyWith<$Res>? get security; @@ -170,84 +171,106 @@ class _$EewCopyWithImpl<$Res, $Val extends Eew> implements $EewCopyWith<$Res> { Object? reportId = freezed, Object? alertFlag = freezed, }) { - return _then(_value.copyWith( - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - reportTime: freezed == reportTime - ? _value.reportTime - : reportTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - regionCode: freezed == regionCode - ? _value.regionCode - : regionCode // ignore: cast_nullable_to_non_nullable - as String?, - requestTime: freezed == requestTime - ? _value.requestTime - : requestTime // ignore: cast_nullable_to_non_nullable - as String?, - regionName: freezed == regionName - ? _value.regionName - : regionName // ignore: cast_nullable_to_non_nullable - as String?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - isCancel: freezed == isCancel - ? _value.isCancel - : isCancel // ignore: cast_nullable_to_non_nullable - as bool?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - intensity: freezed == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - isFinal: freezed == isFinal - ? _value.isFinal - : isFinal // ignore: cast_nullable_to_non_nullable - as bool?, - isTraining: freezed == isTraining - ? _value.isTraining - : isTraining // ignore: cast_nullable_to_non_nullable - as bool?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - reportNum: freezed == reportNum - ? _value.reportNum - : reportNum // ignore: cast_nullable_to_non_nullable - as int?, - requestHypoType: freezed == requestHypoType - ? _value.requestHypoType - : requestHypoType // ignore: cast_nullable_to_non_nullable - as String?, - reportId: freezed == reportId - ? _value.reportId - : reportId // ignore: cast_nullable_to_non_nullable - as String?, - alertFlag: freezed == alertFlag - ? _value.alertFlag - : alertFlag // ignore: cast_nullable_to_non_nullable - as String?, - ) as $Val); + return _then( + _value.copyWith( + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + reportTime: + freezed == reportTime + ? _value.reportTime + : reportTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + regionCode: + freezed == regionCode + ? _value.regionCode + : regionCode // ignore: cast_nullable_to_non_nullable + as String?, + requestTime: + freezed == requestTime + ? _value.requestTime + : requestTime // ignore: cast_nullable_to_non_nullable + as String?, + regionName: + freezed == regionName + ? _value.regionName + : regionName // ignore: cast_nullable_to_non_nullable + as String?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + isCancel: + freezed == isCancel + ? _value.isCancel + : isCancel // ignore: cast_nullable_to_non_nullable + as bool?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + intensity: + freezed == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + isFinal: + freezed == isFinal + ? _value.isFinal + : isFinal // ignore: cast_nullable_to_non_nullable + as bool?, + isTraining: + freezed == isTraining + ? _value.isTraining + : isTraining // ignore: cast_nullable_to_non_nullable + as bool?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + reportNum: + freezed == reportNum + ? _value.reportNum + : reportNum // ignore: cast_nullable_to_non_nullable + as int?, + requestHypoType: + freezed == requestHypoType + ? _value.requestHypoType + : requestHypoType // ignore: cast_nullable_to_non_nullable + as String?, + reportId: + freezed == reportId + ? _value.reportId + : reportId // ignore: cast_nullable_to_non_nullable + as String?, + alertFlag: + freezed == alertFlag + ? _value.alertFlag + : alertFlag // ignore: cast_nullable_to_non_nullable + as String?, + ) + as $Val, + ); } /// Create a copy of Eew @@ -285,34 +308,34 @@ abstract class _$$EewImplCopyWith<$Res> implements $EewCopyWith<$Res> { __$$EewImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {Result? result, - @JsonKey( - fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) - DateTime? reportTime, - String? regionCode, - String? requestTime, - String? regionName, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - double? longitude, - @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) bool? isCancel, - @JsonKey(fromJson: depthFromString, toJson: depthToString) int? depth, - @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) - JmaIntensity? intensity, - @JsonKey(name: 'is_final', fromJson: boolFromDynamic) bool? isFinal, - @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) bool? isTraining, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - double? latitude, - @JsonKey(name: 'origin_time', fromJson: originTimeFromString) - DateTime? originTime, - Security? security, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - double? magnitude, - @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) - int? reportNum, - String? requestHypoType, - String? reportId, - @JsonKey(name: 'alertflg') String? alertFlag}); + $Res call({ + Result? result, + @JsonKey(fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) + DateTime? reportTime, + String? regionCode, + String? requestTime, + String? regionName, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + double? longitude, + @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) bool? isCancel, + @JsonKey(fromJson: depthFromString, toJson: depthToString) int? depth, + @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) + JmaIntensity? intensity, + @JsonKey(name: 'is_final', fromJson: boolFromDynamic) bool? isFinal, + @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) bool? isTraining, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + double? latitude, + @JsonKey(name: 'origin_time', fromJson: originTimeFromString) + DateTime? originTime, + Security? security, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + double? magnitude, + @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) + int? reportNum, + String? requestHypoType, + String? reportId, + @JsonKey(name: 'alertflg') String? alertFlag, + }); @override $ResultCopyWith<$Res>? get result; @@ -324,7 +347,7 @@ abstract class _$$EewImplCopyWith<$Res> implements $EewCopyWith<$Res> { class __$$EewImplCopyWithImpl<$Res> extends _$EewCopyWithImpl<$Res, _$EewImpl> implements _$$EewImplCopyWith<$Res> { __$$EewImplCopyWithImpl(_$EewImpl _value, $Res Function(_$EewImpl) _then) - : super(_value, _then); + : super(_value, _then); /// Create a copy of Eew /// with the given fields replaced by the non-null parameter values. @@ -351,119 +374,139 @@ class __$$EewImplCopyWithImpl<$Res> extends _$EewCopyWithImpl<$Res, _$EewImpl> Object? reportId = freezed, Object? alertFlag = freezed, }) { - return _then(_$EewImpl( - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - reportTime: freezed == reportTime - ? _value.reportTime - : reportTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - regionCode: freezed == regionCode - ? _value.regionCode - : regionCode // ignore: cast_nullable_to_non_nullable - as String?, - requestTime: freezed == requestTime - ? _value.requestTime - : requestTime // ignore: cast_nullable_to_non_nullable - as String?, - regionName: freezed == regionName - ? _value.regionName - : regionName // ignore: cast_nullable_to_non_nullable - as String?, - longitude: freezed == longitude - ? _value.longitude - : longitude // ignore: cast_nullable_to_non_nullable - as double?, - isCancel: freezed == isCancel - ? _value.isCancel - : isCancel // ignore: cast_nullable_to_non_nullable - as bool?, - depth: freezed == depth - ? _value.depth - : depth // ignore: cast_nullable_to_non_nullable - as int?, - intensity: freezed == intensity - ? _value.intensity - : intensity // ignore: cast_nullable_to_non_nullable - as JmaIntensity?, - isFinal: freezed == isFinal - ? _value.isFinal - : isFinal // ignore: cast_nullable_to_non_nullable - as bool?, - isTraining: freezed == isTraining - ? _value.isTraining - : isTraining // ignore: cast_nullable_to_non_nullable - as bool?, - latitude: freezed == latitude - ? _value.latitude - : latitude // ignore: cast_nullable_to_non_nullable - as double?, - originTime: freezed == originTime - ? _value.originTime - : originTime // ignore: cast_nullable_to_non_nullable - as DateTime?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - magnitude: freezed == magnitude - ? _value.magnitude - : magnitude // ignore: cast_nullable_to_non_nullable - as double?, - reportNum: freezed == reportNum - ? _value.reportNum - : reportNum // ignore: cast_nullable_to_non_nullable - as int?, - requestHypoType: freezed == requestHypoType - ? _value.requestHypoType - : requestHypoType // ignore: cast_nullable_to_non_nullable - as String?, - reportId: freezed == reportId - ? _value.reportId - : reportId // ignore: cast_nullable_to_non_nullable - as String?, - alertFlag: freezed == alertFlag - ? _value.alertFlag - : alertFlag // ignore: cast_nullable_to_non_nullable - as String?, - )); + return _then( + _$EewImpl( + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + reportTime: + freezed == reportTime + ? _value.reportTime + : reportTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + regionCode: + freezed == regionCode + ? _value.regionCode + : regionCode // ignore: cast_nullable_to_non_nullable + as String?, + requestTime: + freezed == requestTime + ? _value.requestTime + : requestTime // ignore: cast_nullable_to_non_nullable + as String?, + regionName: + freezed == regionName + ? _value.regionName + : regionName // ignore: cast_nullable_to_non_nullable + as String?, + longitude: + freezed == longitude + ? _value.longitude + : longitude // ignore: cast_nullable_to_non_nullable + as double?, + isCancel: + freezed == isCancel + ? _value.isCancel + : isCancel // ignore: cast_nullable_to_non_nullable + as bool?, + depth: + freezed == depth + ? _value.depth + : depth // ignore: cast_nullable_to_non_nullable + as int?, + intensity: + freezed == intensity + ? _value.intensity + : intensity // ignore: cast_nullable_to_non_nullable + as JmaIntensity?, + isFinal: + freezed == isFinal + ? _value.isFinal + : isFinal // ignore: cast_nullable_to_non_nullable + as bool?, + isTraining: + freezed == isTraining + ? _value.isTraining + : isTraining // ignore: cast_nullable_to_non_nullable + as bool?, + latitude: + freezed == latitude + ? _value.latitude + : latitude // ignore: cast_nullable_to_non_nullable + as double?, + originTime: + freezed == originTime + ? _value.originTime + : originTime // ignore: cast_nullable_to_non_nullable + as DateTime?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + magnitude: + freezed == magnitude + ? _value.magnitude + : magnitude // ignore: cast_nullable_to_non_nullable + as double?, + reportNum: + freezed == reportNum + ? _value.reportNum + : reportNum // ignore: cast_nullable_to_non_nullable + as int?, + requestHypoType: + freezed == requestHypoType + ? _value.requestHypoType + : requestHypoType // ignore: cast_nullable_to_non_nullable + as String?, + reportId: + freezed == reportId + ? _value.reportId + : reportId // ignore: cast_nullable_to_non_nullable + as String?, + alertFlag: + freezed == alertFlag + ? _value.alertFlag + : alertFlag // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); } } /// @nodoc @JsonSerializable() class _$EewImpl extends _Eew { - const _$EewImpl( - {this.result, - @JsonKey( - fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) - this.reportTime, - this.regionCode, - this.requestTime, - this.regionName, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - this.longitude, - @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) this.isCancel, - @JsonKey(fromJson: depthFromString, toJson: depthToString) this.depth, - @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) - this.intensity, - @JsonKey(name: 'is_final', fromJson: boolFromDynamic) this.isFinal, - @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) this.isTraining, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - this.latitude, - @JsonKey(name: 'origin_time', fromJson: originTimeFromString) - this.originTime, - this.security, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - this.magnitude, - @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) - this.reportNum, - this.requestHypoType, - this.reportId, - @JsonKey(name: 'alertflg') this.alertFlag}) - : super._(); + const _$EewImpl({ + this.result, + @JsonKey(fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) + this.reportTime, + this.regionCode, + this.requestTime, + this.regionName, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + this.longitude, + @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) this.isCancel, + @JsonKey(fromJson: depthFromString, toJson: depthToString) this.depth, + @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) + this.intensity, + @JsonKey(name: 'is_final', fromJson: boolFromDynamic) this.isFinal, + @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) this.isTraining, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + this.latitude, + @JsonKey(name: 'origin_time', fromJson: originTimeFromString) + this.originTime, + this.security, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + this.magnitude, + @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) + this.reportNum, + this.requestHypoType, + this.reportId, + @JsonKey(name: 'alertflg') this.alertFlag, + }) : super._(); factory _$EewImpl.fromJson(Map json) => _$$EewImplFromJson(json); @@ -606,27 +649,27 @@ class _$EewImpl extends _Eew { @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hashAll([ - runtimeType, - result, - reportTime, - regionCode, - requestTime, - regionName, - longitude, - isCancel, - depth, - intensity, - isFinal, - isTraining, - latitude, - originTime, - security, - magnitude, - reportNum, - requestHypoType, - reportId, - alertFlag - ]); + runtimeType, + result, + reportTime, + regionCode, + requestTime, + regionName, + longitude, + isCancel, + depth, + intensity, + isFinal, + isTraining, + latitude, + originTime, + security, + magnitude, + reportNum, + requestHypoType, + reportId, + alertFlag, + ]); /// Create a copy of Eew /// with the given fields replaced by the non-null parameter values. @@ -638,44 +681,40 @@ class _$EewImpl extends _Eew { @override Map toJson() { - return _$$EewImplToJson( - this, - ); + return _$$EewImplToJson(this); } } abstract class _Eew extends Eew { - const factory _Eew( - {final Result? result, - @JsonKey( - fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) - final DateTime? reportTime, - final String? regionCode, - final String? requestTime, - final String? regionName, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - final double? longitude, - @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) - final bool? isCancel, - @JsonKey(fromJson: depthFromString, toJson: depthToString) - final int? depth, - @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) - final JmaIntensity? intensity, - @JsonKey(name: 'is_final', fromJson: boolFromDynamic) final bool? isFinal, - @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) - final bool? isTraining, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - final double? latitude, - @JsonKey(name: 'origin_time', fromJson: originTimeFromString) - final DateTime? originTime, - final Security? security, - @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) - final double? magnitude, - @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) - final int? reportNum, - final String? requestHypoType, - final String? reportId, - @JsonKey(name: 'alertflg') final String? alertFlag}) = _$EewImpl; + const factory _Eew({ + final Result? result, + @JsonKey(fromJson: dateTimeOrNullFromString, toJson: dateTimeOrNullToString) + final DateTime? reportTime, + final String? regionCode, + final String? requestTime, + final String? regionName, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + final double? longitude, + @JsonKey(name: 'is_cancel', fromJson: boolFromDynamic) final bool? isCancel, + @JsonKey(fromJson: depthFromString, toJson: depthToString) final int? depth, + @JsonKey(name: 'calcintensity', fromJson: JmaIntensity.fromString) + final JmaIntensity? intensity, + @JsonKey(name: 'is_final', fromJson: boolFromDynamic) final bool? isFinal, + @JsonKey(name: 'isTraining', fromJson: boolFromDynamic) + final bool? isTraining, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + final double? latitude, + @JsonKey(name: 'origin_time', fromJson: originTimeFromString) + final DateTime? originTime, + final Security? security, + @JsonKey(fromJson: doubleOrNullFromString, toJson: doubleOrNullToString) + final double? magnitude, + @JsonKey(name: 'report_num', fromJson: intFromString, toJson: intToString) + final int? reportNum, + final String? requestHypoType, + final String? reportId, + @JsonKey(name: 'alertflg') final String? alertFlag, + }) = _$EewImpl; const _Eew._() : super._(); factory _Eew.fromJson(Map json) = _$EewImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.g.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.g.dart index d1577cfb..897ff243 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/eew.g.dart @@ -9,85 +9,99 @@ part of 'eew.dart'; // ************************************************************************** _$EewImpl _$$EewImplFromJson(Map json) => $checkedCreate( - r'_$EewImpl', - json, - ($checkedConvert) { - final val = _$EewImpl( - result: $checkedConvert( - 'result', - (v) => v == null - ? null - : Result.fromJson(v as Map)), - reportTime: $checkedConvert( - 'report_time', (v) => dateTimeOrNullFromString(v as String?)), - regionCode: $checkedConvert('region_code', (v) => v as String?), - requestTime: $checkedConvert('request_time', (v) => v as String?), - regionName: $checkedConvert('region_name', (v) => v as String?), - longitude: $checkedConvert( - 'longitude', (v) => doubleOrNullFromString(v as String?)), - isCancel: $checkedConvert('is_cancel', (v) => boolFromDynamic(v)), - depth: $checkedConvert('depth', (v) => depthFromString(v as String?)), - intensity: $checkedConvert( - 'calcintensity', (v) => JmaIntensity.fromString(v as String?)), - isFinal: $checkedConvert('is_final', (v) => boolFromDynamic(v)), - isTraining: $checkedConvert('isTraining', (v) => boolFromDynamic(v)), - latitude: $checkedConvert( - 'latitude', (v) => doubleOrNullFromString(v as String?)), - originTime: $checkedConvert( - 'origin_time', (v) => originTimeFromString(v as String?)), - security: $checkedConvert( - 'security', - (v) => v == null - ? null - : Security.fromJson(v as Map)), - magnitude: $checkedConvert( - 'magnitude', (v) => doubleOrNullFromString(v as String?)), - reportNum: - $checkedConvert('report_num', (v) => intFromString(v as String?)), - requestHypoType: - $checkedConvert('request_hypo_type', (v) => v as String?), - reportId: $checkedConvert('report_id', (v) => v as String?), - alertFlag: $checkedConvert('alertflg', (v) => v as String?), - ); - return val; - }, - fieldKeyMap: const { - 'reportTime': 'report_time', - 'regionCode': 'region_code', - 'requestTime': 'request_time', - 'regionName': 'region_name', - 'isCancel': 'is_cancel', - 'intensity': 'calcintensity', - 'isFinal': 'is_final', - 'originTime': 'origin_time', - 'reportNum': 'report_num', - 'requestHypoType': 'request_hypo_type', - 'reportId': 'report_id', - 'alertFlag': 'alertflg' - }, + r'_$EewImpl', + json, + ($checkedConvert) { + final val = _$EewImpl( + result: $checkedConvert( + 'result', + (v) => v == null ? null : Result.fromJson(v as Map), + ), + reportTime: $checkedConvert( + 'report_time', + (v) => dateTimeOrNullFromString(v as String?), + ), + regionCode: $checkedConvert('region_code', (v) => v as String?), + requestTime: $checkedConvert('request_time', (v) => v as String?), + regionName: $checkedConvert('region_name', (v) => v as String?), + longitude: $checkedConvert( + 'longitude', + (v) => doubleOrNullFromString(v as String?), + ), + isCancel: $checkedConvert('is_cancel', (v) => boolFromDynamic(v)), + depth: $checkedConvert('depth', (v) => depthFromString(v as String?)), + intensity: $checkedConvert( + 'calcintensity', + (v) => JmaIntensity.fromString(v as String?), + ), + isFinal: $checkedConvert('is_final', (v) => boolFromDynamic(v)), + isTraining: $checkedConvert('isTraining', (v) => boolFromDynamic(v)), + latitude: $checkedConvert( + 'latitude', + (v) => doubleOrNullFromString(v as String?), + ), + originTime: $checkedConvert( + 'origin_time', + (v) => originTimeFromString(v as String?), + ), + security: $checkedConvert( + 'security', + (v) => v == null ? null : Security.fromJson(v as Map), + ), + magnitude: $checkedConvert( + 'magnitude', + (v) => doubleOrNullFromString(v as String?), + ), + reportNum: $checkedConvert( + 'report_num', + (v) => intFromString(v as String?), + ), + requestHypoType: $checkedConvert( + 'request_hypo_type', + (v) => v as String?, + ), + reportId: $checkedConvert('report_id', (v) => v as String?), + alertFlag: $checkedConvert('alertflg', (v) => v as String?), ); + return val; + }, + fieldKeyMap: const { + 'reportTime': 'report_time', + 'regionCode': 'region_code', + 'requestTime': 'request_time', + 'regionName': 'region_name', + 'isCancel': 'is_cancel', + 'intensity': 'calcintensity', + 'isFinal': 'is_final', + 'originTime': 'origin_time', + 'reportNum': 'report_num', + 'requestHypoType': 'request_hypo_type', + 'reportId': 'report_id', + 'alertFlag': 'alertflg', + }, +); Map _$$EewImplToJson(_$EewImpl instance) => { - 'result': instance.result, - 'report_time': dateTimeOrNullToString(instance.reportTime), - 'region_code': instance.regionCode, - 'request_time': instance.requestTime, - 'region_name': instance.regionName, - 'longitude': doubleOrNullToString(instance.longitude), - 'is_cancel': instance.isCancel, - 'depth': depthToString(instance.depth), - 'calcintensity': _$JmaIntensityEnumMap[instance.intensity], - 'is_final': instance.isFinal, - 'isTraining': instance.isTraining, - 'latitude': doubleOrNullToString(instance.latitude), - 'origin_time': instance.originTime?.toIso8601String(), - 'security': instance.security, - 'magnitude': doubleOrNullToString(instance.magnitude), - 'report_num': intToString(instance.reportNum), - 'request_hypo_type': instance.requestHypoType, - 'report_id': instance.reportId, - 'alertflg': instance.alertFlag, - }; + 'result': instance.result, + 'report_time': dateTimeOrNullToString(instance.reportTime), + 'region_code': instance.regionCode, + 'request_time': instance.requestTime, + 'region_name': instance.regionName, + 'longitude': doubleOrNullToString(instance.longitude), + 'is_cancel': instance.isCancel, + 'depth': depthToString(instance.depth), + 'calcintensity': _$JmaIntensityEnumMap[instance.intensity], + 'is_final': instance.isFinal, + 'isTraining': instance.isTraining, + 'latitude': doubleOrNullToString(instance.latitude), + 'origin_time': instance.originTime?.toIso8601String(), + 'security': instance.security, + 'magnitude': doubleOrNullToString(instance.magnitude), + 'report_num': intToString(instance.reportNum), + 'request_hypo_type': instance.requestHypoType, + 'report_id': instance.reportId, + 'alertflg': instance.alertFlag, +}; const _$JmaIntensityEnumMap = { JmaIntensity.unknown: 'unknown', diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/jma_intensity.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/jma_intensity.dart index daae83f3..6906eb5b 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/jma_intensity.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/jma_intensity.dart @@ -1,81 +1,37 @@ /// 気象庁震度階級 enum JmaIntensity { /// 不明 - unknown( - displayName: '不明', - description: '不明', - level: -1, - ), + unknown(displayName: '不明', description: '不明', level: -1), /// 震度0 - zero( - displayName: '0', - description: '震度0', - level: 0, - ), + zero(displayName: '0', description: '震度0', level: 0), /// 震度1 - one( - displayName: '1', - description: '震度1', - level: 1, - ), + one(displayName: '1', description: '震度1', level: 1), /// 震度2 - two( - displayName: '2', - description: '震度2', - level: 2, - ), + two(displayName: '2', description: '震度2', level: 2), /// 震度3 - three( - displayName: '3', - description: '震度3', - level: 3, - ), + three(displayName: '3', description: '震度3', level: 3), /// 震度4 - four( - displayName: '4', - description: '震度4', - level: 4, - ), + four(displayName: '4', description: '震度4', level: 4), /// 震度5弱 - fiveLower( - displayName: '5-', - description: '震度5弱', - level: 5, - ), + fiveLower(displayName: '5-', description: '震度5弱', level: 5), /// 震度5強 - fiveUpper( - displayName: '5+', - description: '震度5強', - level: 6, - ), + fiveUpper(displayName: '5+', description: '震度5強', level: 6), /// 震度6弱 - sixLower( - displayName: '6-', - description: '震度6弱', - level: 7, - ), + sixLower(displayName: '6-', description: '震度6弱', level: 7), /// 震度6強 - sixUpper( - displayName: '6+', - description: '震度6強', - level: 8, - ), + sixUpper(displayName: '6+', description: '震度6強', level: 8), /// 震度7 - seven( - displayName: '7', - description: '震度7', - level: 9, - ); + seven(displayName: '7', description: '震度7', level: 9); const JmaIntensity({ required this.displayName, diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/kyoshin_monitor_web_api_response.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/kyoshin_monitor_web_api_response.dart index 37f72389..c5e0609d 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/kyoshin_monitor_web_api_response.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/kyoshin_monitor_web_api_response.dart @@ -1,10 +1,7 @@ import 'package:kyoshin_monitor_api/kyoshin_monitor_api.dart'; abstract class KyoshinMonitorWebApiResponse { - KyoshinMonitorWebApiResponse({ - required this.security, - required this.result, - }); + KyoshinMonitorWebApiResponse({required this.security, required this.result}); final Security? security; final Result? result; diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.freezed.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.freezed.dart index 194001da..cea37233 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.freezed.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.freezed.dart @@ -12,7 +12,8 @@ part of 'maintenance_message.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); MaintenanceMessage _$MaintenanceMessageFromJson(Map json) { return _MaintenanceMessage.fromJson(json); @@ -40,16 +41,18 @@ mixin _$MaintenanceMessage { /// @nodoc abstract class $MaintenanceMessageCopyWith<$Res> { factory $MaintenanceMessageCopyWith( - MaintenanceMessage value, $Res Function(MaintenanceMessage) then) = - _$MaintenanceMessageCopyWithImpl<$Res, MaintenanceMessage>; + MaintenanceMessage value, + $Res Function(MaintenanceMessage) then, + ) = _$MaintenanceMessageCopyWithImpl<$Res, MaintenanceMessage>; @useResult - $Res call( - {String? message, - Security? security, - MaintenanceMessageType? type, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - DateTime requestTime, - Result? result}); + $Res call({ + String? message, + Security? security, + MaintenanceMessageType? type, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + DateTime requestTime, + Result? result, + }); $SecurityCopyWith<$Res>? get security; $ResultCopyWith<$Res>? get result; @@ -76,28 +79,36 @@ class _$MaintenanceMessageCopyWithImpl<$Res, $Val extends MaintenanceMessage> Object? requestTime = null, Object? result = freezed, }) { - return _then(_value.copyWith( - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as MaintenanceMessageType?, - requestTime: null == requestTime - ? _value.requestTime - : requestTime // ignore: cast_nullable_to_non_nullable - as DateTime, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - ) as $Val); + return _then( + _value.copyWith( + message: + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + type: + freezed == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as MaintenanceMessageType?, + requestTime: + null == requestTime + ? _value.requestTime + : requestTime // ignore: cast_nullable_to_non_nullable + as DateTime, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + ) + as $Val, + ); } /// Create a copy of MaintenanceMessage @@ -132,18 +143,20 @@ class _$MaintenanceMessageCopyWithImpl<$Res, $Val extends MaintenanceMessage> /// @nodoc abstract class _$$MaintenanceMessageImplCopyWith<$Res> implements $MaintenanceMessageCopyWith<$Res> { - factory _$$MaintenanceMessageImplCopyWith(_$MaintenanceMessageImpl value, - $Res Function(_$MaintenanceMessageImpl) then) = - __$$MaintenanceMessageImplCopyWithImpl<$Res>; + factory _$$MaintenanceMessageImplCopyWith( + _$MaintenanceMessageImpl value, + $Res Function(_$MaintenanceMessageImpl) then, + ) = __$$MaintenanceMessageImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {String? message, - Security? security, - MaintenanceMessageType? type, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - DateTime requestTime, - Result? result}); + $Res call({ + String? message, + Security? security, + MaintenanceMessageType? type, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + DateTime requestTime, + Result? result, + }); @override $SecurityCopyWith<$Res>? get security; @@ -155,9 +168,10 @@ abstract class _$$MaintenanceMessageImplCopyWith<$Res> class __$$MaintenanceMessageImplCopyWithImpl<$Res> extends _$MaintenanceMessageCopyWithImpl<$Res, _$MaintenanceMessageImpl> implements _$$MaintenanceMessageImplCopyWith<$Res> { - __$$MaintenanceMessageImplCopyWithImpl(_$MaintenanceMessageImpl _value, - $Res Function(_$MaintenanceMessageImpl) _then) - : super(_value, _then); + __$$MaintenanceMessageImplCopyWithImpl( + _$MaintenanceMessageImpl _value, + $Res Function(_$MaintenanceMessageImpl) _then, + ) : super(_value, _then); /// Create a copy of MaintenanceMessage /// with the given fields replaced by the non-null parameter values. @@ -170,41 +184,49 @@ class __$$MaintenanceMessageImplCopyWithImpl<$Res> Object? requestTime = null, Object? result = freezed, }) { - return _then(_$MaintenanceMessageImpl( - message: freezed == message - ? _value.message - : message // ignore: cast_nullable_to_non_nullable - as String?, - security: freezed == security - ? _value.security - : security // ignore: cast_nullable_to_non_nullable - as Security?, - type: freezed == type - ? _value.type - : type // ignore: cast_nullable_to_non_nullable - as MaintenanceMessageType?, - requestTime: null == requestTime - ? _value.requestTime - : requestTime // ignore: cast_nullable_to_non_nullable - as DateTime, - result: freezed == result - ? _value.result - : result // ignore: cast_nullable_to_non_nullable - as Result?, - )); + return _then( + _$MaintenanceMessageImpl( + message: + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + security: + freezed == security + ? _value.security + : security // ignore: cast_nullable_to_non_nullable + as Security?, + type: + freezed == type + ? _value.type + : type // ignore: cast_nullable_to_non_nullable + as MaintenanceMessageType?, + requestTime: + null == requestTime + ? _value.requestTime + : requestTime // ignore: cast_nullable_to_non_nullable + as DateTime, + result: + freezed == result + ? _value.result + : result // ignore: cast_nullable_to_non_nullable + as Result?, + ), + ); } } /// @nodoc @JsonSerializable() class _$MaintenanceMessageImpl implements _MaintenanceMessage { - const _$MaintenanceMessageImpl( - {required this.message, - required this.security, - required this.type, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - required this.requestTime, - required this.result}); + const _$MaintenanceMessageImpl({ + required this.message, + required this.security, + required this.type, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + required this.requestTime, + required this.result, + }); factory _$MaintenanceMessageImpl.fromJson(Map json) => _$$MaintenanceMessageImplFromJson(json); @@ -252,24 +274,25 @@ class _$MaintenanceMessageImpl implements _MaintenanceMessage { @pragma('vm:prefer-inline') _$$MaintenanceMessageImplCopyWith<_$MaintenanceMessageImpl> get copyWith => __$$MaintenanceMessageImplCopyWithImpl<_$MaintenanceMessageImpl>( - this, _$identity); + this, + _$identity, + ); @override Map toJson() { - return _$$MaintenanceMessageImplToJson( - this, - ); + return _$$MaintenanceMessageImplToJson(this); } } abstract class _MaintenanceMessage implements MaintenanceMessage { - const factory _MaintenanceMessage( - {required final String? message, - required final Security? security, - required final MaintenanceMessageType? type, - @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) - required final DateTime requestTime, - required final Result? result}) = _$MaintenanceMessageImpl; + const factory _MaintenanceMessage({ + required final String? message, + required final Security? security, + required final MaintenanceMessageType? type, + @JsonKey(fromJson: dateTimeFromString, toJson: dateTimeToString) + required final DateTime requestTime, + required final Result? result, + }) = _$MaintenanceMessageImpl; factory _MaintenanceMessage.fromJson(Map json) = _$MaintenanceMessageImpl.fromJson; diff --git a/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.g.dart b/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.g.dart index 7f222e94..2e7bf38a 100644 --- a/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.g.dart +++ b/packages/kyoshin_monitor_api/lib/src/model/web_api/maintenance_message.g.dart @@ -9,42 +9,44 @@ part of 'maintenance_message.dart'; // ************************************************************************** _$MaintenanceMessageImpl _$$MaintenanceMessageImplFromJson( - Map json) => - $checkedCreate( - r'_$MaintenanceMessageImpl', - json, - ($checkedConvert) { - final val = _$MaintenanceMessageImpl( - message: $checkedConvert('message', (v) => v as String?), - security: $checkedConvert( - 'security', - (v) => v == null - ? null - : Security.fromJson(v as Map)), - type: $checkedConvert('type', - (v) => $enumDecodeNullable(_$MaintenanceMessageTypeEnumMap, v)), - requestTime: $checkedConvert( - 'request_time', (v) => dateTimeFromString(v as String)), - result: $checkedConvert( - 'result', - (v) => v == null - ? null - : Result.fromJson(v as Map)), - ); - return val; - }, - fieldKeyMap: const {'requestTime': 'request_time'}, + Map json, +) => $checkedCreate( + r'_$MaintenanceMessageImpl', + json, + ($checkedConvert) { + final val = _$MaintenanceMessageImpl( + message: $checkedConvert('message', (v) => v as String?), + security: $checkedConvert( + 'security', + (v) => v == null ? null : Security.fromJson(v as Map), + ), + type: $checkedConvert( + 'type', + (v) => $enumDecodeNullable(_$MaintenanceMessageTypeEnumMap, v), + ), + requestTime: $checkedConvert( + 'request_time', + (v) => dateTimeFromString(v as String), + ), + result: $checkedConvert( + 'result', + (v) => v == null ? null : Result.fromJson(v as Map), + ), ); + return val; + }, + fieldKeyMap: const {'requestTime': 'request_time'}, +); Map _$$MaintenanceMessageImplToJson( - _$MaintenanceMessageImpl instance) => - { - 'message': instance.message, - 'security': instance.security, - 'type': _$MaintenanceMessageTypeEnumMap[instance.type], - 'request_time': dateTimeToString(instance.requestTime), - 'result': instance.result, - }; + _$MaintenanceMessageImpl instance, +) => { + 'message': instance.message, + 'security': instance.security, + 'type': _$MaintenanceMessageTypeEnumMap[instance.type], + 'request_time': dateTimeToString(instance.requestTime), + 'result': instance.result, +}; const _$MaintenanceMessageTypeEnumMap = { MaintenanceMessageType.non: '0', diff --git a/packages/kyoshin_monitor_image_parser/bin/export.dart b/packages/kyoshin_monitor_image_parser/bin/export.dart index b150471b..1bf4cb6d 100644 --- a/packages/kyoshin_monitor_image_parser/bin/export.dart +++ b/packages/kyoshin_monitor_image_parser/bin/export.dart @@ -13,11 +13,7 @@ class Color { // ignore: prefer_constructors_over_static_methods static Color fromRGB(int r, int g, int b) { - return Color( - r.clamp(0, 255), - g.clamp(0, 255), - b.clamp(0, 255), - ); + return Color(r.clamp(0, 255), g.clamp(0, 255), b.clamp(0, 255)); } } @@ -77,12 +73,7 @@ List scaleToHsv(double p) { } else { // 区間C: fC(v) = p (v in [0..1]) + h=0固定 h = 0.0; - v = _solveMonotonicallyDecreasing( - target: p, - lower: 0, - upper: 1, - func: _fC, - ); + v = _solveMonotonicallyDecreasing(target: p, lower: 0, upper: 1, func: _fC); } return [h, s, v]; } @@ -371,48 +362,40 @@ void main() { ]; // 震度のカラーマップを作成 - final intensityColorMap = intensityList.map((value) { - final p = (value + 3) / 10; - final hsv = scaleToHsv(p); - final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); - return ( - value: p, - color: Color.fromRGB(rgb[0], rgb[1], rgb[2]), - ); - }).toList(); + final intensityColorMap = + intensityList.map((value) { + final p = (value + 3) / 10; + final hsv = scaleToHsv(p); + final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); + return (value: p, color: Color.fromRGB(rgb[0], rgb[1], rgb[2])); + }).toList(); // PGAのカラーマップを作成 - final pgaColorMap = pgaList.map((value) { - final p = (math.log(value) / math.ln10 + 2) / 5; - final hsv = scaleToHsv(p); - final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); - return ( - value: p, - color: Color.fromRGB(rgb[0], rgb[1], rgb[2]), - ); - }).toList(); + final pgaColorMap = + pgaList.map((value) { + final p = (math.log(value) / math.ln10 + 2) / 5; + final hsv = scaleToHsv(p); + final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); + return (value: p, color: Color.fromRGB(rgb[0], rgb[1], rgb[2])); + }).toList(); // PGVのカラーマップを作成 - final pgvColorMap = pgvList.map((value) { - final p = (math.log(value) / math.ln10 + 3) / 5; - final hsv = scaleToHsv(p); - final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); - return ( - value: p, - color: Color.fromRGB(rgb[0], rgb[1], rgb[2]), - ); - }).toList(); + final pgvColorMap = + pgvList.map((value) { + final p = (math.log(value) / math.ln10 + 3) / 5; + final hsv = scaleToHsv(p); + final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); + return (value: p, color: Color.fromRGB(rgb[0], rgb[1], rgb[2])); + }).toList(); // PGDのカラーマップを作成 - final pgdColorMap = pgdList.map((value) { - final p = (math.log(value) / math.ln10 + 4) / 5; - final hsv = scaleToHsv(p); - final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); - return ( - value: p, - color: Color.fromRGB(rgb[0], rgb[1], rgb[2]), - ); - }).toList(); + final pgdColorMap = + pgdList.map((value) { + final p = (math.log(value) / math.ln10 + 4) / 5; + final hsv = scaleToHsv(p); + final rgb = hsvToRgb(hsv[0], hsv[1], hsv[2]); + return (value: p, color: Color.fromRGB(rgb[0], rgb[1], rgb[2])); + }).toList(); // 震度の補間値を計算 for (var i = 0; i < positionSteps; i++) { diff --git a/packages/kyoshin_monitor_image_parser/lib/src/exception/kyoshin_monitor_image_exception.dart b/packages/kyoshin_monitor_image_parser/lib/src/exception/kyoshin_monitor_image_exception.dart index 77f9bd34..bb73781b 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/exception/kyoshin_monitor_image_exception.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/exception/kyoshin_monitor_image_exception.dart @@ -5,16 +5,13 @@ sealed class KyoshinImageParseException implements Exception { class KyoshinImageParseInvalidGifException extends KyoshinImageParseException { const KyoshinImageParseInvalidGifException() - : super(KyoshinImageParseExceptionType.invalidGif); + : super(KyoshinImageParseExceptionType.invalidGif); } class KyoshinImageParseInvalidImageSizeException extends KyoshinImageParseException { const KyoshinImageParseInvalidImageSizeException() - : super(KyoshinImageParseExceptionType.invalidImageSize); + : super(KyoshinImageParseExceptionType.invalidImageSize); } -enum KyoshinImageParseExceptionType { - invalidGif, - invalidImageSize, -} +enum KyoshinImageParseExceptionType { invalidGif, invalidImageSize } diff --git a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.dart b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.dart index 4146d8f0..802226da 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.dart @@ -32,8 +32,7 @@ class KyoshinMonitorObservationAnalyzedPoint factory KyoshinMonitorObservationAnalyzedPoint.fromJson( Map json, - ) => - _$KyoshinMonitorObservationAnalyzedPointFromJson(json); + ) => _$KyoshinMonitorObservationAnalyzedPointFromJson(json); double get scaleToIntensity => scale * 10 - 3; double get scaleToPga => math.pow(10, 5 * scale - 2).toDouble(); diff --git a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.freezed.dart b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.freezed.dart index 6ea71139..b0e6ed66 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.freezed.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.freezed.dart @@ -12,10 +12,12 @@ part of 'kyoshin_monitor_observation_point.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); KyoshinMonitorObservationPoint _$KyoshinMonitorObservationPointFromJson( - Map json) { + Map json, +) { return _KyoshinMonitorObservationPoint.fromJson(json); } @@ -32,23 +34,28 @@ mixin _$KyoshinMonitorObservationPoint { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorObservationPointCopyWith - get copyWith => throw _privateConstructorUsedError; + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorObservationPointCopyWith<$Res> { factory $KyoshinMonitorObservationPointCopyWith( - KyoshinMonitorObservationPoint value, - $Res Function(KyoshinMonitorObservationPoint) then) = - _$KyoshinMonitorObservationPointCopyWithImpl<$Res, - KyoshinMonitorObservationPoint>; + KyoshinMonitorObservationPoint value, + $Res Function(KyoshinMonitorObservationPoint) then, + ) = + _$KyoshinMonitorObservationPointCopyWithImpl< + $Res, + KyoshinMonitorObservationPoint + >; @useResult $Res call({String code, int x, int y}); } /// @nodoc -class _$KyoshinMonitorObservationPointCopyWithImpl<$Res, - $Val extends KyoshinMonitorObservationPoint> +class _$KyoshinMonitorObservationPointCopyWithImpl< + $Res, + $Val extends KyoshinMonitorObservationPoint +> implements $KyoshinMonitorObservationPointCopyWith<$Res> { _$KyoshinMonitorObservationPointCopyWithImpl(this._value, this._then); @@ -61,25 +68,27 @@ class _$KyoshinMonitorObservationPointCopyWithImpl<$Res, /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? x = null, - Object? y = null, - }) { - return _then(_value.copyWith( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - x: null == x - ? _value.x - : x // ignore: cast_nullable_to_non_nullable - as int, - y: null == y - ? _value.y - : y // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + $Res call({Object? code = null, Object? x = null, Object? y = null}) { + return _then( + _value.copyWith( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + x: + null == x + ? _value.x + : x // ignore: cast_nullable_to_non_nullable + as int, + y: + null == y + ? _value.y + : y // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); } } @@ -87,9 +96,9 @@ class _$KyoshinMonitorObservationPointCopyWithImpl<$Res, abstract class _$$KyoshinMonitorObservationPointImplCopyWith<$Res> implements $KyoshinMonitorObservationPointCopyWith<$Res> { factory _$$KyoshinMonitorObservationPointImplCopyWith( - _$KyoshinMonitorObservationPointImpl value, - $Res Function(_$KyoshinMonitorObservationPointImpl) then) = - __$$KyoshinMonitorObservationPointImplCopyWithImpl<$Res>; + _$KyoshinMonitorObservationPointImpl value, + $Res Function(_$KyoshinMonitorObservationPointImpl) then, + ) = __$$KyoshinMonitorObservationPointImplCopyWithImpl<$Res>; @override @useResult $Res call({String code, int x, int y}); @@ -97,37 +106,41 @@ abstract class _$$KyoshinMonitorObservationPointImplCopyWith<$Res> /// @nodoc class __$$KyoshinMonitorObservationPointImplCopyWithImpl<$Res> - extends _$KyoshinMonitorObservationPointCopyWithImpl<$Res, - _$KyoshinMonitorObservationPointImpl> + extends + _$KyoshinMonitorObservationPointCopyWithImpl< + $Res, + _$KyoshinMonitorObservationPointImpl + > implements _$$KyoshinMonitorObservationPointImplCopyWith<$Res> { __$$KyoshinMonitorObservationPointImplCopyWithImpl( - _$KyoshinMonitorObservationPointImpl _value, - $Res Function(_$KyoshinMonitorObservationPointImpl) _then) - : super(_value, _then); + _$KyoshinMonitorObservationPointImpl _value, + $Res Function(_$KyoshinMonitorObservationPointImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorObservationPoint /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override - $Res call({ - Object? code = null, - Object? x = null, - Object? y = null, - }) { - return _then(_$KyoshinMonitorObservationPointImpl( - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as String, - x: null == x - ? _value.x - : x // ignore: cast_nullable_to_non_nullable - as int, - y: null == y - ? _value.y - : y // ignore: cast_nullable_to_non_nullable - as int, - )); + $Res call({Object? code = null, Object? x = null, Object? y = null}) { + return _then( + _$KyoshinMonitorObservationPointImpl( + code: + null == code + ? _value.code + : code // ignore: cast_nullable_to_non_nullable + as String, + x: + null == x + ? _value.x + : x // ignore: cast_nullable_to_non_nullable + as int, + y: + null == y + ? _value.y + : y // ignore: cast_nullable_to_non_nullable + as int, + ), + ); } } @@ -135,12 +148,15 @@ class __$$KyoshinMonitorObservationPointImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorObservationPointImpl implements _KyoshinMonitorObservationPoint { - const _$KyoshinMonitorObservationPointImpl( - {required this.code, required this.x, required this.y}); + const _$KyoshinMonitorObservationPointImpl({ + required this.code, + required this.x, + required this.y, + }); factory _$KyoshinMonitorObservationPointImpl.fromJson( - Map json) => - _$$KyoshinMonitorObservationPointImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorObservationPointImplFromJson(json); @override final String code; @@ -174,24 +190,25 @@ class _$KyoshinMonitorObservationPointImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorObservationPointImplCopyWith< - _$KyoshinMonitorObservationPointImpl> - get copyWith => __$$KyoshinMonitorObservationPointImplCopyWithImpl< - _$KyoshinMonitorObservationPointImpl>(this, _$identity); + _$KyoshinMonitorObservationPointImpl + > + get copyWith => __$$KyoshinMonitorObservationPointImplCopyWithImpl< + _$KyoshinMonitorObservationPointImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorObservationPointImplToJson( - this, - ); + return _$$KyoshinMonitorObservationPointImplToJson(this); } } abstract class _KyoshinMonitorObservationPoint implements KyoshinMonitorObservationPoint { - const factory _KyoshinMonitorObservationPoint( - {required final String code, - required final int x, - required final int y}) = _$KyoshinMonitorObservationPointImpl; + const factory _KyoshinMonitorObservationPoint({ + required final String code, + required final int x, + required final int y, + }) = _$KyoshinMonitorObservationPointImpl; factory _KyoshinMonitorObservationPoint.fromJson(Map json) = _$KyoshinMonitorObservationPointImpl.fromJson; @@ -208,13 +225,13 @@ abstract class _KyoshinMonitorObservationPoint @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorObservationPointImplCopyWith< - _$KyoshinMonitorObservationPointImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorObservationPointImpl + > + get copyWith => throw _privateConstructorUsedError; } KyoshinMonitorObservationAnalyzedPoint - _$KyoshinMonitorObservationAnalyzedPointFromJson( - Map json) { +_$KyoshinMonitorObservationAnalyzedPointFromJson(Map json) { return _KyoshinMonitorObservationAnalyzedPoint.fromJson(json); } @@ -234,31 +251,38 @@ mixin _$KyoshinMonitorObservationAnalyzedPoint { /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) $KyoshinMonitorObservationAnalyzedPointCopyWith< - KyoshinMonitorObservationAnalyzedPoint> - get copyWith => throw _privateConstructorUsedError; + KyoshinMonitorObservationAnalyzedPoint + > + get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res> { factory $KyoshinMonitorObservationAnalyzedPointCopyWith( - KyoshinMonitorObservationAnalyzedPoint value, - $Res Function(KyoshinMonitorObservationAnalyzedPoint) then) = - _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl<$Res, - KyoshinMonitorObservationAnalyzedPoint>; + KyoshinMonitorObservationAnalyzedPoint value, + $Res Function(KyoshinMonitorObservationAnalyzedPoint) then, + ) = + _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl< + $Res, + KyoshinMonitorObservationAnalyzedPoint + >; @useResult - $Res call( - {KyoshinMonitorObservationPoint point, - double scale, - int r, - int g, - int b}); + $Res call({ + KyoshinMonitorObservationPoint point, + double scale, + int r, + int g, + int b, + }); $KyoshinMonitorObservationPointCopyWith<$Res> get point; } /// @nodoc -class _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl<$Res, - $Val extends KyoshinMonitorObservationAnalyzedPoint> +class _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl< + $Res, + $Val extends KyoshinMonitorObservationAnalyzedPoint +> implements $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res> { _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl(this._value, this._then); @@ -278,28 +302,36 @@ class _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl<$Res, Object? g = null, Object? b = null, }) { - return _then(_value.copyWith( - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorObservationPoint, - scale: null == scale - ? _value.scale - : scale // ignore: cast_nullable_to_non_nullable - as double, - r: null == r - ? _value.r - : r // ignore: cast_nullable_to_non_nullable - as int, - g: null == g - ? _value.g - : g // ignore: cast_nullable_to_non_nullable - as int, - b: null == b - ? _value.b - : b // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); + return _then( + _value.copyWith( + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorObservationPoint, + scale: + null == scale + ? _value.scale + : scale // ignore: cast_nullable_to_non_nullable + as double, + r: + null == r + ? _value.r + : r // ignore: cast_nullable_to_non_nullable + as int, + g: + null == g + ? _value.g + : g // ignore: cast_nullable_to_non_nullable + as int, + b: + null == b + ? _value.b + : b // ignore: cast_nullable_to_non_nullable + as int, + ) + as $Val, + ); } /// Create a copy of KyoshinMonitorObservationAnalyzedPoint @@ -317,17 +349,18 @@ class _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl<$Res, abstract class _$$KyoshinMonitorObservationAnalyzedPointImplCopyWith<$Res> implements $KyoshinMonitorObservationAnalyzedPointCopyWith<$Res> { factory _$$KyoshinMonitorObservationAnalyzedPointImplCopyWith( - _$KyoshinMonitorObservationAnalyzedPointImpl value, - $Res Function(_$KyoshinMonitorObservationAnalyzedPointImpl) then) = - __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl<$Res>; + _$KyoshinMonitorObservationAnalyzedPointImpl value, + $Res Function(_$KyoshinMonitorObservationAnalyzedPointImpl) then, + ) = __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {KyoshinMonitorObservationPoint point, - double scale, - int r, - int g, - int b}); + $Res call({ + KyoshinMonitorObservationPoint point, + double scale, + int r, + int g, + int b, + }); @override $KyoshinMonitorObservationPointCopyWith<$Res> get point; @@ -335,13 +368,16 @@ abstract class _$$KyoshinMonitorObservationAnalyzedPointImplCopyWith<$Res> /// @nodoc class __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl<$Res> - extends _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl<$Res, - _$KyoshinMonitorObservationAnalyzedPointImpl> + extends + _$KyoshinMonitorObservationAnalyzedPointCopyWithImpl< + $Res, + _$KyoshinMonitorObservationAnalyzedPointImpl + > implements _$$KyoshinMonitorObservationAnalyzedPointImplCopyWith<$Res> { __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl( - _$KyoshinMonitorObservationAnalyzedPointImpl _value, - $Res Function(_$KyoshinMonitorObservationAnalyzedPointImpl) _then) - : super(_value, _then); + _$KyoshinMonitorObservationAnalyzedPointImpl _value, + $Res Function(_$KyoshinMonitorObservationAnalyzedPointImpl) _then, + ) : super(_value, _then); /// Create a copy of KyoshinMonitorObservationAnalyzedPoint /// with the given fields replaced by the non-null parameter values. @@ -354,28 +390,35 @@ class __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl<$Res> Object? g = null, Object? b = null, }) { - return _then(_$KyoshinMonitorObservationAnalyzedPointImpl( - point: null == point - ? _value.point - : point // ignore: cast_nullable_to_non_nullable - as KyoshinMonitorObservationPoint, - scale: null == scale - ? _value.scale - : scale // ignore: cast_nullable_to_non_nullable - as double, - r: null == r - ? _value.r - : r // ignore: cast_nullable_to_non_nullable - as int, - g: null == g - ? _value.g - : g // ignore: cast_nullable_to_non_nullable - as int, - b: null == b - ? _value.b - : b // ignore: cast_nullable_to_non_nullable - as int, - )); + return _then( + _$KyoshinMonitorObservationAnalyzedPointImpl( + point: + null == point + ? _value.point + : point // ignore: cast_nullable_to_non_nullable + as KyoshinMonitorObservationPoint, + scale: + null == scale + ? _value.scale + : scale // ignore: cast_nullable_to_non_nullable + as double, + r: + null == r + ? _value.r + : r // ignore: cast_nullable_to_non_nullable + as int, + g: + null == g + ? _value.g + : g // ignore: cast_nullable_to_non_nullable + as int, + b: + null == b + ? _value.b + : b // ignore: cast_nullable_to_non_nullable + as int, + ), + ); } } @@ -383,17 +426,17 @@ class __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl<$Res> @JsonSerializable() class _$KyoshinMonitorObservationAnalyzedPointImpl extends _KyoshinMonitorObservationAnalyzedPoint { - const _$KyoshinMonitorObservationAnalyzedPointImpl( - {required this.point, - required this.scale, - required this.r, - required this.g, - required this.b}) - : super._(); + const _$KyoshinMonitorObservationAnalyzedPointImpl({ + required this.point, + required this.scale, + required this.r, + required this.g, + required this.b, + }) : super._(); factory _$KyoshinMonitorObservationAnalyzedPointImpl.fromJson( - Map json) => - _$$KyoshinMonitorObservationAnalyzedPointImplFromJson(json); + Map json, + ) => _$$KyoshinMonitorObservationAnalyzedPointImplFromJson(json); @override final KyoshinMonitorObservationPoint point; @@ -433,32 +476,32 @@ class _$KyoshinMonitorObservationAnalyzedPointImpl @override @pragma('vm:prefer-inline') _$$KyoshinMonitorObservationAnalyzedPointImplCopyWith< - _$KyoshinMonitorObservationAnalyzedPointImpl> - get copyWith => - __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl< - _$KyoshinMonitorObservationAnalyzedPointImpl>(this, _$identity); + _$KyoshinMonitorObservationAnalyzedPointImpl + > + get copyWith => __$$KyoshinMonitorObservationAnalyzedPointImplCopyWithImpl< + _$KyoshinMonitorObservationAnalyzedPointImpl + >(this, _$identity); @override Map toJson() { - return _$$KyoshinMonitorObservationAnalyzedPointImplToJson( - this, - ); + return _$$KyoshinMonitorObservationAnalyzedPointImplToJson(this); } } abstract class _KyoshinMonitorObservationAnalyzedPoint extends KyoshinMonitorObservationAnalyzedPoint { - const factory _KyoshinMonitorObservationAnalyzedPoint( - {required final KyoshinMonitorObservationPoint point, - required final double scale, - required final int r, - required final int g, - required final int b}) = _$KyoshinMonitorObservationAnalyzedPointImpl; + const factory _KyoshinMonitorObservationAnalyzedPoint({ + required final KyoshinMonitorObservationPoint point, + required final double scale, + required final int r, + required final int g, + required final int b, + }) = _$KyoshinMonitorObservationAnalyzedPointImpl; const _KyoshinMonitorObservationAnalyzedPoint._() : super._(); factory _KyoshinMonitorObservationAnalyzedPoint.fromJson( - Map json) = - _$KyoshinMonitorObservationAnalyzedPointImpl.fromJson; + Map json, + ) = _$KyoshinMonitorObservationAnalyzedPointImpl.fromJson; @override KyoshinMonitorObservationPoint get point; @@ -476,6 +519,7 @@ abstract class _KyoshinMonitorObservationAnalyzedPoint @override @JsonKey(includeFromJson: false, includeToJson: false) _$$KyoshinMonitorObservationAnalyzedPointImplCopyWith< - _$KyoshinMonitorObservationAnalyzedPointImpl> - get copyWith => throw _privateConstructorUsedError; + _$KyoshinMonitorObservationAnalyzedPointImpl + > + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.g.dart b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.g.dart index a30fd8d1..953c6aed 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.g.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/model/kyoshin_monitor_observation_point.g.dart @@ -9,55 +9,47 @@ part of 'kyoshin_monitor_observation_point.dart'; // ************************************************************************** _$KyoshinMonitorObservationPointImpl - _$$KyoshinMonitorObservationPointImplFromJson(Map json) => - $checkedCreate( - r'_$KyoshinMonitorObservationPointImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorObservationPointImpl( - code: $checkedConvert('code', (v) => v as String), - x: $checkedConvert('x', (v) => (v as num).toInt()), - y: $checkedConvert('y', (v) => (v as num).toInt()), - ); - return val; - }, - ); +_$$KyoshinMonitorObservationPointImplFromJson(Map json) => + $checkedCreate(r'_$KyoshinMonitorObservationPointImpl', json, ( + $checkedConvert, + ) { + final val = _$KyoshinMonitorObservationPointImpl( + code: $checkedConvert('code', (v) => v as String), + x: $checkedConvert('x', (v) => (v as num).toInt()), + y: $checkedConvert('y', (v) => (v as num).toInt()), + ); + return val; + }); Map _$$KyoshinMonitorObservationPointImplToJson( - _$KyoshinMonitorObservationPointImpl instance) => - { - 'code': instance.code, - 'x': instance.x, - 'y': instance.y, - }; + _$KyoshinMonitorObservationPointImpl instance, +) => {'code': instance.code, 'x': instance.x, 'y': instance.y}; _$KyoshinMonitorObservationAnalyzedPointImpl - _$$KyoshinMonitorObservationAnalyzedPointImplFromJson( - Map json) => - $checkedCreate( - r'_$KyoshinMonitorObservationAnalyzedPointImpl', - json, - ($checkedConvert) { - final val = _$KyoshinMonitorObservationAnalyzedPointImpl( - point: $checkedConvert( - 'point', - (v) => KyoshinMonitorObservationPoint.fromJson( - v as Map)), - scale: $checkedConvert('scale', (v) => (v as num).toDouble()), - r: $checkedConvert('r', (v) => (v as num).toInt()), - g: $checkedConvert('g', (v) => (v as num).toInt()), - b: $checkedConvert('b', (v) => (v as num).toInt()), - ); - return val; - }, - ); +_$$KyoshinMonitorObservationAnalyzedPointImplFromJson( + Map json, +) => $checkedCreate(r'_$KyoshinMonitorObservationAnalyzedPointImpl', json, ( + $checkedConvert, +) { + final val = _$KyoshinMonitorObservationAnalyzedPointImpl( + point: $checkedConvert( + 'point', + (v) => KyoshinMonitorObservationPoint.fromJson(v as Map), + ), + scale: $checkedConvert('scale', (v) => (v as num).toDouble()), + r: $checkedConvert('r', (v) => (v as num).toInt()), + g: $checkedConvert('g', (v) => (v as num).toInt()), + b: $checkedConvert('b', (v) => (v as num).toInt()), + ); + return val; +}); Map _$$KyoshinMonitorObservationAnalyzedPointImplToJson( - _$KyoshinMonitorObservationAnalyzedPointImpl instance) => - { - 'point': instance.point, - 'scale': instance.scale, - 'r': instance.r, - 'g': instance.g, - 'b': instance.b, - }; + _$KyoshinMonitorObservationAnalyzedPointImpl instance, +) => { + 'point': instance.point, + 'scale': instance.scale, + 'r': instance.r, + 'g': instance.g, + 'b': instance.b, +}; diff --git a/packages/kyoshin_monitor_image_parser/lib/src/parser/kyoshin_monitor_image_parser.dart b/packages/kyoshin_monitor_image_parser/lib/src/parser/kyoshin_monitor_image_parser.dart index cc4465e9..5cc61d6c 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/parser/kyoshin_monitor_image_parser.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/parser/kyoshin_monitor_image_parser.dart @@ -24,23 +24,11 @@ class KyoshinMonitorImageParser { for (final point in points) { assert(point.x >= 0 && point.x < image.width, 'x is out of range'); assert(point.y >= 0 && point.y < image.height, 'y is out of range'); - final pixel = image.getPixel( - point.x, - point.y, - ); - final hsv = HsvColor.fromRgb( - pixel.r, - pixel.g, - pixel.b, - pixel.a, - ); + final pixel = image.getPixel(point.x, point.y); + final hsv = HsvColor.fromRgb(pixel.r, pixel.g, pixel.b, pixel.a); final position = _hsvToPosition(hsv); if (position == null) { - results.add( - KyoshinMonitorImageParseObservationFailure( - point, - ), - ); + results.add(KyoshinMonitorImageParseObservationFailure(point)); } else { results.add( KyoshinMonitorImageParseObservationSuccess( @@ -63,28 +51,17 @@ class KyoshinMonitorImageParser { required List gifImage, required List points, }) async { - final image = img.decodeGif( - Uint8List.fromList(gifImage), - ); + final image = img.decodeGif(Uint8List.fromList(gifImage)); if (image == null) { throw const KyoshinImageParseInvalidGifException(); } - return parse( - image: image, - points: points, - ); + return parse(image: image, points: points); } Future> parseGifInIsolate( List gifImage, List points, - ) async => - Isolate.run( - () => parseGif( - gifImage: gifImage, - points: points, - ), - ); + ) async => Isolate.run(() => parseGif(gifImage: gifImage, points: points)); @visibleForTesting double? hsvToPosition(HsvColor hsv) => _hsvToPosition(hsv); @@ -107,7 +84,8 @@ class KyoshinMonitorImageParser { var p = 0.0; if (v > 0.1 && s > 0.75) { if (h > 0.1476) { - p = 280.31 * math.pow(h, 6) - + p = + 280.31 * math.pow(h, 6) - 916.05 * math.pow(h, 5) + 1142.6 * math.pow(h, 4) - 709.95 * math.pow(h, 3) + @@ -116,7 +94,8 @@ class KyoshinMonitorImageParser { 3.2217; } if (h <= 0.1476 && h > 0.001) { - p = 151.4 * math.pow(h, 4) - + p = + 151.4 * math.pow(h, 4) - 49.32 * math.pow(h, 3) + 6.753 * math.pow(h, 2) - 2.481 * h + diff --git a/packages/kyoshin_monitor_image_parser/lib/src/util/hsv_color.dart b/packages/kyoshin_monitor_image_parser/lib/src/util/hsv_color.dart index 19365f6f..97cbe787 100644 --- a/packages/kyoshin_monitor_image_parser/lib/src/util/hsv_color.dart +++ b/packages/kyoshin_monitor_image_parser/lib/src/util/hsv_color.dart @@ -29,14 +29,14 @@ class HsvColor { } const HsvColor._fromAHSV(this.alpha, this.hue, this.saturation, this.value) - : assert(alpha >= 0.0, 'alpha must be between 0.0 and 1.0'), - assert(alpha <= 1.0, 'alpha must be between 0.0 and 1.0'), - assert(hue >= 0.0, 'hue must be between 0.0 and 360.0'), - assert(hue <= 360.0, 'hue must be between 0.0 and 360.0'), - assert(saturation >= 0.0, 'saturation must be between 0.0 and 1.0'), - assert(saturation <= 1.0, 'saturation must be between 0.0 and 1.0'), - assert(value >= 0.0, 'value must be between 0.0 and 1.0'), - assert(value <= 1.0, 'value must be between 0.0 and 1.0'); + : assert(alpha >= 0.0, 'alpha must be between 0.0 and 1.0'), + assert(alpha <= 1.0, 'alpha must be between 0.0 and 1.0'), + assert(hue >= 0.0, 'hue must be between 0.0 and 360.0'), + assert(hue <= 360.0, 'hue must be between 0.0 and 360.0'), + assert(saturation >= 0.0, 'saturation must be between 0.0 and 1.0'), + assert(saturation <= 1.0, 'saturation must be between 0.0 and 1.0'), + assert(value >= 0.0, 'value must be between 0.0 and 1.0'), + assert(value <= 1.0, 'value must be between 0.0 and 1.0'); final double alpha; final double hue; diff --git a/packages/kyoshin_observation_point_converter_internal/lib/kyoshin_observation_point_converter_internal.dart b/packages/kyoshin_observation_point_converter_internal/lib/kyoshin_observation_point_converter_internal.dart index 5dac80fc..eac0ec56 100644 --- a/packages/kyoshin_observation_point_converter_internal/lib/kyoshin_observation_point_converter_internal.dart +++ b/packages/kyoshin_observation_point_converter_internal/lib/kyoshin_observation_point_converter_internal.dart @@ -10,16 +10,17 @@ class KyoshinObservationPointConverter { final file = File(path); final body = await file.readAsString(); final json = jsonDecode(body) as List; - final result = json - .map((e) { - try { - return ObservationModel.fromJson(e as Map); - } on Exception catch (_) { - return null; - } - }) - .whereType() - .toList(); + final result = + json + .map((e) { + try { + return ObservationModel.fromJson(e as Map); + } on Exception catch (_) { + return null; + } + }) + .whereType() + .toList(); return result; } @@ -46,10 +47,7 @@ class KyoshinObservationPointConverter { longitude: point.longitude, ), name: point.name, - point: KyoshinObservationPoint_Point( - x: point.x, - y: point.y, - ), + point: KyoshinObservationPoint_Point(x: point.x, y: point.y), region: point.region, arv400: await _getArv( latitude: point.latitude, @@ -58,9 +56,7 @@ class KyoshinObservationPointConverter { ), ); } - return KyoshinObservationPoints( - points: result, - ); + return KyoshinObservationPoints(points: result); } Future _getArv({ @@ -72,28 +68,31 @@ class KyoshinObservationPointConverter { if (cacheFile.existsSync()) { final json = jsonDecode(await cacheFile.readAsString()) as Map; - final arvStr = (((json['features'] as List?)?.first - as Map?)?['properties'] - as Map?)?['ARV'] as String?; + final arvStr = + (((json['features'] as List?)?.first + as Map?)?['properties'] + as Map?)?['ARV'] + as String?; final arv = double.tryParse(arvStr.toString()); return arv; } final response = await http.get( Uri.parse( - 'https://www.j-shis.bosai.go.jp/map/api/sstrct/V2/meshinfo.geojson' - '?position=$longitude,$latitude' - '&epsg=4326'), + 'https://www.j-shis.bosai.go.jp/map/api/sstrct/V2/meshinfo.geojson' + '?position=$longitude,$latitude' + '&epsg=4326', + ), ); final json = jsonDecode(response.body) as Map; print(json); - final arvStr = (((json['features'] as List?)?.first - as Map?)?['properties'] - as Map?)?['ARV'] as String?; + final arvStr = + (((json['features'] as List?)?.first + as Map?)?['properties'] + as Map?)?['ARV'] + as String?; final arv = double.tryParse(arvStr.toString()); - cacheFile.writeAsStringSync( - jsonEncode(json), - ); + cacheFile.writeAsStringSync(jsonEncode(json)); print('ARV: $arv'); return null; } diff --git a/packages/lat_lng/lib/src/lat_lng.dart b/packages/lat_lng/lib/src/lat_lng.dart index e74b42c7..98d2a206 100644 --- a/packages/lat_lng/lib/src/lat_lng.dart +++ b/packages/lat_lng/lib/src/lat_lng.dart @@ -19,10 +19,7 @@ class LatLng extends Point { return 'LatLng(lat: $lat, lon: $lon)'; } - Map toJson() => { - 'lat': lat, - 'lon': lon, - }; + Map toJson() => {'lat': lat, 'lon': lon}; } extension LatLngEx on LatLng { diff --git a/packages/lat_lng/lib/src/lat_lng_boundary.dart b/packages/lat_lng/lib/src/lat_lng_boundary.dart index d3f683fd..3c01c99a 100644 --- a/packages/lat_lng/lib/src/lat_lng_boundary.dart +++ b/packages/lat_lng/lib/src/lat_lng_boundary.dart @@ -34,10 +34,7 @@ class LatLngBoundary { } factory LatLngBoundary.fromList(List points) { - assert( - points.isNotEmpty && points.length > 1, - 'points must be not empty', - ); + assert(points.isNotEmpty && points.length > 1, 'points must be not empty'); var northEastLat = double.negativeInfinity; var northEastLon = double.negativeInfinity; var southWestLat = double.infinity; diff --git a/packages/msgpack_dart/example/benchmark.dart b/packages/msgpack_dart/example/benchmark.dart index 53842df4..777679d8 100644 --- a/packages/msgpack_dart/example/benchmark.dart +++ b/packages/msgpack_dart/example/benchmark.dart @@ -19,7 +19,9 @@ class Fraction { } Fraction cross(Fraction other) => new Fraction( - other.denominator * numerator, other.numerator * denominator); + other.denominator * numerator, + other.numerator * denominator, + ); @override String toString() => "${numerator}/${denominator}"; @@ -57,7 +59,7 @@ main(List args) async { "String": "Hello World", "Integer": 1, "Double": 2.0154, - "Array": const [1, 2, 3, "Hello"] + "Array": const [1, 2, 3, "Hello"], }, "Medium Data": { "/downstream/wemo/CoffeeMaker-1_0-221421S0000731/Brew_Age": [ @@ -95,9 +97,9 @@ main(List args) async { [1440366133032, -123913], [1440366134045, -123914], [1440366135050, -123915], - [1440366136049, -123916] - ] - } + [1440366136049, -123916], + ], + }, }; bool markdown = false; @@ -171,9 +173,11 @@ testObjectDecode(String desc, input, bool markdown) { print(" Total Time: $totalTime microseconds (${totalTime / 1000}ms)"); print(" Average Time: $avgTime microseconds (${avgTime / 1000}ms)"); print( - " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)"); + " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)", + ); print( - " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)"); + " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)", + ); } var jTotal = totalTime; var jAvg = avgTime; @@ -198,9 +202,11 @@ testObjectDecode(String desc, input, bool markdown) { print(" Total Time: ${totalTime} microseconds (${totalTime / 1000}ms)"); print(" Average Time: ${avgTime} microseconds (${avgTime / 1000}ms)"); print( - " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)"); + " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)", + ); print( - " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)"); + " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)", + ); } var nTotal = totalTime; var nAvg = avgTime; @@ -225,9 +231,11 @@ testObjectDecode(String desc, input, bool markdown) { print(" Total Time: ${totalTime} microseconds (${totalTime / 1000}ms)"); print(" Average Time: ${avgTime} microseconds (${avgTime / 1000}ms)"); print( - " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)"); + " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)", + ); print( - " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)"); + " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)", + ); } var n2Total = totalTime; var n2Avg = avgTime; @@ -237,18 +245,26 @@ testObjectDecode(String desc, input, bool markdown) { if (markdown) { print("Time | JSON | MsgPack2 | msgpack_dart |"); print("-----|------|----------|--------------|"); - print("Total | $jTotal μs (${jTotal / 1000}ms) | " + - "$nTotal μs (${nTotal / 1000}ms) |" + - "$n2Total μs (${n2Total / 1000}ms)"); - print("Average | $jAvg μs (${jAvg / 1000}ms) | " + - "$nAvg μs (${nAvg / 1000}ms) |" + - "$n2Avg μs (${n2Avg / 1000}ms)"); - print("Longest | $jLong μs (${jLong / 1000}ms) | " + - "$nLong μs (${nLong / 1000}ms) |" + - "$n2Long μs (${n2Long / 1000}ms)"); - print("Shortest | $jShort μs (${jShort / 1000}ms) | " + - "$nShort μs (${nShort / 1000}ms) |" + - "$n2Short μs (${n2Short / 1000}ms)"); + print( + "Total | $jTotal μs (${jTotal / 1000}ms) | " + + "$nTotal μs (${nTotal / 1000}ms) |" + + "$n2Total μs (${n2Total / 1000}ms)", + ); + print( + "Average | $jAvg μs (${jAvg / 1000}ms) | " + + "$nAvg μs (${nAvg / 1000}ms) |" + + "$n2Avg μs (${n2Avg / 1000}ms)", + ); + print( + "Longest | $jLong μs (${jLong / 1000}ms) | " + + "$nLong μs (${nLong / 1000}ms) |" + + "$n2Long μs (${n2Long / 1000}ms)", + ); + print( + "Shortest | $jShort μs (${jShort / 1000}ms) | " + + "$nShort μs (${nShort / 1000}ms) |" + + "$n2Short μs (${n2Short / 1000}ms)", + ); } var bestAvg = n2Avg; @@ -297,9 +313,11 @@ testObjectEncode(String desc, input, bool markdown) { print(" Total Time: $totalTime microseconds (${totalTime / 1000}ms)"); print(" Average Time: $avgTime microseconds (${avgTime / 1000}ms)"); print( - " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)"); + " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)", + ); print( - " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)"); + " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)", + ); print(" Size: ${size} bytes"); } var jTotal = totalTime; @@ -326,9 +344,11 @@ testObjectEncode(String desc, input, bool markdown) { print(" Total Time: ${totalTime} microseconds (${totalTime / 1000}ms)"); print(" Average Time: ${avgTime} microseconds (${avgTime / 1000}ms)"); print( - " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)"); + " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)", + ); print( - " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)"); + " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)", + ); print(" Size: ${size} bytes"); } var nTotal = totalTime; @@ -357,9 +377,11 @@ testObjectEncode(String desc, input, bool markdown) { print(" Total Time: ${totalTime} microseconds (${totalTime / 1000}ms)"); print(" Average Time: ${avgTime} microseconds (${avgTime / 1000}ms)"); print( - " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)"); + " Longest Time: ${times.last} microseconds (${times.last / 1000}ms)", + ); print( - " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)"); + " Shortest Time: ${times.first} microseconds (${times.first / 1000}ms)", + ); print(" Size: ${size} bytes"); } var n2Total = totalTime; @@ -371,18 +393,26 @@ testObjectEncode(String desc, input, bool markdown) { if (markdown) { print("Time | JSON | MsgPack2 | msgpack_dart |"); print("-----|------|---------|--------------|"); - print("Total | $jTotal μs (${jTotal / 1000}ms) | " + - "$nTotal μs (${nTotal / 1000}ms) | " + - "$n2Total μs (${n2Total / 1000}ms)"); - print("Average | $jAvg μs (${jAvg / 1000}ms) | " + - "$nAvg μs (${nAvg / 1000}ms) | " + - "$n2Avg μs (${n2Avg / 1000}ms)"); - print("Longest | $jLong μs (${jLong / 1000}ms) | " + - "$nLong μs (${nLong / 1000}ms) | " + - "$n2Long μs (${n2Long / 1000}ms)"); - print("Shortest | $jShort μs (${jShort / 1000}ms) | " + - "$nShort μs (${nShort / 1000}ms) | " + - "$n2Short μs (${n2Short / 1000}ms)"); + print( + "Total | $jTotal μs (${jTotal / 1000}ms) | " + + "$nTotal μs (${nTotal / 1000}ms) | " + + "$n2Total μs (${n2Total / 1000}ms)", + ); + print( + "Average | $jAvg μs (${jAvg / 1000}ms) | " + + "$nAvg μs (${nAvg / 1000}ms) | " + + "$n2Avg μs (${n2Avg / 1000}ms)", + ); + print( + "Longest | $jLong μs (${jLong / 1000}ms) | " + + "$nLong μs (${nLong / 1000}ms) | " + + "$n2Long μs (${n2Long / 1000}ms)", + ); + print( + "Shortest | $jShort μs (${jShort / 1000}ms) | " + + "$nShort μs (${nShort / 1000}ms) | " + + "$n2Short μs (${n2Short / 1000}ms)", + ); print("Size | $jSize bytes | $nSize bytes | $n2Size bytes"); } diff --git a/packages/msgpack_dart/lib/msgpack_dart.dart b/packages/msgpack_dart/lib/msgpack_dart.dart index 924d061a..7cf526c4 100644 --- a/packages/msgpack_dart/lib/msgpack_dart.dart +++ b/packages/msgpack_dart/lib/msgpack_dart.dart @@ -9,10 +9,7 @@ part 'src/deserializer.dart'; part 'src/extension/ext_decoder.dart'; part 'src/serializer.dart'; -Uint8List serialize( - dynamic value, { - ExtEncoder? extEncoder, -}) { +Uint8List serialize(dynamic value, {ExtEncoder? extEncoder}) { final s = Serializer(extEncoder: extEncoder); s.encode(value); return s.takeBytes(); diff --git a/packages/msgpack_dart/lib/src/data_writer.dart b/packages/msgpack_dart/lib/src/data_writer.dart index f11a7e37..6ff5cde9 100644 --- a/packages/msgpack_dart/lib/src/data_writer.dart +++ b/packages/msgpack_dart/lib/src/data_writer.dart @@ -84,7 +84,10 @@ class DataWriter { // be 0 if (bytes is Uint8List) { _scratchBuffer?.setRange( - _scratchOffset, _scratchOffset + length, bytes); + _scratchOffset, + _scratchOffset + length, + bytes, + ); } else { for (int i = 0; i < length; i++) { _scratchBuffer?[_scratchOffset + i] = bytes[i]; @@ -116,8 +119,10 @@ class DataWriter { if (_scratchBuffer == null) { // start with small scratch buffer, expand to regular later if needed _scratchBuffer = Uint8List(_kScratchSizeInitial); - _scratchData = - ByteData.view(_scratchBuffer!.buffer, _scratchBuffer!.offsetInBytes); + _scratchData = ByteData.view( + _scratchBuffer!.buffer, + _scratchBuffer!.offsetInBytes, + ); } final remaining = _scratchBuffer!.length - _scratchOffset; if (remaining < size) { @@ -130,14 +135,18 @@ class DataWriter { if (_builder.isEmpty) { // We're still on small scratch buffer, move it to _builder // and create regular one - _builder.add(Uint8List.view( - _scratchBuffer!.buffer, - _scratchBuffer!.offsetInBytes, - _scratchOffset, - )); + _builder.add( + Uint8List.view( + _scratchBuffer!.buffer, + _scratchBuffer!.offsetInBytes, + _scratchOffset, + ), + ); _scratchBuffer = Uint8List(_kScratchSizeRegular); _scratchData = ByteData.view( - _scratchBuffer!.buffer, _scratchBuffer!.offsetInBytes); + _scratchBuffer!.buffer, + _scratchBuffer!.offsetInBytes, + ); } else { _builder.add( Uint8List.fromList( diff --git a/packages/msgpack_dart/lib/src/deserializer.dart b/packages/msgpack_dart/lib/src/deserializer.dart index b1cabaec..603090b0 100644 --- a/packages/msgpack_dart/lib/src/deserializer.dart +++ b/packages/msgpack_dart/lib/src/deserializer.dart @@ -17,9 +17,9 @@ class Deserializer { Uint8List list, { ExtDecoder? extDecoder, this.copyBinaryData = false, - }) : _list = list, - _data = ByteData.view(list.buffer, list.offsetInBytes), - _extDecoder = extDecoder; + }) : _list = list, + _data = ByteData.view(list.buffer, list.offsetInBytes), + _extDecoder = extDecoder; /// If false, decoded binary data buffers will reference underlying input /// buffer and thus may change when the content of input buffer changes. @@ -167,8 +167,11 @@ class Deserializer { } Uint8List _readBuffer(int length) { - final res = - Uint8List.view(_list.buffer, _list.offsetInBytes + _offset, length); + final res = Uint8List.view( + _list.buffer, + _list.offsetInBytes + _offset, + length, + ); _offset += length; return copyBinaryData ? Uint8List.fromList(res) : res; } diff --git a/packages/msgpack_dart/lib/src/extension/ext_decoder.dart b/packages/msgpack_dart/lib/src/extension/ext_decoder.dart index c030c216..8bae828f 100644 --- a/packages/msgpack_dart/lib/src/extension/ext_decoder.dart +++ b/packages/msgpack_dart/lib/src/extension/ext_decoder.dart @@ -11,12 +11,16 @@ class ExtTimeStampDecoder implements ExtDecoder { } if (list.lengthInBytes == 8) { // 30bit unsigned int: nano seconds - final data = - ByteData.view(list.buffer, list.offsetInBytes).getUint64(0); + final data = ByteData.view( + list.buffer, + list.offsetInBytes, + ).getUint64(0); final nanoSec = data >> 34; final sec = data & 0x3fffffff; - return DateTime.fromMicrosecondsSinceEpoch(sec * 1000 + nanoSec, - isUtc: true); + return DateTime.fromMicrosecondsSinceEpoch( + sec * 1000 + nanoSec, + isUtc: true, + ); } } if (extType == 0x12) { diff --git a/packages/msgpack_dart/lib/src/serializer.dart b/packages/msgpack_dart/lib/src/serializer.dart index d85e4cd2..1018cac4 100644 --- a/packages/msgpack_dart/lib/src/serializer.dart +++ b/packages/msgpack_dart/lib/src/serializer.dart @@ -21,11 +21,9 @@ class Serializer { final DataWriter _writer; final ExtEncoder? _extEncoder; - Serializer({ - DataWriter? dataWriter, - ExtEncoder? extEncoder, - }) : _writer = dataWriter ?? DataWriter(), - _extEncoder = extEncoder; + Serializer({DataWriter? dataWriter, ExtEncoder? extEncoder}) + : _writer = dataWriter ?? DataWriter(), + _extEncoder = extEncoder; void encode(dynamic d) { if (d == null) return _writer.writeUint8(0xc0); @@ -38,7 +36,8 @@ class Serializer { if (d is Iterable) return _writeIterable(d); if (d is ByteData) return _writeBinary( - d.buffer.asUint8List(d.offsetInBytes, d.lengthInBytes)); + d.buffer.asUint8List(d.offsetInBytes, d.lengthInBytes), + ); if (d is Map) return _writeMap(d); if (_extEncoder != null && _writeExt(d)) { return; diff --git a/packages/msgpack_dart/test/msgpack_dart_test.dart b/packages/msgpack_dart/test/msgpack_dart_test.dart index bd217509..7b9e137c 100644 --- a/packages/msgpack_dart/test/msgpack_dart_test.dart +++ b/packages/msgpack_dart/test/msgpack_dart_test.dart @@ -204,8 +204,10 @@ void packFloat32() { void packDouble() { List encoded = serialize(3.14); - expect(encoded, - orderedEquals([0xcb, 0x40, 0x09, 0x1e, 0xb8, 0x51, 0xeb, 0x85, 0x1f])); + expect( + encoded, + orderedEquals([0xcb, 0x40, 0x09, 0x1e, 0xb8, 0x51, 0xeb, 0x85, 0x1f]), + ); } void packString5() { @@ -216,37 +218,39 @@ void packString5() { void packString22() { List encoded = serialize("hello there, everyone!"); expect( - encoded, - orderedEquals([ - 182, - 104, - 101, - 108, - 108, - 111, - 32, - 116, - 104, - 101, - 114, - 101, - 44, - 32, - 101, - 118, - 101, - 114, - 121, - 111, - 110, - 101, - 33 - ])); + encoded, + orderedEquals([ + 182, + 104, + 101, + 108, + 108, + 111, + 32, + 116, + 104, + 101, + 114, + 101, + 44, + 32, + 101, + 118, + 101, + 114, + 121, + 111, + 110, + 101, + 33, + ]), + ); } void packString256() { List encoded = serialize( - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + ); expect(encoded, hasLength(259)); expect(encoded.sublist(0, 3), orderedEquals([218, 1, 0])); expect(encoded.sublist(3, 259), everyElement(65)); @@ -281,37 +285,42 @@ void packByteData() { List encoded = serialize(data); expect(encoded.length, equals(34)); expect(encoded.getRange(0, 2), orderedEquals([0xc4, 32])); - expect(encoded.getRange(2, encoded.length), - orderedEquals(data.buffer.asUint8List())); + expect( + encoded.getRange(2, encoded.length), + orderedEquals(data.buffer.asUint8List()), + ); } void packStringArray() { List encoded = serialize(["one", "two", "three"]); expect( - encoded, - orderedEquals([ - 147, - 163, - 111, - 110, - 101, - 163, - 116, - 119, - 111, - 165, - 116, - 104, - 114, - 101, - 101 - ])); + encoded, + orderedEquals([ + 147, + 163, + 111, + 110, + 101, + 163, + 116, + 119, + 111, + 165, + 116, + 104, + 114, + 101, + 101, + ]), + ); } void packIntToStringMap() { List encoded = serialize({1: "one", 2: "two"}); - expect(encoded, - orderedEquals([130, 1, 163, 111, 110, 101, 2, 163, 116, 119, 111])); + expect( + encoded, + orderedEquals([130, 1, 163, 111, 110, 101, 2, 163, 116, 119, 111]), + ); } // Test unpacking @@ -364,7 +373,7 @@ void unpackString22() { 111, 110, 101, - 33 + 33, ]); var value = deserialize(data); expect(value, isString); @@ -408,8 +417,17 @@ void unpackUint32() { void unpackUint64() { // Dart 2 doesn't support true Uint64 without using BigInt - Uint8List data = - Uint8List.fromList([207, 127, 255, 255, 255, 255, 255, 255, 255]); + Uint8List data = Uint8List.fromList([ + 207, + 127, + 255, + 255, + 255, + 255, + 255, + 255, + 255, + ]); var value = deserialize(data); expect(value, isInt); expect(value, equals(9223372036854775807)); @@ -452,21 +470,33 @@ void unpackFloat32() { } void unpackDouble() { - Uint8List data = Uint8List.fromList( - [0xcb, 0x40, 0x09, 0x1e, 0xb8, 0x51, 0xeb, 0x85, 0x1f]); + Uint8List data = Uint8List.fromList([ + 0xcb, + 0x40, + 0x09, + 0x1e, + 0xb8, + 0x51, + 0xeb, + 0x85, + 0x1f, + ]); var value = deserialize(data); expect(value, equals(3.14)); } void unpackString256() { - Uint8List data = - new Uint8List.fromList([218, 1, 0]..addAll(new List.filled(256, 65))); + Uint8List data = new Uint8List.fromList( + [218, 1, 0]..addAll(new List.filled(256, 65)), + ); var value = deserialize(data); expect(value, isString); expect( - value, - equals( - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); + value, + equals( + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + ), + ); } void unpackStringArray() { @@ -485,7 +515,7 @@ void unpackStringArray() { 104, 114, 101, - 101 + 101, ]); var value = deserialize(data); expect(value, isList); @@ -493,8 +523,19 @@ void unpackStringArray() { } void unpackIntToStringMap() { - Uint8List data = new Uint8List.fromList( - [130, 1, 163, 111, 110, 101, 2, 163, 116, 119, 111]); + Uint8List data = new Uint8List.fromList([ + 130, + 1, + 163, + 111, + 110, + 101, + 2, + 163, + 116, + 119, + 111, + ]); var value = deserialize(data); expect(value, isMap); expect(value[1], equals("one")); @@ -507,8 +548,10 @@ void unpackSmallDateTime() { expect(value, equals(DateTime.fromMillisecondsSinceEpoch(0))); data = [0xd7, 0xff, 47, 175, 8, 0, 91, 124, 180, 16]; value = deserialize(Uint8List.fromList(data)); - expect((value as DateTime).toUtc(), - equals(DateTime.utc(2018, 8, 22, 0, 56, 56, 200))); + expect( + (value as DateTime).toUtc(), + equals(DateTime.utc(2018, 8, 22, 0, 56, 56, 200)), + ); } void unpackPastDate() { @@ -527,7 +570,7 @@ void unpackPastDate() { 184, 204, 121, - 158 + 158, ]; var value = deserialize(Uint8List.fromList(data)) as DateTime; @@ -548,7 +591,7 @@ void unpackPastDate() { 255, 255, 248, - 248 + 248, ]; value = deserialize(Uint8List.fromList(data)); expect(value.toUtc(), equals(DateTime.utc(1969, 12, 31, 23, 30))); From a43fd6458006cf9636232d999b2fdc4d2d8510c4 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 14 Feb 2025 00:32:20 +0900 Subject: [PATCH 67/70] Update dependencies and SDK versions --- .fvmrc | 2 +- .vscode/settings.json | 2 +- pubspec.lock | 8 ++++---- pubspec.yaml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.fvmrc b/.fvmrc index c0edbf9e..4cfa3d5f 100644 --- a/.fvmrc +++ b/.fvmrc @@ -1,3 +1,3 @@ { "flutter": "3.29.0" -} +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 3f669a9f..025b1b5a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "dart.flutterSdkPath": ".fvm/versions/3.27.4", + "dart.flutterSdkPath": ".fvm/versions/3.29.0", "search.exclude": { "**/.fvm": true, "*.geojson": true diff --git a/pubspec.lock b/pubspec.lock index ae4c083a..97954dfb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1199,10 +1199,10 @@ packages: dependency: "direct main" description: name: melos - sha256: "282486e17f60879225c3d8d3d4ce6169e64e346802337178d8a50ab6553ebec3" + sha256: "63e9852a28a44c811503b31c607606f9ce8d891e22879e1e97fc7417c22ed6bc" url: "https://pub.dev" source: hosted - version: "7.0.0-dev.4" + version: "7.0.0-dev.7" meta: dependency: transitive description: @@ -1870,10 +1870,10 @@ packages: dependency: transitive description: name: test - sha256: "301b213cd241ca982e9ba50266bd3f5bd1ea33f1455554c5abb85d1be0e2d87e" + sha256: "8391fbe68d520daf2314121764d38e37f934c02fd7301ad18307bd93bd6b725d" url: "https://pub.dev" source: hosted - version: "1.25.15" + version: "1.25.14" test_api: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e5c8c4fc..46505bb8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: eqmonitor_workspace description: The workspace for the EQMonitor project. environment: - sdk: ^3.6.1 + sdk: ^3.7.0 workspace: - app - packages/_base @@ -25,7 +25,7 @@ workspace: - packages/kyoshin_monitor_image_parser # dependencies: - melos: ^7.0.0-dev.4 + melos: ^7.0.0-dev.7 dependency_overrides: # `yumemi_lints` の `file` 依存関係が `file` 6.xになっているため、 # 強制的に `file` 7.x を依存関係に追加する From 12a0311f7c78f8fd8139b56e2bb8c9c76f9d6f0b Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 14 Feb 2025 01:11:47 +0900 Subject: [PATCH 68/70] Refactor code formatting and trailing commas --- .../estimated_intensity_provider.dart | 54 +++++++++---------- .../earthquake_history_list_tile.dart | 2 +- .../ui/earthquake_history_screen.dart | 4 +- .../ui/component/earthquake_map.dart | 10 ++-- .../ui/component/prefecture_intensity.dart | 4 +- .../component/prefecture_lpgm_intensity.dart | 4 +- .../earthquake_history_early_sort_chip.dart | 2 +- .../ui/earthquake_history_early_screen.dart | 2 +- .../debug_kyoshin_monitor.dart | 8 +-- .../display_settings/ui/display_settings.dart | 2 +- .../setup/component/background_image.dart | 2 +- 11 files changed, 47 insertions(+), 47 deletions(-) diff --git a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart index 4459fca0..15ea9394 100644 --- a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart +++ b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart @@ -15,12 +15,11 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'estimated_intensity_provider.freezed.dart'; part 'estimated_intensity_provider.g.dart'; -typedef _CachedPoint = - ({ - String regionCode, - String cityCode, - EarthquakeParameterStationItem station, - }); +typedef _CachedPoint = ({ + String regionCode, + String cityCode, + EarthquakeParameterStationItem station, +}); @Riverpod(keepAlive: true) class EstimatedIntensity extends _$EstimatedIntensity { @@ -62,15 +61,12 @@ class EstimatedIntensity extends _$EstimatedIntensity { } for (final eew in targetEews) { - final result = - calculator - .getEstimatedIntensity( - points: _calculationPoints!.toList(), - jmaMagnitude: eew.magnitude!, - depth: eew.depth!, - hypocenter: (lat: eew.latitude!, lon: eew.longitude!), - ) - .toList(); + final result = calculator.getEstimatedIntensity( + points: _calculationPoints!.toList(), + jmaMagnitude: eew.magnitude!, + depth: eew.depth!, + hypocenter: (lat: eew.latitude!, lon: eew.longitude!), + ).toList(); results.add(result); } @@ -101,19 +97,21 @@ class EstimatedIntensity extends _$EstimatedIntensity { List eews, EarthquakeParameter parameter, ) async => - // TODO(YumNumm): 並列計算 - calc(eews, parameter); + // TODO(YumNumm): 並列計算 + calc(eews, parameter); List<_CachedPoint> _generateCachedPoints(EarthquakeParameter earthquake) { final result = <_CachedPoint>[]; for (final region in earthquake.regions) { for (final city in region.cities) { for (final station in city.stations) { - result.add(( - regionCode: region.code, - cityCode: city.code, - station: station, - )); + result.add( + ( + regionCode: region.code, + cityCode: city.code, + station: station, + ), + ); } } } @@ -125,11 +123,13 @@ class EstimatedIntensity extends _$EstimatedIntensity { ) { final result = []; for (final point in points) { - result.add(( - lat: point.station.latitude, - lon: point.station.longitude, - arv400: point.station.arv400, - )); + result.add( + ( + lat: point.station.latitude, + lon: point.station.longitude, + arv400: point.station.arv400, + ), + ); } return result; } diff --git a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart index a3f718ae..d5b2466a 100644 --- a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart +++ b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart @@ -56,7 +56,7 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { return codeTable.areaEpicenter.items .firstWhereOrNull((e) => int.tryParse(e.code) == item.epicenterCode) ?.name; - }, [item]); + }, [item],); final hypoDetailName = useMemoized( () => codeTable.areaEpicenterDetail.items.firstWhereOrNull( (e) => int.tryParse(e.code) == item.epicenterDetailCode, diff --git a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart index 7baea31a..361e930c 100644 --- a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart +++ b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart @@ -37,7 +37,7 @@ class EarthquakeHistoryScreen extends HookConsumerWidget { }), ); return null; - }, [parameter.value]); + }, [parameter.value],); return Scaffold( appBar: AppBar( @@ -157,7 +157,7 @@ class _SliverListBody extends HookConsumerWidget { } }); return null; - }, [controller, state, onScrollEnd, onRefresh]); + }, [controller, state, onScrollEnd, onRefresh],); Widget listView({ required (List, int) data, diff --git a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart index cef4c4a1..b6610db1 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart @@ -75,7 +75,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { // ignore: discarded_futures final itemCalculateFutureing = useMemoized(() async { return _compute(colorModel, item, earthquakeParams); - }, [colorModel, item, earthquakeParams]); + }, [colorModel, item, earthquakeParams],); final itemCalculateFuture = useFuture(itemCalculateFutureing); final result = itemCalculateFuture.data; if (itemCalculateFuture.hasError) { @@ -122,7 +122,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { bbox = bbox.add(jma_map.LatLng(lat: latitude, lng: longitude)); } return bbox; - }, [regionsItem]); + }, [regionsItem],); final mapController = useState(null); @@ -148,7 +148,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { right: 10, top: 10, ); - }, [bbox, item]); + }, [bbox, item],); // * Display mode related List<_Action> getActions(EarthquakeHistoryDetailConfig config) => [ @@ -247,7 +247,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { }), ); return null; - }, [item]); + }, [item],); final maxZoomLevel = useState(6); return RepaintBoundary( @@ -414,7 +414,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { regionsLpgmItem, stationsLpgmItem, ); - }, (earthquake, earthquakeParams, colorModel)); + }, (earthquake, earthquakeParams, colorModel),); } } diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart index 3abf52cc..176f81d8 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart @@ -113,7 +113,7 @@ Future>> _calculator( .reversed .toList(); return Map.fromEntries(reorderedResult); -}, arg); +}, arg,); class PrefectureIntensityWidget extends HookConsumerWidget { const PrefectureIntensityWidget({required this.item, super.key}); @@ -133,7 +133,7 @@ class PrefectureIntensityWidget extends HookConsumerWidget { prefectures: item.intensityPrefectures!, cities: item.intensityCities, stations: item.intensityStations, - )), + ),), ); return switch (mergedPrefecturesFuture) { AsyncLoading() => const Center( diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart index 6619c0e4..11ed1acb 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart @@ -61,7 +61,7 @@ Future>> _lpgmCalculator( } } return result; - }, arg); + }, arg,); class PrefectureLpgmIntensityWidget extends HookConsumerWidget { const PrefectureLpgmIntensityWidget({required this.item, super.key}); @@ -77,7 +77,7 @@ class PrefectureLpgmIntensityWidget extends HookConsumerWidget { _LpgmCalculatorProvider(( prefectures: item.lpgmIntensityPrefectures, stations: item.lpgmIntenstiyStations, - )), + ),), ); return switch (mergedPrefecturesFuture) { diff --git a/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart b/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart index 1090d6b8..934c1b0d 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart @@ -136,7 +136,7 @@ class _SortModal extends HookConsumerWidget { (EarthquakeEarlySortType.origin_time, true) => '地震発生時刻の古い順', (EarthquakeEarlySortType.max_intensity, false) => '最大観測震度の大きい順', (EarthquakeEarlySortType.max_intensity, true) => '最大観測震度の小さい順', - }), + },), value: ascending.value, onChanged: (v) => ascending.value = v, ), diff --git a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart index 2308f017..eb810fde 100644 --- a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart +++ b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart @@ -194,7 +194,7 @@ class _SliverListBody extends HookConsumerWidget { } }); return null; - }, [controller, state, onScrollEnd, onRefresh]); + }, [controller, state, onScrollEnd, onRefresh],); final theme = Theme.of(context); final colorSchema = theme.colorScheme; diff --git a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart index 61f9e679..8d90af04 100644 --- a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart +++ b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart @@ -85,7 +85,7 @@ class _Body extends ConsumerWidget { }), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle), + }, style: bodyTextStyle,), ], ), ), @@ -98,7 +98,7 @@ class _Body extends ConsumerWidget { AsyncData(:final value) => value.toString(), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle), + }, style: bodyTextStyle,), ], ), ), @@ -130,7 +130,7 @@ class _Body extends ConsumerWidget { }), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle), + }, style: bodyTextStyle,), if (state.valueOrNull?.currentImageRaw != null) ColoredBox( color: Colors.white, @@ -160,7 +160,7 @@ class _Body extends ConsumerWidget { ).convert(value.toJson()), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle), + }, style: bodyTextStyle,), ], ), ), diff --git a/app/lib/feature/settings/features/display_settings/ui/display_settings.dart b/app/lib/feature/settings/features/display_settings/ui/display_settings.dart index 7843ca67..f5de6fcf 100644 --- a/app/lib/feature/settings/features/display_settings/ui/display_settings.dart +++ b/app/lib/feature/settings/features/display_settings/ui/display_settings.dart @@ -83,7 +83,7 @@ class _ThemeSelector extends ConsumerWidget { ThemeMode.light => 'ライト', ThemeMode.dark => 'ダーク', _ => throw UnimplementedError(), - }), + },), const SizedBox(height: 4), Radio.adaptive( value: diff --git a/app/lib/feature/setup/component/background_image.dart b/app/lib/feature/setup/component/background_image.dart index 890fe5b5..f931ed81 100644 --- a/app/lib/feature/setup/component/background_image.dart +++ b/app/lib/feature/setup/component/background_image.dart @@ -30,7 +30,7 @@ class SetupBackgroundImageWidget extends HookWidget { useEffect(() { startTime.value = DateTime.now().millisecondsSinceEpoch; return null; - }, [context]); + }, [context],); if (shader.hasData) { return AnimatedBuilder( animation: animationController, From c46202d70d0fc908b48aa1b1fb4caaae74b4098f Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 14 Feb 2025 01:11:58 +0900 Subject: [PATCH 69/70] Add script for automated Dart code fixes --- scripts/fix.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/fix.sh diff --git a/scripts/fix.sh b/scripts/fix.sh new file mode 100755 index 00000000..10b43b31 --- /dev/null +++ b/scripts/fix.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# https://github.com/yumemi-inc/flutter-mobile-project-template/blob/main/scripts/fix.sh + +source "$(dirname "${BASH_SOURCE[0]}")/common.sh" + +files=() +while IFS= read -r -d $'\0' file; do + files+=("$file") +done < <(find_custom_dart_files) + +for file in "${files[@]}"; do + # limit jobs to 5 + if [ "$(jobs -r | wc -l)" -ge 5 ]; then + wait "$(jobs -r -p | head -1)" + fi + dart fix --apply "$file" & +done +wait From 0faa28cf8bff9926a6c67ecd606ffd00a9291b37 Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:29:16 +0000 Subject: [PATCH 70/70] Auto format --- .../estimated_intensity_provider.dart | 54 +++++++++---------- .../earthquake_history_list_tile.dart | 2 +- .../ui/earthquake_history_screen.dart | 4 +- .../ui/component/earthquake_map.dart | 10 ++-- .../ui/component/prefecture_intensity.dart | 4 +- .../component/prefecture_lpgm_intensity.dart | 4 +- .../earthquake_history_early_sort_chip.dart | 2 +- .../ui/earthquake_history_early_screen.dart | 2 +- .../debug_kyoshin_monitor.dart | 8 +-- .../display_settings/ui/display_settings.dart | 2 +- .../setup/component/background_image.dart | 2 +- 11 files changed, 47 insertions(+), 47 deletions(-) diff --git a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart index 15ea9394..4459fca0 100644 --- a/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart +++ b/app/lib/core/provider/estimated_intensity/provider/estimated_intensity_provider.dart @@ -15,11 +15,12 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'estimated_intensity_provider.freezed.dart'; part 'estimated_intensity_provider.g.dart'; -typedef _CachedPoint = ({ - String regionCode, - String cityCode, - EarthquakeParameterStationItem station, -}); +typedef _CachedPoint = + ({ + String regionCode, + String cityCode, + EarthquakeParameterStationItem station, + }); @Riverpod(keepAlive: true) class EstimatedIntensity extends _$EstimatedIntensity { @@ -61,12 +62,15 @@ class EstimatedIntensity extends _$EstimatedIntensity { } for (final eew in targetEews) { - final result = calculator.getEstimatedIntensity( - points: _calculationPoints!.toList(), - jmaMagnitude: eew.magnitude!, - depth: eew.depth!, - hypocenter: (lat: eew.latitude!, lon: eew.longitude!), - ).toList(); + final result = + calculator + .getEstimatedIntensity( + points: _calculationPoints!.toList(), + jmaMagnitude: eew.magnitude!, + depth: eew.depth!, + hypocenter: (lat: eew.latitude!, lon: eew.longitude!), + ) + .toList(); results.add(result); } @@ -97,21 +101,19 @@ class EstimatedIntensity extends _$EstimatedIntensity { List eews, EarthquakeParameter parameter, ) async => - // TODO(YumNumm): 並列計算 - calc(eews, parameter); + // TODO(YumNumm): 並列計算 + calc(eews, parameter); List<_CachedPoint> _generateCachedPoints(EarthquakeParameter earthquake) { final result = <_CachedPoint>[]; for (final region in earthquake.regions) { for (final city in region.cities) { for (final station in city.stations) { - result.add( - ( - regionCode: region.code, - cityCode: city.code, - station: station, - ), - ); + result.add(( + regionCode: region.code, + cityCode: city.code, + station: station, + )); } } } @@ -123,13 +125,11 @@ class EstimatedIntensity extends _$EstimatedIntensity { ) { final result = []; for (final point in points) { - result.add( - ( - lat: point.station.latitude, - lon: point.station.longitude, - arv400: point.station.arv400, - ), - ); + result.add(( + lat: point.station.latitude, + lon: point.station.longitude, + arv400: point.station.arv400, + )); } return result; } diff --git a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart index d5b2466a..a3f718ae 100644 --- a/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart +++ b/app/lib/feature/earthquake_history/ui/components/earthquake_history_list_tile.dart @@ -56,7 +56,7 @@ class EarthquakeHistoryListTile extends HookConsumerWidget { return codeTable.areaEpicenter.items .firstWhereOrNull((e) => int.tryParse(e.code) == item.epicenterCode) ?.name; - }, [item],); + }, [item]); final hypoDetailName = useMemoized( () => codeTable.areaEpicenterDetail.items.firstWhereOrNull( (e) => int.tryParse(e.code) == item.epicenterDetailCode, diff --git a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart index 361e930c..7baea31a 100644 --- a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart +++ b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart @@ -37,7 +37,7 @@ class EarthquakeHistoryScreen extends HookConsumerWidget { }), ); return null; - }, [parameter.value],); + }, [parameter.value]); return Scaffold( appBar: AppBar( @@ -157,7 +157,7 @@ class _SliverListBody extends HookConsumerWidget { } }); return null; - }, [controller, state, onScrollEnd, onRefresh],); + }, [controller, state, onScrollEnd, onRefresh]); Widget listView({ required (List, int) data, diff --git a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart index b6610db1..cef4c4a1 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/earthquake_map.dart @@ -75,7 +75,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { // ignore: discarded_futures final itemCalculateFutureing = useMemoized(() async { return _compute(colorModel, item, earthquakeParams); - }, [colorModel, item, earthquakeParams],); + }, [colorModel, item, earthquakeParams]); final itemCalculateFuture = useFuture(itemCalculateFutureing); final result = itemCalculateFuture.data; if (itemCalculateFuture.hasError) { @@ -122,7 +122,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { bbox = bbox.add(jma_map.LatLng(lat: latitude, lng: longitude)); } return bbox; - }, [regionsItem],); + }, [regionsItem]); final mapController = useState(null); @@ -148,7 +148,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { right: 10, top: 10, ); - }, [bbox, item],); + }, [bbox, item]); // * Display mode related List<_Action> getActions(EarthquakeHistoryDetailConfig config) => [ @@ -247,7 +247,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { }), ); return null; - }, [item],); + }, [item]); final maxZoomLevel = useState(6); return RepaintBoundary( @@ -414,7 +414,7 @@ class EarthquakeMapWidget extends HookConsumerWidget { regionsLpgmItem, stationsLpgmItem, ); - }, (earthquake, earthquakeParams, colorModel),); + }, (earthquake, earthquakeParams, colorModel)); } } diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart index 176f81d8..3abf52cc 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_intensity.dart @@ -113,7 +113,7 @@ Future>> _calculator( .reversed .toList(); return Map.fromEntries(reorderedResult); -}, arg,); +}, arg); class PrefectureIntensityWidget extends HookConsumerWidget { const PrefectureIntensityWidget({required this.item, super.key}); @@ -133,7 +133,7 @@ class PrefectureIntensityWidget extends HookConsumerWidget { prefectures: item.intensityPrefectures!, cities: item.intensityCities, stations: item.intensityStations, - ),), + )), ); return switch (mergedPrefecturesFuture) { AsyncLoading() => const Center( diff --git a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart index 11ed1acb..6619c0e4 100644 --- a/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart +++ b/app/lib/feature/earthquake_history_details/ui/component/prefecture_lpgm_intensity.dart @@ -61,7 +61,7 @@ Future>> _lpgmCalculator( } } return result; - }, arg,); + }, arg); class PrefectureLpgmIntensityWidget extends HookConsumerWidget { const PrefectureLpgmIntensityWidget({required this.item, super.key}); @@ -77,7 +77,7 @@ class PrefectureLpgmIntensityWidget extends HookConsumerWidget { _LpgmCalculatorProvider(( prefectures: item.lpgmIntensityPrefectures, stations: item.lpgmIntenstiyStations, - ),), + )), ); return switch (mergedPrefecturesFuture) { diff --git a/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart b/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart index 934c1b0d..1090d6b8 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/chip/earthquake_history_early_sort_chip.dart @@ -136,7 +136,7 @@ class _SortModal extends HookConsumerWidget { (EarthquakeEarlySortType.origin_time, true) => '地震発生時刻の古い順', (EarthquakeEarlySortType.max_intensity, false) => '最大観測震度の大きい順', (EarthquakeEarlySortType.max_intensity, true) => '最大観測震度の小さい順', - },), + }), value: ascending.value, onChanged: (v) => ascending.value = v, ), diff --git a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart index eb810fde..2308f017 100644 --- a/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart +++ b/app/lib/feature/earthquake_history_early/ui/earthquake_history_early_screen.dart @@ -194,7 +194,7 @@ class _SliverListBody extends HookConsumerWidget { } }); return null; - }, [controller, state, onScrollEnd, onRefresh],); + }, [controller, state, onScrollEnd, onRefresh]); final theme = Theme.of(context); final colorSchema = theme.colorScheme; diff --git a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart index 8d90af04..61f9e679 100644 --- a/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart +++ b/app/lib/feature/settings/children/config/debug/kyoshin_monitor/debug_kyoshin_monitor.dart @@ -85,7 +85,7 @@ class _Body extends ConsumerWidget { }), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle,), + }, style: bodyTextStyle), ], ), ), @@ -98,7 +98,7 @@ class _Body extends ConsumerWidget { AsyncData(:final value) => value.toString(), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle,), + }, style: bodyTextStyle), ], ), ), @@ -130,7 +130,7 @@ class _Body extends ConsumerWidget { }), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle,), + }, style: bodyTextStyle), if (state.valueOrNull?.currentImageRaw != null) ColoredBox( color: Colors.white, @@ -160,7 +160,7 @@ class _Body extends ConsumerWidget { ).convert(value.toJson()), AsyncError(:final error) => error.toString(), _ => 'Loading...', - }, style: bodyTextStyle,), + }, style: bodyTextStyle), ], ), ), diff --git a/app/lib/feature/settings/features/display_settings/ui/display_settings.dart b/app/lib/feature/settings/features/display_settings/ui/display_settings.dart index f5de6fcf..7843ca67 100644 --- a/app/lib/feature/settings/features/display_settings/ui/display_settings.dart +++ b/app/lib/feature/settings/features/display_settings/ui/display_settings.dart @@ -83,7 +83,7 @@ class _ThemeSelector extends ConsumerWidget { ThemeMode.light => 'ライト', ThemeMode.dark => 'ダーク', _ => throw UnimplementedError(), - },), + }), const SizedBox(height: 4), Radio.adaptive( value: diff --git a/app/lib/feature/setup/component/background_image.dart b/app/lib/feature/setup/component/background_image.dart index f931ed81..890fe5b5 100644 --- a/app/lib/feature/setup/component/background_image.dart +++ b/app/lib/feature/setup/component/background_image.dart @@ -30,7 +30,7 @@ class SetupBackgroundImageWidget extends HookWidget { useEffect(() { startTime.value = DateTime.now().millisecondsSinceEpoch; return null; - }, [context],); + }, [context]); if (shader.hasData) { return AnimatedBuilder( animation: animationController,