Skip to content

Commit

Permalink
EQAPI v1 対応への下ごしらえ (#547)
Browse files Browse the repository at this point in the history
* add
  • Loading branch information
YumNumm authored Jan 30, 2024
1 parent 57a5958 commit 900ffd6
Show file tree
Hide file tree
Showing 49 changed files with 2,307 additions and 151 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ SPEC CHECKSUMS:
FirebaseMessaging: 9bc34a98d2e0237e1b121915120d4d48ddcf301e
FirebaseSessions: f90fe9212ee2818641eda051c0835c9c4e30d9ae
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e
GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
Expand Down
14 changes: 14 additions & 0 deletions lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'package:dynamic_color/dynamic_color.dart';
import 'package:eqmonitor/core/provider/package_info.dart';
import 'package:eqmonitor/core/router/router.dart';
import 'package:eqmonitor/core/theme/custom_colors.dart';
import 'package:eqmonitor/gen/fonts.gen.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

Expand Down Expand Up @@ -67,6 +69,18 @@ class App extends HookConsumerWidget {
);
},
);
if (kDebugMode) {
final packageInfo = ref.watch(packageInfoProvider);
return Directionality(
textDirection: TextDirection.ltr,
child: Banner(
message: 'v${packageInfo.version}-${packageInfo.buildNumber}',
location: BannerLocation.bottomStart,
color: Colors.red.shade900,
child: app,
),
);
}
return app;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqapi_types/model/v3/telegram_v3.dart';
import 'package:eqmonitor/core/component/intenisty/intensity_icon_type.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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqapi_types/model/v3/telegram_v3.dart';
import 'package:eqmonitor/core/component/intenisty/intensity_icon_type.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';
Expand Down
22 changes: 19 additions & 3 deletions lib/core/provider/map/map_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,27 @@ class MapColorScheme with _$MapColorScheme {
);

factory MapColorScheme.dark({required ColorScheme colorScheme}) =>
/*
MapColorScheme(
backgroundColor: colorScheme.surfaceVariant,
worldLandColor: colorScheme.surface,
backgroundColor: colorScheme.surface,
worldLandColor: Color.lerp(
Colors.blue,
colorScheme.surfaceVariant,
0.9,
)!,
worldLineColor: colorScheme.onSurfaceVariant,
japanLandColor: colorScheme.surface,
japanLandColor: Color.lerp(
Colors.blue.shade700,
colorScheme.surface,
0.75,
)!,
japanLineColor: colorScheme.onSurfaceVariant,
);*/
MapColorScheme(
backgroundColor: colorScheme.surface,
worldLandColor: colorScheme.surfaceVariant,
worldLineColor: colorScheme.onSurfaceVariant,
japanLandColor: colorScheme.surfaceVariant,
japanLineColor: colorScheme.onSurfaceVariant,
);
}
69 changes: 32 additions & 37 deletions lib/core/provider/map/map_config.freezed.dart

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

Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import 'package:eqapi_types/model/components/comments.dart';
import 'package:eqapi_types/model/components/earthquake.dart';
import 'package:eqapi_types/model/components/intensity.dart';
import 'package:eqapi_types/model/components/tsunami-information/comments.dart';
import 'package:eqapi_types/model/components/tsunami-information/tsunami_estimation.dart';
import 'package:eqapi_types/model/components/tsunami-information/tsunami_forecast.dart';
import 'package:eqapi_types/model/components/tsunami-information/tsunami_observations.dart';
import 'package:eqapi_types/model/telegram_v3.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'earthquake_history_item.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:dio/dio.dart';
import 'package:eqapi_types/model/telegram_v3.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqmonitor/feature/earthquake_history/data/telegram_history_data_source.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import 'package:collection/collection.dart';
import 'package:eqapi_types/model/components/comments.dart';
import 'package:eqapi_types/model/components/earthquake.dart';
import 'package:eqapi_types/model/components/intensity.dart';
import 'package:eqapi_types/model/components/tsunami-information/comments.dart';
import 'package:eqapi_types/model/components/tsunami-information/tsunami_estimation.dart';
import 'package:eqapi_types/model/components/tsunami-information/tsunami_forecast.dart';
import 'package:eqapi_types/model/components/tsunami-information/tsunami_observations.dart';
import 'package:eqapi_types/model/telegram_v3.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqmonitor/core/extension/async_value.dart';
import 'package:eqmonitor/core/provider/app_lifecycle.dart';
import 'package:eqmonitor/core/provider/config/earthquake_history/earthquake_history_config_provider.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:eqapi_types/model/telegram_v3.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqmonitor/core/provider/log/talker.dart';
import 'package:eqmonitor/feature/earthquake_history/model/state/earthquake_history_item.dart';
import 'package:eqmonitor/feature/home/features/eew/provider/eew_alive_telegram.dart';
Expand Down
10 changes: 10 additions & 0 deletions lib/feature/home/features/map/view/main_map_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ class MainMapView extends HookConsumerWidget {
),
].wait,
);
Future<void>.delayed(
const Duration(
milliseconds: 100,
),
() async => notifier.moveCameraToDefaultPosition(
bottom: 100,
left: 10,
right: 10,
),
);
},
rotateGesturesEnabled: false,
tiltGesturesEnabled: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore_for_file: invalid_annotation_target

import 'package:eqapi_types/model/telegram_v3.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'telegram_ws_model.freezed.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';

import 'package:eqapi_types/model/telegram_v3.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqmonitor/core/provider/log/talker.dart';
import 'package:eqmonitor/feature/home/features/telegram_ws/model/socket_status.dart';
import 'package:eqmonitor/feature/home/features/telegram_ws/provider/telegram_socket_io.dart';
Expand Down
29 changes: 29 additions & 0 deletions packages/eqapi_client/lib/src/eqapi_client.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:dio/dio.dart';
import 'package:eqapi_types/eqapi_types.dart';
import 'package:eqapi_types/lib.dart';
import 'package:retrofit/retrofit.dart';

part 'eqapi_client.g.dart';
Expand All @@ -17,6 +18,34 @@ class EqApi {
);
}

@RestApi()
abstract class V1 {
factory V1(Dio dio, {String baseUrl}) = _V1;

@GET('/v1/earthquake')
Future<List<EarthquakeV1>> getEarthquake({
/// 1~100
@Query('limit') int limit = 100,

/// 0~100000
@Query('offset') int offset = 0,

/// 0~10
@Query('magnitudeLte') double? magnitudeLte,

/// 0~10
@Query('magnitudeGte') double? magnitudeGte,

/// 0~1000
@Query('depthLte') double? depthLte,

/// 0~1000
@Query('depthGte') double? depthGte,
@Query('intensityLte') JmaIntensity? intensityLte,
@Query('intensityGte') JmaIntensity? intensityGte,
});
}

@RestApi()
abstract class V3 {
factory V3(Dio dio, {String baseUrl}) = _V3;
Expand Down
Loading

0 comments on commit 900ffd6

Please sign in to comment.