From c7fd54c23ebc849af02e9675ce3529238f3737ce Mon Sep 17 00:00:00 2001 From: YumNumm Date: Thu, 28 Nov 2024 23:50:33 +0900 Subject: [PATCH 1/9] add: eqmonitor_lints --- packages/eqmonitor_lints/.gitignore | 7 +++++++ packages/eqmonitor_lints/README.md | 1 + .../eqmonitor_lints/lib/analysis_options.yaml | 18 ++++++++++++++++++ packages/eqmonitor_lints/pubspec.yaml | 12 ++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 packages/eqmonitor_lints/.gitignore create mode 100644 packages/eqmonitor_lints/README.md create mode 100644 packages/eqmonitor_lints/lib/analysis_options.yaml create mode 100644 packages/eqmonitor_lints/pubspec.yaml diff --git a/packages/eqmonitor_lints/.gitignore b/packages/eqmonitor_lints/.gitignore new file mode 100644 index 000000000..3cceda557 --- /dev/null +++ b/packages/eqmonitor_lints/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/eqmonitor_lints/README.md b/packages/eqmonitor_lints/README.md new file mode 100644 index 000000000..49da5ffe9 --- /dev/null +++ b/packages/eqmonitor_lints/README.md @@ -0,0 +1 @@ +# Lint package for EQMonitor diff --git a/packages/eqmonitor_lints/lib/analysis_options.yaml b/packages/eqmonitor_lints/lib/analysis_options.yaml new file mode 100644 index 000000000..bea5d1f36 --- /dev/null +++ b/packages/eqmonitor_lints/lib/analysis_options.yaml @@ -0,0 +1,18 @@ +include: package:yumemi_lints/flutter/3.24/recommended.yaml + +linter: + rules: + diagnostic_describe_all_properties: false + +analyzer: + errors: + # https://pub.dev/packages/freezed#install + invalid_annotation_target: ignore + plugins: + - custom_lint + +custom_lint: + rules: + - prefer_clock_now: false + - avoid_hardcoded_color: false + - avoid_hardcoded_japanese: false diff --git a/packages/eqmonitor_lints/pubspec.yaml b/packages/eqmonitor_lints/pubspec.yaml new file mode 100644 index 000000000..a570b1ef5 --- /dev/null +++ b/packages/eqmonitor_lints/pubspec.yaml @@ -0,0 +1,12 @@ +name: eqmonitor_lints + +environment: + sdk: ^3.5.4 + flutter: ^3.24.5 + +dependencies: + altive_lints: ^1.16.0 + custom_lint: ^0.7.0 + flutter: + sdk: flutter + yumemi_lints: ^2.2.0 From 3dd419c10c296b8760720225a9d06ab4ce8c2c0e Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 00:12:53 +0900 Subject: [PATCH 2/9] update lint packages --- app/analysis_options.yaml | 16 +- app/pubspec.lock | 79 ++-- app/pubspec.yaml | 13 +- app/pubspec_overrides.yaml | 4 +- packages/eqapi_client/analysis_options.yaml | 1 + packages/eqapi_client/pubspec.yaml | 3 +- packages/eqapi_client/pubspec_overrides.yaml | 4 +- packages/eqapi_types/analysis_options.yaml | 20 +- packages/eqapi_types/pubspec.yaml | 3 +- packages/eqapi_types/pubspec_overrides.yaml | 4 +- packages/extensions/CHANGELOG.md | 3 - packages/extensions/analysis_options.yaml | 20 +- packages/extensions/pubspec.yaml | 3 +- packages/extensions/pubspec_overrides.yaml | 4 + .../CHANGELOG.md | 3 - .../analysis_options.yaml | 1 + .../pubspec.lock | 362 +++++++++++++++++- .../pubspec.yaml | 4 + .../pubspec_overrides.yaml | 4 +- .../analysis_options.yaml | 1 + packages/jma_code_table_types/pubspec.yaml | 4 + .../pubspec_overrides.yaml | 4 + packages/jma_map/analysis_options.yaml | 1 + .../jma_map/bin/jma_map_protobuf_gen.dart | 105 ++--- packages/jma_map/pubspec.yaml | 4 + packages/jma_map/pubspec_overrides.yaml | 4 + .../analysis_options.yaml | 1 + .../jma_parameter_api_client/pubspec.yaml | 3 +- .../pubspec_overrides.yaml | 4 +- .../analysis_options.yaml | 30 +- .../pubspec.yaml | 11 +- .../pubspec_overrides.yaml | 4 +- .../jma_parameter_types/analysis_options.yaml | 1 + packages/jma_parameter_types/pubspec.yaml | 4 + .../analysis_options.yaml | 1 + .../pubspec.yaml | 4 + .../analysis_options.yaml | 1 + .../pubspec.yaml | 4 + packages/lat_lng/analysis_options.yaml | 20 +- packages/lat_lng/pubspec.yaml | 3 +- .../analysis_options.yaml | 1 + .../notification_setting_types/pubspec.yaml | 4 + 42 files changed, 564 insertions(+), 206 deletions(-) create mode 100644 packages/eqapi_client/analysis_options.yaml delete mode 100644 packages/extensions/CHANGELOG.md create mode 100644 packages/extensions/pubspec_overrides.yaml delete mode 100644 packages/jma_code_table_converter_internal/CHANGELOG.md create mode 100644 packages/jma_code_table_converter_internal/analysis_options.yaml create mode 100644 packages/jma_code_table_types/analysis_options.yaml create mode 100644 packages/jma_code_table_types/pubspec_overrides.yaml create mode 100644 packages/jma_map/analysis_options.yaml create mode 100644 packages/jma_map/pubspec_overrides.yaml create mode 100644 packages/jma_parameter_api_client/analysis_options.yaml create mode 100644 packages/jma_parameter_types/analysis_options.yaml create mode 100644 packages/kyoshin_observation_point_converter_internal/analysis_options.yaml create mode 100644 packages/kyoshin_observation_point_types/analysis_options.yaml create mode 100644 packages/notification_setting_types/analysis_options.yaml diff --git a/app/analysis_options.yaml b/app/analysis_options.yaml index 4a6dad6bb..122959d8e 100644 --- a/app/analysis_options.yaml +++ b/app/analysis_options.yaml @@ -1,15 +1 @@ -# https://pub.dev/packages/pedantic_mono -include: package:pedantic_mono/analysis_options.yaml - -analyzer: - language: - plugins: - - custom_lint - errors: - invalid_annotation_target: ignore - duplicate_ignore: ignore - -linter: - rules: - always_use_package_imports: true - lines_longer_than_80_chars: false +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/app/pubspec.lock b/app/pubspec.lock index b8db1ad89..460ecc448 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -30,6 +30,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.0" + altive_lints: + dependency: transitive + description: + name: altive_lints + sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 + url: "https://pub.dev" + source: hosted + version: "1.16.0" analyzer: dependency: "direct dev" description: @@ -290,26 +298,34 @@ packages: dependency: "direct dev" description: name: custom_lint - sha256: "22bd87a362f433ba6aae127a7bac2838645270737f3721b180916d7c5946cb5d" + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" url: "https://pub.dev" source: hosted - version: "0.5.11" + version: "0.7.0" custom_lint_builder: dependency: transitive description: name: custom_lint_builder - sha256: "0d48e002438950f9582e574ef806b2bea5719d8d14c0f9f754fbad729bcf3b19" + sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" url: "https://pub.dev" source: hosted - version: "0.5.14" + version: "0.7.0" custom_lint_core: dependency: transitive description: name: custom_lint_core - sha256: "2952837953022de610dacb464f045594854ced6506ac7f76af28d4a6490e189b" + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" url: "https://pub.dev" source: hosted - version: "0.5.14" + version: "1.0.0+6.7.0" dart_style: dependency: transitive description: @@ -412,6 +428,13 @@ packages: relative: true source: path version: "1.0.1" + eqmonitor_lints: + dependency: "direct dev" + description: + path: "../packages/eqmonitor_lints" + relative: true + source: path + version: "0.0.0" equatable: dependency: transitive description: @@ -455,10 +478,10 @@ packages: dependency: transitive description: name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "6.1.4" firebase_analytics: dependency: "direct main" description: @@ -681,10 +704,10 @@ packages: dependency: transitive description: name: flutter_riverpod - sha256: "2fd9f58a39b7269cb3495b09245000fcd267243518157a7c2f832189fb64f013" + sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.6.1" flutter_secure_storage: dependency: "direct main" description: @@ -883,10 +906,10 @@ packages: dependency: "direct main" description: name: hooks_riverpod - sha256: "169d7bf1d61c749c065e09388841906b2ff963794b932867372ed4f423a8d877" + sha256: "70bba33cfc5670c84b796e6929c54b8bc5be7d0fe15bb28c2560500b9ad06966" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.6.1" hotreloader: dependency: transitive description: @@ -1460,50 +1483,50 @@ packages: dependency: transitive description: name: riverpod - sha256: "0f41a697a17609a7ac18e5fe0d5bdbe4c1ff7e7da6523baf46a203df0c44eaf2" + sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.6.1" riverpod_analyzer_utils: dependency: transitive description: name: riverpod_analyzer_utils - sha256: b6e782db97522de3ad797210bd3babbdb0a67da899aaa6ffbb6572108bdbf48d + sha256: c6b8222b2b483cb87ae77ad147d6408f400c64f060df7a225b127f4afef4f8c8 url: "https://pub.dev" source: hosted - version: "1.0.0-dev.1" + version: "0.5.8" riverpod_annotation: dependency: "direct main" description: name: riverpod_annotation - sha256: "79452c7ba2e8f48c7309c73be5aaa101eec5fe7948dfd26659b883fb276858b4" + sha256: e14b0bf45b71326654e2705d462f21b958f987087be850afd60578fcd502d1b8 url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.6.1" riverpod_generator: dependency: "direct dev" description: name: riverpod_generator - sha256: "9f3cb7b43e9151fef1cc80031b3ad9fb5d0fe64577cc18e1627061d743823213" + sha256: "63546d70952015f0981361636bf8f356d9cfd9d7f6f0815e3c07789a41233188" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.11" + version: "2.6.3" riverpod_lint: dependency: "direct dev" description: name: riverpod_lint - sha256: "8ddb6be92f0de4704d6109405aebc7436b15b847abf0d9f647039afe48dc0050" + sha256: "83e4caa337a9840469b7b9bd8c2351ce85abad80f570d84146911b32086fbd99" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.4" + version: "2.6.3" rxdart: dependency: transitive description: name: rxdart - sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" url: "https://pub.dev" source: hosted - version: "0.27.7" + version: "0.28.0" screenshot: dependency: "direct main" description: @@ -2054,6 +2077,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + yumemi_lints: + dependency: transitive + description: + name: yumemi_lints + sha256: "5f88e2e5c052133631471b630bc8ef4cd77e7edef4d94b3a0d01d64470295c89" + url: "https://pub.dev" + source: hosted + version: "2.2.0" sdks: dart: ">=3.5.4 <4.0.0" flutter: ">=3.24.5" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index cdc5ef040..531c0266e 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -47,7 +47,7 @@ dependencies: geolocator: ^13.0.2 go_router: ^14.6.1 google_fonts: ^6.2.1 - hooks_riverpod: ^3.0.0-dev.3 + hooks_riverpod: ^2.6.1 image: ^4.3.0 in_app_review: ^2.0.10 intl: ^0.19.0 @@ -71,7 +71,7 @@ dependencies: path_provider: ^2.1.5 permission_handler: ^11.3.1 purchases_flutter: ^8.2.2 - riverpod_annotation: ^3.0.0-dev.3 + riverpod_annotation: ^2.6.1 screenshot: 3.0.0 share_plus: ^10.1.2 shared_preference_app_group: ^1.1.1 @@ -95,19 +95,22 @@ dependencies: dev_dependencies: analyzer: ^6.7.0 build_runner: ^2.4.13 - custom_lint: ^0.5.11 + custom_lint: ^0.7.0 dependency_validator: ^4.1.1 envied_generator: ^1.0.0 + eqmonitor_lints: + path: ../packages/eqmonitor_lints flutter_gen_runner: ^5.8.0 freezed: ^2.5.2 go_router_builder: ^2.7.1 json_serializable: ^6.9.0 pedantic_mono: ^1.29.0 retrofit_generator: ^9.1.5 - riverpod_generator: ^3.0.0-dev.11 - riverpod_lint: ^3.0.0-dev.4 + riverpod_generator: ^2.6.3 + riverpod_lint: ^2.6.3 test: ^1.25.7 + flutter: uses-material-design: true assets: diff --git a/app/pubspec_overrides.yaml b/app/pubspec_overrides.yaml index 428be1a1c..6350f7fd9 100644 --- a/app/pubspec_overrides.yaml +++ b/app/pubspec_overrides.yaml @@ -1,9 +1,11 @@ -# melos_managed_dependency_overrides: eqapi_client,eqapi_types,extensions,jma_code_table_types,jma_map,jma_parameter_api_client,jma_parameter_types,lat_lng,kyoshin_observation_point_types,notification_setting_types +# melos_managed_dependency_overrides: eqapi_client,eqapi_types,extensions,jma_code_table_types,jma_map,jma_parameter_api_client,jma_parameter_types,lat_lng,kyoshin_observation_point_types,notification_setting_types,eqmonitor_lints dependency_overrides: eqapi_client: path: ../packages/eqapi_client eqapi_types: path: ../packages/eqapi_types + eqmonitor_lints: + path: ../packages/eqmonitor_lints extensions: path: ../packages/extensions jma_code_table_types: diff --git a/packages/eqapi_client/analysis_options.yaml b/packages/eqapi_client/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/eqapi_client/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/eqapi_client/pubspec.yaml b/packages/eqapi_client/pubspec.yaml index 4c3b2b9a5..822bf8cf3 100644 --- a/packages/eqapi_client/pubspec.yaml +++ b/packages/eqapi_client/pubspec.yaml @@ -15,5 +15,6 @@ dependencies: dev_dependencies: build_runner: ^2.4.7 - pedantic_mono: ^1.25.0 + eqmonitor_lints: + path: ../eqmonitor_lints retrofit_generator: ^9.1.2 diff --git a/packages/eqapi_client/pubspec_overrides.yaml b/packages/eqapi_client/pubspec_overrides.yaml index 33b50e9d9..acae91003 100644 --- a/packages/eqapi_client/pubspec_overrides.yaml +++ b/packages/eqapi_client/pubspec_overrides.yaml @@ -1,6 +1,8 @@ -# melos_managed_dependency_overrides: eqapi_types,lat_lng +# melos_managed_dependency_overrides: eqapi_types,lat_lng,eqmonitor_lints dependency_overrides: eqapi_types: path: ../eqapi_types + eqmonitor_lints: + path: ../eqmonitor_lints lat_lng: path: ../lat_lng diff --git a/packages/eqapi_types/analysis_options.yaml b/packages/eqapi_types/analysis_options.yaml index 6f8d6d437..122959d8e 100644 --- a/packages/eqapi_types/analysis_options.yaml +++ b/packages/eqapi_types/analysis_options.yaml @@ -1,19 +1 @@ -# https://pub.dev/packages/pedantic_mono -include: package:pedantic_mono/analysis_options.yaml - -analyzer: - exclude: - - "**/*.g.dart" - - "**/*.freezed.dart" - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - plugins: - - custom_lint - errors: - invalid_annotation_target: ignore - -linter: - rules: - always_use_package_imports: true +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/eqapi_types/pubspec.yaml b/packages/eqapi_types/pubspec.yaml index 2de7a31d6..324e10d37 100644 --- a/packages/eqapi_types/pubspec.yaml +++ b/packages/eqapi_types/pubspec.yaml @@ -19,7 +19,8 @@ dependencies: dev_dependencies: build_runner: ^2.4.6 + eqmonitor_lints: + path: ../eqmonitor_lints freezed: ^2.4.3 lints: ^5.0.0 - pedantic_mono: ^1.28.0 test: ^1.24.7 diff --git a/packages/eqapi_types/pubspec_overrides.yaml b/packages/eqapi_types/pubspec_overrides.yaml index 1a55f1429..b6722a995 100644 --- a/packages/eqapi_types/pubspec_overrides.yaml +++ b/packages/eqapi_types/pubspec_overrides.yaml @@ -1,4 +1,6 @@ -# melos_managed_dependency_overrides: lat_lng +# melos_managed_dependency_overrides: lat_lng,eqmonitor_lints dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints lat_lng: path: ../lat_lng diff --git a/packages/extensions/CHANGELOG.md b/packages/extensions/CHANGELOG.md deleted file mode 100644 index effe43c82..000000000 --- a/packages/extensions/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.0 - -- Initial version. diff --git a/packages/extensions/analysis_options.yaml b/packages/extensions/analysis_options.yaml index 6f8d6d437..122959d8e 100644 --- a/packages/extensions/analysis_options.yaml +++ b/packages/extensions/analysis_options.yaml @@ -1,19 +1 @@ -# https://pub.dev/packages/pedantic_mono -include: package:pedantic_mono/analysis_options.yaml - -analyzer: - exclude: - - "**/*.g.dart" - - "**/*.freezed.dart" - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - plugins: - - custom_lint - errors: - invalid_annotation_target: ignore - -linter: - rules: - always_use_package_imports: true +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/extensions/pubspec.yaml b/packages/extensions/pubspec.yaml index 8dca9dbd4..e51b890a1 100644 --- a/packages/extensions/pubspec.yaml +++ b/packages/extensions/pubspec.yaml @@ -5,4 +5,5 @@ version: 1.0.0 environment: sdk: ^3.5.4 dev_dependencies: - pedantic_mono: ^1.23.0 + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/extensions/pubspec_overrides.yaml b/packages/extensions/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/extensions/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_code_table_converter_internal/CHANGELOG.md b/packages/jma_code_table_converter_internal/CHANGELOG.md deleted file mode 100644 index effe43c82..000000000 --- a/packages/jma_code_table_converter_internal/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.0 - -- Initial version. diff --git a/packages/jma_code_table_converter_internal/analysis_options.yaml b/packages/jma_code_table_converter_internal/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/jma_code_table_converter_internal/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_code_table_converter_internal/pubspec.lock b/packages/jma_code_table_converter_internal/pubspec.lock index 6f7f02d68..4533a2e34 100644 --- a/packages/jma_code_table_converter_internal/pubspec.lock +++ b/packages/jma_code_table_converter_internal/pubspec.lock @@ -1,6 +1,51 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + url: "https://pub.dev" + source: hosted + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" + altive_lints: + dependency: transitive + description: + name: altive_lints + sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 + url: "https://pub.dev" + source: hosted + version: "1.16.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + url: "https://pub.dev" + source: hosted + version: "6.7.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" async: dependency: transitive description: @@ -9,14 +54,125 @@ packages: url: "https://pub.dev" source: hosted version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" collection: dependency: transitive description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.1" + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + custom_lint: + dependency: transitive + description: + name: custom_lint + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" + url: "https://pub.dev" + source: hosted + version: "1.0.0+6.7.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" + source: hosted + version: "2.3.7" + eqmonitor_lints: + dependency: "direct dev" + description: + path: "../eqmonitor_lints" + relative: true + source: path + version: "0.0.0" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" fixnum: dependency: transitive description: @@ -25,6 +181,35 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + url: "https://pub.dev" + source: hosted + version: "4.2.0" http: dependency: "direct main" description: @@ -37,10 +222,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.0.2" jma_code_table_types: dependency: "direct main" description: @@ -48,14 +233,62 @@ packages: relative: true source: path version: "1.0.0" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.15.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -72,6 +305,35 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" source_span: dependency: transitive description: @@ -80,6 +342,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" string_scanner: dependency: transitive description: @@ -96,6 +390,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" typed_data: dependency: transitive description: @@ -104,6 +406,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" web: dependency: transitive description: @@ -112,5 +446,21 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + yumemi_lints: + dependency: transitive + description: + name: yumemi_lints + sha256: "5f88e2e5c052133631471b630bc8ef4cd77e7edef4d94b3a0d01d64470295c89" + url: "https://pub.dev" + source: hosted + version: "2.2.0" sdks: dart: ">=3.5.4 <4.0.0" diff --git a/packages/jma_code_table_converter_internal/pubspec.yaml b/packages/jma_code_table_converter_internal/pubspec.yaml index 822736204..a71d51d26 100644 --- a/packages/jma_code_table_converter_internal/pubspec.yaml +++ b/packages/jma_code_table_converter_internal/pubspec.yaml @@ -12,3 +12,7 @@ dependencies: git: url: https://github.com/YumNumm/EQMonitor.git path: packages/eqapi_types + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_code_table_converter_internal/pubspec_overrides.yaml b/packages/jma_code_table_converter_internal/pubspec_overrides.yaml index ea86ccbee..b2f6f3272 100644 --- a/packages/jma_code_table_converter_internal/pubspec_overrides.yaml +++ b/packages/jma_code_table_converter_internal/pubspec_overrides.yaml @@ -1,4 +1,6 @@ -# melos_managed_dependency_overrides: jma_code_table_types +# melos_managed_dependency_overrides: jma_code_table_types,eqmonitor_lints dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints jma_code_table_types: path: ../jma_code_table_types diff --git a/packages/jma_code_table_types/analysis_options.yaml b/packages/jma_code_table_types/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/jma_code_table_types/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_code_table_types/pubspec.yaml b/packages/jma_code_table_types/pubspec.yaml index 44f83556c..bc2a08c72 100644 --- a/packages/jma_code_table_types/pubspec.yaml +++ b/packages/jma_code_table_types/pubspec.yaml @@ -7,3 +7,7 @@ environment: dependencies: protobuf: ^3.1.0 + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_code_table_types/pubspec_overrides.yaml b/packages/jma_code_table_types/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/jma_code_table_types/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_map/analysis_options.yaml b/packages/jma_map/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/jma_map/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_map/bin/jma_map_protobuf_gen.dart b/packages/jma_map/bin/jma_map_protobuf_gen.dart index 9b33ff52c..1156089ba 100644 --- a/packages/jma_map/bin/jma_map_protobuf_gen.dart +++ b/packages/jma_map/bin/jma_map_protobuf_gen.dart @@ -5,7 +5,7 @@ import 'dart:math'; import 'package:jma_map/gen/jma_map.pb.dart'; Future main() async { - final List jmaMapDataList = []; + final jmaMapDataList = []; final targets = [ JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_EEW, @@ -14,7 +14,7 @@ Future main() async { JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI, ]; for (final target in targets) { - final body = await File("maps/${target.toFileName}.geojson").readAsString(); + final body = await File('maps/${target.toFileName}.geojson').readAsString(); final json = jsonDecode(body) as Map; final jmaMapData = await _parseGeoJsonToJmaMap(json); @@ -27,7 +27,7 @@ Future main() async { ); } // dump to file - final file = File("out.pb"); + final file = File('out.pb'); await file.writeAsBytes( JmaMap( data: jmaMapDataList, @@ -36,74 +36,83 @@ Future main() async { } Future> _parseGeoJsonToJmaMap( - Map geojson) async { + Map geojson, +) async { final results = []; - final features = geojson["features"] as List; + 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, + 'geometry': { + 'type': final String geometryType, + 'coordinates': final List coordinates, }, - "properties": final Map properties, + 'properties': final Map properties, }) { - final List latLngs = []; - if (geometryType == "Polygon") { + final latLngs = []; + if (geometryType == 'Polygon') { for (final lists in coordinates) { - for (final list in lists) { - latLngs.add(LatLng( - lat: list[1] as double, - lng: list[0] as double, - )); + for (final list in lists as List) { + latLngs.add( + LatLng( + lat: list[1] as double, + lng: list[0] as double, + ), + ); } } - } else if (geometryType == "MultiPolygon") { + } else if (geometryType == 'MultiPolygon') { for (final lists in coordinates) { - for (final list in lists) { - for (final l in list) { - latLngs.add(LatLng( - lat: l[1] as double, - lng: l[0] as double, - )); + for (final list in lists as List) { + for (final l in list as List) { + latLngs.add( + LatLng( + lat: l[1] as double, + lng: l[0] as double, + ), + ); } } } - } else if (geometryType == "MultiLineString") { + } else if (geometryType == 'MultiLineString') { for (final e in coordinates) { for (final list in e) { - latLngs.add(LatLng( - lat: list[1] as double, - lng: list[0] as double, - )); + latLngs.add( + LatLng( + lat: list[1] as double, + lng: list[0] as double, + ), + ); } } - } else if (geometryType == "LineString") { + } else if (geometryType == 'LineString') { for (final list in coordinates) { - latLngs.add(LatLng( - lat: list[1] as double, - lng: list[0] as double, - )); + latLngs.add( + LatLng( + lat: list[1] as double, + lng: list[0] as double, + ), + ); } } else { - throw Exception("Unknown geometry type: $geometryType"); + throw Exception('Unknown geometry type: $geometryType'); } final bbox = latLngs.toLatLngBounds; - bool skipFlag = false; + var skipFlag = false; final property = JmaMap_JmaMapData_JmaMapDataItem_Property( - code: properties["code"] as String? ?? - properties["regioncode"] as String? ?? + code: properties['code'] as String? ?? + properties['regioncode'] as String? ?? (() { skipFlag = true; - print("Unknown code: ${properties}"); + print('Unknown code: $properties'); }()), - name: properties["name"] as String? ?? - (throw Exception("Unknown name: ${properties}")), - nameKana: properties["namekana"] as String? ?? + name: properties['name'] as String? ?? + (throw Exception('Unknown name: $properties')), + nameKana: properties['namekana'] as String? ?? (() { skipFlag = true; - print("Unknown nameKana: ${properties}"); + print('Unknown nameKana: $properties'); }()), ); if (skipFlag) { @@ -116,7 +125,7 @@ Future> _parseGeoJsonToJmaMap( ), ); } else { - throw Exception("Unknown feature: $json"); + throw Exception('Unknown feature: $json'); } } return results; @@ -126,7 +135,7 @@ extension LatLngListEx on List { LatLngBounds get toLatLngBounds { final latLngs = this; if (latLngs.isEmpty) { - throw Exception("LatLngs is empty"); + throw Exception('LatLngs is empty'); } var northEastLat = -180.0; var northEastLng = -180.0; @@ -155,12 +164,12 @@ extension LatLngListEx on List { extension JmaMapTypeConverter on JmaMap_JmaMapData_JmaMapType { String get toFileName => switch (this) { JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_E => - "areaForecastLocalE", + 'areaForecastLocalE', JmaMap_JmaMapData_JmaMapType.AREA_FORECAST_LOCAL_EEW => - "areaForecastLocalEew", + 'areaForecastLocalEew', JmaMap_JmaMapData_JmaMapType.AREA_INFORMATION_CITY => - "areaInformationCityQuake", - JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI => "areaTsunami", + 'areaInformationCityQuake', + JmaMap_JmaMapData_JmaMapType.AREA_TSUNAMI => 'areaTsunami', _ => throw UnimplementedError(), }; } diff --git a/packages/jma_map/pubspec.yaml b/packages/jma_map/pubspec.yaml index 6c5454ac3..0dac391e3 100644 --- a/packages/jma_map/pubspec.yaml +++ b/packages/jma_map/pubspec.yaml @@ -8,3 +8,7 @@ environment: dependencies: protobuf: ^3.1.0 + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_map/pubspec_overrides.yaml b/packages/jma_map/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/jma_map/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_parameter_api_client/analysis_options.yaml b/packages/jma_parameter_api_client/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/jma_parameter_api_client/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_parameter_api_client/pubspec.yaml b/packages/jma_parameter_api_client/pubspec.yaml index 1a81654ed..c0613c391 100644 --- a/packages/jma_parameter_api_client/pubspec.yaml +++ b/packages/jma_parameter_api_client/pubspec.yaml @@ -17,5 +17,6 @@ dependencies: dev_dependencies: build_runner: ^2.4.7 - pedantic_mono: ^1.25.0 retrofit_generator: ^9.1.2 + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/jma_parameter_api_client/pubspec_overrides.yaml b/packages/jma_parameter_api_client/pubspec_overrides.yaml index 4347aa9d7..9bac56c9e 100644 --- a/packages/jma_parameter_api_client/pubspec_overrides.yaml +++ b/packages/jma_parameter_api_client/pubspec_overrides.yaml @@ -1,4 +1,6 @@ -# melos_managed_dependency_overrides: jma_parameter_types +# melos_managed_dependency_overrides: jma_parameter_types,eqmonitor_lints dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints jma_parameter_types: path: ../jma_parameter_types diff --git a/packages/jma_parameter_converter_internal/analysis_options.yaml b/packages/jma_parameter_converter_internal/analysis_options.yaml index f27466482..122959d8e 100644 --- a/packages/jma_parameter_converter_internal/analysis_options.yaml +++ b/packages/jma_parameter_converter_internal/analysis_options.yaml @@ -1,29 +1 @@ -# This file configures the static analysis results for your project (errors, -# warnings, and lints). -# -# This enables the 'recommended' set of lints from `package:lints`. -# This set helps identify many issues that may lead to problems when running -# or consuming Dart code, and enforces writing Dart using a single, idiomatic -# style and format. -# -# If you want a smaller set of lints you can change this to specify -# 'package:lints/core.yaml'. These are just the most critical lints -# (the recommended set includes the core lints). -# The core lints are also what is used by pub.dev for scoring packages. - -include: package:lints/recommended.yaml -# Uncomment the following section to specify additional rules. - -# linter: -# rules: -# - camel_case_types - -# analyzer: -# exclude: -# - path/to/excluded/files/** - -# For more information about the core and recommended set of lints, see -# https://dart.dev/go/core-lints - -# For additional information about configuring this file, see -# https://dart.dev/guides/language/analysis-options +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_parameter_converter_internal/pubspec.yaml b/packages/jma_parameter_converter_internal/pubspec.yaml index e1284a8e6..cb7f30575 100644 --- a/packages/jma_parameter_converter_internal/pubspec.yaml +++ b/packages/jma_parameter_converter_internal/pubspec.yaml @@ -8,18 +8,19 @@ environment: # Add regular dependencies here. dependencies: + collection: ^1.17.1 + file: ^7.0.0 + freezed_annotation: ^2.2.0 + http: ^1.2.1 jma_parameter_types: git: url: https://github.com/YumNumm/EQMonitor.git path: packages/jma_parameter_types - freezed_annotation: ^2.2.0 json_annotation: ^4.8.1 - collection: ^1.17.1 - file: ^7.0.0 - http: ^1.2.1 dev_dependencies: build_runner: ^2.4.4 + eqmonitor_lints: + path: ../eqmonitor_lints freezed: ^2.3.4 json_serializable: ^6.7.0 - pedantic_mono: ^1.28.0 diff --git a/packages/jma_parameter_converter_internal/pubspec_overrides.yaml b/packages/jma_parameter_converter_internal/pubspec_overrides.yaml index 4347aa9d7..9bac56c9e 100644 --- a/packages/jma_parameter_converter_internal/pubspec_overrides.yaml +++ b/packages/jma_parameter_converter_internal/pubspec_overrides.yaml @@ -1,4 +1,6 @@ -# melos_managed_dependency_overrides: jma_parameter_types +# melos_managed_dependency_overrides: jma_parameter_types,eqmonitor_lints dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints jma_parameter_types: path: ../jma_parameter_types diff --git a/packages/jma_parameter_types/analysis_options.yaml b/packages/jma_parameter_types/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/jma_parameter_types/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_parameter_types/pubspec.yaml b/packages/jma_parameter_types/pubspec.yaml index fd6067fe3..2058b4610 100644 --- a/packages/jma_parameter_types/pubspec.yaml +++ b/packages/jma_parameter_types/pubspec.yaml @@ -8,3 +8,7 @@ environment: dependencies: protobuf: ^3.1.0 + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/kyoshin_observation_point_converter_internal/analysis_options.yaml b/packages/kyoshin_observation_point_converter_internal/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/kyoshin_observation_point_converter_internal/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml index 66deef824..4326c91f0 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml +++ b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml @@ -13,3 +13,7 @@ dependencies: path: packages/kyoshin_observation_point_types geojson_vi: ^2.2.4 maps_toolkit: ^3.0.0 + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/kyoshin_observation_point_types/analysis_options.yaml b/packages/kyoshin_observation_point_types/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/kyoshin_observation_point_types/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/kyoshin_observation_point_types/pubspec.yaml b/packages/kyoshin_observation_point_types/pubspec.yaml index 36ebfa860..309a89a90 100644 --- a/packages/kyoshin_observation_point_types/pubspec.yaml +++ b/packages/kyoshin_observation_point_types/pubspec.yaml @@ -7,3 +7,7 @@ environment: dependencies: protobuf: ^3.1.0 + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/lat_lng/analysis_options.yaml b/packages/lat_lng/analysis_options.yaml index 6f8d6d437..122959d8e 100644 --- a/packages/lat_lng/analysis_options.yaml +++ b/packages/lat_lng/analysis_options.yaml @@ -1,19 +1 @@ -# https://pub.dev/packages/pedantic_mono -include: package:pedantic_mono/analysis_options.yaml - -analyzer: - exclude: - - "**/*.g.dart" - - "**/*.freezed.dart" - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - plugins: - - custom_lint - errors: - invalid_annotation_target: ignore - -linter: - rules: - always_use_package_imports: true +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/lat_lng/pubspec.yaml b/packages/lat_lng/pubspec.yaml index 073c78e23..1a9a5b396 100644 --- a/packages/lat_lng/pubspec.yaml +++ b/packages/lat_lng/pubspec.yaml @@ -9,4 +9,5 @@ dependencies: latlong2: ^0.9.0 dev_dependencies: - pedantic_mono: ^1.23.0 + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/notification_setting_types/analysis_options.yaml b/packages/notification_setting_types/analysis_options.yaml new file mode 100644 index 000000000..122959d8e --- /dev/null +++ b/packages/notification_setting_types/analysis_options.yaml @@ -0,0 +1 @@ +include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/notification_setting_types/pubspec.yaml b/packages/notification_setting_types/pubspec.yaml index 5b1683531..b2126580c 100644 --- a/packages/notification_setting_types/pubspec.yaml +++ b/packages/notification_setting_types/pubspec.yaml @@ -5,3 +5,7 @@ environment: dependencies: protobuf: ^3.1.0 + +dev_dependencies: + eqmonitor_lints: + path: ../eqmonitor_lints From 8b765b64b3e0feef7a2014e148343e43832cf0e1 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 00:20:29 +0900 Subject: [PATCH 3/9] fix: error --- .../feature/donation/ui/donation_screen.dart | 10 +- .../ui/earthquake_history_screen.dart | 8 +- ...rthquake_history_early_details_screen.dart | 36 +- .../ui/earthquake_history_early_screen.dart | 6 +- .../sheet/earthquake_history_widget.dart | 2 +- app/lib/feature/home/view/home_view.dart | 8 +- .../page/information_history_page.dart | 2 +- .../ui/notification_remote_settings_page.dart | 18 +- .../jma_map/bin/jma_map_protobuf_gen.dart | 2 +- .../pubspec.lock | 203 +++++++-- .../pubspec.yaml | 2 +- .../pubspec_overrides.yaml | 4 + ..._observation_point_converter_internal.dart | 87 ++-- .../pubspec.lock | 362 +++++++++++++++- .../pubspec_overrides.yaml | 4 +- .../pubspec_overrides.yaml | 4 + packages/lat_lng/pubspec_overrides.yaml | 4 + .../analysis_options.yaml | 3 + .../notification_setting_types/pubspec.lock | 408 +++++++++++++++++- .../notification_setting_types/pubspec.yaml | 1 + .../pubspec_overrides.yaml | 4 + 21 files changed, 1039 insertions(+), 139 deletions(-) create mode 100644 packages/jma_parameter_types/pubspec_overrides.yaml create mode 100644 packages/kyoshin_observation_point_types/pubspec_overrides.yaml create mode 100644 packages/lat_lng/pubspec_overrides.yaml create mode 100644 packages/notification_setting_types/pubspec_overrides.yaml diff --git a/app/lib/feature/donation/ui/donation_screen.dart b/app/lib/feature/donation/ui/donation_screen.dart index 72e9de125..0a1bc3895 100644 --- a/app/lib/feature/donation/ui/donation_screen.dart +++ b/app/lib/feature/donation/ui/donation_screen.dart @@ -155,11 +155,6 @@ class _ShowDonationButton extends HookConsumerWidget { const SizedBox(width: 8), Expanded( child: switch (state) { - AsyncLoading() => ActionButton.text( - context: context, - text: '読み込み中...', - onPressed: () {}, - ), AsyncError() => ActionButton.text( context: context, text: '読み込みに失敗しました', @@ -235,6 +230,11 @@ class _ShowDonationButton extends HookConsumerWidget { ], ); }(), + _ => ActionButton.text( + context: context, + text: '読み込み中...', + onPressed: () {}, + ) }, ), ], 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 53fd6f29c..6de934e34 100644 --- a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart +++ b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart @@ -173,7 +173,7 @@ class _SliverListBody extends HookConsumerWidget { final item = data.$1[index]; return EarthquakeHistoryListTile( item: item, - onTap: () => EarthquakeHistoryDetailsRoute( + onTap: () async => EarthquakeHistoryDetailsRoute( eventId: item.eventId, ).push(context), ); @@ -185,9 +185,6 @@ class _SliverListBody extends HookConsumerWidget { return RefreshIndicator( onRefresh: () async => onRefresh?.call(), child: switch (state) { - AsyncLoading() => const Center( - child: CircularProgressIndicator.adaptive(), - ), AsyncError(:final error) => () { if (error is EarthquakeParameterHasNotInitializedException) { final parameterState = ref.watch(jmaParameterProvider); @@ -219,6 +216,9 @@ class _SliverListBody extends HookConsumerWidget { ); }(), AsyncData(:final value) => listView(data: value), + _ => const Center( + child: CircularProgressIndicator.adaptive(), + ), }, ); } 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 995b07362..192b6251e 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 @@ -54,24 +54,6 @@ class EarthquakeHistoryEarlyDetailsScreen extends HookConsumerWidget { ref.refresh(earthquakeHistoryEarlyEventProvider(id)), ), ), - AsyncLoading() => 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, - ), - ), - ], - ), - ), - ), AsyncData(:final value) => Scaffold( body: Stack( children: [ @@ -165,6 +147,24 @@ class EarthquakeHistoryEarlyDetailsScreen extends HookConsumerWidget { ], ), ), + _ => 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, + ), + ), + ], + ), + ), + ), }; } } 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 5664dbb9b..5b430cea7 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 @@ -244,9 +244,6 @@ class _SliverListBody extends HookConsumerWidget { return RefreshIndicator( onRefresh: () async => onRefresh?.call(), child: switch (state) { - AsyncLoading() => const Center( - child: CircularProgressIndicator.adaptive(), - ), AsyncError(:final error) => () { final valueOrNull = state.valueOrNull; if (valueOrNull != null) { @@ -306,6 +303,9 @@ class _SliverListBody extends HookConsumerWidget { ), ], ), + _ => const Center( + child: CircularProgressIndicator.adaptive(), + ), }, ); } 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 a558c066b..53591efe1 100644 --- a/app/lib/feature/home/component/sheet/earthquake_history_widget.dart +++ b/app/lib/feature/home/component/sheet/earthquake_history_widget.dart @@ -62,7 +62,6 @@ class EarthquakeHistorySheetWidget extends HookConsumerWidget { .toList(), ); }(), - AsyncLoading() => loading, AsyncError(:final error) => ErrorInfoWidget( error: error, onRefresh: () async { @@ -71,6 +70,7 @@ class EarthquakeHistorySheetWidget extends HookConsumerWidget { .refresh(); }, ), + _ => loading, }, Row( children: [ diff --git a/app/lib/feature/home/view/home_view.dart b/app/lib/feature/home/view/home_view.dart index ff7f5cecd..47c067782 100644 --- a/app/lib/feature/home/view/home_view.dart +++ b/app/lib/feature/home/view/home_view.dart @@ -649,10 +649,6 @@ class _NotificationMigrationWidget extends ConsumerWidget { final state = ref.watch(notificationRemoteSettingsInitialSetupNotifierProvider); return switch (state) { - AsyncLoading() => const ListTile( - title: Text('通知設定の移行中'), - leading: CircularProgressIndicator.adaptive(), - ), AsyncError(:final error) => BorderedContainer( elevation: 1, child: ListTile( @@ -697,6 +693,10 @@ class _NotificationMigrationWidget extends ConsumerWidget { }, ), }, + _ => const ListTile( + title: Text('通知設定の移行中'), + leading: CircularProgressIndicator.adaptive(), + ), }; } } 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 5256f0f57..bed6b8bbb 100644 --- a/app/lib/feature/information_history/page/information_history_page.dart +++ b/app/lib/feature/information_history/page/information_history_page.dart @@ -50,7 +50,7 @@ class InformationHistoryPage extends HookConsumerWidget { ref.invalidate(informationHistoryViewModelProvider), ), ), - AsyncLoading() || null => const _Loading(), + _ => const _Loading(), }, ], ), 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 0cff7676a..691d29bbf 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 @@ -117,7 +117,15 @@ class _Body extends ConsumerWidget { final state = ref.watch(notificationRemoteSettingsNotifierProvider); return switch (state) { - AsyncLoading() => const Center( + AsyncError(:final error) => ErrorInfoWidget( + error: error, + onRefresh: () => + ref.refresh(notificationRemoteSettingsNotifierProvider), + ), + AsyncData(:final value) => _Data( + state: value, + ), + _ => const Center( child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, @@ -135,14 +143,6 @@ class _Body extends ConsumerWidget { ], ), ), - AsyncError(:final error) => ErrorInfoWidget( - error: error, - onRefresh: () => - ref.refresh(notificationRemoteSettingsNotifierProvider), - ), - AsyncData(:final value) => _Data( - state: value, - ), }; } } diff --git a/packages/jma_map/bin/jma_map_protobuf_gen.dart b/packages/jma_map/bin/jma_map_protobuf_gen.dart index 1156089ba..038d62cee 100644 --- a/packages/jma_map/bin/jma_map_protobuf_gen.dart +++ b/packages/jma_map/bin/jma_map_protobuf_gen.dart @@ -77,7 +77,7 @@ Future> _parseGeoJsonToJmaMap( } } else if (geometryType == 'MultiLineString') { for (final e in coordinates) { - for (final list in e) { + for (final list in e as List) { latLngs.add( LatLng( lat: list[1] as double, diff --git a/packages/jma_parameter_converter_internal/pubspec.lock b/packages/jma_parameter_converter_internal/pubspec.lock index 6959bffce..6804f9989 100644 --- a/packages/jma_parameter_converter_internal/pubspec.lock +++ b/packages/jma_parameter_converter_internal/pubspec.lock @@ -5,23 +5,39 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "73.0.0" + version: "72.0.0" _macros: dependency: transitive description: dart source: sdk version: "0.3.2" + altive_lints: + dependency: transitive + description: + name: altive_lints + sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 + url: "https://pub.dev" + source: hosted + version: "1.16.0" analyzer: dependency: transitive description: name: analyzer - sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + url: "https://pub.dev" + source: hosted + version: "6.7.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" url: "https://pub.dev" source: hosted - version: "6.8.0" + version: "0.11.3" args: dependency: transitive description: @@ -110,6 +126,14 @@ packages: url: "https://pub.dev" source: hosted version: "8.9.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -118,6 +142,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" code_builder: dependency: transitive description: @@ -130,10 +170,10 @@ packages: dependency: "direct main" description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.1" + version: "1.18.0" convert: dependency: transitive description: @@ -150,6 +190,38 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.6" + custom_lint: + dependency: transitive + description: + name: custom_lint + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" + url: "https://pub.dev" + source: hosted + version: "1.0.0+6.7.0" dart_style: dependency: transitive description: @@ -158,14 +230,21 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.7" + eqmonitor_lints: + dependency: "direct dev" + description: + path: "../eqmonitor_lints" + relative: true + source: path + version: "0.0.0" file: dependency: "direct main" description: name: file - sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "6.1.4" fixnum: dependency: transitive description: @@ -174,14 +253,11 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - flutter_lints: + flutter: dependency: transitive - description: - name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" - url: "https://pub.dev" - source: hosted - version: "5.0.0" + description: flutter + source: sdk + version: "0.0.0" freezed: dependency: "direct dev" description: @@ -222,6 +298,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + url: "https://pub.dev" + source: hosted + version: "4.2.0" http: dependency: "direct main" description: @@ -242,10 +326,10 @@ packages: dependency: transitive description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.0.2" io: dependency: transitive description: @@ -285,14 +369,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.9.0" - lints: - dependency: transitive - description: - name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" - url: "https://pub.dev" - source: hosted - version: "5.0.0" logging: dependency: transitive description: @@ -317,14 +393,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.15.0" mime: dependency: transitive description: @@ -349,14 +433,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" - pedantic_mono: - dependency: "direct dev" - description: - name: pedantic_mono - sha256: "23b8ce74610b7397363c314cd0dc0f21d175f44f4429b3b2bcc9305c3549bb19" - url: "https://pub.dev" - source: hosted - version: "1.29.0" pool: dependency: transitive description: @@ -389,14 +465,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" shelf: dependency: transitive description: name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.2" + version: "1.4.1" shelf_web_socket: dependency: transitive description: @@ -405,6 +489,11 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" source_gen: dependency: transitive description: @@ -429,6 +518,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: @@ -493,6 +590,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" watcher: dependency: transitive description: @@ -533,5 +654,13 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + yumemi_lints: + dependency: transitive + description: + name: yumemi_lints + sha256: "5f88e2e5c052133631471b630bc8ef4cd77e7edef4d94b3a0d01d64470295c89" + url: "https://pub.dev" + source: hosted + version: "2.2.0" sdks: dart: ">=3.5.4 <4.0.0" diff --git a/packages/jma_parameter_converter_internal/pubspec.yaml b/packages/jma_parameter_converter_internal/pubspec.yaml index cb7f30575..097cd00bd 100644 --- a/packages/jma_parameter_converter_internal/pubspec.yaml +++ b/packages/jma_parameter_converter_internal/pubspec.yaml @@ -9,7 +9,7 @@ environment: # Add regular dependencies here. dependencies: collection: ^1.17.1 - file: ^7.0.0 + file: ^6.1.4 freezed_annotation: ^2.2.0 http: ^1.2.1 jma_parameter_types: diff --git a/packages/jma_parameter_types/pubspec_overrides.yaml b/packages/jma_parameter_types/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/jma_parameter_types/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints 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 daac31c48..e92786fe6 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 @@ -24,7 +24,7 @@ class KyoshinObservationPointConverter { } Future loadMap() async { - final file = File("AreaForecastLocalE.json"); + final file = File('AreaForecastLocalE.json'); final geojson = GeoJSON.fromJSON(await file.readAsString()); return geojson; @@ -38,23 +38,25 @@ class KyoshinObservationPointConverter { for (final point in points) { print(point.code); - result.add(KyoshinObservationPoint( - code: point.code, - location: KyoshinObservationPoint_LatLng( - latitude: point.latitude, - longitude: point.longitude, + result.add( + KyoshinObservationPoint( + code: point.code, + location: KyoshinObservationPoint_LatLng( + latitude: point.latitude, + longitude: point.longitude, + ), + name: point.name, + point: KyoshinObservationPoint_Point( + x: point.x, + y: point.y, + ), + region: point.region, + arv400: await _getArv( + latitude: point.latitude, + longitude: point.longitude, + ), ), - name: point.name, - point: KyoshinObservationPoint_Point( - x: point.x, - y: point.y, - ), - region: point.region, - arv400: await _getArv( - latitude: point.latitude, - longitude: point.longitude, - ), - )); + ); } return KyoshinObservationPoints( points: result, @@ -66,13 +68,13 @@ class KyoshinObservationPointConverter { required double longitude, }) async { // Cacheのチェック - final cacheFile = File("cache/${latitude}_$longitude.json"); + final cacheFile = File('cache/${latitude}_$longitude.json'); if (await cacheFile.exists()) { 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; } @@ -80,32 +82,24 @@ class KyoshinObservationPointConverter { final response = await http.get( Uri.parse( 'https://www.j-shis.bosai.go.jp/map/api/sstrct/V2/meshinfo.geojson' - '?position=${longitude},${latitude}' + '?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.writeAsString( jsonEncode(json), ); - print("ARV: $arv"); + print('ARV: $arv'); return null; } } class ObservationModel { - final String code; - final String name; - final String region; - final double latitude; - final double longitude; - final int x; - final int y; - ObservationModel({ required this.code, required this.name, @@ -117,19 +111,26 @@ class ObservationModel { }); factory ObservationModel.fromJson(Map json) { - if (!json.containsKey("Point")) { - throw ArgumentError("Code is required."); + if (!json.containsKey('Point')) { + throw ArgumentError('Code is required.'); } return ObservationModel( - code: json["Code"], - name: json["Name"], - region: json["Region"], + code: json['Code'] as String, + name: json['Name'] as String, + region: json['Region'] as String, latitude: - (json["Location"] as Map)["Latitude"] as double, + (json['Location'] as Map)['Latitude'] as double, longitude: - (json["Location"] as Map)["Longitude"] as double, - x: (json["Point"] as Map)["X"] as int, - y: (json["Point"] as Map)["Y"] as int, + (json['Location'] as Map)['Longitude'] as double, + x: (json['Point'] as Map)['X'] as int, + y: (json['Point'] as Map)['Y'] as int, ); } + final String code; + final String name; + final String region; + final double latitude; + final double longitude; + final int x; + final int y; } diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec.lock b/packages/kyoshin_observation_point_converter_internal/pubspec.lock index 1af480e85..4e7cd76a9 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec.lock +++ b/packages/kyoshin_observation_point_converter_internal/pubspec.lock @@ -1,6 +1,51 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + url: "https://pub.dev" + source: hosted + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" + altive_lints: + dependency: transitive + description: + name: altive_lints + sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 + url: "https://pub.dev" + source: hosted + version: "1.16.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + url: "https://pub.dev" + source: hosted + version: "6.7.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" async: dependency: transitive description: @@ -9,14 +54,125 @@ packages: url: "https://pub.dev" source: hosted version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" collection: dependency: transitive description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.1" + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + custom_lint: + dependency: transitive + description: + name: custom_lint + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" + url: "https://pub.dev" + source: hosted + version: "1.0.0+6.7.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" + source: hosted + version: "2.3.7" + eqmonitor_lints: + dependency: "direct dev" + description: + path: "../eqmonitor_lints" + relative: true + source: path + version: "0.0.0" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" fixnum: dependency: transitive description: @@ -25,6 +181,19 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" geojson_vi: dependency: "direct main" description: @@ -33,6 +202,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.5" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + url: "https://pub.dev" + source: hosted + version: "4.2.0" http: dependency: "direct main" description: @@ -45,10 +230,18 @@ packages: dependency: transitive description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.0.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" kyoshin_observation_point_types: dependency: "direct main" description: @@ -56,6 +249,22 @@ packages: relative: true source: path version: "1.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" maps_toolkit: dependency: "direct main" description: @@ -64,14 +273,38 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.15.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" path: dependency: transitive description: @@ -88,6 +321,35 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" source_span: dependency: transitive description: @@ -96,6 +358,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" string_scanner: dependency: transitive description: @@ -112,6 +406,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" typed_data: dependency: transitive description: @@ -120,6 +422,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" web: dependency: transitive description: @@ -128,5 +462,21 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + yumemi_lints: + dependency: transitive + description: + name: yumemi_lints + sha256: "5f88e2e5c052133631471b630bc8ef4cd77e7edef4d94b3a0d01d64470295c89" + url: "https://pub.dev" + source: hosted + version: "2.2.0" sdks: dart: ">=3.5.4 <4.0.0" diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec_overrides.yaml b/packages/kyoshin_observation_point_converter_internal/pubspec_overrides.yaml index 7f985f3d5..b211d582a 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec_overrides.yaml +++ b/packages/kyoshin_observation_point_converter_internal/pubspec_overrides.yaml @@ -1,4 +1,6 @@ -# melos_managed_dependency_overrides: kyoshin_observation_point_types +# melos_managed_dependency_overrides: kyoshin_observation_point_types,eqmonitor_lints dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints kyoshin_observation_point_types: path: ../kyoshin_observation_point_types diff --git a/packages/kyoshin_observation_point_types/pubspec_overrides.yaml b/packages/kyoshin_observation_point_types/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/kyoshin_observation_point_types/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/lat_lng/pubspec_overrides.yaml b/packages/lat_lng/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/lat_lng/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints diff --git a/packages/notification_setting_types/analysis_options.yaml b/packages/notification_setting_types/analysis_options.yaml index 122959d8e..64fd8f653 100644 --- a/packages/notification_setting_types/analysis_options.yaml +++ b/packages/notification_setting_types/analysis_options.yaml @@ -1 +1,4 @@ include: package:eqmonitor_lints/analysis_options.yaml +analyzer: + errors: + implementation_imports: ignore diff --git a/packages/notification_setting_types/pubspec.lock b/packages/notification_setting_types/pubspec.lock index 52fade592..9f4266e7a 100644 --- a/packages/notification_setting_types/pubspec.lock +++ b/packages/notification_setting_types/pubspec.lock @@ -1,30 +1,279 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + url: "https://pub.dev" + source: hosted + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" + altive_lints: + dependency: transitive + description: + name: altive_lints + sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 + url: "https://pub.dev" + source: hosted + version: "1.16.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + url: "https://pub.dev" + source: hosted + version: "6.7.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" collection: dependency: transitive description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.1" - fixnum: + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + custom_lint: + dependency: transitive + description: + name: custom_lint + sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + custom_lint_visitor: + dependency: transitive + description: + name: custom_lint_visitor + sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" + url: "https://pub.dev" + source: hosted + version: "1.0.0+6.7.0" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" + source: hosted + version: "2.3.7" + eqmonitor_lints: + dependency: "direct dev" + description: + path: "../eqmonitor_lints" + relative: true + source: path + version: "0.0.0" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + fixnum: + dependency: "direct main" description: name: fixnum sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted version: "1.1.1" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + url: "https://pub.dev" + source: hosted + version: "4.2.0" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.15.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" protobuf: dependency: "direct main" description: @@ -33,5 +282,154 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + yumemi_lints: + dependency: transitive + description: + name: yumemi_lints + sha256: "5f88e2e5c052133631471b630bc8ef4cd77e7edef4d94b3a0d01d64470295c89" + url: "https://pub.dev" + source: hosted + version: "2.2.0" sdks: dart: ">=3.5.4 <4.0.0" diff --git a/packages/notification_setting_types/pubspec.yaml b/packages/notification_setting_types/pubspec.yaml index b2126580c..329ab996b 100644 --- a/packages/notification_setting_types/pubspec.yaml +++ b/packages/notification_setting_types/pubspec.yaml @@ -4,6 +4,7 @@ environment: sdk: ^3.5.4 dependencies: + fixnum: ^1.1.1 protobuf: ^3.1.0 dev_dependencies: diff --git a/packages/notification_setting_types/pubspec_overrides.yaml b/packages/notification_setting_types/pubspec_overrides.yaml new file mode 100644 index 000000000..4ebee87ff --- /dev/null +++ b/packages/notification_setting_types/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: eqmonitor_lints +dependency_overrides: + eqmonitor_lints: + path: ../eqmonitor_lints From 73c7b0f21fa61cb0d0894dfe1804af9e03b674c4 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 00:24:21 +0900 Subject: [PATCH 4/9] =?UTF-8?q?fix(ci):=20Check=20Pull=20Request=E3=81=A7r?= =?UTF-8?q?ebuild&format=E3=82=92=E8=A1=8C=E3=81=86=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check-pull-request.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-pull-request.yaml b/.github/workflows/check-pull-request.yaml index 62b9a336e..05d4d0a2c 100644 --- a/.github/workflows/check-pull-request.yaml +++ b/.github/workflows/check-pull-request.yaml @@ -61,7 +61,10 @@ jobs: uses: ./.github/actions/setup-application-runtime - name: re-generated code - run: melos run regenerate_code --no-select + run: melos run rebuild --no-select + + - name: format + run: melos run format --no-select - name: check difference run: | From abda4147e86bc3ac9f6f19962b3d563c6cd91b0e Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 19:51:08 +0900 Subject: [PATCH 5/9] refactor: Update analysis options and ignore deprecated members across multiple files - Updated analysis_options.yaml to ignore lines longer than 80 characters. - Added ignore directives for deprecated members in various generated files. - Removed unused api_authentication_service and related files. - General code cleanup and adjustments in multiple provider and feature files. --- app/analysis_options.yaml | 4 + app/lib/app.dart | 8 +- ....dart => api_authentication_notifier.dart} | 4 +- .../api/api_authentication_notifier.g.dart | 29 ++ .../core/api/api_authentication_payload.dart | 9 +- .../api/api_authentication_payload.g.dart | 6 +- .../api/api_authentication_service.g.dart | 29 -- app/lib/core/api/eq_api.dart | 3 +- app/lib/core/api/eq_api.g.dart | 6 +- app/lib/core/api/jma_parameter_api.dart | 3 +- app/lib/core/api/jma_parameter_api.g.dart | 6 +- .../chip/date_range_filter_chip.dart | 3 +- .../component/sheet/basic_modal_sheet.dart | 2 +- .../sheet/sheet_floating_action_buttons.dart | 4 +- .../core/component/widget/error_widget.dart | 3 +- app/lib/core/extension/async_value.dart | 6 +- app/lib/core/provider/app_lifecycle.dart | 39 +- app/lib/core/provider/app_lifecycle.g.dart | 19 +- .../application_documents_directory.dart | 3 +- .../application_documents_directory.g.dart | 6 +- .../capture/intensity_icon_render.g.dart | 2 +- .../crashlytics_setting_provider.dart | 37 -- .../crashlytics_setting_provider.g.dart | 29 -- .../model/crashlytics_setting_model.dart | 14 - .../crashlytics_setting_model.freezed.dart | 173 -------- .../model/crashlytics_setting_model.g.dart | 28 -- .../earthquake_history_config_provider.g.dart | 2 +- .../notification/fcm_topic_manager.g.dart | 2 +- .../permission/permission_notifier.dart | 4 +- .../permission/permission_notifier.g.dart | 4 +- .../intensity_color_provider.dart | 5 +- .../intensity_color_provider.g.dart | 4 +- .../debugger/debugger_provider.g.dart | 2 +- app/lib/core/provider/device_info.dart | 5 +- app/lib/core/provider/device_info.g.dart | 10 +- app/lib/core/provider/dio_provider.dart | 3 +- app/lib/core/provider/dio_provider.g.dart | 6 +- .../core/provider/eew/eew_alive_telegram.dart | 5 +- .../provider/eew/eew_alive_telegram.g.dart | 10 +- app/lib/core/provider/eew/eew_telegram.dart | 9 +- app/lib/core/provider/eew/eew_telegram.g.dart | 8 +- .../data/estimated_intensity_data_source.dart | 3 +- .../estimated_intensity_data_source.g.dart | 6 +- .../estimated_intensity_provider.dart | 13 +- .../estimated_intensity_provider.g.dart | 12 +- .../firebase/firebase_crashlytics.dart | 3 +- .../firebase/firebase_crashlytics.g.dart | 6 +- .../provider/firebase/firebase_messaging.dart | 3 +- .../firebase/firebase_messaging.g.dart | 6 +- .../firebase_messaging_interaction.dart | 3 +- .../firebase_messaging_interaction.g.dart | 6 +- .../provider/jma_code_table_provider.dart | 3 +- .../provider/jma_code_table_provider.g.dart | 6 +- .../jma_parameter/jma_parameter.g.dart | 2 +- .../kyoshin_observation_points_provider.dart | 3 +- ...kyoshin_observation_points_provider.g.dart | 6 +- app/lib/core/provider/log/talker.dart | 23 +- app/lib/core/provider/log/talker.g.dart | 6 +- .../core/provider/map/jma_map_provider.dart | 3 +- .../core/provider/map/jma_map_provider.g.dart | 6 +- app/lib/core/provider/map/map_config.dart | 2 +- .../core/provider/map/map_config.freezed.dart | 52 +-- app/lib/core/provider/map/map_config.g.dart | 6 +- app/lib/core/provider/map/map_style.dart | 3 +- app/lib/core/provider/map/map_style.g.dart | 6 +- app/lib/core/provider/notification_token.dart | 3 +- .../core/provider/notification_token.g.dart | 6 +- .../provider/ntp/ntp_config_provider.g.dart | 2 +- app/lib/core/provider/ntp/ntp_provider.dart | 9 +- app/lib/core/provider/ntp/ntp_provider.g.dart | 4 +- app/lib/core/provider/package_info.dart | 3 +- app/lib/core/provider/package_info.g.dart | 6 +- app/lib/core/provider/secure_storage.dart | 3 +- app/lib/core/provider/secure_storage.g.dart | 6 +- app/lib/core/provider/shared_preferences.dart | 3 +- .../core/provider/shared_preferences.g.dart | 6 +- .../provider/telegram_url_provider.g.dart | 2 +- app/lib/core/provider/time_ticker.dart | 3 +- app/lib/core/provider/time_ticker.g.dart | 6 +- .../data/travel_time_data_source.dart | 3 +- .../data/travel_time_data_source.g.dart | 6 +- .../provider/travel_time_provider.dart | 5 +- .../provider/travel_time_provider.g.dart | 10 +- .../websocket/websocket_provider.dart | 23 +- .../websocket/websocket_provider.g.dart | 204 +--------- app/lib/core/router/router.dart | 10 +- app/lib/core/router/router.g.dart | 6 +- app/lib/core/theme/build_theme.dart | 3 +- app/lib/core/theme/platform_brightness.g.dart | 2 +- app/lib/core/theme/theme_provider.dart | 4 +- app/lib/core/theme/theme_provider.g.dart | 4 +- .../donation/data/donation_notifier.dart | 5 +- .../donation/data/donation_notifier.g.dart | 72 +--- .../donation/ui/donation_executed_screen.dart | 5 +- .../data/earthquake_history_notifier.dart | 10 +- .../data/earthquake_history_notifier.g.dart | 136 ++----- .../data/earthquake_history_repository.dart | 3 +- .../data/earthquake_history_repository.g.dart | 6 +- .../earthquake_history_not_found.dart | 4 +- .../component/bar_sheet.dart | 4 +- .../earthquake_hypo_info_widget.dart | 2 +- .../component/earthquake_map.dart | 42 +- .../component/prefecture_intensity.dart | 8 +- .../component/prefecture_intensity.g.dart | 104 ++--- .../component/prefecture_lpgm_intensity.dart | 8 +- .../prefecture_lpgm_intensity.g.dart | 99 ++--- ...earthquake_history_details_notifier.g.dart | 66 +-- .../screen/earthquake_history_details.dart | 3 +- ...hquake_history_early_details_notifier.dart | 3 +- ...uake_history_early_details_notifier.g.dart | 75 +--- .../earthquake_history_early_notifier.g.dart | 65 +-- .../earthquake_history_early_repository.dart | 5 +- ...earthquake_history_early_repository.g.dart | 6 +- .../earthquake_history_early_parameter.dart | 4 +- ...quake_history_early_parameter.freezed.dart | 108 ++--- .../earthquake_history_early_parameter.g.dart | 24 +- .../ui/components/bar_sheet.dart | 4 +- .../earthquake_history_early_sort_chip.dart | 16 +- .../earthquake_early_hypo_info_widget.dart | 2 +- .../ui/components/earthquake_early_map.dart | 35 +- .../ui/earthquake_history_early_screen.dart | 10 +- .../kmoni/kmoni_settings_dialog.dart | 2 +- .../parameter/parameter_loader_widget.dart | 10 - .../render/map_components_renderer.dart | 8 +- .../shake-detect/shake_detection_card.dart | 5 +- .../sheet/earthquake_history_widget.dart | 4 +- .../home/component/sheet/sheet_header.dart | 2 +- .../eew_settings/eew_settings_notifier.g.dart | 2 +- .../kmoni/data/kmoni_data_source.dart | 3 +- .../kmoni/data/kmoni_data_source.g.dart | 6 +- .../kmoni/page/kmoni_settings_page.dart | 2 +- .../kmoni/provider/kmoni_color_provider.dart | 3 +- .../provider/kmoni_color_provider.g.dart | 6 +- .../kmoni/provider/kmoni_view_model.dart | 2 +- .../kmoni/provider/kmoni_view_model.g.dart | 4 +- .../kmoni/use_case/kmoni_use_case.dart | 3 +- .../kmoni/use_case/kmoni_use_case.g.dart | 6 +- .../kmoni_maintenance_view_model.dart | 3 +- .../kmoni_maintenance_view_model.g.dart | 6 +- .../kmoni/viewmodel/kmoni_settings.dart | 2 +- .../kmoni/viewmodel/kmoni_settings.g.dart | 4 +- .../home/features/map/view/main_map_view.dart | 5 +- .../map/viewmodel/main_map_viewmodel.dart | 25 +- .../map/viewmodel/main_map_viewmodel.g.dart | 4 +- app/lib/feature/home/view/home_view.dart | 377 +++++++++--------- .../page/information_history_page.dart | 30 +- .../repository/information_repository.dart | 3 +- .../repository/information_repository.g.dart | 6 +- .../information_history_view_model.dart | 4 +- .../information_history_view_model.g.dart | 4 +- app/lib/feature/location/data/location.dart | 5 +- app/lib/feature/location/data/location.g.dart | 10 +- .../application_info/about_this_app.dart | 12 +- .../application_info/license_page.dart | 7 +- .../privacy_policy_screen.dart | 5 +- .../term_of_service_screen.dart | 5 +- .../http_api_endpoint_selector_page.dart | 16 +- .../websocket_api_endpoint_selector_page.dart | 16 +- .../children/config/debug/debugger_page.dart | 18 +- .../earthquake_history_config_page.dart | 14 +- ...ke_notification_settings_view_model.g.dart | 2 +- ...ew_notification_settings_view_model.g.dart | 2 +- .../color_scheme_config_page.dart | 25 +- .../display_settings/ui/display_settings.dart | 32 +- .../features/feedback/feedback_screen.dart | 6 +- ...otification_local_settings_notifier.g.dart | 2 +- ...tification_remote_settings_notifier.g.dart | 2 +- ...ification_remote_settings_saved_state.dart | 11 +- ...ication_remote_settings_saved_state.g.dart | 8 +- .../service/fcm_token_change_detector.g.dart | 2 +- ...ication_remote_authentication_service.dart | 17 +- ...ation_remote_authentication_service.g.dart | 6 +- ...ation_remote_settings_migrate_service.dart | 4 +- ...ion_remote_settings_migrate_service.g.dart | 4 +- .../components/earthquake_status_widget.dart | 4 +- .../ui/components/eew_status_widget.dart | 4 +- .../ui/notification_remote_settings_page.dart | 5 +- ...ation_remote_settings_earthquake_page.dart | 18 +- ...notification_remote_settings_eew_page.dart | 20 +- app/lib/feature/settings/settings_screen.dart | 22 +- .../setup/component/background_image.dart | 1 + .../setup/pages/introduction_page.dart | 4 +- app/lib/feature/setup/pages/kmoni_warn.dart | 2 +- .../feature/setup/screen/setup_screen.dart | 18 +- .../provider/shake_detection_provider.dart | 5 +- .../provider/shake_detection_provider.g.dart | 8 +- app/lib/main.dart | 9 +- .../earthquake_history_list_tile_test.dart | 15 +- .../eqapi_client/lib/src/children/auth.dart | 14 +- .../eqapi_client/lib/src/children/v1.dart | 11 +- .../eqapi_client/lib/src/children/v1.g.dart | 2 +- .../eqapi_client/lib/src/eqapi_client.dart | 2 - .../lib/src/model/v1/earthquake.dart | 8 +- .../eqapi_types/lib/src/model/v1/eew.dart | 8 +- .../lib/src/model/v1/telegram.dart | 2 +- .../eqmonitor_lints/lib/analysis_options.yaml | 5 + packages/extensions/lib/src/string.dart | 4 +- .../analysis_options.yaml | 3 + .../jma_code_table_converter_internal.dart | 18 +- .../jma_code_table_converter_internal.dart | 112 +++--- .../analysis_options.yaml | 1 - packages/jma_map/analysis_options.yaml | 1 - .../jma_map/bin/jma_map_protobuf_gen.dart | 28 +- .../jma_parameter_api_client/pubspec.yaml | 2 +- .../build.yaml | 11 + .../lib/converter/earthquake.dart | 32 +- .../lib/converter/tsunami.dart | 3 +- .../lib/dmdata/common.g.dart | 32 +- .../lib/dmdata/earthquake.g.dart | 66 ++- .../lib/dmdata/tsunami.g.dart | 59 ++- ..._observation_point_converter_internal.dart | 16 +- ..._observation_point_converter_internal.dart | 6 +- .../pubspec.yaml | 2 +- .../analysis_options.yaml | 5 + .../lat_lng/lib/src/lat_lng_boundary.dart | 5 +- 215 files changed, 1456 insertions(+), 1927 deletions(-) rename app/lib/core/api/{api_authentication_service.dart => api_authentication_notifier.dart} (94%) create mode 100644 app/lib/core/api/api_authentication_notifier.g.dart delete mode 100644 app/lib/core/api/api_authentication_service.g.dart delete mode 100644 app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.dart delete mode 100644 app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.g.dart delete mode 100644 app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.dart delete mode 100644 app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.freezed.dart delete mode 100644 app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.g.dart delete mode 100644 packages/jma_code_table_types/analysis_options.yaml delete mode 100644 packages/jma_map/analysis_options.yaml create mode 100644 packages/jma_parameter_converter_internal/build.yaml diff --git a/app/analysis_options.yaml b/app/analysis_options.yaml index 122959d8e..ba5f68170 100644 --- a/app/analysis_options.yaml +++ b/app/analysis_options.yaml @@ -1 +1,5 @@ include: package:eqmonitor_lints/analysis_options.yaml +analyzer: + errors: + document_ignores: ignore + lines_longer_than_80_chars: ignore diff --git a/app/lib/app.dart b/app/lib/app.dart index 50b190e03..f88cfbc2a 100644 --- a/app/lib/app.dart +++ b/app/lib/app.dart @@ -40,11 +40,11 @@ class App extends HookConsumerWidget { if (lightDynamic != null && darkDynamic != null) { // On Android S+ devices, use the provided dynamic color scheme. - // (Recommended) Harmonize the dynamic color scheme' built-in semantic - // colors. + // (Recommended) Harmonize the dynamic color scheme' + // built-in semantic colors. lightColorScheme = lightDynamic.harmonized(); - // (Optional) Customize the scheme as desired. For example, one might - // want to use a brand color to override the dynamic + // (Optional) Customize the scheme as desired. For example, + // one might want to use a brand color to override the dynamic // [ColorScheme.secondary]. lightColorScheme = lightColorScheme.copyWith(secondary: brandBlue); // (Optional) If applicable, harmonize custom colors. diff --git a/app/lib/core/api/api_authentication_service.dart b/app/lib/core/api/api_authentication_notifier.dart similarity index 94% rename from app/lib/core/api/api_authentication_service.dart rename to app/lib/core/api/api_authentication_notifier.dart index 98dc3458e..78b55ec39 100644 --- a/app/lib/core/api/api_authentication_service.dart +++ b/app/lib/core/api/api_authentication_notifier.dart @@ -4,10 +4,10 @@ import 'package:eqmonitor/core/provider/secure_storage.dart'; import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; -part 'api_authentication_service.g.dart'; +part 'api_authentication_notifier.g.dart'; @Riverpod(keepAlive: true) -class ApiAuthenticationService extends _$ApiAuthenticationService { +class ApiAuthenticationNotifier extends _$ApiAuthenticationNotifier { @override Future build() async { final secureStorage = ref.watch(secureStorageProvider); diff --git a/app/lib/core/api/api_authentication_notifier.g.dart b/app/lib/core/api/api_authentication_notifier.g.dart new file mode 100644 index 000000000..f395daa58 --- /dev/null +++ b/app/lib/core/api/api_authentication_notifier.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: type=lint, duplicate_ignore + +part of 'api_authentication_notifier.dart'; + +// ************************************************************************** +// RiverpodGenerator +// ************************************************************************** + +String _$apiAuthenticationNotifierHash() => + r'0545a5e734e8f4585d2aefb2eda67fb10791d1ba'; + +/// See also [ApiAuthenticationNotifier]. +@ProviderFor(ApiAuthenticationNotifier) +final apiAuthenticationNotifierProvider = + AsyncNotifierProvider.internal( + 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 +// 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/api_authentication_payload.dart b/app/lib/core/api/api_authentication_payload.dart index ea85c7e51..a6b0ab7b4 100644 --- a/app/lib/core/api/api_authentication_payload.dart +++ b/app/lib/core/api/api_authentication_payload.dart @@ -1,5 +1,6 @@ -import 'package:eqmonitor/core/api/api_authentication_service.dart'; +import 'package:eqmonitor/core/api/api_authentication_notifier.dart'; import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'api_authentication_payload.g.dart'; @@ -9,10 +10,10 @@ Future< ({ String id, String role, - })> apiAuthenticationPayload(ApiAuthenticationPayloadRef ref) async { - final state = await ref.watch(apiAuthenticationServiceProvider.future); + })> apiAuthenticationPayload(Ref ref) async { + final state = await ref.watch(apiAuthenticationNotifierProvider.future); if (state == null) { throw UnauthorizedException(); } - return ref.read(apiAuthenticationServiceProvider.notifier).extractPayload(); + return ref.read(apiAuthenticationNotifierProvider.notifier).extractPayload(); } diff --git a/app/lib/core/api/api_authentication_payload.g.dart b/app/lib/core/api/api_authentication_payload.g.dart index 7f5f143ee..c935838fc 100644 --- a/app/lib/core/api/api_authentication_payload.g.dart +++ b/app/lib/core/api/api_authentication_payload.g.dart @@ -9,7 +9,7 @@ part of 'api_authentication_payload.dart'; // ************************************************************************** String _$apiAuthenticationPayloadHash() => - r'5262212d5ac1cfdd93dfb86390c7867d0ea7406f'; + r'b381a5161adb22c2ec3263673d35a62839b77de9'; /// See also [apiAuthenticationPayload]. @ProviderFor(apiAuthenticationPayload) @@ -24,7 +24,9 @@ final apiAuthenticationPayloadProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/api_authentication_service.g.dart b/app/lib/core/api/api_authentication_service.g.dart deleted file mode 100644 index af8b24a7a..000000000 --- a/app/lib/core/api/api_authentication_service.g.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore - -part of 'api_authentication_service.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$apiAuthenticationServiceHash() => - r'81cab09e5606fc0989fa584435e156cb8c42bf7a'; - -/// See also [ApiAuthenticationService]. -@ProviderFor(ApiAuthenticationService) -final apiAuthenticationServiceProvider = - AsyncNotifierProvider.internal( - ApiAuthenticationService.new, - name: r'apiAuthenticationServiceProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$apiAuthenticationServiceHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$ApiAuthenticationService = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, 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 b7d97a98d..800e57cf7 100644 --- a/app/lib/core/api/eq_api.dart +++ b/app/lib/core/api/eq_api.dart @@ -2,6 +2,7 @@ import 'package:dio/dio.dart'; import 'package:eqapi_client/eqapi_client.dart'; import 'package:eqmonitor/core/provider/dio_provider.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart'; import 'package:talker_dio_logger/talker_dio_logger_settings.dart'; @@ -10,7 +11,7 @@ import 'package:talker_flutter/talker_flutter.dart'; part 'eq_api.g.dart'; @Riverpod(keepAlive: true) -EqApi eqApi(EqApiRef ref) { +EqApi eqApi(Ref ref) { final dio = ref.watch(dioProvider); dio.options = dio.options.copyWith( sendTimeout: const Duration(seconds: 10), diff --git a/app/lib/core/api/eq_api.g.dart b/app/lib/core/api/eq_api.g.dart index 0bd5282ad..db5b2f55c 100644 --- a/app/lib/core/api/eq_api.g.dart +++ b/app/lib/core/api/eq_api.g.dart @@ -8,7 +8,7 @@ part of 'eq_api.dart'; // RiverpodGenerator // ************************************************************************** -String _$eqApiHash() => r'686065a770d45b1464ec7f0cdf382cf132038822'; +String _$eqApiHash() => r'e024f84d6ae97012b1ecf706a24e19c5b620a015'; /// See also [eqApi]. @ProviderFor(eqApi) @@ -21,6 +21,8 @@ final eqApiProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef EqApiRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/jma_parameter_api.dart b/app/lib/core/api/jma_parameter_api.dart index 1b284ecb5..fb42e773a 100644 --- a/app/lib/core/api/jma_parameter_api.dart +++ b/app/lib/core/api/jma_parameter_api.dart @@ -1,11 +1,12 @@ import 'package:dio/dio.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_parameter_api_client/jma_parameter_api_client.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'jma_parameter_api.g.dart'; @Riverpod(keepAlive: true) -JmaParameterApiClient jmaParameterApiClient(JmaParameterApiClientRef ref) { +JmaParameterApiClient jmaParameterApiClient(Ref ref) { return JmaParameterApiClient( client: Dio( BaseOptions( diff --git a/app/lib/core/api/jma_parameter_api.g.dart b/app/lib/core/api/jma_parameter_api.g.dart index 9142ac94f..c36940f07 100644 --- a/app/lib/core/api/jma_parameter_api.g.dart +++ b/app/lib/core/api/jma_parameter_api.g.dart @@ -9,7 +9,7 @@ part of 'jma_parameter_api.dart'; // ************************************************************************** String _$jmaParameterApiClientHash() => - r'7c110a35d1041f823d6333b2c69121f95150ef08'; + r'1049f167512c0194430cb0c6715bd65a7a207589'; /// See also [jmaParameterApiClient]. @ProviderFor(jmaParameterApiClient) @@ -23,6 +23,8 @@ final jmaParameterApiClientProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef JmaParameterApiClientRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/component/chip/date_range_filter_chip.dart b/app/lib/core/component/chip/date_range_filter_chip.dart index de78c1753..f224701b4 100644 --- a/app/lib/core/component/chip/date_range_filter_chip.dart +++ b/app/lib/core/component/chip/date_range_filter_chip.dart @@ -81,6 +81,7 @@ extension MinMaxDateTime on (DateTime?, DateTime?) { return '${DateRangeFilterChip.format.format(max!)} 以前'; } // それ以外 - return '${DateRangeFilterChip.format.format(min!)} ~ ${DateRangeFilterChip.format.format(max!)}'; + return '${DateRangeFilterChip.format.format(min!)} ~ ' + '${DateRangeFilterChip.format.format(max!)}'; } } diff --git a/app/lib/core/component/sheet/basic_modal_sheet.dart b/app/lib/core/component/sheet/basic_modal_sheet.dart index 55cc12bb3..c41c8d2ff 100644 --- a/app/lib/core/component/sheet/basic_modal_sheet.dart +++ b/app/lib/core/component/sheet/basic_modal_sheet.dart @@ -4,9 +4,9 @@ import 'package:sheet/sheet.dart'; class BasicModalSheet extends HookWidget { const BasicModalSheet({ - super.key, required this.controller, required this.children, + super.key, this.hasAppBar = true, }); final SheetController controller; 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 684b8e5b4..f5bb29717 100644 --- a/app/lib/core/component/sheet/sheet_floating_action_buttons.dart +++ b/app/lib/core/component/sheet/sheet_floating_action_buttons.dart @@ -4,9 +4,9 @@ import 'package:sheet/sheet.dart'; class SheetFloatingActionButtons extends HookWidget { const SheetFloatingActionButtons({ - super.key, required this.controller, required this.fab, + super.key, this.maxHeight = 0.3, this.hasAppBar = true, }); @@ -32,7 +32,7 @@ class SheetFloatingActionButtons extends HookWidget { (hasAppBar ? AppBar().preferredSize.height : 0)); return AnimatedBuilder( animation: controller.animation, - builder: (BuildContext context, Widget? child) { + builder: (context, child) { final bottom = height * controller.animation.value; return Positioned( right: padding.right, diff --git a/app/lib/core/component/widget/error_widget.dart b/app/lib/core/component/widget/error_widget.dart index e20204a07..4509c05e1 100644 --- a/app/lib/core/component/widget/error_widget.dart +++ b/app/lib/core/component/widget/error_widget.dart @@ -41,7 +41,8 @@ class ErrorInfoWidget extends StatelessWidget { const SizedBox(height: 8), Text( (response != null - ? '${exception.response?.statusCode} ${exception.response?.statusMessage}' + ? '${exception.response?.statusCode} ' + '${exception.response?.statusMessage}' : '') + switch (data) { { diff --git a/app/lib/core/extension/async_value.dart b/app/lib/core/extension/async_value.dart index 0aa87e61e..2d588bf7a 100644 --- a/app/lib/core/extension/async_value.dart +++ b/app/lib/core/extension/async_value.dart @@ -22,13 +22,13 @@ extension AsyncValueX on AsyncValue { /// [skipErrorOnHasValue]がtrueの時はデータがある場合のエラーをスキップする /// ページングの2ページ目以降でエラー時に、取得ずみデータを表示する場合などに使用する R whenPlus({ + required R Function(T data, bool hasError) data, + required R Function(Object error, StackTrace stackTrace) error, + required R Function() loading, bool skipLoadingOnReload = false, bool skipLoadingOnRefresh = true, bool skipError = false, bool skipErrorOnHasValue = false, - required R Function(T data, bool hasError) data, - required R Function(Object error, StackTrace stackTrace) error, - required R Function() loading, }) { if (skipErrorOnHasValue) { if (hasValue && hasError) { diff --git a/app/lib/core/provider/app_lifecycle.dart b/app/lib/core/provider/app_lifecycle.dart index 0b3d85de7..b6fe24452 100644 --- a/app/lib/core/provider/app_lifecycle.dart +++ b/app/lib/core/provider/app_lifecycle.dart @@ -1,41 +1,26 @@ // Flutter imports: -import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:flutter/widgets.dart'; -// Package imports: -import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'app_lifecycle.g.dart'; /// ref: https://zenn.dev/riscait/books/flutter-riverpod-practical-introduction/viewer/v2-app-lifecycle @Riverpod(keepAlive: true) -AppLifecycleState appLifeCycle(AppLifeCycleRef ref) { - final observer = _AppLifecycleObserver((value) => ref.state = value, ref); - - final binding = WidgetsBinding.instance..addObserver(observer); - ref - ..onDispose(() => binding.removeObserver(observer)) - ..listenSelf( - (previous, next) => ref - .read(talkerProvider) - .logCustom(AppLifeCycleLog('$previous -> $next')), - ); - return AppLifecycleState.resumed; -} - -class _AppLifecycleObserver extends WidgetsBindingObserver { - _AppLifecycleObserver(this._didChangeState, this.ref); - final Ref ref; - - final ValueChanged _didChangeState; +class AppLifecycle extends _$AppLifecycle with WidgetsBindingObserver { + @override + AppLifecycleState build() { + // プロバイダ構築時に監視を開始。 + final binding = WidgetsBinding.instance..addObserver(this); + // プロバイダが破棄された時に監視を解除。 + ref.onDispose(() => binding.removeObserver(this)); + // 初期値として `resumed` を返している。 + return AppLifecycleState.resumed; + } @override void didChangeAppLifecycleState(AppLifecycleState state) { - _didChangeState(state); + // `AppLifecycleState` の変更を検知してNotifierが持つ状態を更新。 + this.state = state; super.didChangeAppLifecycleState(state); } } - -extension AppLifecycleStateExtension on AppLifecycleState { - bool get isResumed => this == AppLifecycleState.resumed; -} diff --git a/app/lib/core/provider/app_lifecycle.g.dart b/app/lib/core/provider/app_lifecycle.g.dart index 40735554a..0827f4e7f 100644 --- a/app/lib/core/provider/app_lifecycle.g.dart +++ b/app/lib/core/provider/app_lifecycle.g.dart @@ -8,21 +8,22 @@ part of 'app_lifecycle.dart'; // RiverpodGenerator // ************************************************************************** -String _$appLifeCycleHash() => r'2125fa2be4911e573a97302e962110e735c0a91b'; +String _$appLifecycleHash() => r'9e357a2c4983fa88f3ed65162de86ce5813fb838'; /// ref: https://zenn.dev/riscait/books/flutter-riverpod-practical-introduction/viewer/v2-app-lifecycle /// -/// Copied from [appLifeCycle]. -@ProviderFor(appLifeCycle) -final appLifeCycleProvider = Provider.internal( - appLifeCycle, - name: r'appLifeCycleProvider', +/// Copied from [AppLifecycle]. +@ProviderFor(AppLifecycle) +final appLifecycleProvider = + NotifierProvider.internal( + AppLifecycle.new, + name: r'appLifecycleProvider', debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$appLifeCycleHash, + const bool.fromEnvironment('dart.vm.product') ? null : _$appLifecycleHash, dependencies: null, allTransitiveDependencies: null, ); -typedef AppLifeCycleRef = ProviderRef; +typedef _$AppLifecycle = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/application_documents_directory.dart b/app/lib/core/provider/application_documents_directory.dart index 9de81a4e6..c1262fde2 100644 --- a/app/lib/core/provider/application_documents_directory.dart +++ b/app/lib/core/provider/application_documents_directory.dart @@ -1,9 +1,10 @@ import 'dart:io'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'application_documents_directory.g.dart'; @Riverpod(keepAlive: true) -Directory applicationDocumentsDirectory(ApplicationDocumentsDirectoryRef ref) => +Directory applicationDocumentsDirectory(Ref ref) => throw UnimplementedError(); diff --git a/app/lib/core/provider/application_documents_directory.g.dart b/app/lib/core/provider/application_documents_directory.g.dart index cb24f256f..58b1a2591 100644 --- a/app/lib/core/provider/application_documents_directory.g.dart +++ b/app/lib/core/provider/application_documents_directory.g.dart @@ -9,7 +9,7 @@ part of 'application_documents_directory.dart'; // ************************************************************************** String _$applicationDocumentsDirectoryHash() => - r'247d3d84b108284e9db0472ee403ae00352882a9'; + r'246c835294da120f3536b1486d6fcaedde798440'; /// See also [applicationDocumentsDirectory]. @ProviderFor(applicationDocumentsDirectory) @@ -23,6 +23,8 @@ final applicationDocumentsDirectoryProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef ApplicationDocumentsDirectoryRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/capture/intensity_icon_render.g.dart b/app/lib/core/provider/capture/intensity_icon_render.g.dart index fe9059258..69a4ae29e 100644 --- a/app/lib/core/provider/capture/intensity_icon_render.g.dart +++ b/app/lib/core/provider/capture/intensity_icon_render.g.dart @@ -129,4 +129,4 @@ final currentLocationIconRenderProvider = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/crashlytics/crashlytics_setting_provider.dart b/app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.dart deleted file mode 100644 index afb19a333..000000000 --- a/app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'dart:convert'; - -import 'package:eqmonitor/core/provider/config/crashlytics/model/crashlytics_setting_model.dart'; -import 'package:eqmonitor/core/provider/shared_preferences.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -part 'crashlytics_setting_provider.g.dart'; - -@riverpod -class CrashlyticsSetting extends _$CrashlyticsSetting { - @override - CrashlyticsSettingModel build() { - ref.listenSelf((_, next) => _save()); - return const CrashlyticsSettingModel(); - } - - static const String _key = 'crashlytics_setting'; - - Future _save() async => ref - .read(sharedPreferencesProvider) - .setString(_key, jsonEncode(state.toJson())); - - void setEnabled({required bool isEnabled}) { - state = state.copyWith(isEnabled: isEnabled); - } - - static CrashlyticsSettingModel? read(SharedPreferences prefs) { - final json = prefs.getString(_key); - if (json == null) { - return null; - } - return CrashlyticsSettingModel.fromJson( - jsonDecode(json) as Map, - ); - } -} diff --git a/app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.g.dart b/app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.g.dart deleted file mode 100644 index 5e4f22d14..000000000 --- a/app/lib/core/provider/config/crashlytics/crashlytics_setting_provider.g.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore - -part of 'crashlytics_setting_provider.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$crashlyticsSettingHash() => - r'000581239d3ee84dd95a09f814f6d5b8f31fa845'; - -/// See also [CrashlyticsSetting]. -@ProviderFor(CrashlyticsSetting) -final crashlyticsSettingProvider = AutoDisposeNotifierProvider< - CrashlyticsSetting, CrashlyticsSettingModel>.internal( - CrashlyticsSetting.new, - name: r'crashlyticsSettingProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$crashlyticsSettingHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$CrashlyticsSetting = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package diff --git a/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.dart b/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.dart deleted file mode 100644 index 6bbb5df61..000000000 --- a/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'crashlytics_setting_model.freezed.dart'; -part 'crashlytics_setting_model.g.dart'; - -@freezed -class CrashlyticsSettingModel with _$CrashlyticsSettingModel { - const factory CrashlyticsSettingModel({ - @Default(true) bool isEnabled, - }) = _CrashlyticsSettingModel; - - factory CrashlyticsSettingModel.fromJson(Map json) => - _$CrashlyticsSettingModelFromJson(json); -} diff --git a/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.freezed.dart b/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.freezed.dart deleted file mode 100644 index 22d6c7fea..000000000 --- a/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.freezed.dart +++ /dev/null @@ -1,173 +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 'crashlytics_setting_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'); - -CrashlyticsSettingModel _$CrashlyticsSettingModelFromJson( - Map json) { - return _CrashlyticsSettingModel.fromJson(json); -} - -/// @nodoc -mixin _$CrashlyticsSettingModel { - bool get isEnabled => throw _privateConstructorUsedError; - - /// Serializes this CrashlyticsSettingModel to a JSON map. - Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of CrashlyticsSettingModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $CrashlyticsSettingModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $CrashlyticsSettingModelCopyWith<$Res> { - factory $CrashlyticsSettingModelCopyWith(CrashlyticsSettingModel value, - $Res Function(CrashlyticsSettingModel) then) = - _$CrashlyticsSettingModelCopyWithImpl<$Res, CrashlyticsSettingModel>; - @useResult - $Res call({bool isEnabled}); -} - -/// @nodoc -class _$CrashlyticsSettingModelCopyWithImpl<$Res, - $Val extends CrashlyticsSettingModel> - implements $CrashlyticsSettingModelCopyWith<$Res> { - _$CrashlyticsSettingModelCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of CrashlyticsSettingModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isEnabled = null, - }) { - return _then(_value.copyWith( - isEnabled: null == isEnabled - ? _value.isEnabled - : isEnabled // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$CrashlyticsSettingModelImplCopyWith<$Res> - implements $CrashlyticsSettingModelCopyWith<$Res> { - factory _$$CrashlyticsSettingModelImplCopyWith( - _$CrashlyticsSettingModelImpl value, - $Res Function(_$CrashlyticsSettingModelImpl) then) = - __$$CrashlyticsSettingModelImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({bool isEnabled}); -} - -/// @nodoc -class __$$CrashlyticsSettingModelImplCopyWithImpl<$Res> - extends _$CrashlyticsSettingModelCopyWithImpl<$Res, - _$CrashlyticsSettingModelImpl> - implements _$$CrashlyticsSettingModelImplCopyWith<$Res> { - __$$CrashlyticsSettingModelImplCopyWithImpl( - _$CrashlyticsSettingModelImpl _value, - $Res Function(_$CrashlyticsSettingModelImpl) _then) - : super(_value, _then); - - /// Create a copy of CrashlyticsSettingModel - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? isEnabled = null, - }) { - return _then(_$CrashlyticsSettingModelImpl( - isEnabled: null == isEnabled - ? _value.isEnabled - : isEnabled // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$CrashlyticsSettingModelImpl implements _CrashlyticsSettingModel { - const _$CrashlyticsSettingModelImpl({this.isEnabled = true}); - - factory _$CrashlyticsSettingModelImpl.fromJson(Map json) => - _$$CrashlyticsSettingModelImplFromJson(json); - - @override - @JsonKey() - final bool isEnabled; - - @override - String toString() { - return 'CrashlyticsSettingModel(isEnabled: $isEnabled)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CrashlyticsSettingModelImpl && - (identical(other.isEnabled, isEnabled) || - other.isEnabled == isEnabled)); - } - - @JsonKey(includeFromJson: false, includeToJson: false) - @override - int get hashCode => Object.hash(runtimeType, isEnabled); - - /// Create a copy of CrashlyticsSettingModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$CrashlyticsSettingModelImplCopyWith<_$CrashlyticsSettingModelImpl> - get copyWith => __$$CrashlyticsSettingModelImplCopyWithImpl< - _$CrashlyticsSettingModelImpl>(this, _$identity); - - @override - Map toJson() { - return _$$CrashlyticsSettingModelImplToJson( - this, - ); - } -} - -abstract class _CrashlyticsSettingModel implements CrashlyticsSettingModel { - const factory _CrashlyticsSettingModel({final bool isEnabled}) = - _$CrashlyticsSettingModelImpl; - - factory _CrashlyticsSettingModel.fromJson(Map json) = - _$CrashlyticsSettingModelImpl.fromJson; - - @override - bool get isEnabled; - - /// Create a copy of CrashlyticsSettingModel - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$CrashlyticsSettingModelImplCopyWith<_$CrashlyticsSettingModelImpl> - get copyWith => throw _privateConstructorUsedError; -} diff --git a/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.g.dart b/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.g.dart deleted file mode 100644 index 30cb284b9..000000000 --- a/app/lib/core/provider/config/crashlytics/model/crashlytics_setting_model.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: type=lint, duplicate_ignore - -part of 'crashlytics_setting_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$CrashlyticsSettingModelImpl _$$CrashlyticsSettingModelImplFromJson( - Map json) => - $checkedCreate( - r'_$CrashlyticsSettingModelImpl', - json, - ($checkedConvert) { - final val = _$CrashlyticsSettingModelImpl( - isEnabled: $checkedConvert('isEnabled', (v) => v as bool? ?? true), - ); - return val; - }, - ); - -Map _$$CrashlyticsSettingModelImplToJson( - _$CrashlyticsSettingModelImpl instance) => - { - 'isEnabled': instance.isEnabled, - }; 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 2e091494f..00599b33c 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 @@ -27,4 +27,4 @@ final earthquakeHistoryConfigProvider = AutoDisposeNotifierProvider< 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/notification/fcm_topic_manager.g.dart b/app/lib/core/provider/config/notification/fcm_topic_manager.g.dart index ab93c2cca..a3fdcd0b7 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 @@ -25,4 +25,4 @@ final fcmTopicManagerProvider = typedef _$FcmTopicManager = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/permission/permission_notifier.dart b/app/lib/core/provider/config/permission/permission_notifier.dart index 7b435e71c..905bc127c 100644 --- a/app/lib/core/provider/config/permission/permission_notifier.dart +++ b/app/lib/core/provider/config/permission/permission_notifier.dart @@ -15,9 +15,9 @@ part 'permission_notifier.g.dart'; class PermissionNotifier extends _$PermissionNotifier { @override PermissionStateModel build() { - ref.listen(appLifeCycleProvider, (_, next) { + ref.listen(appLifecycleProvider, (_, next) async { if (next == AppLifecycleState.resumed) { - initialize(); + await initialize(); } }); return const PermissionStateModel(); 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 bf5ea1d08..8a9d7f7a3 100644 --- a/app/lib/core/provider/config/permission/permission_notifier.g.dart +++ b/app/lib/core/provider/config/permission/permission_notifier.g.dart @@ -9,7 +9,7 @@ part of 'permission_notifier.dart'; // ************************************************************************** String _$permissionNotifierHash() => - r'5b6cb19c6735ab50f46b092b19413866f8e4223a'; + r'9148f70192bfa7e7a23b910cd3e111566b64994d'; /// See also [PermissionNotifier]. @ProviderFor(PermissionNotifier) @@ -26,4 +26,4 @@ final permissionNotifierProvider = typedef _$PermissionNotifier = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/theme/intensity_color/intensity_color_provider.dart b/app/lib/core/provider/config/theme/intensity_color/intensity_color_provider.dart index 744c5c768..f9c5449b9 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 @@ -21,10 +21,9 @@ class IntensityColor extends _$IntensityColor { static const _key = 'intensity_color'; - // ignore: use_setters_to_change_properties - void update(IntensityColorModel model) { + Future update(IntensityColorModel model) async { state = model; - ref.read(sharedPreferencesProvider).setString( + await ref.read(sharedPreferencesProvider).setString( _key, jsonEncode(model.toJson()), ); 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 867e135e9..3ebd0482e 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 @@ -8,7 +8,7 @@ part of 'intensity_color_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$intensityColorHash() => r'7892bed4f63a288d70217c9f2795257f4751bc5c'; +String _$intensityColorHash() => r'9c5f1148d0001d84e37f1a0bb14d65cdaee14795'; /// See also [IntensityColor]. @ProviderFor(IntensityColor) @@ -25,4 +25,4 @@ final intensityColorProvider = typedef _$IntensityColor = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/debugger/debugger_provider.g.dart b/app/lib/core/provider/debugger/debugger_provider.g.dart index a3cbca5a2..6bb77b748 100644 --- a/app/lib/core/provider/debugger/debugger_provider.g.dart +++ b/app/lib/core/provider/debugger/debugger_provider.g.dart @@ -24,4 +24,4 @@ final debuggerProvider = typedef _$Debugger = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/device_info.dart b/app/lib/core/provider/device_info.dart index 9b0a6726c..08e09c145 100644 --- a/app/lib/core/provider/device_info.dart +++ b/app/lib/core/provider/device_info.dart @@ -1,11 +1,12 @@ import 'package:device_info_plus/device_info_plus.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'device_info.g.dart'; @Riverpod(keepAlive: true) -AndroidDeviceInfo androidDeviceInfo(AndroidDeviceInfoRef ref) => +AndroidDeviceInfo androidDeviceInfo(Ref ref) => throw UnimplementedError(); @Riverpod(keepAlive: true) -IosDeviceInfo iosDeviceInfo(IosDeviceInfoRef ref) => throw UnimplementedError(); +IosDeviceInfo iosDeviceInfo(Ref ref) => throw UnimplementedError(); diff --git a/app/lib/core/provider/device_info.g.dart b/app/lib/core/provider/device_info.g.dart index 8a32f7f22..2ccb24548 100644 --- a/app/lib/core/provider/device_info.g.dart +++ b/app/lib/core/provider/device_info.g.dart @@ -8,7 +8,7 @@ part of 'device_info.dart'; // RiverpodGenerator // ************************************************************************** -String _$androidDeviceInfoHash() => r'458369b0c5f4d1058e744561e6c84af623330d1a'; +String _$androidDeviceInfoHash() => r'02f1a66ec8a7e96d418eb9cb0a981fd40d5d2523'; /// See also [androidDeviceInfo]. @ProviderFor(androidDeviceInfo) @@ -22,8 +22,10 @@ final androidDeviceInfoProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef AndroidDeviceInfoRef = ProviderRef; -String _$iosDeviceInfoHash() => r'524afbbda4c23aa698f034aa8b2735affcbdc08c'; +String _$iosDeviceInfoHash() => r'5c95b3efca6425549ed7e884f54f041a61267149'; /// See also [iosDeviceInfo]. @ProviderFor(iosDeviceInfo) @@ -37,6 +39,8 @@ final iosDeviceInfoProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef IosDeviceInfoRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/dio_provider.dart b/app/lib/core/provider/dio_provider.dart index 3bf316577..ecd290f99 100644 --- a/app/lib/core/provider/dio_provider.dart +++ b/app/lib/core/provider/dio_provider.dart @@ -6,6 +6,7 @@ import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/core/provider/shared_preferences.dart'; import 'package:eqmonitor/core/provider/telegram_url/provider/telegram_url_provider.dart'; import 'package:flutter/foundation.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart'; import 'package:talker_dio_logger/talker_dio_logger_settings.dart'; @@ -14,7 +15,7 @@ import 'package:talker_flutter/talker_flutter.dart'; part 'dio_provider.g.dart'; @Riverpod(keepAlive: true) -Dio dio(DioRef ref) { +Dio dio(Ref ref) { final key = ref.watch(telegramUrlProvider).apiAuthorization; final authorization = key != null ? 'Bearer $key' : null; final dio = Dio( diff --git a/app/lib/core/provider/dio_provider.g.dart b/app/lib/core/provider/dio_provider.g.dart index af261cf22..560aecd0d 100644 --- a/app/lib/core/provider/dio_provider.g.dart +++ b/app/lib/core/provider/dio_provider.g.dart @@ -8,7 +8,7 @@ part of 'dio_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$dioHash() => r'9223635e6ccfbdbe256b1211246398d3ce778fd1'; +String _$dioHash() => r'5d646c54d92a9b59f60f2253149c45b78b6a4e18'; /// See also [dio]. @ProviderFor(dio) @@ -21,6 +21,8 @@ final dioProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef DioRef = ProviderRef; String _$isDioProxyEnabledHash() => r'716d5c817b377684285a697bf988ce19f0645c81'; @@ -39,4 +41,4 @@ final isDioProxyEnabledProvider = typedef _$IsDioProxyEnabled = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/eew/eew_alive_telegram.dart b/app/lib/core/provider/eew/eew_alive_telegram.dart index a144cc0d7..cae817ec1 100644 --- a/app/lib/core/provider/eew/eew_alive_telegram.dart +++ b/app/lib/core/provider/eew/eew_alive_telegram.dart @@ -2,6 +2,7 @@ import 'package:collection/collection.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/provider/eew/eew_telegram.dart'; import 'package:eqmonitor/core/provider/time_ticker.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'eew_alive_telegram.g.dart'; @@ -9,7 +10,7 @@ part 'eew_alive_telegram.g.dart'; /// イベント終了していないEEWのうち、精度が低いものを除外したもの @Riverpod(keepAlive: true) List eewAliveNormalTelegram( - EewAliveNormalTelegramRef ref, + Ref ref, ) { final state = ref.watch(eewAliveTelegramProvider) ?? []; return state.where((e) { @@ -49,7 +50,7 @@ class EewAliveTelegram extends _$EewAliveTelegram { } @Riverpod(keepAlive: true) -EewAliveChecker eewAliveChecker(EewAliveCheckerRef ref) => EewAliveChecker(); +EewAliveChecker eewAliveChecker(Ref ref) => EewAliveChecker(); class EewAliveChecker { /// イベント終了の判定 diff --git a/app/lib/core/provider/eew/eew_alive_telegram.g.dart b/app/lib/core/provider/eew/eew_alive_telegram.g.dart index 68fc39632..b683823aa 100644 --- a/app/lib/core/provider/eew/eew_alive_telegram.g.dart +++ b/app/lib/core/provider/eew/eew_alive_telegram.g.dart @@ -9,7 +9,7 @@ part of 'eew_alive_telegram.dart'; // ************************************************************************** String _$eewAliveNormalTelegramHash() => - r'29da2deaf8b2611744f88585a5fa215e7c14d99a'; + r'3d5ba64b3f98437062584f49208f9898a32358f3'; /// イベント終了していないEEWのうち、精度が低いものを除外したもの /// @@ -25,8 +25,10 @@ final eewAliveNormalTelegramProvider = Provider>.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef EewAliveNormalTelegramRef = ProviderRef>; -String _$eewAliveCheckerHash() => r'9a37a3cc06eecdcaf74ecf1e717f9f34a6761948'; +String _$eewAliveCheckerHash() => r'f092d121ff9d9ea2b58fb253608779403a4ce39f'; /// See also [eewAliveChecker]. @ProviderFor(eewAliveChecker) @@ -40,6 +42,8 @@ final eewAliveCheckerProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef EewAliveCheckerRef = ProviderRef; String _$eewAliveTelegramHash() => r'75a2a8e24ee834cde6895bc29ff84cdc69470cb7'; @@ -60,4 +64,4 @@ final eewAliveTelegramProvider = typedef _$EewAliveTelegram = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/eew/eew_telegram.dart b/app/lib/core/provider/eew/eew_telegram.dart index 7ce91de02..6a632a69d 100644 --- a/app/lib/core/provider/eew/eew_telegram.dart +++ b/app/lib/core/provider/eew/eew_telegram.dart @@ -8,6 +8,7 @@ import 'package:eqmonitor/core/provider/app_lifecycle.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:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:web_socket_client/web_socket_client.dart'; @@ -22,7 +23,7 @@ class Eew extends _$Eew { // WebSocketのListen開始 ref ..listen( - websocketTableMessagesProvider(), + websocketTableMessagesProvider, (_, next) { final valueOrNull = next.valueOrNull; if (valueOrNull is RealtimePostgresInsertPayload) { @@ -30,7 +31,7 @@ class Eew extends _$Eew { } }, ) - ..listen(appLifeCycleProvider, (_, next) { + ..listen(appLifecycleProvider, (_, next) { if (next == AppLifecycleState.resumed) { log('AppLifecycleState.resumed: Refetch EEW'); _refetchRestApi(); @@ -51,7 +52,7 @@ class Eew extends _$Eew { if (webSocketState is Connected || webSocketState is Reconnected) { return; } - if (ref.read(appLifeCycleProvider) != AppLifecycleState.resumed) { + if (ref.read(appLifecycleProvider) != AppLifecycleState.resumed) { return; } ref.read(talkerProvider).log('Refetch EEW'); @@ -79,7 +80,7 @@ class Eew extends _$Eew { } @Riverpod(keepAlive: true) -Future> _eewRest(_EewRestRef ref) async { +Future> _eewRest(Ref ref) async { final api = ref.watch(eqApiProvider); final result = await api.v1.getEewLatest(); return result.data; diff --git a/app/lib/core/provider/eew/eew_telegram.g.dart b/app/lib/core/provider/eew/eew_telegram.g.dart index 2d3f9d0b8..61a005f0a 100644 --- a/app/lib/core/provider/eew/eew_telegram.g.dart +++ b/app/lib/core/provider/eew/eew_telegram.g.dart @@ -8,7 +8,7 @@ part of 'eew_telegram.dart'; // RiverpodGenerator // ************************************************************************** -String _$eewRestHash() => r'50b79c8338a45d444be3724ecadee6c752cbf167'; +String _$eewRestHash() => r'69fa253ca95a018a286351ead0b2f662f5e47626'; /// See also [_eewRest]. @ProviderFor(_eewRest) @@ -21,8 +21,10 @@ final _eewRestProvider = FutureProvider>.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef _EewRestRef = FutureProviderRef>; -String _$eewHash() => r'b668694610d9a1f3a4bbbe66deab098347a6b8e3'; +String _$eewHash() => r'397608aa488e504237231aaea748dab4fa0ea1f5'; /// See also [Eew]. @ProviderFor(Eew) @@ -37,4 +39,4 @@ final eewProvider = NotifierProvider>>.internal( typedef _$Eew = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/data/estimated_intensity_data_source.dart b/app/lib/core/provider/estimated_intensity/data/estimated_intensity_data_source.dart index 8144804eb..23726d0a5 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 @@ -1,5 +1,6 @@ import 'dart:math' as math; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:latlong2/latlong.dart' as lat_long_2; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -7,7 +8,7 @@ part 'estimated_intensity_data_source.g.dart'; @Riverpod(keepAlive: true) EstimatedIntensityDataSource estimatedIntensityDataSource( - EstimatedIntensityDataSourceRef ref, + Ref ref, ) => EstimatedIntensityDataSource(); 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 5b9b20d06..5b81d8087 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 @@ -9,7 +9,7 @@ part of 'estimated_intensity_data_source.dart'; // ************************************************************************** String _$estimatedIntensityDataSourceHash() => - r'0ead37256b9a00cecfc4ffbb15270ad2e69ccd10'; + r'a8dc59d604c60eb6292bd73c63664558890fd43c'; /// See also [estimatedIntensityDataSource]. @ProviderFor(estimatedIntensityDataSource) @@ -24,7 +24,9 @@ final estimatedIntensityDataSourceProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 0489fd845..2c447b5c0 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 @@ -8,6 +8,7 @@ import 'package:eqmonitor/core/provider/estimated_intensity/data/estimated_inten import 'package:eqmonitor/core/provider/jma_parameter/jma_parameter.dart'; import 'package:flutter/foundation.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_parameter_api_client/jma_parameter_api_client.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -73,7 +74,10 @@ class EstimatedIntensity extends _$EstimatedIntensity { } // resultsのIterableそれぞれは同じ長さであることを確認 - assert(results.every((e) => e.length == _calculationPoints!.length)); + assert( + results.every((e) => e.length == _calculationPoints!.length), + 'results length must be same as calculationPoints length', + ); final result = []; // それぞれについて最大の値を取る @@ -138,7 +142,7 @@ class EstimatedIntensity extends _$EstimatedIntensity { @Riverpod(keepAlive: true) Stream> estimatedIntensityCity( - EstimatedIntensityCityRef ref, + Ref ref, ) async* { final estimatedIntensity = ref.watch(estimatedIntensityProvider).valueOrNull; if (estimatedIntensity != null) { @@ -157,11 +161,12 @@ Stream> estimatedIntensityCity( @Riverpod(keepAlive: true) Stream> estimatedIntensityRegion( - EstimatedIntensityRegionRef ref, + Ref ref, ) async* { final estimatedIntensity = ref.watch(estimatedIntensityProvider).valueOrNull; log( - 'estimatedIntensityRegion: ${estimatedIntensity.runtimeType}, ${estimatedIntensity?.length}', + 'estimatedIntensityRegion: ${estimatedIntensity.runtimeType}, ' + '${estimatedIntensity?.length}', name: 'estimatedIntensityRegion', ); if (estimatedIntensity != null) { 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 c1158bbdb..e0a7461f8 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 @@ -9,7 +9,7 @@ part of 'estimated_intensity_provider.dart'; // ************************************************************************** String _$estimatedIntensityCityHash() => - r'8fed41327805b67db22bf4e10852f848f72216f7'; + r'9bcbac883935662bc3388807662d7d6a4c8f7da6'; /// See also [estimatedIntensityCity]. @ProviderFor(estimatedIntensityCity) @@ -24,9 +24,11 @@ final estimatedIntensityCityProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef EstimatedIntensityCityRef = StreamProviderRef>; String _$estimatedIntensityRegionHash() => - r'e87900e95ed3a85e8c9186e114dc70ed75fb74ed'; + r'bc6d5fcbeeb39c3b9705951ed3412df7bf83645e'; /// See also [estimatedIntensityRegion]. @ProviderFor(estimatedIntensityRegion) @@ -41,9 +43,11 @@ final estimatedIntensityRegionProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef EstimatedIntensityRegionRef = StreamProviderRef>; String _$estimatedIntensityHash() => - r'2b1635766324d17864f9ee350e297952e6ef0d86'; + r'd60154c92ffedbd45ee522e8f26d8000cc8c74fd'; /// See also [EstimatedIntensity]. @ProviderFor(EstimatedIntensity) @@ -60,4 +64,4 @@ final estimatedIntensityProvider = AsyncNotifierProvider>; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/firebase/firebase_crashlytics.dart b/app/lib/core/provider/firebase/firebase_crashlytics.dart index a7aac648c..6fb2cfe4b 100644 --- a/app/lib/core/provider/firebase/firebase_crashlytics.dart +++ b/app/lib/core/provider/firebase/firebase_crashlytics.dart @@ -1,8 +1,9 @@ import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'firebase_crashlytics.g.dart'; @Riverpod(keepAlive: true) -FirebaseCrashlytics firebaseCrashlytics(FirebaseCrashlyticsRef ref) => +FirebaseCrashlytics firebaseCrashlytics(Ref ref) => FirebaseCrashlytics.instance; diff --git a/app/lib/core/provider/firebase/firebase_crashlytics.g.dart b/app/lib/core/provider/firebase/firebase_crashlytics.g.dart index 21224533c..f9d6fd6dd 100644 --- a/app/lib/core/provider/firebase/firebase_crashlytics.g.dart +++ b/app/lib/core/provider/firebase/firebase_crashlytics.g.dart @@ -9,7 +9,7 @@ part of 'firebase_crashlytics.dart'; // ************************************************************************** String _$firebaseCrashlyticsHash() => - r'cc3047b8184f44f1459874a75f8d3dc516e91072'; + r'b676b545954cfaab78c5f4cfd7d774d97c96dcad'; /// See also [firebaseCrashlytics]. @ProviderFor(firebaseCrashlytics) @@ -23,6 +23,8 @@ final firebaseCrashlyticsProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef FirebaseCrashlyticsRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/firebase/firebase_messaging.dart b/app/lib/core/provider/firebase/firebase_messaging.dart index 83b9a408f..f184fb383 100644 --- a/app/lib/core/provider/firebase/firebase_messaging.dart +++ b/app/lib/core/provider/firebase/firebase_messaging.dart @@ -1,8 +1,9 @@ import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'firebase_messaging.g.dart'; @Riverpod(keepAlive: true) -FirebaseMessaging firebaseMessaging(FirebaseMessagingRef ref) => +FirebaseMessaging firebaseMessaging(Ref ref) => FirebaseMessaging.instance; diff --git a/app/lib/core/provider/firebase/firebase_messaging.g.dart b/app/lib/core/provider/firebase/firebase_messaging.g.dart index c163020b3..6b08dc165 100644 --- a/app/lib/core/provider/firebase/firebase_messaging.g.dart +++ b/app/lib/core/provider/firebase/firebase_messaging.g.dart @@ -8,7 +8,7 @@ part of 'firebase_messaging.dart'; // RiverpodGenerator // ************************************************************************** -String _$firebaseMessagingHash() => r'c96a03147f08cc0d5bdb4c4736051f7f9b1c7e65'; +String _$firebaseMessagingHash() => r'6765ce963b9b8c50186b5132356d60eb68265741'; /// See also [firebaseMessaging]. @ProviderFor(firebaseMessaging) @@ -22,6 +22,8 @@ final firebaseMessagingProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef FirebaseMessagingRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/firebase/firebase_messaging_interaction.dart b/app/lib/core/provider/firebase/firebase_messaging_interaction.dart index 14f94313e..bfbb889fc 100644 --- a/app/lib/core/provider/firebase/firebase_messaging_interaction.dart +++ b/app/lib/core/provider/firebase/firebase_messaging_interaction.dart @@ -1,12 +1,13 @@ import 'package:eqmonitor/core/provider/firebase/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'firebase_messaging_interaction.g.dart'; @Riverpod(keepAlive: true) Stream firebaseMessagingInteraction( - FirebaseMessagingInteractionRef ref, + Ref ref, ) async* { final messaging = ref.watch(firebaseMessagingProvider); final initialMessage = await messaging.getInitialMessage(); 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 26c7f8dba..8ba5d24e2 100644 --- a/app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart +++ b/app/lib/core/provider/firebase/firebase_messaging_interaction.g.dart @@ -9,7 +9,7 @@ part of 'firebase_messaging_interaction.dart'; // ************************************************************************** String _$firebaseMessagingInteractionHash() => - r'e9f5c9192138ef904cba11702ebc8863edf59f7a'; + r'51d01acd3aeffbeb731537057efbc3e2e2f6af6a'; /// See also [firebaseMessagingInteraction]. @ProviderFor(firebaseMessagingInteraction) @@ -24,6 +24,8 @@ final firebaseMessagingInteractionProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef FirebaseMessagingInteractionRef = StreamProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/jma_code_table_provider.dart b/app/lib/core/provider/jma_code_table_provider.dart index a0df317a0..ec6744114 100644 --- a/app/lib/core/provider/jma_code_table_provider.dart +++ b/app/lib/core/provider/jma_code_table_provider.dart @@ -1,12 +1,13 @@ import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:flutter/services.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_code_table_types/jma_code_table.pb.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'jma_code_table_provider.g.dart'; @Riverpod(keepAlive: true) -JmaCodeTable jmaCodeTable(JmaCodeTableRef ref) => throw UnimplementedError(); +JmaCodeTable jmaCodeTable(Ref ref) => throw UnimplementedError(); Future loadJmaCodeTable() async => JmaCodeTable.fromBuffer( (await rootBundle.load(Assets.jmaCodeTable)).buffer.asUint8List(), diff --git a/app/lib/core/provider/jma_code_table_provider.g.dart b/app/lib/core/provider/jma_code_table_provider.g.dart index 2251899cc..a500ce475 100644 --- a/app/lib/core/provider/jma_code_table_provider.g.dart +++ b/app/lib/core/provider/jma_code_table_provider.g.dart @@ -8,7 +8,7 @@ part of 'jma_code_table_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$jmaCodeTableHash() => r'50be79b70cc2d0df15ecdef34f971ed408a059b2'; +String _$jmaCodeTableHash() => r'94db7e0261aaf71cfee48960a72415da70d378c7'; /// See also [jmaCodeTable]. @ProviderFor(jmaCodeTable) @@ -21,6 +21,8 @@ final jmaCodeTableProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef JmaCodeTableRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/jma_parameter/jma_parameter.g.dart b/app/lib/core/provider/jma_parameter/jma_parameter.g.dart index 6d0fb39c6..e0c4e8936 100644 --- a/app/lib/core/provider/jma_parameter/jma_parameter.g.dart +++ b/app/lib/core/provider/jma_parameter/jma_parameter.g.dart @@ -41,4 +41,4 @@ final earthquakeParameterEtagProvider = typedef _$EarthquakeParameterEtag = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart b/app/lib/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart index caa8bf128..fbb75ed25 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 @@ -1,6 +1,7 @@ import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:kyoshin_observation_point_types/kyoshin_observation_point.pb.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -8,7 +9,7 @@ part 'kyoshin_observation_points_provider.g.dart'; @Riverpod(keepAlive: true) KyoshinObservationPoints kyoshinObservationPoints( - KyoshinObservationPointsRef ref, + Ref ref, ) => throw UnimplementedError(); 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 46deb55fd..988baf91f 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 @@ -9,7 +9,7 @@ part of 'kyoshin_observation_points_provider.dart'; // ************************************************************************** String _$kyoshinObservationPointsHash() => - r'69bb2084b1e913a55f36a1ba2a0378c09501087a'; + r'061eb4355dbeac3146c82ea5d23f1d6ca75c4eaa'; /// See also [kyoshinObservationPoints]. @ProviderFor(kyoshinObservationPoints) @@ -24,6 +24,8 @@ final kyoshinObservationPointsProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef KyoshinObservationPointsRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 f02910ace..41144a0cb 100644 --- a/app/lib/core/provider/log/talker.dart +++ b/app/lib/core/provider/log/talker.dart @@ -1,13 +1,16 @@ // ignore_for_file: overridden_fields +import 'dart:async'; + import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:talker_flutter/talker_flutter.dart'; part 'talker.g.dart'; @Riverpod(keepAlive: true) -Talker talker(TalkerRef ref) => throw UnimplementedError(); +Talker talker(Ref ref) => throw UnimplementedError(); class TelegramWebSocketLog extends TalkerLog { TelegramWebSocketLog(super.message); @@ -73,13 +76,17 @@ class CrashlyticsTalkerObserver implements TalkerObserver { CrashlyticsTalkerObserver(); @override - void onError(TalkerError err) => FirebaseCrashlytics.instance.log( - 'Error: ${err.message}, ${err.exception}, ${err.stackTrace}', + void onError(TalkerError err) => unawaited( + FirebaseCrashlytics.instance.log( + 'Error: ${err.message}, ${err.exception}, ${err.stackTrace}', + ), ); @override - void onException(TalkerException err) => FirebaseCrashlytics.instance.log( - 'Exception: ${err.message}, ${err.exception}, ${err.stackTrace}', + void onException(TalkerException err) => unawaited( + FirebaseCrashlytics.instance.log( + 'Exception: ${err.message}, ${err.exception}, ${err.stackTrace}', + ), ); @override @@ -87,8 +94,10 @@ class CrashlyticsTalkerObserver implements TalkerObserver { if (log.title == TelegramWebSocketLog('').title) { return; } - FirebaseCrashlytics.instance.log( - log.message.toString(), + unawaited( + FirebaseCrashlytics.instance.log( + log.message.toString(), + ), ); } } diff --git a/app/lib/core/provider/log/talker.g.dart b/app/lib/core/provider/log/talker.g.dart index 731c3d2da..5d2c17948 100644 --- a/app/lib/core/provider/log/talker.g.dart +++ b/app/lib/core/provider/log/talker.g.dart @@ -8,7 +8,7 @@ part of 'talker.dart'; // RiverpodGenerator // ************************************************************************** -String _$talkerHash() => r'4509d8da008ccf8ac469ff99e62b8a26328b1cf1'; +String _$talkerHash() => r'd325c49b84b3fee9aa8b793dfed6b5ab8be197ee'; /// See also [talker]. @ProviderFor(talker) @@ -21,6 +21,8 @@ final talkerProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef TalkerRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/map/jma_map_provider.dart b/app/lib/core/provider/map/jma_map_provider.dart index 2030aead1..98ce849c0 100644 --- a/app/lib/core/provider/map/jma_map_provider.dart +++ b/app/lib/core/provider/map/jma_map_provider.dart @@ -1,5 +1,6 @@ import 'package:eqmonitor/gen/assets.gen.dart'; import 'package:flutter/services.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_map/jma_map.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -7,7 +8,7 @@ part 'jma_map_provider.g.dart'; @Riverpod(keepAlive: true) Future>> jmaMap( - JmaMapRef ref, + Ref ref, ) async { final bytes = await rootBundle.load(Assets.jmaMap); final jmaMap = JmaMap.fromBuffer( 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 d48a82636..a07a0d40b 100644 --- a/app/lib/core/provider/map/jma_map_provider.g.dart +++ b/app/lib/core/provider/map/jma_map_provider.g.dart @@ -8,7 +8,7 @@ part of 'jma_map_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$jmaMapHash() => r'161fcbf22085148d21c9b0e2f5a7a6a4fb034a46'; +String _$jmaMapHash() => r'644f26223f787fb02550d62f7d6fd3be6b9039e1'; /// See also [jmaMap]. @ProviderFor(jmaMap) @@ -22,7 +22,9 @@ final jmaMapProvider = FutureProvider< allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef JmaMapRef = FutureProviderRef< Map>>; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/map/map_config.dart b/app/lib/core/provider/map/map_config.dart index d06984d00..ff37f8040 100644 --- a/app/lib/core/provider/map/map_config.dart +++ b/app/lib/core/provider/map/map_config.dart @@ -7,9 +7,9 @@ part 'map_config.g.dart'; @freezed class MapConfig with _$MapConfig { const factory MapConfig({ + required MapColorScheme colorScheme, @Default(0.8) double minScale, @Default(20) double maxScale, - required MapColorScheme colorScheme, }) = _MapConfig; factory MapConfig.fromJson(Map json) => diff --git a/app/lib/core/provider/map/map_config.freezed.dart b/app/lib/core/provider/map/map_config.freezed.dart index f2fecab03..522197de1 100644 --- a/app/lib/core/provider/map/map_config.freezed.dart +++ b/app/lib/core/provider/map/map_config.freezed.dart @@ -20,9 +20,9 @@ MapConfig _$MapConfigFromJson(Map json) { /// @nodoc mixin _$MapConfig { + MapColorScheme get colorScheme => throw _privateConstructorUsedError; double get minScale => throw _privateConstructorUsedError; double get maxScale => throw _privateConstructorUsedError; - MapColorScheme get colorScheme => throw _privateConstructorUsedError; /// Serializes this MapConfig to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -39,7 +39,7 @@ abstract class $MapConfigCopyWith<$Res> { factory $MapConfigCopyWith(MapConfig value, $Res Function(MapConfig) then) = _$MapConfigCopyWithImpl<$Res, MapConfig>; @useResult - $Res call({double minScale, double maxScale, MapColorScheme colorScheme}); + $Res call({MapColorScheme colorScheme, double minScale, double maxScale}); $MapColorSchemeCopyWith<$Res> get colorScheme; } @@ -59,11 +59,15 @@ class _$MapConfigCopyWithImpl<$Res, $Val extends MapConfig> @pragma('vm:prefer-inline') @override $Res call({ + Object? colorScheme = null, Object? minScale = null, Object? maxScale = null, - Object? colorScheme = null, }) { return _then(_value.copyWith( + colorScheme: null == colorScheme + ? _value.colorScheme + : colorScheme // ignore: cast_nullable_to_non_nullable + as MapColorScheme, minScale: null == minScale ? _value.minScale : minScale // ignore: cast_nullable_to_non_nullable @@ -72,10 +76,6 @@ class _$MapConfigCopyWithImpl<$Res, $Val extends MapConfig> ? _value.maxScale : maxScale // ignore: cast_nullable_to_non_nullable as double, - colorScheme: null == colorScheme - ? _value.colorScheme - : colorScheme // ignore: cast_nullable_to_non_nullable - as MapColorScheme, ) as $Val); } @@ -98,7 +98,7 @@ abstract class _$$MapConfigImplCopyWith<$Res> __$$MapConfigImplCopyWithImpl<$Res>; @override @useResult - $Res call({double minScale, double maxScale, MapColorScheme colorScheme}); + $Res call({MapColorScheme colorScheme, double minScale, double maxScale}); @override $MapColorSchemeCopyWith<$Res> get colorScheme; @@ -117,11 +117,15 @@ class __$$MapConfigImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ + Object? colorScheme = null, Object? minScale = null, Object? maxScale = null, - Object? colorScheme = null, }) { return _then(_$MapConfigImpl( + colorScheme: null == colorScheme + ? _value.colorScheme + : colorScheme // ignore: cast_nullable_to_non_nullable + as MapColorScheme, minScale: null == minScale ? _value.minScale : minScale // ignore: cast_nullable_to_non_nullable @@ -130,10 +134,6 @@ class __$$MapConfigImplCopyWithImpl<$Res> ? _value.maxScale : maxScale // ignore: cast_nullable_to_non_nullable as double, - colorScheme: null == colorScheme - ? _value.colorScheme - : colorScheme // ignore: cast_nullable_to_non_nullable - as MapColorScheme, )); } } @@ -142,23 +142,23 @@ class __$$MapConfigImplCopyWithImpl<$Res> @JsonSerializable() class _$MapConfigImpl implements _MapConfig { const _$MapConfigImpl( - {this.minScale = 0.8, this.maxScale = 20, required this.colorScheme}); + {required this.colorScheme, this.minScale = 0.8, this.maxScale = 20}); factory _$MapConfigImpl.fromJson(Map json) => _$$MapConfigImplFromJson(json); + @override + final MapColorScheme colorScheme; @override @JsonKey() final double minScale; @override @JsonKey() final double maxScale; - @override - final MapColorScheme colorScheme; @override String toString() { - return 'MapConfig(minScale: $minScale, maxScale: $maxScale, colorScheme: $colorScheme)'; + return 'MapConfig(colorScheme: $colorScheme, minScale: $minScale, maxScale: $maxScale)'; } @override @@ -166,17 +166,17 @@ class _$MapConfigImpl implements _MapConfig { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MapConfigImpl && + (identical(other.colorScheme, colorScheme) || + other.colorScheme == colorScheme) && (identical(other.minScale, minScale) || other.minScale == minScale) && (identical(other.maxScale, maxScale) || - other.maxScale == maxScale) && - (identical(other.colorScheme, colorScheme) || - other.colorScheme == colorScheme)); + other.maxScale == maxScale)); } @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, minScale, maxScale, colorScheme); + int get hashCode => Object.hash(runtimeType, colorScheme, minScale, maxScale); /// Create a copy of MapConfig /// with the given fields replaced by the non-null parameter values. @@ -196,19 +196,19 @@ class _$MapConfigImpl implements _MapConfig { abstract class _MapConfig implements MapConfig { const factory _MapConfig( - {final double minScale, - final double maxScale, - required final MapColorScheme colorScheme}) = _$MapConfigImpl; + {required final MapColorScheme colorScheme, + final double minScale, + final double maxScale}) = _$MapConfigImpl; factory _MapConfig.fromJson(Map json) = _$MapConfigImpl.fromJson; + @override + MapColorScheme get colorScheme; @override double get minScale; @override double get maxScale; - @override - MapColorScheme get colorScheme; /// Create a copy of MapConfig /// with the given fields replaced by the non-null parameter values. diff --git a/app/lib/core/provider/map/map_config.g.dart b/app/lib/core/provider/map/map_config.g.dart index b55d48b90..5610d77b9 100644 --- a/app/lib/core/provider/map/map_config.g.dart +++ b/app/lib/core/provider/map/map_config.g.dart @@ -14,12 +14,12 @@ _$MapConfigImpl _$$MapConfigImplFromJson(Map json) => json, ($checkedConvert) { final val = _$MapConfigImpl( + colorScheme: $checkedConvert('colorScheme', + (v) => MapColorScheme.fromJson(v as Map)), minScale: $checkedConvert( 'minScale', (v) => (v as num?)?.toDouble() ?? 0.8), maxScale: $checkedConvert('maxScale', (v) => (v as num?)?.toDouble() ?? 20), - colorScheme: $checkedConvert('colorScheme', - (v) => MapColorScheme.fromJson(v as Map)), ); return val; }, @@ -27,9 +27,9 @@ _$MapConfigImpl _$$MapConfigImplFromJson(Map json) => Map _$$MapConfigImplToJson(_$MapConfigImpl instance) => { + 'colorScheme': instance.colorScheme, 'minScale': instance.minScale, 'maxScale': instance.maxScale, - 'colorScheme': instance.colorScheme, }; _$MapColorSchemeImpl _$$MapColorSchemeImplFromJson(Map json) => diff --git a/app/lib/core/provider/map/map_style.dart b/app/lib/core/provider/map/map_style.dart index 42c647dfa..1d42d8860 100644 --- a/app/lib/core/provider/map/map_style.dart +++ b/app/lib/core/provider/map/map_style.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'package:eqmonitor/core/provider/map/map_config.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; import 'package:path_provider/path_provider.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -11,7 +12,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'map_style.g.dart'; @Riverpod(keepAlive: true) -MapStyle mapStyle(MapStyleRef ref) => MapStyle(); +MapStyle mapStyle(Ref ref) => MapStyle(); class MapStyle { Future _saveStyleJson( diff --git a/app/lib/core/provider/map/map_style.g.dart b/app/lib/core/provider/map/map_style.g.dart index 550185c34..931de2e7e 100644 --- a/app/lib/core/provider/map/map_style.g.dart +++ b/app/lib/core/provider/map/map_style.g.dart @@ -8,7 +8,7 @@ part of 'map_style.dart'; // RiverpodGenerator // ************************************************************************** -String _$mapStyleHash() => r'0c91efbd2feb55baabb14a4974da1bc2e8c35b36'; +String _$mapStyleHash() => r'f752aca00d8f0c658435a25af9055a289f505171'; /// See also [mapStyle]. @ProviderFor(mapStyle) @@ -21,6 +21,8 @@ final mapStyleProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef MapStyleRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 3d8544954..56fa58301 100644 --- a/app/lib/core/provider/notification_token.dart +++ b/app/lib/core/provider/notification_token.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:eqmonitor/core/provider/firebase/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'notification_token.freezed.dart'; @@ -10,7 +11,7 @@ part 'notification_token.g.dart'; @riverpod Future notificationToken( - NotificationTokenRef ref, + Ref ref, ) async { if (kIsWeb) { throw UnimplementedError(); diff --git a/app/lib/core/provider/notification_token.g.dart b/app/lib/core/provider/notification_token.g.dart index 8a00ffd44..b53527740 100644 --- a/app/lib/core/provider/notification_token.g.dart +++ b/app/lib/core/provider/notification_token.g.dart @@ -33,7 +33,7 @@ Map _$$NotificationTokenModelImplToJson( // RiverpodGenerator // ************************************************************************** -String _$notificationTokenHash() => r'6b84c736d40b28b63d9d1990f7c36451ccf72195'; +String _$notificationTokenHash() => r'1d7efa28d4e4401069a1a4426fdbbd4b04239c5e'; /// See also [notificationToken]. @ProviderFor(notificationToken) @@ -48,7 +48,9 @@ final notificationTokenProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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_provider.g.dart b/app/lib/core/provider/ntp/ntp_config_provider.g.dart index 2b88c6ede..4da8fb2b1 100644 --- a/app/lib/core/provider/ntp/ntp_config_provider.g.dart +++ b/app/lib/core/provider/ntp/ntp_config_provider.g.dart @@ -23,4 +23,4 @@ final ntpConfigProvider = NotifierProvider.internal( typedef _$NtpConfig = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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_provider.dart b/app/lib/core/provider/ntp/ntp_provider.dart index 364c7effa..599bf2e1d 100644 --- a/app/lib/core/provider/ntp/ntp_provider.dart +++ b/app/lib/core/provider/ntp/ntp_provider.dart @@ -17,9 +17,12 @@ class Ntp extends _$Ntp { final config = ref.watch(ntpConfigProvider); final interval = config.interval; - final timer = Timer.periodic(interval, (_) { - sync(); - }); + final timer = Timer.periodic( + interval, + (_) async { + await sync(); + }, + ); ref.onDispose(timer.cancel); return const NtpStateModel(); diff --git a/app/lib/core/provider/ntp/ntp_provider.g.dart b/app/lib/core/provider/ntp/ntp_provider.g.dart index 00b0bebf1..b2a4295de 100644 --- a/app/lib/core/provider/ntp/ntp_provider.g.dart +++ b/app/lib/core/provider/ntp/ntp_provider.g.dart @@ -8,7 +8,7 @@ part of 'ntp_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$ntpHash() => r'622504fb560a5a31ad58f4b6fa8bb111db74cb05'; +String _$ntpHash() => r'0a1145a034623030daec27689364f213540ecf79'; /// See also [Ntp]. @ProviderFor(Ntp) @@ -23,4 +23,4 @@ final ntpProvider = NotifierProvider.internal( typedef _$Ntp = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/package_info.dart b/app/lib/core/provider/package_info.dart index 708fa4239..e558a2014 100644 --- a/app/lib/core/provider/package_info.dart +++ b/app/lib/core/provider/package_info.dart @@ -1,7 +1,8 @@ +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'package_info.g.dart'; @Riverpod(keepAlive: true) -PackageInfo packageInfo(PackageInfoRef ref) => throw UnimplementedError(); +PackageInfo packageInfo(Ref ref) => throw UnimplementedError(); diff --git a/app/lib/core/provider/package_info.g.dart b/app/lib/core/provider/package_info.g.dart index 08b40d353..739cb3cb7 100644 --- a/app/lib/core/provider/package_info.g.dart +++ b/app/lib/core/provider/package_info.g.dart @@ -8,7 +8,7 @@ part of 'package_info.dart'; // RiverpodGenerator // ************************************************************************** -String _$packageInfoHash() => r'517f01fbab81b5ebd10a5d03633b9ffaee13310a'; +String _$packageInfoHash() => r'41becc3addedc53e378ee1d1462ccfd8ccf6cce1'; /// See also [packageInfo]. @ProviderFor(packageInfo) @@ -21,6 +21,8 @@ final packageInfoProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef PackageInfoRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 cf9c9f1b3..551c502d0 100644 --- a/app/lib/core/provider/secure_storage.dart +++ b/app/lib/core/provider/secure_storage.dart @@ -1,10 +1,11 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'secure_storage.g.dart'; @Riverpod(keepAlive: true) -FlutterSecureStorage secureStorage(SecureStorageRef ref) => +FlutterSecureStorage secureStorage(Ref ref) => const FlutterSecureStorage( aOptions: AndroidOptions( resetOnError: true, diff --git a/app/lib/core/provider/secure_storage.g.dart b/app/lib/core/provider/secure_storage.g.dart index 22e81bfa5..4af58ac92 100644 --- a/app/lib/core/provider/secure_storage.g.dart +++ b/app/lib/core/provider/secure_storage.g.dart @@ -8,7 +8,7 @@ part of 'secure_storage.dart'; // RiverpodGenerator // ************************************************************************** -String _$secureStorageHash() => r'0eea8870671934e93a6ec21257140504fa3254a3'; +String _$secureStorageHash() => r'e9fc957f66ce98042ac32ef37cbcd216a7323cd6'; /// See also [secureStorage]. @ProviderFor(secureStorage) @@ -22,6 +22,8 @@ final secureStorageProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef SecureStorageRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/shared_preferences.dart b/app/lib/core/provider/shared_preferences.dart index 8cad256c8..459d6d610 100644 --- a/app/lib/core/provider/shared_preferences.dart +++ b/app/lib/core/provider/shared_preferences.dart @@ -1,8 +1,9 @@ +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:shared_preferences/shared_preferences.dart'; part 'shared_preferences.g.dart'; @Riverpod(keepAlive: true) -SharedPreferences sharedPreferences(SharedPreferencesRef ref) => +SharedPreferences sharedPreferences(Ref ref) => throw UnimplementedError(); diff --git a/app/lib/core/provider/shared_preferences.g.dart b/app/lib/core/provider/shared_preferences.g.dart index 666f4e9bb..a21cbc393 100644 --- a/app/lib/core/provider/shared_preferences.g.dart +++ b/app/lib/core/provider/shared_preferences.g.dart @@ -8,7 +8,7 @@ part of 'shared_preferences.dart'; // RiverpodGenerator // ************************************************************************** -String _$sharedPreferencesHash() => r'75e745127707e465d3f55ce89ddcc932bd72bc2d'; +String _$sharedPreferencesHash() => r'6bbc55d4dc38d5979ff916112845bcc4a4a3a1ea'; /// See also [sharedPreferences]. @ProviderFor(sharedPreferences) @@ -22,6 +22,8 @@ final sharedPreferencesProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef SharedPreferencesRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/telegram_url/provider/telegram_url_provider.g.dart b/app/lib/core/provider/telegram_url/provider/telegram_url_provider.g.dart index f148c0883..e6f2eec12 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 @@ -24,4 +24,4 @@ final telegramUrlProvider = typedef _$TelegramUrl = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/time_ticker.dart b/app/lib/core/provider/time_ticker.dart index fd013a095..09598a87c 100644 --- a/app/lib/core/provider/time_ticker.dart +++ b/app/lib/core/provider/time_ticker.dart @@ -1,7 +1,8 @@ +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'time_ticker.g.dart'; @Riverpod(keepAlive: true) -Stream timeTicker(TimeTickerRef ref) => +Stream timeTicker(Ref ref) => Stream.periodic(const Duration(seconds: 1), (_) => DateTime.now()); diff --git a/app/lib/core/provider/time_ticker.g.dart b/app/lib/core/provider/time_ticker.g.dart index bea97dc0f..4badbdf90 100644 --- a/app/lib/core/provider/time_ticker.g.dart +++ b/app/lib/core/provider/time_ticker.g.dart @@ -8,7 +8,7 @@ part of 'time_ticker.dart'; // RiverpodGenerator // ************************************************************************** -String _$timeTickerHash() => r'044c3a83021e23d21f28147fc9676a6dd92b87c2'; +String _$timeTickerHash() => r'b1e4f0bdc4174efb4e7d7f31e5d94d54a9ef1dc8'; /// See also [timeTicker]. @ProviderFor(timeTicker) @@ -21,6 +21,8 @@ final timeTickerProvider = StreamProvider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef TimeTickerRef = StreamProviderRef; // ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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.dart b/app/lib/core/provider/travel_time/data/travel_time_data_source.dart index 90c652b52..39af6e1f2 100644 --- a/app/lib/core/provider/travel_time/data/travel_time_data_source.dart +++ b/app/lib/core/provider/travel_time/data/travel_time_data_source.dart @@ -1,11 +1,12 @@ import 'package:eqmonitor/core/provider/travel_time/model/travel_time_table.dart'; import 'package:flutter/services.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'travel_time_data_source.g.dart'; @Riverpod(keepAlive: true) -TravelTimeDataSource travelTimeDataSource(TravelTimeDataSourceRef ref) => +TravelTimeDataSource travelTimeDataSource(Ref ref) => TravelTimeDataSource(); class TravelTimeDataSource { 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 a2677049a..247e6a232 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 @@ -9,7 +9,7 @@ part of 'travel_time_data_source.dart'; // ************************************************************************** String _$travelTimeDataSourceHash() => - r'c9ec60861967354ad1ad846a20ed561ac921c36d'; + r'0672ad590917e5110439b14dfb400d5652082d8f'; /// See also [travelTimeDataSource]. @ProviderFor(travelTimeDataSource) @@ -23,6 +23,8 @@ final travelTimeDataSourceProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef TravelTimeDataSourceRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/provider/travel_time_provider.dart b/app/lib/core/provider/travel_time/provider/travel_time_provider.dart index f681522bd..a02a6bbee 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 @@ -2,19 +2,20 @@ import 'package:collection/collection.dart'; import 'package:eqmonitor/core/provider/travel_time/data/travel_time_data_source.dart'; import 'package:eqmonitor/core/provider/travel_time/model/travel_time_table.dart'; import 'package:extensions/extensions.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'travel_time_provider.g.dart'; @Riverpod(keepAlive: true) -Future travelTime(TravelTimeRef ref) async { +Future travelTime(Ref ref) async { final dataSource = ref.watch(travelTimeDataSourceProvider); return TravelTimeTables(table: await dataSource.loadTables()); } @Riverpod(keepAlive: true) Future travelTimeDepthMap( - TravelTimeDepthMapRef ref, + Ref ref, ) async { final state = await ref.watch(travelTimeProvider.future); 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 1e5be238f..6ea8209df 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,7 +8,7 @@ part of 'travel_time_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$travelTimeHash() => r'b309b731b7ecb63f9896067485571d5e34249361'; +String _$travelTimeHash() => r'390c9a0aec373a40dec642325d1da143ea74862a'; /// See also [travelTime]. @ProviderFor(travelTime) @@ -21,9 +21,11 @@ final travelTimeProvider = FutureProvider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef TravelTimeRef = FutureProviderRef; String _$travelTimeDepthMapHash() => - r'4eef1655bcfc042cf7169446012c0cc0049c386b'; + r'371546dc657fab0f9a010710f05044931d62b973'; /// See also [travelTimeDepthMap]. @ProviderFor(travelTimeDepthMap) @@ -37,6 +39,8 @@ final travelTimeDepthMapProvider = FutureProvider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef TravelTimeDepthMapRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/websocket/websocket_provider.dart b/app/lib/core/provider/websocket/websocket_provider.dart index e16fb11ab..0a418e1a2 100644 --- a/app/lib/core/provider/websocket/websocket_provider.dart +++ b/app/lib/core/provider/websocket/websocket_provider.dart @@ -9,13 +9,14 @@ import 'package:eqmonitor/core/provider/app_lifecycle.dart'; import 'package:eqmonitor/core/provider/log/talker.dart'; import 'package:eqmonitor/core/provider/telegram_url/provider/telegram_url_provider.dart'; import 'package:eqmonitor/env/env.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:web_socket_client/web_socket_client.dart'; part 'websocket_provider.g.dart'; @Riverpod(keepAlive: true) -WebSocket websocket(WebsocketRef ref) { +WebSocket websocket(Ref ref) { final apiUrl = ref.watch(telegramUrlProvider.select((v) => v.wsApiUrl)); final uri = Uri.parse(apiUrl); final backoff = BinaryExponentialBackoff( @@ -34,7 +35,7 @@ WebSocket websocket(WebsocketRef ref) { ..onDispose(() { socket.close(1000, 'Connection closed'); }) - ..listen(appLifeCycleProvider, (_, next) { + ..listen(appLifecycleProvider, (_, next) { // backgroundになったら接続を閉じる if (next == AppLifecycleState.paused) { socket.close(1000, 'Connection closed'); @@ -94,7 +95,7 @@ class WebsocketMessages extends _$WebsocketMessages { @Riverpod(keepAlive: true) Stream websocketParsedMessages( - WebsocketParsedMessagesRef ref, + Ref ref, ) { final controller = StreamController(); ref @@ -111,23 +112,19 @@ Stream websocketParsedMessages( } @Riverpod(keepAlive: true) -Stream> - websocketTableMessages( - WebsocketTableMessagesRef ref, +Stream websocketTableMessages( + Ref ref, ) { - final controller = StreamController>(); + final controller = StreamController(); ref ..listen(websocketParsedMessagesProvider, (previous, next) { final value = next.value; if (value == null || next.isLoading) { return; } - final _ = switch (value) { - RealtimePostgresInsertPayload() => controller.add(value), - RealtimePostgresUpdatePayload() => controller.add(value), - RealtimePostgresDeletePayload() => controller.add(value), - _ => null, - }; + if (value is RealtimePostgresChangesPayloadTable) { + controller.add(value); + } }) ..onDispose(controller.close); return controller.stream; diff --git a/app/lib/core/provider/websocket/websocket_provider.g.dart b/app/lib/core/provider/websocket/websocket_provider.g.dart index 67fcf8bb7..688a6e706 100644 --- a/app/lib/core/provider/websocket/websocket_provider.g.dart +++ b/app/lib/core/provider/websocket/websocket_provider.g.dart @@ -8,7 +8,7 @@ part of 'websocket_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$websocketHash() => r'713cd86acd6c99ea37b035179cad5d756335c0ea'; +String _$websocketHash() => r'cb3408b7a0df5a6b8c4cbe5c07a567970771172a'; /// See also [websocket]. @ProviderFor(websocket) @@ -21,9 +21,11 @@ final websocketProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef WebsocketRef = ProviderRef; String _$websocketParsedMessagesHash() => - r'5a18e83f5c10c6e092adcc0cae8350271f028a71'; + r'e0d6a3353d45285f1e3b9489636a6d022eb9be1f'; /// See also [websocketParsedMessages]. @ProviderFor(websocketParsedMessages) @@ -38,192 +40,30 @@ final websocketParsedMessagesProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef WebsocketParsedMessagesRef = StreamProviderRef; String _$websocketTableMessagesHash() => - r'0a9ac03d694b8afd31b1fc8bb975921002df0c63'; - -/// 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)); - } -} + r'53916279b0c281a63156b8900900605a867bea1c'; /// See also [websocketTableMessages]. @ProviderFor(websocketTableMessages) -const websocketTableMessagesProvider = WebsocketTableMessagesFamily(); - -/// See also [websocketTableMessages]. -class WebsocketTableMessagesFamily extends Family { - /// See also [websocketTableMessages]. - const WebsocketTableMessagesFamily(); - - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'websocketTableMessagesProvider'; - - /// See also [websocketTableMessages]. - WebsocketTableMessagesProvider call() { - return WebsocketTableMessagesProvider(); - } - - @visibleForOverriding - @override - WebsocketTableMessagesProvider getProviderOverride( - covariant WebsocketTableMessagesProvider provider, - ) { - return call(); - } - - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith( - Stream> - Function(WebsocketTableMessagesRef ref) - create) { - return _$WebsocketTableMessagesFamilyOverride(this, create); - } -} - -class _$WebsocketTableMessagesFamilyOverride implements FamilyOverride { - _$WebsocketTableMessagesFamilyOverride(this.overriddenFamily, this.create); - - final Stream> - Function(WebsocketTableMessagesRef ref) create; - - @override - final WebsocketTableMessagesFamily overriddenFamily; - - @override - WebsocketTableMessagesProvider getProviderOverride( - covariant WebsocketTableMessagesProvider provider, - ) { - return provider._copyWith(create); - } -} - -/// See also [websocketTableMessages]. -class WebsocketTableMessagesProvider - extends StreamProvider> { - /// See also [websocketTableMessages]. - WebsocketTableMessagesProvider() - : this._internal( - (ref) => websocketTableMessages( - ref as WebsocketTableMessagesRef, - ), - from: websocketTableMessagesProvider, - name: r'websocketTableMessagesProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$websocketTableMessagesHash, - dependencies: WebsocketTableMessagesFamily._dependencies, - allTransitiveDependencies: - WebsocketTableMessagesFamily._allTransitiveDependencies, - ); - - WebsocketTableMessagesProvider._internal( - super.create, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - }) : super.internal(); - - @override - Override overrideWith( - Stream> Function( - WebsocketTableMessagesRef ref) - create, - ) { - return ProviderOverride( - origin: this, - override: WebsocketTableMessagesProvider._internal( - (ref) => create(ref as WebsocketTableMessagesRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - ), - ); - } - - @override - () get argument { - return (); - } - - @override - StreamProviderElement> - createElement() { - return _WebsocketTableMessagesProviderElement(this); - } - - WebsocketTableMessagesProvider _copyWith( - Stream> - Function(WebsocketTableMessagesRef ref) - create, - ) { - return WebsocketTableMessagesProvider._internal( - (ref) => create(ref as WebsocketTableMessagesRef), - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - ); - } - - @override - bool operator ==(Object other) { - return other is WebsocketTableMessagesProvider && - other.runtimeType == runtimeType; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, T.hashCode); - - return _SystemHash.finish(hash); - } -} - -mixin WebsocketTableMessagesRef - on StreamProviderRef> {} - -class _WebsocketTableMessagesProviderElement - extends StreamProviderElement> - with WebsocketTableMessagesRef { - _WebsocketTableMessagesProviderElement(super.provider); -} +final websocketTableMessagesProvider = + StreamProvider.internal( + 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; String _$websocketStatusHash() => r'b02f3b5f4e952453120dd81fd92ee33911fd6bda'; /// See also [WebsocketStatus]. @@ -257,4 +97,4 @@ final websocketMessagesProvider = typedef _$WebsocketMessages = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/router/router.dart b/app/lib/core/router/router.dart index a211de566..7a143192b 100644 --- a/app/lib/core/router/router.dart +++ b/app/lib/core/router/router.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/app.dart'; import 'package:eqmonitor/core/provider/debugger/debugger_provider.dart'; @@ -43,7 +45,7 @@ part 'router.g.dart'; final isInitializedStateProvider = StateProvider((ref) => false); @Riverpod(keepAlive: true) -GoRouter goRouter(GoRouterRef ref) => GoRouter( +GoRouter goRouter(Ref ref) => GoRouter( routes: $appRoutes, navigatorKey: App.navigatorKey, initialLocation: @@ -395,8 +397,10 @@ class _NavigatorObserver extends NavigatorObserver { if (kIsWeb) { return; } - 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 7b2f81e23..ea20b61b4 100644 --- a/app/lib/core/router/router.g.dart +++ b/app/lib/core/router/router.g.dart @@ -670,7 +670,7 @@ bool _$boolConverter(String value) { // RiverpodGenerator // ************************************************************************** -String _$goRouterHash() => r'a7cd95377d5ff1f764cfb89abde896f1176007ce'; +String _$goRouterHash() => r'cbbe17fc25f9ec41badc7b58e131c077e09d7df0'; /// See also [goRouter]. @ProviderFor(goRouter) @@ -683,6 +683,8 @@ final goRouterProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef GoRouterRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/theme/build_theme.dart b/app/lib/core/theme/build_theme.dart index ca4fca6fe..281ef3e65 100644 --- a/app/lib/core/theme/build_theme.dart +++ b/app/lib/core/theme/build_theme.dart @@ -14,7 +14,8 @@ ThemeData buildTheme({ fontFamily: FontFamily.notoSansJP, pageTransitionsTheme: const PageTransitionsTheme( builders: { - // MEMO(YumNumm): PredictiveBackを使うと、MediaQuery.sizeOf(context)の値が変わるので無効 + // MEMO(YumNumm): PredictiveBackを使うと、 + // MediaQuery.sizeOf(context)の値が変わるので無効 // TargetPlatform.android: PredictiveBackPageTransitionsBuilder(), }, ), diff --git a/app/lib/core/theme/platform_brightness.g.dart b/app/lib/core/theme/platform_brightness.g.dart index 7ad2308d1..afd2d9177 100644 --- a/app/lib/core/theme/platform_brightness.g.dart +++ b/app/lib/core/theme/platform_brightness.g.dart @@ -26,4 +26,4 @@ final platformBrightnessProvider = typedef _$PlatformBrightness = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/theme/theme_provider.dart b/app/lib/core/theme/theme_provider.dart index d115ab777..5125f6839 100644 --- a/app/lib/core/theme/theme_provider.dart +++ b/app/lib/core/theme/theme_provider.dart @@ -16,9 +16,9 @@ class ThemeModeNotifier extends _$ThemeModeNotifier { return ThemeMode.system; } - void update(ThemeMode mode) { + Future update(ThemeMode mode) async { state = mode; - ref.read(sharedPreferencesProvider).setString(_prefsKey, mode.name); + await ref.read(sharedPreferencesProvider).setString(_prefsKey, mode.name); } ThemeMode? _load() { diff --git a/app/lib/core/theme/theme_provider.g.dart b/app/lib/core/theme/theme_provider.g.dart index 5df14b2c7..24f54e8cb 100644 --- a/app/lib/core/theme/theme_provider.g.dart +++ b/app/lib/core/theme/theme_provider.g.dart @@ -8,7 +8,7 @@ part of 'theme_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$themeModeNotifierHash() => r'8a4b1640f25e4b8e64757138da1600737fa38bce'; +String _$themeModeNotifierHash() => r'fc896b63bda7ea9e58659851b10234f4074bab94'; /// See also [ThemeModeNotifier]. @ProviderFor(ThemeModeNotifier) @@ -25,4 +25,4 @@ final themeModeNotifierProvider = typedef _$ThemeModeNotifier = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/data/donation_notifier.dart b/app/lib/feature/donation/data/donation_notifier.dart index c644e0872..3bfb2509e 100644 --- a/app/lib/feature/donation/data/donation_notifier.dart +++ b/app/lib/feature/donation/data/donation_notifier.dart @@ -1,4 +1,5 @@ import 'package:flutter/foundation.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:purchases_flutter/purchases_flutter.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -24,13 +25,13 @@ Future initInAppPurchase() async { } @Riverpod(keepAlive: true) -Future> products(ProductsRef ref) => Purchases.getProducts( +Future> products(Ref ref) => Purchases.getProducts( Products.values.map((e) => e.id).toList(), productCategory: ProductCategory.nonSubscription, ); @riverpod -Future purchase(PurchaseRef ref, StoreProduct product) => +Future purchase(Ref ref, StoreProduct product) => Purchases.purchaseStoreProduct(product); enum Products { diff --git a/app/lib/feature/donation/data/donation_notifier.g.dart b/app/lib/feature/donation/data/donation_notifier.g.dart index 60b754347..8d99e2f3e 100644 --- a/app/lib/feature/donation/data/donation_notifier.g.dart +++ b/app/lib/feature/donation/data/donation_notifier.g.dart @@ -8,7 +8,7 @@ part of 'donation_notifier.dart'; // RiverpodGenerator // ************************************************************************** -String _$productsHash() => r'c5e9bf5181fb57002ab4984e1c00bcdd63f3af6c'; +String _$productsHash() => r'0580a85a0955da5812cf32d6ad08d86940b1ffd5'; /// See also [products]. @ProviderFor(products) @@ -21,8 +21,10 @@ final productsProvider = FutureProvider>.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef ProductsRef = FutureProviderRef>; -String _$purchaseHash() => r'266039065a829b3a6940455e8aa1dcf4627790c8'; +String _$purchaseHash() => r'9937f03b7541e1c598c164216e7a7ce9dd2ea4d7'; /// Copied from Dart SDK class _SystemHash { @@ -50,24 +52,10 @@ class _SystemHash { const purchaseProvider = PurchaseFamily(); /// See also [purchase]. -class PurchaseFamily extends Family { +class PurchaseFamily extends Family> { /// See also [purchase]. const PurchaseFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'purchaseProvider'; - /// See also [purchase]. PurchaseProvider call( StoreProduct product, @@ -77,7 +65,6 @@ class PurchaseFamily extends Family { ); } - @visibleForOverriding @override PurchaseProvider getProviderOverride( covariant PurchaseProvider provider, @@ -87,27 +74,19 @@ class PurchaseFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith( - FutureOr Function(PurchaseRef ref) create) { - return _$PurchaseFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$PurchaseFamilyOverride implements FamilyOverride { - _$PurchaseFamilyOverride(this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final FutureOr Function(PurchaseRef ref) create; + static const Iterable? _allTransitiveDependencies = null; @override - final PurchaseFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - PurchaseProvider getProviderOverride( - covariant PurchaseProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'purchaseProvider'; } /// See also [purchase]. @@ -132,7 +111,7 @@ class PurchaseProvider extends AutoDisposeFutureProvider { ); PurchaseProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -145,7 +124,7 @@ class PurchaseProvider extends AutoDisposeFutureProvider { @override Override overrideWith( - FutureOr Function(PurchaseRef ref) create, + FutureOr Function(PurchaseRef provider) create, ) { return ProviderOverride( origin: this, @@ -161,30 +140,11 @@ class PurchaseProvider extends AutoDisposeFutureProvider { ); } - @override - (StoreProduct,) get argument { - return (product,); - } - @override AutoDisposeFutureProviderElement createElement() { return _PurchaseProviderElement(this); } - PurchaseProvider _copyWith( - FutureOr Function(PurchaseRef ref) create, - ) { - return PurchaseProvider._internal( - (ref) => create(ref as PurchaseRef), - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - product: product, - ); - } - @override bool operator ==(Object other) { return other is PurchaseProvider && other.product == product; @@ -199,6 +159,8 @@ class PurchaseProvider extends AutoDisposeFutureProvider { } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin PurchaseRef on AutoDisposeFutureProviderRef { /// The parameter `product` of this provider. StoreProduct get product; @@ -212,4 +174,4 @@ class _PurchaseProviderElement 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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_executed_screen.dart b/app/lib/feature/donation/ui/donation_executed_screen.dart index e9d59d86b..7cf91779c 100644 --- a/app/lib/feature/donation/ui/donation_executed_screen.dart +++ b/app/lib/feature/donation/ui/donation_executed_screen.dart @@ -84,7 +84,8 @@ class DonationExecutedScreen extends HookConsumerWidget { ActionButton.text( context: context, text: 'アプリストアでレビューを書く', - onPressed: () => InAppReview.instance.openStoreListing( + onPressed: () async => + InAppReview.instance.openStoreListing( appStoreId: '6447546703', ), ), @@ -190,7 +191,7 @@ class _ScrollView extends StatelessWidget { color: Colors.blue.shade400, ), recognizer: TapGestureRecognizer() - ..onTap = () => launchUrlString( + ..onTap = () async => launchUrlString( 'https://twitter.com/$account', ), ), 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 191849a73..52695d41c 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_notifier.dart @@ -13,6 +13,7 @@ import 'package:eqmonitor/feature/earthquake_history/data/model/earthquake_v1_ex import 'package:eqmonitor/feature/earthquake_history_details/data/earthquake_history_details_notifier.dart'; import 'package:extensions/extensions.dart'; import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_parameter_api_client/jma_parameter_api_client.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:web_socket_client/web_socket_client.dart'; @@ -47,7 +48,7 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { // アプリがバックグラウンドからフォアグラウンドに戻った際にデータを再取得する ..listen( - appLifeCycleProvider, + appLifecycleProvider, (_, next) async { if (next == AppLifecycleState.resumed) { await _onResumed(); @@ -56,9 +57,12 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { ) // WebSocketからのデータを適用する ..listen( - websocketTableMessagesProvider(), + websocketTableMessagesProvider, (_, next) { if (next case AsyncData(value: final value)) { + if (value is! RealtimePostgresChangesPayloadTable) { + return; + } final _ = switch (value) { RealtimePostgresInsertPayload(:final newData) => _upsertEarthquakeV1s([newData]), @@ -309,7 +313,7 @@ class EarthquakeHistoryNotifier extends _$EarthquakeHistoryNotifier { @riverpod Future earthquakeV1Extended( - EarthquakeV1ExtendedRef ref, + Ref ref, EarthquakeV1 data, ) async { // ensure earthquakeParameter has been initialized. 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 c18530a63..de102187d 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 @@ -9,7 +9,7 @@ part of 'earthquake_history_notifier.dart'; // ************************************************************************** String _$earthquakeV1ExtendedHash() => - r'0e75d744275dd72ce35fa905707e3b3c9758308d'; + r'6059e33aa04e55267335423e23fb56b95f7c2238'; /// Copied from Dart SDK class _SystemHash { @@ -37,24 +37,11 @@ class _SystemHash { const earthquakeV1ExtendedProvider = EarthquakeV1ExtendedFamily(); /// See also [earthquakeV1Extended]. -class EarthquakeV1ExtendedFamily extends Family { +class EarthquakeV1ExtendedFamily + extends Family> { /// See also [earthquakeV1Extended]. const EarthquakeV1ExtendedFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'earthquakeV1ExtendedProvider'; - /// See also [earthquakeV1Extended]. EarthquakeV1ExtendedProvider call( EarthquakeV1 data, @@ -64,7 +51,6 @@ class EarthquakeV1ExtendedFamily extends Family { ); } - @visibleForOverriding @override EarthquakeV1ExtendedProvider getProviderOverride( covariant EarthquakeV1ExtendedProvider provider, @@ -74,29 +60,19 @@ class EarthquakeV1ExtendedFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith( - FutureOr Function(EarthquakeV1ExtendedRef ref) - create) { - return _$EarthquakeV1ExtendedFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$EarthquakeV1ExtendedFamilyOverride implements FamilyOverride { - _$EarthquakeV1ExtendedFamilyOverride(this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final FutureOr Function(EarthquakeV1ExtendedRef ref) - create; + static const Iterable? _allTransitiveDependencies = null; @override - final EarthquakeV1ExtendedFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - EarthquakeV1ExtendedProvider getProviderOverride( - covariant EarthquakeV1ExtendedProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'earthquakeV1ExtendedProvider'; } /// See also [earthquakeV1Extended]. @@ -123,7 +99,7 @@ class EarthquakeV1ExtendedProvider ); EarthquakeV1ExtendedProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -136,7 +112,8 @@ class EarthquakeV1ExtendedProvider @override Override overrideWith( - FutureOr Function(EarthquakeV1ExtendedRef ref) create, + FutureOr Function(EarthquakeV1ExtendedRef provider) + create, ) { return ProviderOverride( origin: this, @@ -152,30 +129,11 @@ class EarthquakeV1ExtendedProvider ); } - @override - (EarthquakeV1,) get argument { - return (data,); - } - @override AutoDisposeFutureProviderElement createElement() { return _EarthquakeV1ExtendedProviderElement(this); } - EarthquakeV1ExtendedProvider _copyWith( - FutureOr Function(EarthquakeV1ExtendedRef ref) create, - ) { - return EarthquakeV1ExtendedProvider._internal( - (ref) => create(ref as EarthquakeV1ExtendedRef), - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - data: data, - ); - } - @override bool operator ==(Object other) { return other is EarthquakeV1ExtendedProvider && other.data == data; @@ -190,6 +148,8 @@ class EarthquakeV1ExtendedProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin EarthquakeV1ExtendedRef on AutoDisposeFutureProviderRef { /// The parameter `data` of this provider. @@ -206,7 +166,7 @@ class _EarthquakeV1ExtendedProviderElement } String _$earthquakeHistoryNotifierHash() => - r'4c689cd77494fde61fc62deba390d4f3e0d3dbe9'; + r'7c78143baf759149f9630d3a62d706d4b0239041'; abstract class _$EarthquakeHistoryNotifier extends BuildlessAutoDisposeAsyncNotifier { @@ -222,24 +182,11 @@ abstract class _$EarthquakeHistoryNotifier const earthquakeHistoryNotifierProvider = EarthquakeHistoryNotifierFamily(); /// See also [EarthquakeHistoryNotifier]. -class EarthquakeHistoryNotifierFamily extends Family { +class EarthquakeHistoryNotifierFamily + extends Family> { /// See also [EarthquakeHistoryNotifier]. const EarthquakeHistoryNotifierFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'earthquakeHistoryNotifierProvider'; - /// See also [EarthquakeHistoryNotifier]. EarthquakeHistoryNotifierProvider call( EarthquakeHistoryParameter parameter, @@ -249,7 +196,6 @@ class EarthquakeHistoryNotifierFamily extends Family { ); } - @visibleForOverriding @override EarthquakeHistoryNotifierProvider getProviderOverride( covariant EarthquakeHistoryNotifierProvider provider, @@ -259,26 +205,19 @@ class EarthquakeHistoryNotifierFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith(EarthquakeHistoryNotifier Function() create) { - return _$EarthquakeHistoryNotifierFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$EarthquakeHistoryNotifierFamilyOverride implements FamilyOverride { - _$EarthquakeHistoryNotifierFamilyOverride(this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final EarthquakeHistoryNotifier Function() create; + static const Iterable? _allTransitiveDependencies = null; @override - final EarthquakeHistoryNotifierFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - EarthquakeHistoryNotifierProvider getProviderOverride( - covariant EarthquakeHistoryNotifierProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'earthquakeHistoryNotifierProvider'; } /// See also [EarthquakeHistoryNotifier]. @@ -303,7 +242,7 @@ class EarthquakeHistoryNotifierProvider ); EarthquakeHistoryNotifierProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -339,31 +278,12 @@ class EarthquakeHistoryNotifierProvider ); } - @override - (EarthquakeHistoryParameter,) get argument { - return (parameter,); - } - @override AutoDisposeAsyncNotifierProviderElement createElement() { return _EarthquakeHistoryNotifierProviderElement(this); } - EarthquakeHistoryNotifierProvider _copyWith( - EarthquakeHistoryNotifier Function() create, - ) { - return EarthquakeHistoryNotifierProvider._internal( - () => create()..parameter = parameter, - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - parameter: parameter, - ); - } - @override bool operator ==(Object other) { return other is EarthquakeHistoryNotifierProvider && @@ -379,6 +299,8 @@ class EarthquakeHistoryNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin EarthquakeHistoryNotifierRef on AutoDisposeAsyncNotifierProviderRef { /// The parameter `parameter` of this provider. @@ -395,4 +317,4 @@ class _EarthquakeHistoryNotifierProviderElement (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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 9bb2930da..ae1c62372 100644 --- a/app/lib/feature/earthquake_history/data/earthquake_history_repository.dart +++ b/app/lib/feature/earthquake_history/data/earthquake_history_repository.dart @@ -1,13 +1,14 @@ import 'package:eqapi_client/eqapi_client.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_repository.g.dart'; @Riverpod(keepAlive: true) EarthquakeHistoryRepository earthquakeHistoryRepository( - EarthquakeHistoryRepositoryRef ref, + Ref ref, ) => EarthquakeHistoryRepository( api: ref.watch(eqApiProvider), 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 2de6152d7..010f77efd 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 @@ -9,7 +9,7 @@ part of 'earthquake_history_repository.dart'; // ************************************************************************** String _$earthquakeHistoryRepositoryHash() => - r'2c1683da85d12acccacadadaf8d2c4b7f21ab843'; + r'8334b94379f200439f3674d3213767e575237279'; /// See also [earthquakeHistoryRepository]. @ProviderFor(earthquakeHistoryRepository) @@ -24,7 +24,9 @@ final earthquakeHistoryRepositoryProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/ui/components/earthquake_history_not_found.dart b/app/lib/feature/earthquake_history/ui/components/earthquake_history_not_found.dart index 42a3af5d2..ab546e141 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 @@ -31,7 +31,7 @@ class EarthquakeHistoryNotFound extends StatelessWidget { ), const SizedBox(height: 4), FilledButton( - onPressed: () => + onPressed: () async => const EarthquakeHistoryEarlyRoute().push(context), child: const Text('震度データベース'), ), @@ -70,7 +70,7 @@ class EarthquakeHistoryAllFetched extends StatelessWidget { ), const SizedBox(height: 4), FilledButton( - onPressed: () => + onPressed: () async => const EarthquakeHistoryEarlyRoute().push(context), child: const Text('震度データベース'), ), diff --git a/app/lib/feature/earthquake_history_details/component/bar_sheet.dart b/app/lib/feature/earthquake_history_details/component/bar_sheet.dart index 6139714d7..0f35cfd3c 100644 --- a/app/lib/feature/earthquake_history_details/component/bar_sheet.dart +++ b/app/lib/feature/earthquake_history_details/component/bar_sheet.dart @@ -5,8 +5,8 @@ const Radius _defaultBarTopRadius = Radius.circular(15); class BarBottomSheet extends StatelessWidget { const BarBottomSheet({ - super.key, required this.child, + super.key, this.control, this.clipBehavior, this.shape, @@ -79,7 +79,7 @@ class BarSheetRoute extends SheetRoute { Widget? topControl, super.duration, }) : super( - builder: (BuildContext context) { + builder: (context) { return BarBottomSheet( control: topControl, clipBehavior: clipBehavior, diff --git a/app/lib/feature/earthquake_history_details/component/earthquake_hypo_info_widget.dart b/app/lib/feature/earthquake_history_details/component/earthquake_hypo_info_widget.dart index bb5926683..38d905021 100644 --- a/app/lib/feature/earthquake_history_details/component/earthquake_hypo_info_widget.dart +++ b/app/lib/feature/earthquake_history_details/component/earthquake_hypo_info_widget.dart @@ -17,8 +17,8 @@ import 'package:intl/intl.dart'; class EarthquakeHypoInfoWidget extends HookConsumerWidget { const EarthquakeHypoInfoWidget({ - super.key, required this.item, + super.key, }); final EarthquakeV1Extended item; diff --git a/app/lib/feature/earthquake_history_details/component/earthquake_map.dart b/app/lib/feature/earthquake_history_details/component/earthquake_map.dart index de9eaf1ad..73089850e 100644 --- a/app/lib/feature/earthquake_history_details/component/earthquake_map.dart +++ b/app/lib/feature/earthquake_history_details/component/earthquake_map.dart @@ -86,8 +86,9 @@ class EarthquakeMapWidget extends HookConsumerWidget { final mapStyle = ref.watch(mapStyleProvider); final isDark = Theme.of(context).brightness == Brightness.dark; + // ignore: discarded_futures final styleJsonFutureing = useMemoized( - () => mapStyle.getStyle( + () async => mapStyle.getStyle( isDark: isDark, scheme: Theme.of(context).colorScheme, ), @@ -113,8 +114,9 @@ class EarthquakeMapWidget extends HookConsumerWidget { ); } + // ignore: discarded_futures final itemCalculateFutureing = useMemoized( - () { + () async { return _compute(colorModel, item, earthquakeParams); }, [colorModel, item, earthquakeParams], @@ -271,9 +273,9 @@ class EarthquakeMapWidget extends HookConsumerWidget { if (ref.watch(kmoniSettingsProvider).showCurrentLocationMarker) { ref.listen( locationStreamProvider, - (_, next) { + (_, next) async { if (next case AsyncData(:final value)) { - currentLocationService.update( + await currentLocationService.update( mapController.value!, (value.latitude, value.longitude), ); @@ -306,26 +308,28 @@ class EarthquakeMapWidget extends HookConsumerWidget { useEffect( () { - WidgetsBinding.instance.endOfFrame.then( - (_) { - registerNavigateToHome(() { + 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; } - controller.animateCamera( - cameraUpdate, + await onDisplayModeChanged( + controller: mapController.value!, + config: config, ); - }); - final controller = mapController.value; - if (controller == null) { - return; - } - onDisplayModeChanged( - controller: mapController.value!, - config: config, - ); - }, + }, + ), ); return null; }, diff --git a/app/lib/feature/earthquake_history_details/component/prefecture_intensity.dart b/app/lib/feature/earthquake_history_details/component/prefecture_intensity.dart index 4ff1fdc65..c0de5f4f8 100644 --- a/app/lib/feature/earthquake_history_details/component/prefecture_intensity.dart +++ b/app/lib/feature/earthquake_history_details/component/prefecture_intensity.dart @@ -22,12 +22,12 @@ typedef _Arg = ({ @riverpod Future>> _calculator( - _CalculatorRef ref, + Ref ref, _Arg arg, ) => compute<_Arg, Map>>( ( - _Arg arg, + arg, ) { final cities = arg.cities; final prefectures = arg.prefectures; @@ -117,8 +117,8 @@ Future>> _calculator( class PrefectureIntensityWidget extends HookConsumerWidget { const PrefectureIntensityWidget({ - super.key, required this.item, + super.key, }); final EarthquakeV1 item; @@ -190,7 +190,7 @@ class PrefectureIntensityWidget extends HookConsumerWidget { ), ), onTap: hasCities - ? () => _PrefectureModalBottomSheet.show( + ? () async => _PrefectureModalBottomSheet.show( context: context, intensity: kv.key, prefectures: kv.value, diff --git a/app/lib/feature/earthquake_history_details/component/prefecture_intensity.g.dart b/app/lib/feature/earthquake_history_details/component/prefecture_intensity.g.dart index 164b273b9..2261751b8 100644 --- a/app/lib/feature/earthquake_history_details/component/prefecture_intensity.g.dart +++ b/app/lib/feature/earthquake_history_details/component/prefecture_intensity.g.dart @@ -8,7 +8,7 @@ part of 'prefecture_intensity.dart'; // RiverpodGenerator // ************************************************************************** -String _$calculatorHash() => r'ec6f3bf8790c9360816212ab548ae098f3b31ad0'; +String _$calculatorHash() => r'04b6761f20dbdfc38319c53807b92dff5751d6b0'; /// Copied from Dart SDK class _SystemHash { @@ -36,34 +36,24 @@ class _SystemHash { const _calculatorProvider = _CalculatorFamily(); /// See also [_calculator]. -class _CalculatorFamily extends Family { +class _CalculatorFamily extends Family< + AsyncValue>>> { /// See also [_calculator]. const _CalculatorFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'_calculatorProvider'; - /// See also [_calculator]. _CalculatorProvider call( - _Arg arg, + ({ + List? cities, + List prefectures, + List? stations + }) arg, ) { return _CalculatorProvider( arg, ); } - @visibleForOverriding @override _CalculatorProvider getProviderOverride( covariant _CalculatorProvider provider, @@ -73,30 +63,19 @@ class _CalculatorFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith( - FutureOr>> Function( - _CalculatorRef ref) - create) { - return _$CalculatorFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$CalculatorFamilyOverride implements FamilyOverride { - _$CalculatorFamilyOverride(this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final FutureOr>> Function( - _CalculatorRef ref) create; + static const Iterable? _allTransitiveDependencies = null; @override - final _CalculatorFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - _CalculatorProvider getProviderOverride( - covariant _CalculatorProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'_calculatorProvider'; } /// See also [_calculator]. @@ -104,7 +83,11 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< Map>> { /// See also [_calculator]. _CalculatorProvider( - _Arg arg, + ({ + List? cities, + List prefectures, + List? stations + }) arg, ) : this._internal( (ref) => _calculator( ref as _CalculatorRef, @@ -123,7 +106,7 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< ); _CalculatorProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -132,12 +115,16 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< required this.arg, }) : super.internal(); - final _Arg arg; + final ({ + List? cities, + List prefectures, + List? stations + }) arg; @override Override overrideWith( FutureOr>> Function( - _CalculatorRef ref) + _CalculatorRef provider) create, ) { return ProviderOverride( @@ -154,33 +141,12 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< ); } - @override - (_Arg,) get argument { - return (arg,); - } - @override AutoDisposeFutureProviderElement< Map>> createElement() { return _CalculatorProviderElement(this); } - _CalculatorProvider _copyWith( - FutureOr>> Function( - _CalculatorRef ref) - create, - ) { - return _CalculatorProvider._internal( - (ref) => create(ref as _CalculatorRef), - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - arg: arg, - ); - } - @override bool operator ==(Object other) { return other is _CalculatorProvider && other.arg == arg; @@ -195,10 +161,16 @@ class _CalculatorProvider extends AutoDisposeFutureProvider< } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin _CalculatorRef on AutoDisposeFutureProviderRef< Map>> { /// The parameter `arg` of this provider. - _Arg get arg; + ({ + List? cities, + List prefectures, + List? stations + }) get arg; } class _CalculatorProviderElement extends AutoDisposeFutureProviderElement< @@ -206,7 +178,11 @@ class _CalculatorProviderElement extends AutoDisposeFutureProviderElement< _CalculatorProviderElement(super.provider); @override - _Arg get arg => (origin as _CalculatorProvider).arg; + ({ + List? cities, + List prefectures, + 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/component/prefecture_lpgm_intensity.dart b/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.dart index 7880def8d..56b801826 100644 --- a/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.dart +++ b/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.dart @@ -22,12 +22,12 @@ typedef _Arg = ({ @riverpod Future>> _lpgmCalculator( - _LpgmCalculatorRef ref, + Ref ref, _Arg arg, ) => compute<_Arg, Map>>( ( - _Arg arg, + arg, ) { final prefectures = arg.prefectures; final stations = arg.stations; @@ -74,8 +74,8 @@ Future>> _lpgmCalculator( class PrefectureLpgmIntensityWidget extends HookConsumerWidget { const PrefectureLpgmIntensityWidget({ - super.key, required this.item, + super.key, }); final EarthquakeV1 item; @@ -134,7 +134,7 @@ class PrefectureLpgmIntensityWidget extends HookConsumerWidget { kv.value.map((e) => e.name).join(', ').toHalfWidth, ), onTap: hasStations - ? () => _PrefectureModalBottomSheet.show( + ? () async => _PrefectureModalBottomSheet.show( context: context, intensity: kv.key, prefectures: kv.value, diff --git a/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.g.dart b/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.g.dart index 6edb0eceb..1cbdc49f8 100644 --- a/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.g.dart +++ b/app/lib/feature/earthquake_history_details/component/prefecture_lpgm_intensity.g.dart @@ -8,7 +8,7 @@ part of 'prefecture_lpgm_intensity.dart'; // RiverpodGenerator // ************************************************************************** -String _$lpgmCalculatorHash() => r'0b31367311caf93e6f6708ea1f0016f6cfacd052'; +String _$lpgmCalculatorHash() => r'6e4fb84f94c2bb397d7704498b6ece2284cd32f2'; /// Copied from Dart SDK class _SystemHash { @@ -36,34 +36,23 @@ class _SystemHash { const _lpgmCalculatorProvider = _LpgmCalculatorFamily(); /// See also [_lpgmCalculator]. -class _LpgmCalculatorFamily extends Family { +class _LpgmCalculatorFamily extends Family< + AsyncValue>>> { /// See also [_lpgmCalculator]. const _LpgmCalculatorFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'_lpgmCalculatorProvider'; - /// See also [_lpgmCalculator]. _LpgmCalculatorProvider call( - _Arg arg, + ({ + List? prefectures, + List? stations + }) arg, ) { return _LpgmCalculatorProvider( arg, ); } - @visibleForOverriding @override _LpgmCalculatorProvider getProviderOverride( covariant _LpgmCalculatorProvider provider, @@ -73,30 +62,19 @@ class _LpgmCalculatorFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith( - FutureOr>> Function( - _LpgmCalculatorRef ref) - create) { - return _$LpgmCalculatorFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$LpgmCalculatorFamilyOverride implements FamilyOverride { - _$LpgmCalculatorFamilyOverride(this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final FutureOr>> - Function(_LpgmCalculatorRef ref) create; + static const Iterable? _allTransitiveDependencies = null; @override - final _LpgmCalculatorFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - _LpgmCalculatorProvider getProviderOverride( - covariant _LpgmCalculatorProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'_lpgmCalculatorProvider'; } /// See also [_lpgmCalculator]. @@ -104,7 +82,10 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< Map>> { /// See also [_lpgmCalculator]. _LpgmCalculatorProvider( - _Arg arg, + ({ + List? prefectures, + List? stations + }) arg, ) : this._internal( (ref) => _lpgmCalculator( ref as _LpgmCalculatorRef, @@ -123,7 +104,7 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< ); _LpgmCalculatorProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -132,12 +113,15 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< required this.arg, }) : super.internal(); - final _Arg arg; + final ({ + List? prefectures, + List? stations + }) arg; @override Override overrideWith( FutureOr>> Function( - _LpgmCalculatorRef ref) + _LpgmCalculatorRef provider) create, ) { return ProviderOverride( @@ -154,33 +138,12 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< ); } - @override - (_Arg,) get argument { - return (arg,); - } - @override AutoDisposeFutureProviderElement< Map>> createElement() { return _LpgmCalculatorProviderElement(this); } - _LpgmCalculatorProvider _copyWith( - FutureOr>> Function( - _LpgmCalculatorRef ref) - create, - ) { - return _LpgmCalculatorProvider._internal( - (ref) => create(ref as _LpgmCalculatorRef), - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - arg: arg, - ); - } - @override bool operator ==(Object other) { return other is _LpgmCalculatorProvider && other.arg == arg; @@ -195,10 +158,15 @@ class _LpgmCalculatorProvider extends AutoDisposeFutureProvider< } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin _LpgmCalculatorRef on AutoDisposeFutureProviderRef< Map>> { /// The parameter `arg` of this provider. - _Arg get arg; + ({ + List? prefectures, + List? stations + }) get arg; } class _LpgmCalculatorProviderElement extends AutoDisposeFutureProviderElement< @@ -207,7 +175,10 @@ class _LpgmCalculatorProviderElement extends AutoDisposeFutureProviderElement< _LpgmCalculatorProviderElement(super.provider); @override - _Arg get arg => (origin as _LpgmCalculatorProvider).arg; + ({ + List? prefectures, + 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/data/earthquake_history_details_notifier.g.dart b/app/lib/feature/earthquake_history_details/data/earthquake_history_details_notifier.g.dart index 56f4dbf69..208503ff9 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 @@ -47,24 +47,11 @@ const earthquakeHistoryDetailsNotifierProvider = EarthquakeHistoryDetailsNotifierFamily(); /// See also [EarthquakeHistoryDetailsNotifier]. -class EarthquakeHistoryDetailsNotifierFamily extends Family { +class EarthquakeHistoryDetailsNotifierFamily + extends Family> { /// See also [EarthquakeHistoryDetailsNotifier]. const EarthquakeHistoryDetailsNotifierFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'earthquakeHistoryDetailsNotifierProvider'; - /// See also [EarthquakeHistoryDetailsNotifier]. EarthquakeHistoryDetailsNotifierProvider call( int eventId, @@ -74,7 +61,6 @@ class EarthquakeHistoryDetailsNotifierFamily extends Family { ); } - @visibleForOverriding @override EarthquakeHistoryDetailsNotifierProvider getProviderOverride( covariant EarthquakeHistoryDetailsNotifierProvider provider, @@ -84,28 +70,19 @@ class EarthquakeHistoryDetailsNotifierFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith(EarthquakeHistoryDetailsNotifier Function() create) { - return _$EarthquakeHistoryDetailsNotifierFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$EarthquakeHistoryDetailsNotifierFamilyOverride - implements FamilyOverride { - _$EarthquakeHistoryDetailsNotifierFamilyOverride( - this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final EarthquakeHistoryDetailsNotifier Function() create; + static const Iterable? _allTransitiveDependencies = null; @override - final EarthquakeHistoryDetailsNotifierFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - EarthquakeHistoryDetailsNotifierProvider getProviderOverride( - covariant EarthquakeHistoryDetailsNotifierProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'earthquakeHistoryDetailsNotifierProvider'; } /// See also [EarthquakeHistoryDetailsNotifier]. @@ -130,7 +107,7 @@ class EarthquakeHistoryDetailsNotifierProvider ); EarthquakeHistoryDetailsNotifierProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -166,31 +143,12 @@ class EarthquakeHistoryDetailsNotifierProvider ); } - @override - (int,) get argument { - return (eventId,); - } - @override AutoDisposeAsyncNotifierProviderElement createElement() { return _EarthquakeHistoryDetailsNotifierProviderElement(this); } - EarthquakeHistoryDetailsNotifierProvider _copyWith( - EarthquakeHistoryDetailsNotifier Function() create, - ) { - return EarthquakeHistoryDetailsNotifierProvider._internal( - () => create()..eventId = eventId, - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - eventId: eventId, - ); - } - @override bool operator ==(Object other) { return other is EarthquakeHistoryDetailsNotifierProvider && @@ -206,6 +164,8 @@ class EarthquakeHistoryDetailsNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin EarthquakeHistoryDetailsNotifierRef on AutoDisposeAsyncNotifierProviderRef { /// The parameter `eventId` of this provider. @@ -223,4 +183,4 @@ class _EarthquakeHistoryDetailsNotifierProviderElement (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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/screen/earthquake_history_details.dart b/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart index f21fd5d57..b292f4d26 100644 --- a/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart +++ b/app/lib/feature/earthquake_history_details/screen/earthquake_history_details.dart @@ -157,7 +157,8 @@ class EarthquakeHistoryDetailsPage extends HookConsumerWidget { FloatingActionButton.small( heroTag: 'earthquake_history_details_layer_fab', tooltip: '地図の表示レイヤーを切り替える', - onPressed: () => showEarthquakeHistoryDetailConfigDialog( + onPressed: () async => + showEarthquakeHistoryDetailConfigDialog( context, showCitySelector: details.intensityCities != null, hasLpgmIntensity: details.maxLpgmIntensity != null, 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 53643bfcd..7740e803f 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 @@ -1,12 +1,13 @@ import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/feature/earthquake_history_early/data/earthquake_history_early_repository.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_early_details_notifier.g.dart'; @riverpod Future earthquakeHistoryEarlyEvent( - EarthquakeHistoryEarlyEventRef ref, + Ref ref, String id, ) => ref 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 3ada6fe39..2e1057417 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 @@ -9,7 +9,7 @@ part of 'earthquake_history_early_details_notifier.dart'; // ************************************************************************** String _$earthquakeHistoryEarlyEventHash() => - r'13fa4d382824e1367de0f53cd8c9fa2a360de781'; + r'45706d786f53b6d4c9396fbe2ac974d757ec1014'; /// Copied from Dart SDK class _SystemHash { @@ -37,24 +37,11 @@ class _SystemHash { const earthquakeHistoryEarlyEventProvider = EarthquakeHistoryEarlyEventFamily(); /// See also [earthquakeHistoryEarlyEvent]. -class EarthquakeHistoryEarlyEventFamily extends Family { +class EarthquakeHistoryEarlyEventFamily + extends Family> { /// See also [earthquakeHistoryEarlyEvent]. const EarthquakeHistoryEarlyEventFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'earthquakeHistoryEarlyEventProvider'; - /// See also [earthquakeHistoryEarlyEvent]. EarthquakeHistoryEarlyEventProvider call( String id, @@ -64,7 +51,6 @@ class EarthquakeHistoryEarlyEventFamily extends Family { ); } - @visibleForOverriding @override EarthquakeHistoryEarlyEventProvider getProviderOverride( covariant EarthquakeHistoryEarlyEventProvider provider, @@ -74,31 +60,19 @@ class EarthquakeHistoryEarlyEventFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith( - FutureOr Function( - EarthquakeHistoryEarlyEventRef ref) - create) { - return _$EarthquakeHistoryEarlyEventFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$EarthquakeHistoryEarlyEventFamilyOverride implements FamilyOverride { - _$EarthquakeHistoryEarlyEventFamilyOverride( - this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final FutureOr Function( - EarthquakeHistoryEarlyEventRef ref) create; + static const Iterable? _allTransitiveDependencies = null; @override - final EarthquakeHistoryEarlyEventFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - EarthquakeHistoryEarlyEventProvider getProviderOverride( - covariant EarthquakeHistoryEarlyEventProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'earthquakeHistoryEarlyEventProvider'; } /// See also [earthquakeHistoryEarlyEvent]. @@ -125,7 +99,7 @@ class EarthquakeHistoryEarlyEventProvider ); EarthquakeHistoryEarlyEventProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -138,7 +112,8 @@ class EarthquakeHistoryEarlyEventProvider @override Override overrideWith( - FutureOr Function(EarthquakeHistoryEarlyEventRef ref) + FutureOr Function( + EarthquakeHistoryEarlyEventRef provider) create, ) { return ProviderOverride( @@ -155,31 +130,11 @@ class EarthquakeHistoryEarlyEventProvider ); } - @override - (String,) get argument { - return (id,); - } - @override AutoDisposeFutureProviderElement createElement() { return _EarthquakeHistoryEarlyEventProviderElement(this); } - EarthquakeHistoryEarlyEventProvider _copyWith( - FutureOr Function(EarthquakeHistoryEarlyEventRef ref) - create, - ) { - return EarthquakeHistoryEarlyEventProvider._internal( - (ref) => create(ref as EarthquakeHistoryEarlyEventRef), - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - id: id, - ); - } - @override bool operator ==(Object other) { return other is EarthquakeHistoryEarlyEventProvider && other.id == id; @@ -194,6 +149,8 @@ class EarthquakeHistoryEarlyEventProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin EarthquakeHistoryEarlyEventRef on AutoDisposeFutureProviderRef { /// The parameter `id` of this provider. @@ -209,4 +166,4 @@ class _EarthquakeHistoryEarlyEventProviderElement 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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.g.dart b/app/lib/feature/earthquake_history_early/data/earthquake_history_early_notifier.g.dart index 6dde1dc3f..f28f1c72c 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 @@ -48,24 +48,11 @@ const earthquakeHistoryEarlyNotifierProvider = EarthquakeHistoryEarlyNotifierFamily(); /// See also [EarthquakeHistoryEarlyNotifier]. -class EarthquakeHistoryEarlyNotifierFamily extends Family { +class EarthquakeHistoryEarlyNotifierFamily + extends Family> { /// See also [EarthquakeHistoryEarlyNotifier]. const EarthquakeHistoryEarlyNotifierFamily(); - static const Iterable? _dependencies = null; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'earthquakeHistoryEarlyNotifierProvider'; - /// See also [EarthquakeHistoryEarlyNotifier]. EarthquakeHistoryEarlyNotifierProvider call( EarthquakeHistoryEarlyParameter parameter, @@ -75,7 +62,6 @@ class EarthquakeHistoryEarlyNotifierFamily extends Family { ); } - @visibleForOverriding @override EarthquakeHistoryEarlyNotifierProvider getProviderOverride( covariant EarthquakeHistoryEarlyNotifierProvider provider, @@ -85,27 +71,19 @@ class EarthquakeHistoryEarlyNotifierFamily extends Family { ); } - /// Enables overriding the behavior of this provider, no matter the parameters. - Override overrideWith(EarthquakeHistoryEarlyNotifier Function() create) { - return _$EarthquakeHistoryEarlyNotifierFamilyOverride(this, create); - } -} + static const Iterable? _dependencies = null; -class _$EarthquakeHistoryEarlyNotifierFamilyOverride implements FamilyOverride { - _$EarthquakeHistoryEarlyNotifierFamilyOverride( - this.overriddenFamily, this.create); + @override + Iterable? get dependencies => _dependencies; - final EarthquakeHistoryEarlyNotifier Function() create; + static const Iterable? _allTransitiveDependencies = null; @override - final EarthquakeHistoryEarlyNotifierFamily overriddenFamily; + Iterable? get allTransitiveDependencies => + _allTransitiveDependencies; @override - EarthquakeHistoryEarlyNotifierProvider getProviderOverride( - covariant EarthquakeHistoryEarlyNotifierProvider provider, - ) { - return provider._copyWith(create); - } + String? get name => r'earthquakeHistoryEarlyNotifierProvider'; } /// See also [EarthquakeHistoryEarlyNotifier]. @@ -130,7 +108,7 @@ class EarthquakeHistoryEarlyNotifierProvider ); EarthquakeHistoryEarlyNotifierProvider._internal( - super.create, { + super._createNotifier, { required super.name, required super.dependencies, required super.allTransitiveDependencies, @@ -166,31 +144,12 @@ class EarthquakeHistoryEarlyNotifierProvider ); } - @override - (EarthquakeHistoryEarlyParameter,) get argument { - return (parameter,); - } - @override AutoDisposeAsyncNotifierProviderElement createElement() { return _EarthquakeHistoryEarlyNotifierProviderElement(this); } - EarthquakeHistoryEarlyNotifierProvider _copyWith( - EarthquakeHistoryEarlyNotifier Function() create, - ) { - return EarthquakeHistoryEarlyNotifierProvider._internal( - () => create()..parameter = parameter, - name: name, - dependencies: dependencies, - allTransitiveDependencies: allTransitiveDependencies, - debugGetCreateSourceHash: debugGetCreateSourceHash, - from: from, - parameter: parameter, - ); - } - @override bool operator ==(Object other) { return other is EarthquakeHistoryEarlyNotifierProvider && @@ -206,6 +165,8 @@ class EarthquakeHistoryEarlyNotifierProvider } } +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element mixin EarthquakeHistoryEarlyNotifierRef on AutoDisposeAsyncNotifierProviderRef< EarthquakeHistoryEarlyNotifierState> { /// The parameter `parameter` of this provider. @@ -223,4 +184,4 @@ class _EarthquakeHistoryEarlyNotifierProviderElement (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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 4b1997fba..de4856367 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 @@ -1,13 +1,14 @@ import 'package:eqapi_client/eqapi_client.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'earthquake_history_early_repository.g.dart'; @Riverpod(keepAlive: true) EarthquakeHistoryEarlyRepository earthquakeHistoryEarlyRepository( - EarthquakeHistoryEarlyRepositoryRef ref, + Ref ref, ) => EarthquakeHistoryEarlyRepository( api: ref.watch(eqApiProvider), @@ -31,7 +32,7 @@ class EarthquakeHistoryEarlyRepository { JmaIntensity? intensityGte, DateTime? originTimeLte, DateTime? originTimeGte, - EarthquakeEarlySortType sort = EarthquakeEarlySortType.origin_time, + EarthquakeEarlySortType sort = EarthquakeEarlySortType.originTime, bool ascending = false, }) async { final response = await _api.v1.getEarthquakeEarlies( 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 db67ff0a9..0ddec7d80 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 @@ -9,7 +9,7 @@ part of 'earthquake_history_early_repository.dart'; // ************************************************************************** String _$earthquakeHistoryEarlyRepositoryHash() => - r'f0cd21fe4c00f1632860e7b3785fe5b69e478607'; + r'14743c564b12bc04659775b6dad5c119c1392720'; /// See also [earthquakeHistoryEarlyRepository]. @ProviderFor(earthquakeHistoryEarlyRepository) @@ -24,7 +24,9 @@ final earthquakeHistoryEarlyRepositoryProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 cd79431a8..25175788c 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 @@ -8,6 +8,8 @@ part 'earthquake_history_early_parameter.g.dart'; @freezed class EarthquakeHistoryEarlyParameter with _$EarthquakeHistoryEarlyParameter { const factory EarthquakeHistoryEarlyParameter({ + required EarthquakeEarlySortType sort, + required bool ascending, double? magnitudeLte, double? magnitudeGte, double? depthLte, @@ -16,8 +18,6 @@ class EarthquakeHistoryEarlyParameter with _$EarthquakeHistoryEarlyParameter { JmaIntensity? intensityGte, DateTime? originTimeLte, DateTime? originTimeGte, - required EarthquakeEarlySortType sort, - required bool ascending, }) = _EarthquakeHistoryEarlyParameter; factory EarthquakeHistoryEarlyParameter.fromJson(Map json) => 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 e589bc24e..83af9c7b3 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 @@ -21,6 +21,8 @@ EarthquakeHistoryEarlyParameter _$EarthquakeHistoryEarlyParameterFromJson( /// @nodoc mixin _$EarthquakeHistoryEarlyParameter { + EarthquakeEarlySortType get sort => throw _privateConstructorUsedError; + bool get ascending => throw _privateConstructorUsedError; double? get magnitudeLte => throw _privateConstructorUsedError; double? get magnitudeGte => throw _privateConstructorUsedError; double? get depthLte => throw _privateConstructorUsedError; @@ -29,8 +31,6 @@ mixin _$EarthquakeHistoryEarlyParameter { JmaIntensity? get intensityGte => throw _privateConstructorUsedError; DateTime? get originTimeLte => throw _privateConstructorUsedError; DateTime? get originTimeGte => throw _privateConstructorUsedError; - EarthquakeEarlySortType get sort => throw _privateConstructorUsedError; - bool get ascending => throw _privateConstructorUsedError; /// Serializes this EarthquakeHistoryEarlyParameter to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -51,16 +51,16 @@ abstract class $EarthquakeHistoryEarlyParameterCopyWith<$Res> { EarthquakeHistoryEarlyParameter>; @useResult $Res call( - {double? magnitudeLte, + {EarthquakeEarlySortType sort, + bool ascending, + double? magnitudeLte, double? magnitudeGte, double? depthLte, double? depthGte, JmaIntensity? intensityLte, JmaIntensity? intensityGte, DateTime? originTimeLte, - DateTime? originTimeGte, - EarthquakeEarlySortType sort, - bool ascending}); + DateTime? originTimeGte}); } /// @nodoc @@ -79,6 +79,8 @@ class _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, @pragma('vm:prefer-inline') @override $Res call({ + Object? sort = null, + Object? ascending = null, Object? magnitudeLte = freezed, Object? magnitudeGte = freezed, Object? depthLte = freezed, @@ -87,10 +89,16 @@ class _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, Object? intensityGte = freezed, Object? originTimeLte = freezed, Object? originTimeGte = freezed, - Object? sort = null, - Object? ascending = null, }) { 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 @@ -123,14 +131,6 @@ class _$EarthquakeHistoryEarlyParameterCopyWithImpl<$Res, ? _value.originTimeGte : originTimeGte // ignore: cast_nullable_to_non_nullable as DateTime?, - 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, ) as $Val); } } @@ -145,16 +145,16 @@ abstract class _$$EarthquakeHistoryEarlyParameterImplCopyWith<$Res> @override @useResult $Res call( - {double? magnitudeLte, + {EarthquakeEarlySortType sort, + bool ascending, + double? magnitudeLte, double? magnitudeGte, double? depthLte, double? depthGte, JmaIntensity? intensityLte, JmaIntensity? intensityGte, DateTime? originTimeLte, - DateTime? originTimeGte, - EarthquakeEarlySortType sort, - bool ascending}); + DateTime? originTimeGte}); } /// @nodoc @@ -172,6 +172,8 @@ class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ + Object? sort = null, + Object? ascending = null, Object? magnitudeLte = freezed, Object? magnitudeGte = freezed, Object? depthLte = freezed, @@ -180,10 +182,16 @@ class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> Object? intensityGte = freezed, Object? originTimeLte = freezed, Object? originTimeGte = freezed, - Object? sort = null, - Object? ascending = null, }) { 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 @@ -216,14 +224,6 @@ class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> ? _value.originTimeGte : originTimeGte // ignore: cast_nullable_to_non_nullable as DateTime?, - 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, )); } } @@ -233,21 +233,25 @@ class __$$EarthquakeHistoryEarlyParameterImplCopyWithImpl<$Res> class _$EarthquakeHistoryEarlyParameterImpl implements _EarthquakeHistoryEarlyParameter { const _$EarthquakeHistoryEarlyParameterImpl( - {this.magnitudeLte, + {required this.sort, + required this.ascending, + this.magnitudeLte, this.magnitudeGte, this.depthLte, this.depthGte, this.intensityLte, this.intensityGte, this.originTimeLte, - this.originTimeGte, - required this.sort, - required this.ascending}); + this.originTimeGte}); factory _$EarthquakeHistoryEarlyParameterImpl.fromJson( Map json) => _$$EarthquakeHistoryEarlyParameterImplFromJson(json); + @override + final EarthquakeEarlySortType sort; + @override + final bool ascending; @override final double? magnitudeLte; @override @@ -264,14 +268,10 @@ class _$EarthquakeHistoryEarlyParameterImpl final DateTime? originTimeLte; @override final DateTime? originTimeGte; - @override - final EarthquakeEarlySortType sort; - @override - final bool ascending; @override String toString() { - return 'EarthquakeHistoryEarlyParameter(magnitudeLte: $magnitudeLte, magnitudeGte: $magnitudeGte, depthLte: $depthLte, depthGte: $depthGte, intensityLte: $intensityLte, intensityGte: $intensityGte, originTimeLte: $originTimeLte, originTimeGte: $originTimeGte, sort: $sort, ascending: $ascending)'; + return 'EarthquakeHistoryEarlyParameter(sort: $sort, ascending: $ascending, magnitudeLte: $magnitudeLte, magnitudeGte: $magnitudeGte, depthLte: $depthLte, depthGte: $depthGte, intensityLte: $intensityLte, intensityGte: $intensityGte, originTimeLte: $originTimeLte, originTimeGte: $originTimeGte)'; } @override @@ -279,6 +279,9 @@ class _$EarthquakeHistoryEarlyParameterImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$EarthquakeHistoryEarlyParameterImpl && + (identical(other.sort, sort) || other.sort == sort) && + (identical(other.ascending, ascending) || + other.ascending == ascending) && (identical(other.magnitudeLte, magnitudeLte) || other.magnitudeLte == magnitudeLte) && (identical(other.magnitudeGte, magnitudeGte) || @@ -294,16 +297,15 @@ class _$EarthquakeHistoryEarlyParameterImpl (identical(other.originTimeLte, originTimeLte) || other.originTimeLte == originTimeLte) && (identical(other.originTimeGte, originTimeGte) || - other.originTimeGte == originTimeGte) && - (identical(other.sort, sort) || other.sort == sort) && - (identical(other.ascending, ascending) || - other.ascending == ascending)); + other.originTimeGte == originTimeGte)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, + sort, + ascending, magnitudeLte, magnitudeGte, depthLte, @@ -311,9 +313,7 @@ class _$EarthquakeHistoryEarlyParameterImpl intensityLte, intensityGte, originTimeLte, - originTimeGte, - sort, - ascending); + originTimeGte); /// Create a copy of EarthquakeHistoryEarlyParameter /// with the given fields replaced by the non-null parameter values. @@ -336,20 +336,24 @@ class _$EarthquakeHistoryEarlyParameterImpl abstract class _EarthquakeHistoryEarlyParameter implements EarthquakeHistoryEarlyParameter { const factory _EarthquakeHistoryEarlyParameter( - {final double? magnitudeLte, + {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, - required final EarthquakeEarlySortType sort, - required final bool ascending}) = _$EarthquakeHistoryEarlyParameterImpl; + final DateTime? originTimeGte}) = _$EarthquakeHistoryEarlyParameterImpl; factory _EarthquakeHistoryEarlyParameter.fromJson(Map json) = _$EarthquakeHistoryEarlyParameterImpl.fromJson; + @override + EarthquakeEarlySortType get sort; + @override + bool get ascending; @override double? get magnitudeLte; @override @@ -366,10 +370,6 @@ abstract class _EarthquakeHistoryEarlyParameter DateTime? get originTimeLte; @override DateTime? get originTimeGte; - @override - EarthquakeEarlySortType get sort; - @override - bool get ascending; /// Create a copy of EarthquakeHistoryEarlyParameter /// with the given fields replaced by the non-null parameter values. 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 3de45c39f..a898aaa97 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 @@ -15,6 +15,9 @@ _$EarthquakeHistoryEarlyParameterImpl json, ($checkedConvert) { final val = _$EarthquakeHistoryEarlyParameterImpl( + sort: $checkedConvert('sort', + (v) => $enumDecode(_$EarthquakeEarlySortTypeEnumMap, v)), + ascending: $checkedConvert('ascending', (v) => v as bool), magnitudeLte: $checkedConvert( 'magnitudeLte', (v) => (v as num?)?.toDouble()), magnitudeGte: $checkedConvert( @@ -31,9 +34,6 @@ _$EarthquakeHistoryEarlyParameterImpl (v) => v == null ? null : DateTime.parse(v as String)), originTimeGte: $checkedConvert('originTimeGte', (v) => v == null ? null : DateTime.parse(v as String)), - sort: $checkedConvert('sort', - (v) => $enumDecode(_$EarthquakeEarlySortTypeEnumMap, v)), - ascending: $checkedConvert('ascending', (v) => v as bool), ); return val; }, @@ -42,6 +42,8 @@ _$EarthquakeHistoryEarlyParameterImpl Map _$$EarthquakeHistoryEarlyParameterImplToJson( _$EarthquakeHistoryEarlyParameterImpl instance) => { + 'sort': _$EarthquakeEarlySortTypeEnumMap[instance.sort]!, + 'ascending': instance.ascending, 'magnitudeLte': instance.magnitudeLte, 'magnitudeGte': instance.magnitudeGte, 'depthLte': instance.depthLte, @@ -50,10 +52,15 @@ Map _$$EarthquakeHistoryEarlyParameterImplToJson( 'intensityGte': _$JmaIntensityEnumMap[instance.intensityGte], 'originTimeLte': instance.originTimeLte?.toIso8601String(), 'originTimeGte': instance.originTimeGte?.toIso8601String(), - 'sort': _$EarthquakeEarlySortTypeEnumMap[instance.sort]!, - 'ascending': instance.ascending, }; +const _$EarthquakeEarlySortTypeEnumMap = { + EarthquakeEarlySortType.originTime: 'origin_time', + EarthquakeEarlySortType.magnitude: 'magnitude', + EarthquakeEarlySortType.depth: 'depth', + EarthquakeEarlySortType.maxIntensity: 'max_intensity', +}; + const _$JmaIntensityEnumMap = { JmaIntensity.one: '1', JmaIntensity.two: '2', @@ -66,10 +73,3 @@ const _$JmaIntensityEnumMap = { JmaIntensity.seven: '7', JmaIntensity.fiveUpperNoInput: '!5-', }; - -const _$EarthquakeEarlySortTypeEnumMap = { - EarthquakeEarlySortType.origin_time: 'origin_time', - EarthquakeEarlySortType.magnitude: 'magnitude', - EarthquakeEarlySortType.depth: 'depth', - EarthquakeEarlySortType.max_intensity: 'max_intensity', -}; diff --git a/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart b/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart index 6139714d7..0f35cfd3c 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart @@ -5,8 +5,8 @@ const Radius _defaultBarTopRadius = Radius.circular(15); class BarBottomSheet extends StatelessWidget { const BarBottomSheet({ - super.key, required this.child, + super.key, this.control, this.clipBehavior, this.shape, @@ -79,7 +79,7 @@ class BarSheetRoute extends SheetRoute { Widget? topControl, super.duration, }) : super( - builder: (BuildContext context) { + builder: (context) { return BarBottomSheet( control: topControl, clipBehavior: clipBehavior, 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 e631709c5..b945256aa 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 @@ -9,10 +9,10 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; class EarthquakeHistoryEarlySortChip extends StatelessWidget { const EarthquakeHistoryEarlySortChip({ - super.key, - this.onChanged, required this.type, required this.ascending, + super.key, + this.onChanged, }); final void Function( @@ -65,8 +65,8 @@ extension _EarthquakeEarlySortTypeEx on EarthquakeEarlySortType { String get label => switch (this) { EarthquakeEarlySortType.depth => '深さ', EarthquakeEarlySortType.magnitude => 'マグニチュード', - EarthquakeEarlySortType.origin_time => '発生時刻', - EarthquakeEarlySortType.max_intensity => '最大観測震度', + EarthquakeEarlySortType.originTime => '発生時刻', + EarthquakeEarlySortType.maxIntensity => '最大観測震度', }; } @@ -131,10 +131,10 @@ class _SortModal extends HookConsumerWidget { (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) => '最大観測震度の小さい順', + (EarthquakeEarlySortType.originTime, false) => '地震発生時刻の新しい順', + (EarthquakeEarlySortType.originTime, true) => '地震発生時刻の古い順', + (EarthquakeEarlySortType.maxIntensity, false) => '最大観測震度の大きい順', + (EarthquakeEarlySortType.maxIntensity, true) => '最大観測震度の小さい順', }, ), value: ascending.value, 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 0991a8788..678bf0ff5 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 @@ -10,8 +10,8 @@ import 'package:intl/intl.dart'; class EarthquakeEarlyHypoInfoWidget extends HookConsumerWidget { const EarthquakeEarlyHypoInfoWidget({ - super.key, required this.item, + super.key, }); final EarthquakeEarlyEvent item; diff --git a/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_map.dart b/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_map.dart index 62557c00c..7c490f1ca 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_map.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/earthquake_early_map.dart @@ -66,8 +66,9 @@ class EarthquakeEarlyMapWidget extends HookConsumerWidget { final mapStyle = ref.watch(mapStyleProvider); final isDark = Theme.of(context).brightness == Brightness.dark; + // ignore: discarded_futures final styleJsonFutureing = useMemoized( - () => mapStyle.getStyle( + () async => mapStyle.getStyle( isDark: isDark, scheme: Theme.of(context).colorScheme, ), @@ -208,26 +209,28 @@ class EarthquakeEarlyMapWidget extends HookConsumerWidget { useEffect( () { - WidgetsBinding.instance.endOfFrame.then( - (_) { - registerNavigateToHome(() { + unawaited( + WidgetsBinding.instance.endOfFrame.then( + (_) async { + registerNavigateToHome(() { + final controller = mapController.value; + if (controller == null) { + return; + } + controller.animateCamera( + cameraUpdate, + ); + }); final controller = mapController.value; if (controller == null) { return; } - controller.animateCamera( - cameraUpdate, + await onDisplayModeChanged( + controller: mapController.value!, + config: config, ); - }); - final controller = mapController.value; - if (controller == null) { - return; - } - onDisplayModeChanged( - controller: mapController.value!, - config: config, - ); - }, + }, + ), ); return null; }, 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 5b430cea7..3a6362f12 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 @@ -38,7 +38,7 @@ class EarthquakeHistoryEarlyScreen extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final parameter = useState( const EarthquakeHistoryEarlyParameter( - sort: EarthquakeEarlySortType.max_intensity, + sort: EarthquakeEarlySortType.maxIntensity, ascending: false, ), ); @@ -74,7 +74,7 @@ class EarthquakeHistoryEarlyScreen extends HookConsumerWidget { ) .fetchNextData(), shouldShowLatestEarthquakeMessage: - parameter.value.sort == EarthquakeEarlySortType.origin_time && + parameter.value.sort == EarthquakeEarlySortType.originTime && !parameter.value.ascending, ), ); @@ -271,8 +271,10 @@ class _SliverListBody extends HookConsumerWidget { text: '地震履歴', style: const TextStyle(fontWeight: FontWeight.bold), recognizer: TapGestureRecognizer() - ..onTap = () => const EarthquakeHistoryRoute() - .push(context), + ..onTap = () async => + const EarthquakeHistoryRoute().push( + context, + ), ), const TextSpan(text: 'を使ってください'), ], diff --git a/app/lib/feature/home/component/kmoni/kmoni_settings_dialog.dart b/app/lib/feature/home/component/kmoni/kmoni_settings_dialog.dart index 05c25adb5..b9a3e394a 100644 --- a/app/lib/feature/home/component/kmoni/kmoni_settings_dialog.dart +++ b/app/lib/feature/home/component/kmoni/kmoni_settings_dialog.dart @@ -157,8 +157,8 @@ class _CustomTrackShape extends RoundedRectSliderTrackShape { @override Rect getPreferredRect({ required RenderBox parentBox, - Offset offset = Offset.zero, required SliderThemeData sliderTheme, + Offset offset = Offset.zero, bool isEnabled = false, bool isDiscrete = false, }) { 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 64e90209e..3b3694832 100644 --- a/app/lib/feature/home/component/parameter/parameter_loader_widget.dart +++ b/app/lib/feature/home/component/parameter/parameter_loader_widget.dart @@ -2,7 +2,6 @@ import 'package:dio/dio.dart'; import 'package:eqmonitor/core/component/container/bordered_container.dart'; import 'package:eqmonitor/core/provider/jma_parameter/jma_parameter.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; class ParameterLoaderWidget extends HookConsumerWidget { @@ -10,15 +9,6 @@ class ParameterLoaderWidget extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - useEffect( - () { - WidgetsBinding.instance.endOfFrame.then( - (_) {}, - ); - return null; - }, - [], - ); final state = ref.watch(jmaParameterProvider); return switch (state) { AsyncError(:final error) => BorderedContainer( diff --git a/app/lib/feature/home/component/render/map_components_renderer.dart b/app/lib/feature/home/component/render/map_components_renderer.dart index a98d83800..fefdd38ca 100644 --- a/app/lib/feature/home/component/render/map_components_renderer.dart +++ b/app/lib/feature/home/component/render/map_components_renderer.dart @@ -18,8 +18,8 @@ class MapComponentsRenderer { ) async { final pixelRatio = MediaQuery.devicePixelRatioOf(context); final result = await _controller.captureFromWidget( - ProviderScope( - parent: container, + UncontrolledProviderScope( + container: container, child: JmaIntensityIcon( intensity: intensity, type: type, @@ -38,8 +38,8 @@ class MapComponentsRenderer { ) async { final pixelRatio = MediaQuery.devicePixelRatioOf(context); final result = await _controller.captureFromWidget( - ProviderScope( - parent: container, + UncontrolledProviderScope( + container: container, child: JmaLgIntensityIcon( intensity: intensity, type: type, 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 fe30ed1fd..7a8dc1a85 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 @@ -72,7 +72,10 @@ class ShakeDetectionCard extends ConsumerWidget { ), ), Text( - "検知時刻: ${DateFormat('yyyy/MM/dd HH:mm').format(event.createdAt.toLocal())}頃", + '検知時刻: ' + // 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/component/sheet/earthquake_history_widget.dart b/app/lib/feature/home/component/sheet/earthquake_history_widget.dart index 53591efe1..aae2cfbd4 100644 --- a/app/lib/feature/home/component/sheet/earthquake_history_widget.dart +++ b/app/lib/feature/home/component/sheet/earthquake_history_widget.dart @@ -53,7 +53,7 @@ class EarthquakeHistorySheetWidget extends HookConsumerWidget { .map( (e) => EarthquakeHistoryListTile( item: e, - onTap: () => EarthquakeHistoryDetailsRoute( + onTap: () async => EarthquakeHistoryDetailsRoute( eventId: e.eventId, ).push(context), showBackgroundColor: false, @@ -76,7 +76,7 @@ class EarthquakeHistorySheetWidget extends HookConsumerWidget { children: [ const Spacer(), TextButton( - onPressed: () => + onPressed: () async => const EarthquakeHistoryRoute().push(context), child: const Text('さらに表示'), ), diff --git a/app/lib/feature/home/component/sheet/sheet_header.dart b/app/lib/feature/home/component/sheet/sheet_header.dart index e6a096927..4fecd5419 100644 --- a/app/lib/feature/home/component/sheet/sheet_header.dart +++ b/app/lib/feature/home/component/sheet/sheet_header.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; class SheetHeader extends StatelessWidget { const SheetHeader({ - super.key, required this.title, + super.key, this.action, }); 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 index 4dab603d3..9669fcd1e 100644 --- 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 @@ -26,4 +26,4 @@ final eewSettingsNotifierProvider = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni/data/kmoni_data_source.dart b/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart index bc7530cf8..53d121ab7 100644 --- a/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart +++ b/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart @@ -4,12 +4,13 @@ import 'package:dio/dio.dart'; import 'package:eqmonitor/feature/home/features/kmoni/model/kmoni_maintenance_message_model.dart'; import 'package:eqmonitor/feature/home/features/kmoni/util/kmoni_web_api_url_generator.dart'; import 'package:eqmonitor/feature/home/features/kmoni/util/realtime_data_type.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'kmoni_data_source.g.dart'; @Riverpod(keepAlive: true) -KmoniDataSource kmoniDataSource(KmoniDataSourceRef ref) => +KmoniDataSource kmoniDataSource(Ref ref) => KmoniDataSource(Dio()); class KmoniDataSource { diff --git a/app/lib/feature/home/features/kmoni/data/kmoni_data_source.g.dart b/app/lib/feature/home/features/kmoni/data/kmoni_data_source.g.dart index c34e89246..495adb88d 100644 --- a/app/lib/feature/home/features/kmoni/data/kmoni_data_source.g.dart +++ b/app/lib/feature/home/features/kmoni/data/kmoni_data_source.g.dart @@ -8,7 +8,7 @@ part of 'kmoni_data_source.dart'; // RiverpodGenerator // ************************************************************************** -String _$kmoniDataSourceHash() => r'883714d82525510c1a7755cb1d6fc0b72f68ff80'; +String _$kmoniDataSourceHash() => r'cf8d6675835e10ff8959dc92788fd7d2c887208d'; /// See also [kmoniDataSource]. @ProviderFor(kmoniDataSource) @@ -22,6 +22,8 @@ final kmoniDataSourceProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef KmoniDataSourceRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni/page/kmoni_settings_page.dart b/app/lib/feature/home/features/kmoni/page/kmoni_settings_page.dart index 927cfd839..4543e01ef 100644 --- a/app/lib/feature/home/features/kmoni/page/kmoni_settings_page.dart +++ b/app/lib/feature/home/features/kmoni/page/kmoni_settings_page.dart @@ -90,7 +90,7 @@ class KmoniSettingsUseToggle extends ConsumerWidget { ), ), ); - final isAccepted = result == true; + final isAccepted = result != null && result; if (isAccepted) { ref.read(kmoniSettingsProvider.notifier).toggleUseKmoni(); diff --git a/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.dart b/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.dart index 30866ba67..ee1878a0e 100644 --- a/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.dart +++ b/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.dart @@ -1,13 +1,14 @@ import 'package:collection/collection.dart'; import 'package:eqmonitor/feature/home/features/kmoni/model/kyoshin_color_map_model.dart'; import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'kmoni_color_provider.g.dart'; @Riverpod(keepAlive: true) List kyoshinColorMap( - KyoshinColorMapRef ref, + Ref ref, ) => throw UnimplementedError(); diff --git a/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.g.dart b/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.g.dart index 6fee93631..96320ae5b 100644 --- a/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.g.dart +++ b/app/lib/feature/home/features/kmoni/provider/kmoni_color_provider.g.dart @@ -8,7 +8,7 @@ part of 'kmoni_color_provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$kyoshinColorMapHash() => r'817bc52e91bf85de3fb107575ded49926cb2f735'; +String _$kyoshinColorMapHash() => r'74b3acf2ebc484ef656b4184e435dc4861052c0f'; /// See also [kyoshinColorMap]. @ProviderFor(kyoshinColorMap) @@ -22,6 +22,8 @@ final kyoshinColorMapProvider = Provider>.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef KyoshinColorMapRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni/provider/kmoni_view_model.dart b/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.dart index 7592aa0e6..54e263d27 100644 --- a/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.dart +++ b/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.dart @@ -19,7 +19,7 @@ class KmoniViewModel extends _$KmoniViewModel { @override KmoniViewModelState build() { ref - ..listen(appLifeCycleProvider, (_, next) async { + ..listen(appLifecycleProvider, (_, next) async { if (next == AppLifecycleState.resumed) { state = state.copyWith( status: KmoniStatus.none, diff --git a/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.g.dart b/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.g.dart index bc8b23788..0d1011c16 100644 --- a/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.g.dart +++ b/app/lib/feature/home/features/kmoni/provider/kmoni_view_model.g.dart @@ -8,7 +8,7 @@ part of 'kmoni_view_model.dart'; // RiverpodGenerator // ************************************************************************** -String _$kmoniViewModelHash() => r'c1b3436e3e4a03524fdfcfab3fa9608454fe6493'; +String _$kmoniViewModelHash() => r'8f12ecad79ca23a4c2d5d8dda5a0f8a0383fbd67'; /// See also [KmoniViewModel]. @ProviderFor(KmoniViewModel) @@ -25,4 +25,4 @@ final kmoniViewModelProvider = typedef _$KmoniViewModel = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni/use_case/kmoni_use_case.dart b/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart index 16475a2c3..bb8d87433 100644 --- a/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart +++ b/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart @@ -7,6 +7,7 @@ import 'package:eqmonitor/feature/home/features/kmoni/util/kmoni_web_api_url_gen import 'package:eqmonitor/feature/home/features/kmoni/util/realtime_data_type.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/rendering.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:image/image.dart' as image; import 'package:kyoshin_observation_point_types/kyoshin_observation_point.pb.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -14,7 +15,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'kmoni_use_case.g.dart'; @Riverpod(keepAlive: true) -KmoniUseCase kmoniUseCase(KmoniUseCaseRef ref) => KmoniUseCase( +KmoniUseCase kmoniUseCase(Ref ref) => KmoniUseCase( ref.watch(kmoniDataSourceProvider), ); diff --git a/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.g.dart b/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.g.dart index 39e2661fb..ebaa1e3ae 100644 --- a/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.g.dart +++ b/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.g.dart @@ -8,7 +8,7 @@ part of 'kmoni_use_case.dart'; // RiverpodGenerator // ************************************************************************** -String _$kmoniUseCaseHash() => r'1b8a4a60f8e07ae91f1d4395eedc049ce4e2344f'; +String _$kmoniUseCaseHash() => r'f144933e1711423ae2b9cdaf5a8523cc00354bdd'; /// See also [kmoniUseCase]. @ProviderFor(kmoniUseCase) @@ -21,6 +21,8 @@ final kmoniUseCaseProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef KmoniUseCaseRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni/viewmodel/kmoni_maintenance_view_model.dart b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.dart index b479e35ea..4bb46351e 100644 --- a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.dart +++ b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.dart @@ -1,11 +1,12 @@ import 'package:eqmonitor/feature/home/features/kmoni/model/kmoni_maintenance_message_model.dart'; import 'package:eqmonitor/feature/home/features/kmoni/use_case/kmoni_use_case.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'kmoni_maintenance_view_model.g.dart'; @riverpod Future kmoniMaintenanceViewModel( - KmoniMaintenanceViewModelRef ref, + Ref ref, ) async => ref.read(kmoniUseCaseProvider).getMaintenanceMessage(); diff --git a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.g.dart b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.g.dart index 83a50df53..1336aabf0 100644 --- a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.g.dart +++ b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_maintenance_view_model.g.dart @@ -9,7 +9,7 @@ part of 'kmoni_maintenance_view_model.dart'; // ************************************************************************** String _$kmoniMaintenanceViewModelHash() => - r'21d6130f6def80d64786a574532e6ca9c56c8826'; + r'452a1a3415c4c29976445b3ad19707d6761a3802'; /// See also [kmoniMaintenanceViewModel]. @ProviderFor(kmoniMaintenanceViewModel) @@ -24,7 +24,9 @@ final kmoniMaintenanceViewModelProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef KmoniMaintenanceViewModelRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/kmoni/viewmodel/kmoni_settings.dart b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.dart index 7bbbd7ca9..92c99d84e 100644 --- a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.dart +++ b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.dart @@ -35,7 +35,7 @@ class KmoniSettingsState with _$KmoniSettingsState { class KmoniSettings extends _$KmoniSettings { @override KmoniSettingsState build() { - ref.listenSelf((_, __) => _save()); + listenSelf((_, __) async => _save()); final result = _loadFromPrefs(); if (result != null) { return result; diff --git a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart index 952ba810c..aba164c75 100644 --- a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart +++ b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart @@ -52,7 +52,7 @@ const _$KmoniMarkerTypeEnumMap = { // RiverpodGenerator // ************************************************************************** -String _$kmoniSettingsHash() => r'4d210d3435704e2155611374de259bf621c9ad49'; +String _$kmoniSettingsHash() => r'16a1d4dff95ea66075a34354e8c49a12d5580d9f'; /// See also [KmoniSettings]. @ProviderFor(KmoniSettings) @@ -69,4 +69,4 @@ final kmoniSettingsProvider = typedef _$KmoniSettings = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/map/view/main_map_view.dart b/app/lib/feature/home/features/map/view/main_map_view.dart index 6d670c95c..a48a08aaa 100644 --- a/app/lib/feature/home/features/map/view/main_map_view.dart +++ b/app/lib/feature/home/features/map/view/main_map_view.dart @@ -31,6 +31,7 @@ class MainMapView extends HookConsumerWidget { ); final mapStyle = ref.watch(mapStyleProvider); final stylePath = useState(null); + // ignore: discarded_futures final getStyleJsonFuture = useMemoized( () async { final path = await mapStyle.getStyle( @@ -51,8 +52,8 @@ class MainMapView extends HookConsumerWidget { () { final timer = Timer.periodic( const Duration(milliseconds: 80), - (timer) { - ref.read(mainMapViewModelProvider.notifier).onTick( + (timer) async { + await ref.read(mainMapViewModelProvider.notifier).onTick( ref.read(ntpProvider.notifier).now() ?? DateTime.now(), ); }, diff --git a/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.dart b/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.dart index 9f2001799..a1d5d0d91 100644 --- a/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.dart +++ b/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.dart @@ -41,58 +41,59 @@ class MainMapViewModel extends _$MainMapViewModel { ref ..listen( kmoniViewModelProvider, - (_, value) { + (_, value) async { final analyzedPoints = value.analyzedPoints; if (analyzedPoints == null) { return; } - _onKmoniStateChanged(analyzedPoints); + await _onKmoniStateChanged(analyzedPoints); }, ) ..listen( eewAliveTelegramProvider, - (_, value) => _onEewStateChanged(value ?? []), + (_, value) async => _onEewStateChanged(value ?? []), ) ..listen( kmoniSettingsProvider, - (_, value) => _onKmoniSettingsChanged(value: value), + (_, value) async => _onKmoniSettingsChanged(value: value), ) ..listen( shakeDetectionKmoniPointsMergedProvider, - (_, value) => _onShakeDetectionStateChanged(value.valueOrNull ?? []), + (_, value) async => + _onShakeDetectionStateChanged(value.valueOrNull ?? []), ) ..listen( eewSettingsNotifierProvider, - (_, value) => _onEewSettingsChanged(value), + (_, value) async => _onEewSettingsChanged(value), ) ..listen( estimatedIntensityRegionProvider, - (_, state) { + (_, state) async { final eewSettings = ref.read(eewSettingsNotifierProvider); if (!eewSettings.showCalculatedRegionIntensity) { return; } if (state case AsyncData(:final value)) { - _onEstimatedIntensityRegionChanged(value); + await _onEstimatedIntensityRegionChanged(value); } }, ) ..listen( estimatedIntensityCityProvider, - (_, state) { + (_, state) async { final eewSettings = ref.read(eewSettingsNotifierProvider); if (!eewSettings.showCalculatedCityIntensity) { return; } if (state case AsyncData(:final value)) { - _onEstimatedIntensityCityChanged(value); + await _onEstimatedIntensityCityChanged(value); } }, ) - ..listen(eewSettingsNotifierProvider, (_, next) { - _onEewSettingsChanged(next); + ..listen(eewSettingsNotifierProvider, (_, next) async { + await _onEewSettingsChanged(next); }); _lastKmoniSettingsState = ref.read(kmoniSettingsProvider); return MainMapViewmodelState( diff --git a/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.g.dart b/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.g.dart index 6b839a88a..c6c0934a4 100644 --- a/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.g.dart +++ b/app/lib/feature/home/features/map/viewmodel/main_map_viewmodel.g.dart @@ -35,7 +35,7 @@ Map _$$_EewHypocenterPropertiesImplToJson( // RiverpodGenerator // ************************************************************************** -String _$mainMapViewModelHash() => r'c31508e0aaa4959479f72fa803a07fca907c553a'; +String _$mainMapViewModelHash() => r'65c65c924cc31e090ceec31b1503385048b85e82'; /// See also [MainMapViewModel]. @ProviderFor(MainMapViewModel) @@ -52,4 +52,4 @@ final mainMapViewModelProvider = typedef _$MainMapViewModel = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/view/home_view.dart b/app/lib/feature/home/view/home_view.dart index 47c067782..d37eca990 100644 --- a/app/lib/feature/home/view/home_view.dart +++ b/app/lib/feature/home/view/home_view.dart @@ -6,7 +6,7 @@ import 'dart:ui'; import 'package:collection/collection.dart'; import 'package:eqapi_types/eqapi_types.dart'; -import 'package:eqmonitor/core/api/api_authentication_service.dart'; +import 'package:eqmonitor/core/api/api_authentication_notifier.dart'; import 'package:eqmonitor/core/component/container/bordered_container.dart'; import 'package:eqmonitor/core/component/intenisty/intensity_icon_type.dart'; import 'package:eqmonitor/core/component/intenisty/jma_forecast_intensity_icon.dart'; @@ -98,181 +98,199 @@ class _HomeBodyWidget extends HookConsumerWidget { final sheetController = useSheetController(); useEffect( () { - WidgetsBinding.instance.endOfFrame.then((_) { - log('Start Initialize'); - ( - ref.read(kmoniViewModelProvider.notifier).initialize(), - ref.read(permissionNotifierProvider.notifier).initialize(), - ref.read(ntpProvider.notifier).sync(), - () async { - final talker = ref.read(talkerProvider); - try { - talker.log('Start Initialize'); - final token = await ref.read(notificationTokenProvider.future); - talker.log('Token: ${token.toJson()}'); - final fcmToken = token.fcmToken; - if (fcmToken == null) { - throw Exception('fcmToken is null'); - } - talker.log('updateToken...'); - await ref - .read(notificationRemoteAuthenticateServiceProvider) - .updateToken(fcmToken: fcmToken); - talker.log('updateToken... Done'); - await ref - .read(fcmTokenChangeDetectorProvider.notifier) - .save(fcmToken); - talker.log('fcmTokenChangeDetectorProvider... Done'); - final authenticationService = - ref.read(apiAuthenticationServiceProvider.notifier); - final ( - id: id, - role: role, - ) = await authenticationService.extractPayload(); - talker.log( - 'Authentication: id=$id, role=$role', - ); - await FirebaseCrashlytics.instance.setUserIdentifier(id); - await FirebaseAnalytics.instance.setUserId( - id: id, - ); - // ignore: avoid_catches_without_on_clauses - } catch (e) { - ref.read(talkerProvider).log( - 'Authentication Error: $e', + unawaited( + WidgetsBinding.instance.endOfFrame.then( + (_) async { + log('Start Initialize'); + await ( + ref.read(kmoniViewModelProvider.notifier).initialize(), + ref.read(permissionNotifierProvider.notifier).initialize(), + ref.read(ntpProvider.notifier).sync(), + () async { + final talker = ref.read(talkerProvider); + try { + talker.log('Start Initialize'); + final token = + await ref.read(notificationTokenProvider.future); + talker.log('Token: ${token.toJson()}'); + final fcmToken = token.fcmToken; + if (fcmToken == null) { + throw Exception('fcmToken is null'); + } + talker.log('updateToken...'); + await ref + .read(notificationRemoteAuthenticateServiceProvider) + .updateToken(fcmToken: fcmToken); + talker.log('updateToken... Done'); + await ref + .read(fcmTokenChangeDetectorProvider.notifier) + .save(fcmToken); + talker.log('fcmTokenChangeDetectorProvider... Done'); + final authenticationService = + ref.read(apiAuthenticationNotifierProvider.notifier); + final ( + id: id, + role: role, + ) = await authenticationService.extractPayload(); + talker.log( + 'Authentication: id=$id, role=$role', ); - await FirebaseCrashlytics.instance.recordError( - e, - StackTrace.current, - ); - rethrow; - } - }(), - Future.doWhile(() async { - try { - final renderer = MapComponentsRenderer(); - if (!context.mounted) { - return false; - } - final futures = >[ - for (final type in [ - IntensityIconType.small, - IntensityIconType.smallWithoutText, - ]) ...[ - for (final intensity in JmaIntensity.values) - renderer - .renderIntensityIcon( - context, - intensity, - type, - ) - .then( - (value) => switch (type) { - IntensityIconType.small => ref - .read(intensityIconRenderProvider.notifier) - .onRendered( - value, - intensity, - ), - IntensityIconType.smallWithoutText => ref - .read( - intensityIconFillRenderProvider.notifier, - ) - .onRendered( - value, - intensity, - ), - _ => null, - }, - ), - for (final intensity in JmaLgIntensity.values) - renderer - .renderLpgmIntensityIcon( - context, - intensity, - type, - ) - .then( - (value) => switch (type) { - IntensityIconType.small => ref - .read( - lpgmIntensityIconRenderProvider.notifier, - ) - .onRendered( - value, - intensity, - ), - IntensityIconType.smallWithoutText => ref - .read( - lpgmIntensityIconFillRenderProvider - .notifier, - ) - .onRendered( - value, - intensity, - ), - _ => null, - }, - ), - ], - for (final type in HypocenterType.values) - renderer - .renderHypocenterIcon( - context, - type, - ) - .then( - (value) => switch (type) { - HypocenterType.normal => ref - .read(hypocenterIconRenderProvider.notifier) - .onRendered( - value, - ), - HypocenterType.lowPrecise => ref + await FirebaseCrashlytics.instance.setUserIdentifier(id); + await FirebaseAnalytics.instance.setUserId( + id: id, + ); + // ignore: avoid_catches_without_on_clauses + } catch (e) { + ref.read(talkerProvider).log( + 'Authentication Error: $e', + ); + await FirebaseCrashlytics.instance.recordError( + e, + StackTrace.current, + ); + rethrow; + } + }(), + Future.doWhile(() async { + try { + final renderer = MapComponentsRenderer(); + if (!context.mounted) { + return false; + } + final futures = >[ + for (final type in [ + IntensityIconType.small, + IntensityIconType.smallWithoutText, + ]) ...[ + for (final intensity in JmaIntensity.values) + renderer + .renderIntensityIcon( + context, + intensity, + type, + ) + .then( + (value) => switch (type) { + IntensityIconType.small => ref + .read( + intensityIconRenderProvider.notifier, + ) + .onRendered( + value, + intensity, + ), + IntensityIconType.smallWithoutText => ref + .read( + intensityIconFillRenderProvider + .notifier, + ) + .onRendered( + value, + intensity, + ), + _ => null, + }, + ), + for (final intensity in JmaLgIntensity.values) + renderer + .renderLpgmIntensityIcon( + context, + intensity, + type, + ) + .then( + (value) => switch (type) { + IntensityIconType.small => ref + .read( + lpgmIntensityIconRenderProvider + .notifier, + ) + .onRendered( + value, + intensity, + ), + IntensityIconType.smallWithoutText => ref + .read( + lpgmIntensityIconFillRenderProvider + .notifier, + ) + .onRendered( + value, + intensity, + ), + _ => null, + }, + ), + ], + for (final type in HypocenterType.values) + renderer + .renderHypocenterIcon( + context, + type, + ) + .then( + (value) => switch (type) { + HypocenterType.normal => ref + .read(hypocenterIconRenderProvider.notifier) + .onRendered( + value, + ), + HypocenterType.lowPrecise => ref + .read( + hypocenterLowPreciseIconRenderProvider + .notifier, + ) + .onRendered( + value, + ), + }, + ), + renderer.renderCurrentLocationIcon(context).then( + (value) => ref .read( - hypocenterLowPreciseIconRenderProvider - .notifier, + currentLocationIconRenderProvider.notifier, ) - .onRendered( - value, - ), - }, - ), - renderer.renderCurrentLocationIcon(context).then( - (value) => ref - .read(currentLocationIconRenderProvider.notifier) - .onRendered(value), - ), - ]; - await futures.wait; - // 画像のキャッシュが終わったかどうかを確認 - final images = ( - intenistyIcon: ref.read(intensityIconRenderProvider), - intensityIconFill: ref.read(intensityIconFillRenderProvider), - hypocenterIcon: ref.read(hypocenterIconRenderProvider), - hypocenterLowPreciseIcon: - ref.read(hypocenterLowPreciseIconRenderProvider), - currentLocationIcon: - ref.read(currentLocationIconRenderProvider), - ); - if (images.hypocenterIcon != null && - images.hypocenterLowPreciseIcon != null && - images.intenistyIcon.isAllRendered() && - images.intensityIconFill.isAllRendered() && - images.currentLocationIcon != null) { - unawaited(FirebaseCrashlytics.instance.log('画像のキャッシュ 成功')); - return false; - } - await Future.delayed(const Duration(milliseconds: 1000)); - return true; - // ignore: avoid_catches_without_on_clauses - } catch (e) { - await Future.delayed(const Duration(milliseconds: 1000)); - return true; - } - }), - ).wait; - }); + .onRendered(value), + ), + ]; + await futures.wait; + // 画像のキャッシュが終わったかどうかを確認 + final images = ( + intenistyIcon: ref.read(intensityIconRenderProvider), + intensityIconFill: + ref.read(intensityIconFillRenderProvider), + hypocenterIcon: ref.read(hypocenterIconRenderProvider), + hypocenterLowPreciseIcon: + ref.read(hypocenterLowPreciseIconRenderProvider), + currentLocationIcon: + ref.read(currentLocationIconRenderProvider), + ); + if (images.hypocenterIcon != null && + images.hypocenterLowPreciseIcon != null && + images.intenistyIcon.isAllRendered() && + images.intensityIconFill.isAllRendered() && + images.currentLocationIcon != null) { + unawaited( + FirebaseCrashlytics.instance.log('画像のキャッシュ 成功'), + ); + return false; + } + await Future.delayed( + const Duration(milliseconds: 1000), + ); + return true; + // ignore: avoid_catches_without_on_clauses + } catch (e) { + await Future.delayed( + const Duration(milliseconds: 1000), + ); + return true; + } + }), + ).wait; + }, + ), + ); return null; }, [], @@ -440,7 +458,7 @@ class _Fabs extends ConsumerWidget { FloatingActionButton.small( heroTag: 'sheet', tooltip: '強震モニタの設定', - onPressed: () => showModalBottomSheet( + onPressed: () async => showModalBottomSheet( context: context, builder: (context) => const KmoniSettingsModal(), ), @@ -495,25 +513,26 @@ class _Sheet extends ConsumerWidget { '震度データベースを用いて、より過去の地震情報を検索できます', ), leading: const Icon(Icons.history), - onTap: () => + onTap: () async => const EarthquakeHistoryEarlyRoute().push(context), ), const _NotificationMigrationWidget(), ListTile( title: const Text('地震・津波に関するお知らせ'), leading: const Icon(Icons.info), - onTap: () => const InformationHistoryRoute().push(context), + onTap: () async => + const InformationHistoryRoute().push(context), ), ListTile( title: const Text('設定'), leading: const Icon(Icons.settings), - onTap: () => const SettingsRoute().push(context), + onTap: () async => const SettingsRoute().push(context), ), if (kDebugMode) ListTile( title: const Text('Debug'), leading: const Icon(Icons.bug_report), - onTap: () => const DebuggerRoute().push(context), + onTap: () async => const DebuggerRoute().push(context), ), const SizedBox(height: 200), ], @@ -564,7 +583,7 @@ class _NotificationPermission extends ConsumerWidget { children: [ const Text('通知を受け取るためには、通知の許可が必要です。'), TextButton.icon( - onPressed: () => ref + onPressed: () async => ref .read(permissionNotifierProvider.notifier) .requestNotificationPermission(), icon: const Icon(Icons.notifications), 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 bed6b8bbb..33113279b 100644 --- a/app/lib/feature/information_history/page/information_history_page.dart +++ b/app/lib/feature/information_history/page/information_history_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/component/widget/error_widget.dart'; import 'package:eqmonitor/core/router/router.dart'; @@ -16,19 +18,21 @@ class InformationHistoryPage extends HookConsumerWidget { final scrollController = PrimaryScrollController.of(context); useEffect( () { - WidgetsBinding.instance.endOfFrame.then( - (_) { - scrollController.addListener( - () => ref + unawaited( + WidgetsBinding.instance.endOfFrame.then( + (_) async { + scrollController.addListener( + () => ref + .read(informationHistoryViewModelProvider.notifier) + .onScrollPositionChanged( + scrollController, + ), + ); + await ref .read(informationHistoryViewModelProvider.notifier) - .onScrollPositionChanged( - scrollController, - ), - ); - ref - .read(informationHistoryViewModelProvider.notifier) - .updateIfNull(); - }, + .updateIfNull(); + }, + ), ); return null; }, @@ -104,7 +108,7 @@ class _InformationDataView extends HookConsumerWidget { subtitle: Text( '${dateFormat.format(item.createdAt.toLocal())}頃発表', ), - onTap: () => + onTap: () async => InformationHistoryDetailsRoute($extra: item).push( context, ), diff --git a/app/lib/feature/information_history/repository/information_repository.dart b/app/lib/feature/information_history/repository/information_repository.dart index 21c34c806..08b2e37e2 100644 --- a/app/lib/feature/information_history/repository/information_repository.dart +++ b/app/lib/feature/information_history/repository/information_repository.dart @@ -2,12 +2,13 @@ import 'package:eqapi_client/eqapi_client.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; import 'package:eqmonitor/core/foundation/result.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'information_repository.g.dart'; @Riverpod(keepAlive: true) -InformationRepository informationRepository(InformationRepositoryRef ref) => +InformationRepository informationRepository(Ref ref) => InformationRepository(ref.watch(eqApiProvider)); class InformationRepository { 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 c86be8377..c1efebd89 100644 --- a/app/lib/feature/information_history/repository/information_repository.g.dart +++ b/app/lib/feature/information_history/repository/information_repository.g.dart @@ -9,7 +9,7 @@ part of 'information_repository.dart'; // ************************************************************************** String _$informationRepositoryHash() => - r'5cfdd4f2b17b34f872c535daaee98bcc4c7a1bb2'; + r'75d6f6f782d220137ee4574b68b6dbb676b98ec3'; /// See also [informationRepository]. @ProviderFor(informationRepository) @@ -23,6 +23,8 @@ final informationRepositoryProvider = Provider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef InformationRepositoryRef = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/viewmodel/information_history_view_model.dart b/app/lib/feature/information_history/viewmodel/information_history_view_model.dart index 53f54cfc5..2b09e69fc 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 @@ -46,7 +46,7 @@ class InformationHistoryViewModel extends _$InformationHistoryViewModel { } } - void onScrollPositionChanged(ScrollController controller) { + Future onScrollPositionChanged(ScrollController controller) async { // エラー発生時・リロード中は何もしない if (state == null) { return; @@ -55,7 +55,7 @@ class InformationHistoryViewModel extends _$InformationHistoryViewModel { return; } if (controller.position.maxScrollExtent - controller.position.pixels < 20) { - update(loadMore: true); + await update(loadMore: true); } } } 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 218201426..1cdc19a15 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 @@ -9,7 +9,7 @@ part of 'information_history_view_model.dart'; // ************************************************************************** String _$informationHistoryViewModelHash() => - r'b25c689d00bd14df0d5ea02d8f6c1cf2104a84d5'; + r'5fa73ce0ed26b966a84c97d115460103977f7868'; /// See also [InformationHistoryViewModel]. @ProviderFor(InformationHistoryViewModel) @@ -27,4 +27,4 @@ final informationHistoryViewModelProvider = NotifierProvider< 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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.dart b/app/lib/feature/location/data/location.dart index cf437750a..8b02273f7 100644 --- a/app/lib/feature/location/data/location.dart +++ b/app/lib/feature/location/data/location.dart @@ -1,5 +1,6 @@ import 'package:eqmonitor/core/provider/kmoni_observation_points/provider/kyoshin_observation_points_provider.dart'; import 'package:geolocator/geolocator.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:kyoshin_observation_point_types/kyoshin_observation_point.pb.dart'; import 'package:latlong2/latlong.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -7,7 +8,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'location.g.dart'; @riverpod -Stream locationStream(LocationStreamRef ref) async* { +Stream locationStream(Ref ref) async* { final stream = Geolocator.getPositionStream( locationSettings: const LocationSettings( accuracy: LocationAccuracy.low, @@ -33,7 +34,7 @@ Stream locationStream(LocationStreamRef ref) async* { @riverpod Stream<(KyoshinObservationPoint, double km)> closestKmoniObservationPointStream( - ClosestKmoniObservationPointStreamRef ref, + Ref ref, ) async* { final kmoniObservationPoints = ref.watch(kyoshinObservationPointsProvider); diff --git a/app/lib/feature/location/data/location.g.dart b/app/lib/feature/location/data/location.g.dart index e99af6a8b..8f8c89a68 100644 --- a/app/lib/feature/location/data/location.g.dart +++ b/app/lib/feature/location/data/location.g.dart @@ -8,7 +8,7 @@ part of 'location.dart'; // RiverpodGenerator // ************************************************************************** -String _$locationStreamHash() => r'8da3ef598118ac847f76a6d2d9440955493b3690'; +String _$locationStreamHash() => r'512cf5869f3db7a5bc88d1c027ab5cc84e006ab8'; /// See also [locationStream]. @ProviderFor(locationStream) @@ -22,9 +22,11 @@ final locationStreamProvider = AutoDisposeStreamProvider.internal( allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef LocationStreamRef = AutoDisposeStreamProviderRef; String _$closestKmoniObservationPointStreamHash() => - r'9ed9db9ec44171fb92f9f211d659cbc490538f43'; + r'0094c2c47c008397a4f460398410ce01c5f4847a'; /// See also [closestKmoniObservationPointStream]. @ProviderFor(closestKmoniObservationPointStream) @@ -39,7 +41,9 @@ final closestKmoniObservationPointStreamProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/application_info/about_this_app.dart b/app/lib/feature/settings/children/application_info/about_this_app.dart index 82280e2bf..65c28b590 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 @@ -12,8 +12,10 @@ class AboutThisAppScreen extends HookWidget { @override Widget build(BuildContext context) { - final markdownFuture = - useMemoized(() => rootBundle.loadString(Assets.docs.aboutThisApp)); + // ignore: discarded_futures + final markdownFuture = useMemoized( + () async => rootBundle.loadString(Assets.docs.aboutThisApp), + ); final markdown = useFuture(markdownFuture); return Scaffold( appBar: AppBar( @@ -26,13 +28,13 @@ class AboutThisAppScreen extends HookWidget { ListTile( title: const Text('利用規約'), leading: const Icon(Icons.description), - onTap: () => + onTap: () async => const TermOfServiceRoute($extra: null).push(context), ), ListTile( title: const Text('プライバシーポリシー'), leading: const Icon(Icons.info), - onTap: () => + onTap: () async => const PrivacyPolicyRoute($extra: null).push(context), ), ListTile( @@ -40,7 +42,7 @@ class AboutThisAppScreen extends HookWidget { subtitle: Text('MIT License ${DateTime.now().year} Ryotaro Onoue'), leading: const Icon(Icons.settings), - onTap: () => const LicenseRoute().push(context), + onTap: () async => const LicenseRoute().push(context), ), const Divider(), BorderedContainer( 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 9fd5d4c9f..77adba4d7 100644 --- a/app/lib/feature/settings/children/application_info/license_page.dart +++ b/app/lib/feature/settings/children/application_info/license_page.dart @@ -30,14 +30,13 @@ class LicensePage extends ConsumerWidget { ), TextButton( child: const Text('https://github.com/YumNumm/EQMonitor'), - onPressed: () => + onPressed: () async => launchUrlString('https://github.com/YumNumm/EQMonitor'), ), TextButton( child: const Text('https://license.eqmonitor.app'), - onPressed: () => 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 ab89f90e4..5d5a43841 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 @@ -32,7 +32,10 @@ class _PrivacyPolicyScreenBody extends HookWidget { @override Widget build(BuildContext context) { final markdownBody = useFuture( - useMemoized(() => rootBundle.loadString(Assets.docs.privacyPolicy)), + // ignore: discarded_futures + useMemoized( + () async => rootBundle.loadString(Assets.docs.privacyPolicy), + ), initialData: '', ); final data = markdownBody.data; 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 029be34bc..ea44bae30 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 @@ -32,7 +32,10 @@ class _TermOfServiceScreenBody extends HookWidget { @override Widget build(BuildContext context) { final markdownBody = useFuture( - useMemoized(() => rootBundle.loadString(Assets.docs.termOfService)), + // ignore: discarded_futures + useMemoized( + () async => rootBundle.loadString(Assets.docs.termOfService), + ), initialData: '', ); final data = markdownBody.data; 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 cbf06797a..2e8be4b4a 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 @@ -26,22 +26,18 @@ class HttpApiEndpointSelectorPage extends ConsumerWidget { subtitle: Text(defaultUrl), value: defaultUrl, groupValue: state, - onChanged: (value) { - 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) { - 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 6cb65811e..9783b8bbf 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 @@ -26,22 +26,18 @@ class WebSocketApiEndpointSelectorPage extends ConsumerWidget { subtitle: Text(defaultUrl), value: defaultUrl, groupValue: state, - onChanged: (value) { - 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) { - 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/debugger_page.dart b/app/lib/feature/settings/children/config/debug/debugger_page.dart index 13ea31f78..3a4e3c0d1 100644 --- a/app/lib/feature/settings/children/config/debug/debugger_page.dart +++ b/app/lib/feature/settings/children/config/debug/debugger_page.dart @@ -61,14 +61,14 @@ class _DebugWidget extends ConsumerWidget { const SheetHeader(title: 'デバッグメニュー'), SwitchListTile.adaptive( value: eewSettings.showCalculatedRegionIntensity, - onChanged: (value) => ref + onChanged: (value) async => ref .read(eewSettingsNotifierProvider.notifier) .setShowCalculatedRegionIntensity(value: value), title: const Text('距離減衰式による予想震度(Region)'), ), SwitchListTile.adaptive( value: eewSettings.showCalculatedCityIntensity, - onChanged: (value) => ref + onChanged: (value) async => ref .read(eewSettingsNotifierProvider.notifier) .setShowCalculatedCityIntensity(value: value), title: const Text('距離減衰式による予想震度(City)'), @@ -76,7 +76,7 @@ class _DebugWidget extends ConsumerWidget { ListTile( title: const Text('ログ'), leading: const Icon(Icons.list), - onTap: () => context.push(const TalkerRoute().location), + onTap: () async => context.push(const TalkerRoute().location), ), ListTile( title: const Text('EEW Test'), @@ -87,14 +87,14 @@ class _DebugWidget extends ConsumerWidget { title: const Text('REST APIエンドポイント'), leading: const Icon(Icons.http), subtitle: Text(ref.watch(telegramUrlProvider).restApiUrl), - onTap: () => + onTap: () async => const HttpApiEndpointSelectorRoute().push(context), ), ListTile( title: const Text('WebSocketエンドポイント'), leading: const Icon(Icons.http), subtitle: Text(ref.watch(telegramUrlProvider).wsApiUrl), - onTap: () => + onTap: () async => const WebsocketEndpointSelectorRoute().push(context), ), ListTile( @@ -153,10 +153,8 @@ class _DebugWidget extends ConsumerWidget { }, ), FilledButton.icon( - onPressed: () => + onPressed: () async => context.push('/earthquake-history-details/20240526142329'), - // const EarthquakeHistoryDetailsRoute(eventId: 20201122190603) - // .push(context), icon: const Icon(Icons.list), label: const Text( "context.push('/earthquake-history-details/20240526142329')", @@ -164,7 +162,7 @@ class _DebugWidget extends ConsumerWidget { ), SwitchListTile.adaptive( value: ref.watch(isDioProxyEnabledProvider), - onChanged: (value) => ref + onChanged: (value) async => ref .read(isDioProxyEnabledProvider.notifier) .set(value: value), title: const Text('Dio Proxy'), @@ -208,7 +206,7 @@ class _Route extends StatelessWidget { return ListTile( title: Text(path), - onTap: () => context.push( + onTap: () async => context.push( path, ), visualDensity: VisualDensity.compact, 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 86a8e30a0..552a824b4 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 @@ -47,7 +47,7 @@ class _EarthquakeHistoryListConfigWidget extends ConsumerWidget { SwitchListTile.adaptive( title: const Text('最大震度ごとの背景塗りつぶし'), value: state.isFillBackground, - onChanged: (value) => ref + onChanged: (value) async => ref .read(earthquakeHistoryConfigProvider.notifier) .updateListConfig( state.copyWith( @@ -61,7 +61,7 @@ class _EarthquakeHistoryListConfigWidget extends ConsumerWidget { title: const Text('訓練・試験報の情報を表示する'), subtitle: const Text('気象庁により作成された、訓練・試験用の緊急地震速報の情報を表示します。※非推奨'), value: state.includeTestTelegrams, - onChanged: (value) => ref + onChanged: (value) async => ref .read(earthquakeHistoryConfigProvider.notifier) .updateListConfig( state.copyWith( @@ -229,7 +229,7 @@ class _EarthquakeHistoryDetailConfigBody extends HookConsumerWidget { selected: showingLpgmIntensity ? _IntensityMode.lpgm : _IntensityMode.intensity, - onSelected: (value) => ref + onSelected: (value) async => ref .read(earthquakeHistoryConfigProvider.notifier) .updateDetailConfig( ref @@ -281,7 +281,7 @@ class __IntensityFillModeSegmentedControlState : const TextStyle(color: Colors.grey), ), }, - onValueChanged: (value) { + onValueChanged: (value) async { if (value != null) { final isAllowed = showCitySelector || value != IntensityFillMode.fillCity; @@ -293,7 +293,7 @@ class __IntensityFillModeSegmentedControlState setState(() {}); return; } - ref + await ref .read(earthquakeHistoryConfigProvider.notifier) .updateDetailConfig( state.copyWith(intensityFillMode: value), @@ -304,7 +304,7 @@ class __IntensityFillModeSegmentedControlState } else { return SegmentedButton( selected: {state.intensityFillMode}, - onSelectionChanged: (p0) => ref + onSelectionChanged: (p0) async => ref .read(earthquakeHistoryConfigProvider.notifier) .updateDetailConfig( state.copyWith(intensityFillMode: p0.first), @@ -380,7 +380,7 @@ class _IntensityStationIconModeSegmentedButton extends ConsumerWidget { return SwitchListTile.adaptive( title: Text(isShowingLpgmIntensity ? '長周期地震動階級アイコンを表示する' : '震度アイコンを表示する'), value: state.showIntensityIcon, - onChanged: (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.g.dart b/app/lib/feature/settings/children/config/notification/earthquake/earthquake_notification_settings_view_model.g.dart index 81b50f361..3043c0df8 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 @@ -28,4 +28,4 @@ final earthquakeNotificationSettingsViewModelProvider = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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.g.dart b/app/lib/feature/settings/children/config/notification/eew/eew_notification_settings_view_model.g.dart index 30012a56c..2deb60472 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 @@ -26,4 +26,4 @@ final eewNotificationsSettingsViewModelProvider = AutoDisposeNotifierProvider< typedef _$EewNotificationsSettingsViewModel = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/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 9196a437e..19a2c663d 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 @@ -21,11 +21,9 @@ class ColorSchemeConfigPage extends ConsumerWidget { RadioListTile.adaptive( value: IntensityColorModel.eqmonitor(), groupValue: state, - onChanged: (value) { - 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), @@ -37,11 +35,9 @@ class ColorSchemeConfigPage extends ConsumerWidget { RadioListTile.adaptive( value: IntensityColorModel.jma(), groupValue: state, - onChanged: (value) { - 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), @@ -51,11 +47,10 @@ class ColorSchemeConfigPage extends ConsumerWidget { RadioListTile.adaptive( value: IntensityColorModel.earthQuickly(), groupValue: state, - onChanged: (value) { - 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), 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 bd3c0ab33..8a074a732 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 @@ -38,7 +38,8 @@ class _Body extends StatelessWidget { ListTile( title: const Text('震度配色設定'), leading: const Icon(Icons.color_lens), - onTap: () => const ColorSchemeConfigRoute().push(context), + onTap: () async => + const ColorSchemeConfigRoute().push(context), ), ], ), @@ -61,9 +62,8 @@ class _ThemeSelector extends ConsumerWidget { mode == ThemeMode.light ? Brightness.light : Brightness.dark; return Expanded( child: GestureDetector( - onTap: () { - ref.read(themeModeNotifierProvider.notifier).update(mode); - }, + onTap: () async => + ref.read(themeModeNotifierProvider.notifier).update(mode), child: Column( children: [ SizedBox( @@ -99,9 +99,8 @@ class _ThemeSelector extends ConsumerWidget { : null : mode, groupValue: state, - onChanged: (value) { - ref.read(themeModeNotifierProvider.notifier).update(mode); - }, + onChanged: (value) async => + ref.read(themeModeNotifierProvider.notifier).update(mode), ), ], ), @@ -142,16 +141,15 @@ class _ThemeSelector extends ConsumerWidget { visualDensity: VisualDensity.compact, title: const Text('システム設定に従う'), value: state == ThemeMode.system, - onChanged: (value) { - ref.read(themeModeNotifierProvider.notifier).update( - value - ? ThemeMode.system - : PlatformDispatcher.instance.platformBrightness == - Brightness.light - ? ThemeMode.light - : ThemeMode.dark, - ); - }, + onChanged: (value) async => + ref.read(themeModeNotifierProvider.notifier).update( + value + ? ThemeMode.system + : PlatformDispatcher.instance.platformBrightness == + Brightness.light + ? ThemeMode.light + : ThemeMode.dark, + ), ), ], ), diff --git a/app/lib/feature/settings/features/feedback/feedback_screen.dart b/app/lib/feature/settings/features/feedback/feedback_screen.dart index 240c01f1f..05ba7b6e7 100644 --- a/app/lib/feature/settings/features/feedback/feedback_screen.dart +++ b/app/lib/feature/settings/features/feedback/feedback_screen.dart @@ -1,3 +1,5 @@ +// ignore_for_file: lines_longer_than_80_chars + import 'package:eqmonitor/feature/settings/features/feedback/data/custom_feedback.dart'; import 'package:feedback/feedback.dart'; import 'package:flutter/material.dart'; @@ -7,9 +9,9 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; class CustomFeedbackForm extends HookConsumerWidget { const CustomFeedbackForm({ - super.key, required this.onSubmit, required this.scrollController, + super.key, }); final OnSubmit onSubmit; @@ -109,7 +111,7 @@ class CustomFeedbackForm extends HookConsumerWidget { FilledButton.tonalIcon( // disable this button until the user has specified a feedback type onPressed: customFeedback.value.feedbackType != null - ? () => onSubmit( + ? () async => onSubmit( feedbackText.value, extras: customFeedback.value.toJson(), ) 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 f5c7b1daf..1b4bb4fc1 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 @@ -27,4 +27,4 @@ final notificationLocalSettingsNotifierProvider = AsyncNotifierProvider< 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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_notifier.g.dart b/app/lib/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.g.dart index 1ac8fb0e4..157b056c9 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 @@ -28,4 +28,4 @@ final notificationRemoteSettingsNotifierProvider = AsyncNotifierProvider< 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 9bdacdb95..a99c196ff 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 @@ -1,10 +1,11 @@ import 'package:collection/collection.dart'; import 'package:eqapi_types/eqapi_types.dart'; -import 'package:eqmonitor/core/api/api_authentication_service.dart'; +import 'package:eqmonitor/core/api/api_authentication_notifier.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; import 'package:eqmonitor/core/provider/jma_code_table_provider.dart'; import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/model/notification_remote_settings_state.dart'; import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_notifier.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:jma_code_table_types/jma_code_table.pb.dart' as jma_code_table; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -12,7 +13,7 @@ part 'notification_remote_settings_saved_state.g.dart'; @riverpod bool notificationRemoteSettingsHasChangedFromSavedState( - NotificationRemoteSettingsHasChangedFromSavedStateRef ref, + Ref ref, ) => ref.watch(notificationRemoteSettingsSavedStateNotifierProvider) != ref.watch(notificationRemoteSettingsNotifierProvider); @@ -25,7 +26,7 @@ class NotificationRemoteSettingsSavedStateNotifier final api = ref.read(eqApiProvider); final String? token; try { - token = await ref.read(apiAuthenticationServiceProvider.future); + token = await ref.read(apiAuthenticationNotifierProvider.future); } on Exception catch (e) { throw UnauthorizedException( innerException: e, @@ -41,7 +42,7 @@ class NotificationRemoteSettingsSavedStateNotifier Future updateEarthquake({ required NotificationSettingsRequest request, }) async { - final token = await ref.read(apiAuthenticationServiceProvider.future); + final token = await ref.read(apiAuthenticationNotifierProvider.future); if (token == null) { throw UnauthorizedException(); } @@ -89,7 +90,7 @@ class NotificationRemoteSettingsSavedStateNotifier Future updateEew({ required NotificationSettingsRequest request, }) async { - final token = await ref.read(apiAuthenticationServiceProvider.future); + final token = await ref.read(apiAuthenticationNotifierProvider.future); if (token == null) { throw UnauthorizedException(); } 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 64d68c382..b10feb313 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 @@ -9,7 +9,7 @@ part of 'notification_remote_settings_saved_state.dart'; // ************************************************************************** String _$notificationRemoteSettingsHasChangedFromSavedStateHash() => - r'35840430e86c9631a000ead5de2b0698ea39609b'; + r'c04adf9bbda4cbfdbdfd8034f0604d332adaa85f'; /// See also [notificationRemoteSettingsHasChangedFromSavedState]. @ProviderFor(notificationRemoteSettingsHasChangedFromSavedState) @@ -24,10 +24,12 @@ final notificationRemoteSettingsHasChangedFromSavedStateProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef NotificationRemoteSettingsHasChangedFromSavedStateRef = AutoDisposeProviderRef; String _$notificationRemoteSettingsSavedStateNotifierHash() => - r'7c36f54d5a3448e16db80823c1d35fc677e7d065'; + r'fd1109b2ec2e36e97ed51490d27e29d6972f24d0'; /// See also [NotificationRemoteSettingsSavedStateNotifier]. @ProviderFor(NotificationRemoteSettingsSavedStateNotifier) @@ -46,4 +48,4 @@ final notificationRemoteSettingsSavedStateNotifierProvider = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 536682540..ffe43ac06 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 @@ -26,4 +26,4 @@ final fcmTokenChangeDetectorProvider = typedef _$FcmTokenChangeDetector = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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_authentication_service.dart b/app/lib/feature/settings/features/notification_remote_settings/data/service/notification_remote_authentication_service.dart index 4faea0534..5c75aeb61 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 @@ -1,35 +1,36 @@ import 'package:eqapi_client/eqapi_client.dart'; import 'package:eqapi_types/eqapi_types.dart'; -import 'package:eqmonitor/core/api/api_authentication_service.dart'; +import 'package:eqmonitor/core/api/api_authentication_notifier.dart'; import 'package:eqmonitor/core/api/eq_api.dart'; import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'notification_remote_authentication_service.g.dart'; @Riverpod(keepAlive: true) NotificationRemoteAuthenticationService notificationRemoteAuthenticateService( - NotificationRemoteAuthenticateServiceRef ref, + Ref ref, ) => NotificationRemoteAuthenticationService( api: ref.watch(eqApiProvider), apiAuthenticationService: - ref.watch(apiAuthenticationServiceProvider.notifier), + ref.watch(apiAuthenticationNotifierProvider.notifier), ref: ref, ); class NotificationRemoteAuthenticationService { NotificationRemoteAuthenticationService({ required EqApi api, - required ApiAuthenticationService apiAuthenticationService, - required NotificationRemoteAuthenticateServiceRef ref, + required ApiAuthenticationNotifier apiAuthenticationService, + required Ref ref, }) : _api = api, _apiAuthenticationService = apiAuthenticationService, _ref = ref; final EqApi _api; - final ApiAuthenticationService _apiAuthenticationService; - final NotificationRemoteAuthenticateServiceRef _ref; + final ApiAuthenticationNotifier _apiAuthenticationService; + final Ref _ref; Future authenticate({ required String fcmToken, @@ -50,7 +51,7 @@ class NotificationRemoteAuthenticationService { required String fcmToken, }) async { final authorization = - await _ref.read(apiAuthenticationServiceProvider.future); + await _ref.read(apiAuthenticationNotifierProvider.future); if (authorization == null) { throw UnauthorizedException(); } 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 dec4a6ee9..fd717ebbe 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 @@ -9,7 +9,7 @@ part of 'notification_remote_authentication_service.dart'; // ************************************************************************** String _$notificationRemoteAuthenticateServiceHash() => - r'2b489c3623656dad6bcae5acf9afad2ed9ffa670'; + r'98471376ed9c8902c7243c5b897f5e8555640b48'; /// See also [notificationRemoteAuthenticateService]. @ProviderFor(notificationRemoteAuthenticateService) @@ -24,7 +24,9 @@ final notificationRemoteAuthenticateServiceProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 247ad801e..e4eb5462c 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 @@ -1,7 +1,7 @@ import 'dart:developer'; import 'package:eqapi_types/eqapi_types.dart'; -import 'package:eqmonitor/core/api/api_authentication_service.dart'; +import 'package:eqmonitor/core/api/api_authentication_notifier.dart'; import 'package:eqmonitor/core/provider/notification_token.dart'; import 'package:eqmonitor/core/provider/shared_preferences.dart'; import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart'; @@ -21,7 +21,7 @@ class NotificationRemoteSettingsInitialSetupNotifier final isMigrated = _getIsMigrated(); // Tokenを持っているかどうか確認 final authorization = - await ref.read(apiAuthenticationServiceProvider.future); + await ref.read(apiAuthenticationNotifierProvider.future); if (isMigrated && authorization != null) { yield NotificationRemoteSettingsSetupState.completed; log( 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 0b7d58131..5566e9c04 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 @@ -9,7 +9,7 @@ part of 'notification_remote_settings_migrate_service.dart'; // ************************************************************************** String _$notificationRemoteSettingsInitialSetupNotifierHash() => - r'fd684d0a1e8cce4294e03a2ac89da7797773891d'; + r'c07726a8460cb9b4374dd27e333e424aa428d827'; /// See also [NotificationRemoteSettingsInitialSetupNotifier]. @ProviderFor(NotificationRemoteSettingsInitialSetupNotifier) @@ -28,4 +28,4 @@ final notificationRemoteSettingsInitialSetupNotifierProvider = 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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 60c0524f9..45335c56a 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 @@ -7,9 +7,9 @@ import 'package:flutter/material.dart'; class EarthquakeStatusWidget extends StatelessWidget { const EarthquakeStatusWidget({ - super.key, required this.earthquake, required this.action, + super.key, }); final NotificationRemoteSettingsEarthquake earthquake; @@ -53,8 +53,8 @@ class EarthquakeStatusWidget extends StatelessWidget { class EarthquakeNotificationStatusText extends StatelessWidget { const EarthquakeNotificationStatusText({ - super.key, required this.earthquake, + super.key, }); final NotificationRemoteSettingsEarthquake earthquake; 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 066ee5147..8d0e375a8 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 @@ -7,9 +7,9 @@ import 'package:flutter/material.dart'; class EewStatusWidget extends StatelessWidget { const EewStatusWidget({ - super.key, required this.eew, required this.action, + super.key, }); final NotificationRemoteSettingsEew eew; @@ -53,8 +53,8 @@ class EewStatusWidget extends StatelessWidget { class EewNotificationStatusWidget extends StatelessWidget { const EewNotificationStatusWidget({ - super.key, required this.eew, + super.key, }); final NotificationRemoteSettingsEew eew; 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 691d29bbf..f9e1d0c9e 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 @@ -161,13 +161,14 @@ class _Data extends StatelessWidget { children: [ EarthquakeStatusWidget( earthquake: state.earthquake, - action: () => + action: () async => const NotificationEarthquakeRoute().push(context), ), const SizedBox(height: 16), EewStatusWidget( eew: state.eew, - action: () => 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 aff252c97..1093c9965 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 @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:collection/collection.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/component/container/bordered_container.dart'; @@ -219,8 +221,8 @@ class _RegionsChoiceView extends ConsumerWidget { (global == null) || region.minJmaIntensity < (global!); final child = Dismissible( key: ValueKey(region.regionId), - onDismissed: (direction) { - HapticFeedback.mediumImpact(); + onDismissed: (direction) async { + unawaited(HapticFeedback.mediumImpact(),); ref .read(notificationRemoteSettingsNotifierProvider.notifier) .updateEarthquakeRegions( @@ -360,18 +362,15 @@ class _AddRegionFloatingActionButton extends StatelessWidget { label: const Text('地域を追加'), icon: const Icon(Icons.add), onPressed: canAddRegion - ? () { - showDialog( + ? () async => showDialog( context: context, builder: (context) { return _AddRegionChoiceDialog( alreadySelectedRegions: regions, ); }, - ); - } - : () { - showDialog( + ) + : () async => showDialog( context: context, builder: (context) { return DefaultTextStyle( @@ -394,8 +393,7 @@ class _AddRegionFloatingActionButton extends StatelessWidget { ), ); }, - ); - }, + ), ); } } 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 76ac30be2..c08d3d00b 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 @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:collection/collection.dart'; import 'package:eqapi_types/eqapi_types.dart'; import 'package:eqmonitor/core/component/container/bordered_container.dart'; @@ -220,8 +222,10 @@ class _RegionsChoiceView extends ConsumerWidget { (global == null) || region.minJmaIntensity < (global!); final child = Dismissible( key: ValueKey(region.regionId), - onDismissed: (direction) { - HapticFeedback.mediumImpact(); + onDismissed: (direction) async { + unawaited( + HapticFeedback.mediumImpact(), + ); ref .read(notificationRemoteSettingsNotifierProvider.notifier) .updateEewRegions( @@ -319,18 +323,15 @@ class _AddRegionFloatingActionButton extends StatelessWidget { label: const Text('地域を追加'), icon: const Icon(Icons.add), onPressed: canAddRegion - ? () { - showDialog( + ? () async => showDialog( context: context, builder: (context) { return _AddRegionChoiceDialog( alreadySelectedRegions: regions, ); }, - ); - } - : () { - showDialog( + ) + : () async => showDialog( context: context, builder: (context) { return DefaultTextStyle( @@ -353,8 +354,7 @@ class _AddRegionFloatingActionButton extends StatelessWidget { ), ); }, - ); - }, + ), ); } } diff --git a/app/lib/feature/settings/settings_screen.dart b/app/lib/feature/settings/settings_screen.dart index e1b3e32d6..c323673d8 100644 --- a/app/lib/feature/settings/settings_screen.dart +++ b/app/lib/feature/settings/settings_screen.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:eqmonitor/core/api/api_authentication_service.dart'; +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'; @@ -61,29 +61,29 @@ class SettingsScreen extends ConsumerWidget { '開発者に寄付することで、アプリの開発を支援できます', ), leading: const Icon(Icons.lightbulb), - onTap: () => const DonationRoute().push(context), + onTap: () async => const DonationRoute().push(context), ), ), const SettingsSectionHeader(text: '各種設定'), ListTile( title: const Text('通知条件設定'), leading: const Icon(Icons.notifications), - onTap: () => const NotificationRoute().push(context), + onTap: () async => const NotificationRoute().push(context), ), ListTile( title: const Text('表示設定'), leading: const Icon(Icons.color_lens), - onTap: () => const DisplayRoute().push(context), + onTap: () async => const DisplayRoute().push(context), ), ListTile( title: const Text('強震モニタ設定'), leading: const Icon(Icons.settings), - onTap: () => context.push(const KmoniRoute().location), + onTap: () async => context.push(const KmoniRoute().location), ), ListTile( title: const Text('地震履歴設定'), leading: const Icon(Icons.history), - onTap: () => context.push( + onTap: () async => context.push( const EarthquakeHistoryConfigRoute().location, ), ), @@ -92,19 +92,19 @@ class SettingsScreen extends ConsumerWidget { title: const Text('フィードバック'), subtitle: const Text('ご意見・ご要望などもこちらからお願いします'), leading: const Icon(Icons.feedback), - onTap: () => _onInquiryTap(context, ref), + onTap: () async => _onInquiryTap(context, ref), ), ListTile( title: const Text('このアプリケーションについて'), subtitle: const Text('利用規約やプライバシーポリシーを確認できます'), leading: const Icon(Icons.description), - onTap: () => const AboutThisAppRoute().push(context), + onTap: () async => const AboutThisAppRoute().push(context), ), ListTile( title: const Text('サーバの稼働状況'), subtitle: const Text('外部Webサイトへ遷移します'), leading: const Icon(Icons.network_ping), - onTap: () => launchUrlString( + onTap: () async => launchUrlString( 'https://status.eqmonitor.app/', mode: LaunchMode.externalApplication, ), @@ -130,7 +130,7 @@ class SettingsScreen extends ConsumerWidget { ListTile( title: const Text('デバッグメニュー'), leading: const Icon(Icons.bug_report), - onTap: () => context.push(const DebuggerRoute().location), + onTap: () async => context.push(const DebuggerRoute().location), ), ], ], @@ -168,7 +168,7 @@ Future _onInquiryTap(BuildContext context, WidgetRef ref) async { (feedback) async { final packageInfo = ref.read(packageInfoProvider); final payload = await ref - .read(apiAuthenticationServiceProvider.notifier) + .read(apiAuthenticationNotifierProvider.notifier) .extractPayload(); final base = '--------------------------\n' diff --git a/app/lib/feature/setup/component/background_image.dart b/app/lib/feature/setup/component/background_image.dart index 78b142b52..8ae78d1ab 100644 --- a/app/lib/feature/setup/component/background_image.dart +++ b/app/lib/feature/setup/component/background_image.dart @@ -25,6 +25,7 @@ class SetupBackgroundImageWidget extends HookWidget { double elapsedTimeInSeconds() => (DateTime.now().millisecondsSinceEpoch - startTime.value) / 1000; final shader = useFuture( + // ignore: discarded_futures FragmentProgram.fromAsset( 'shaders/introduction.frag', ), diff --git a/app/lib/feature/setup/pages/introduction_page.dart b/app/lib/feature/setup/pages/introduction_page.dart index 31ad29b8b..d369844a0 100644 --- a/app/lib/feature/setup/pages/introduction_page.dart +++ b/app/lib/feature/setup/pages/introduction_page.dart @@ -75,7 +75,7 @@ class IntroductionPage extends StatelessWidget { decoration: TextDecoration.underline, ), recognizer: TapGestureRecognizer() - ..onTap = () => context.push( + ..onTap = () async => context.push( const TermOfServiceRoute($extra: null).location, ), ), @@ -88,7 +88,7 @@ class IntroductionPage extends StatelessWidget { decoration: TextDecoration.underline, ), recognizer: TapGestureRecognizer() - ..onTap = () => context.push( + ..onTap = () async => context.push( const PrivacyPolicyRoute($extra: null).location, ), ), diff --git a/app/lib/feature/setup/pages/kmoni_warn.dart b/app/lib/feature/setup/pages/kmoni_warn.dart index 2d233c099..5cba57268 100644 --- a/app/lib/feature/setup/pages/kmoni_warn.dart +++ b/app/lib/feature/setup/pages/kmoni_warn.dart @@ -67,9 +67,9 @@ class KmoniWarnPage extends ConsumerWidget { class UseKmoniButton extends StatelessWidget { const UseKmoniButton({ - super.key, required this.onDisabled, required this.onEnabled, + super.key, }); final void Function() onDisabled; diff --git a/app/lib/feature/setup/screen/setup_screen.dart b/app/lib/feature/setup/screen/setup_screen.dart index 1233fb978..55013f771 100644 --- a/app/lib/feature/setup/screen/setup_screen.dart +++ b/app/lib/feature/setup/screen/setup_screen.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:eqmonitor/core/provider/shared_preferences.dart'; import 'package:eqmonitor/core/router/router.dart'; import 'package:eqmonitor/feature/setup/component/background_image.dart'; @@ -15,12 +17,10 @@ class SetupScreen extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final pageController = usePageController(); - void next() { - pageController.nextPage( - duration: const Duration(milliseconds: 200), - curve: Curves.easeInOut, - ); - } + Future next() async => pageController.nextPage( + duration: const Duration(milliseconds: 200), + curve: Curves.easeInOut, + ); final pages = [ IntroductionPage( @@ -31,8 +31,10 @@ class SetupScreen extends HookConsumerWidget { ), KmoniWarnPage(onNext: next), NotificationSettingIntroPage( - onNext: () { - ref.read(sharedPreferencesProvider).setBool('isInitialized', true); + onNext: () async { + unawaited( + ref.read(sharedPreferencesProvider).setBool('isInitialized', true), + ); const HomeRoute().pushReplacement(context); }, ), 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 1f74fb156..d0dbce660 100644 --- a/app/lib/feature/shake_detection/provider/shake_detection_provider.dart +++ b/app/lib/feature/shake_detection/provider/shake_detection_provider.dart @@ -9,6 +9,7 @@ import 'package:eqmonitor/core/provider/websocket/websocket_provider.dart'; import 'package:eqmonitor/feature/shake_detection/model/shake_detection_kmoni_merged_event.dart'; import 'package:extensions/extensions.dart'; import 'package:flutter/material.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'shake_detection_provider.g.dart'; @@ -21,7 +22,7 @@ class ShakeDetection extends _$ShakeDetection { await ref.watch(_fetchShakeDetectionEventsProvider.future); ref ..listen( - websocketTableMessagesProvider(), + websocketTableMessagesProvider, (_, next) { if (next case AsyncData(value: final value)) { if (value @@ -144,7 +145,7 @@ class ShakeDetectionKmoniPointsMerged @Riverpod(keepAlive: true) Future> _fetchShakeDetectionEvents( - _FetchShakeDetectionEventsRef ref, + Ref ref, ) async => ref.watch(eqApiProvider).v1.getLatestShakeDetectionEvents(); 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 adbd1d077..9c2e12534 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 @@ -9,7 +9,7 @@ part of 'shake_detection_provider.dart'; // ************************************************************************** String _$fetchShakeDetectionEventsHash() => - r'c7a8c166b5fbb423b855af2eb2d6e49ebc4b7d77'; + r'f38c3e2f402f56379e8ee0ebb8c8eef755723690'; /// See also [_fetchShakeDetectionEvents]. @ProviderFor(_fetchShakeDetectionEvents) @@ -24,9 +24,11 @@ final _fetchShakeDetectionEventsProvider = allTransitiveDependencies: null, ); +@Deprecated('Will be removed in 3.0. Use Ref instead') +// ignore: unused_element typedef _FetchShakeDetectionEventsRef = FutureProviderRef>; -String _$shakeDetectionHash() => r'e116f36edfee2d4c06bf0d970baa511438c26d1d'; +String _$shakeDetectionHash() => r'c024f21bfe5df28a1f5c43bc979dd1e3708d0bea'; /// See also [ShakeDetection]. @ProviderFor(ShakeDetection) @@ -62,4 +64,4 @@ final shakeDetectionKmoniPointsMergedProvider = AsyncNotifierProvider< 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, inference_failure_on_uninitialized_variable, inference_failure_on_function_return_type, inference_failure_on_untyped_parameter, deprecated_member_use_from_same_package +// 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/main.dart b/app/lib/main.dart index 67f40d7f3..5c74856dd 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -1,4 +1,4 @@ -// ignore_for_file: unreachable_from_main +// ignore_for_file: unreachable_from_main, prefer_void_to_null import 'dart:async'; import 'dart:developer'; @@ -101,13 +101,10 @@ Future main() async { SharedPreferences.getInstance(), loadKmoniObservationPoints(), PackageInfo.fromPlatform(), - // ignore: prefer_void_to_null (!kIsWeb && Platform.isAndroid ? deviceInfo.androidInfo : Future.value()), - // ignore: prefer_void_to_null (!kIsWeb && Platform.isIOS ? deviceInfo.iosInfo : Future.value()), - kIsWeb ? Future.value() : _registerNotificationChannelIfNeeded(), kIsWeb ? Future.value() : getApplicationDocumentsDirectory(), loadJmaCodeTable(), @@ -169,8 +166,8 @@ Future main() async { ], ); runApp( - ProviderScope( - parent: container, + UncontrolledProviderScope( + container: container, child: const App(), ), ); 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 3321189a4..0cd8cc1da 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 @@ -46,8 +46,7 @@ void main() async { ), ); - testWidgets("遠地地震の場合、'遠地地震'が表示されること(20210121212726)", - (WidgetTester tester) async { + testWidgets("遠地地震の場合、'遠地地震'が表示されること(20210121212726)", (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( earthquake: baseV1.copyWith( @@ -67,8 +66,8 @@ void main() async { expect(find.text('遠地\n地震'), findsOneWidget); }); testWidgets( - '大規模な噴火の場合、\'大規模な噴火\'が表示されること(20210813033300)', - (WidgetTester tester) async { + "大規模な噴火の場合、'大規模な噴火'が表示されること(20210813033300)", + (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( earthquake: baseV1.copyWith( @@ -97,7 +96,7 @@ void main() async { () { testWidgets( 'マグニチュードがある場合、マグニチュードが表示されること', - (WidgetTester tester) async { + (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( earthquake: baseV1.copyWith( @@ -127,7 +126,7 @@ void main() async { ); testWidgets( 'マグニチュードが整数の場合、小数第1位まで表示されること', - (WidgetTester tester) async { + (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( earthquake: baseV1.copyWith( @@ -157,7 +156,7 @@ void main() async { ); testWidgets( 'マグニチュードが小数第2位以降ある場合、四捨五入されて小数第1位まで表示されること(繰り下げケース)', - (WidgetTester tester) async { + (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( earthquake: baseV1.copyWith( @@ -187,7 +186,7 @@ void main() async { ); testWidgets( 'マグニチュードが小数第2位以降ある場合、四捨五入されて小数第1位まで表示されること(繰り上げケース)', - (WidgetTester tester) async { + (tester) async { // Arrange final v1Extended = EarthquakeV1Extended( earthquake: baseV1.copyWith( diff --git a/packages/eqapi_client/lib/src/children/auth.dart b/packages/eqapi_client/lib/src/children/auth.dart index b72eb271a..d0dc7d64d 100644 --- a/packages/eqapi_client/lib/src/children/auth.dart +++ b/packages/eqapi_client/lib/src/children/auth.dart @@ -8,31 +8,31 @@ part 'auth.g.dart'; abstract class AuthApiClient { factory AuthApiClient(Dio dio, {String baseUrl}) = _AuthApiClient; - @PUT("/v1/auth/register") + @PUT('/v1/auth/register') Future> register({ @Body() required FcmTokenRequest request, }); - @PUT("/v1/auth/update") + @PUT('/v1/auth/update') Future> update({ @Body() required FcmTokenRequest request, - @Header("Authorization") required String authorization, + @Header('Authorization') required String authorization, }); @PUT('/v1/auth/settings/eew') Future> updateEewSettings({ @Body() required NotificationSettingsRequest request, - @Header("Authorization") required String authorization, + @Header('Authorization') required String authorization, }); @PUT('/v1/auth/settings/earthquake') Future> updateEarthquakeSettings({ @Body() required NotificationSettingsRequest request, - @Header("Authorization") required String authorization, + @Header('Authorization') required String authorization, }); - @GET("/v1/auth/settings") + @GET('/v1/auth/settings') Future> getNotificationSettings({ - @Header("Authorization") required String authorization, + @Header('Authorization') required String authorization, }); } diff --git a/packages/eqapi_client/lib/src/children/v1.dart b/packages/eqapi_client/lib/src/children/v1.dart index 54e3c1feb..175d00cc7 100644 --- a/packages/eqapi_client/lib/src/children/v1.dart +++ b/packages/eqapi_client/lib/src/children/v1.dart @@ -38,12 +38,13 @@ abstract class V1 { @GET('/v1/earthquake/region') Future>> getEarthquakeRegions({ + @Query('regionCode') required String regionCode, + /// 1~100 @Query('limit') int limit = 10, /// 0~10000 @Query('offset') int offset = 0, - @Query('regionCode') required String regionCode, @Query('intensityLte') String? intensityLte, @Query('intensityGte') String? intensityGte, }); @@ -93,8 +94,8 @@ abstract class V1 { @Query('originTimeLte') DateTime? originTimeLte, @Query('originTimeGte') DateTime? originTimeGte, @Query('sort') - EarthquakeEarlySortType sort = EarthquakeEarlySortType.origin_time, - @Query("ascending") bool ascending = false, + EarthquakeEarlySortType sort = EarthquakeEarlySortType.originTime, + @Query('ascending') bool ascending = false, }); @GET('/v1/shake-detection/latest') @@ -102,8 +103,8 @@ abstract class V1 { } enum EarthquakeEarlySortType { - origin_time, + originTime, magnitude, depth, - max_intensity, + maxIntensity, } diff --git a/packages/eqapi_client/lib/src/children/v1.g.dart b/packages/eqapi_client/lib/src/children/v1.g.dart index 6d786f336..b3ce6e104 100644 --- a/packages/eqapi_client/lib/src/children/v1.g.dart +++ b/packages/eqapi_client/lib/src/children/v1.g.dart @@ -294,7 +294,7 @@ class _V1 implements V1 { String? intensityGte, DateTime? originTimeLte, DateTime? originTimeGte, - EarthquakeEarlySortType sort = EarthquakeEarlySortType.origin_time, + EarthquakeEarlySortType sort = EarthquakeEarlySortType.originTime, bool ascending = false, }) async { final _extra = {}; diff --git a/packages/eqapi_client/lib/src/eqapi_client.dart b/packages/eqapi_client/lib/src/eqapi_client.dart index 78b86efad..a232b36de 100644 --- a/packages/eqapi_client/lib/src/eqapi_client.dart +++ b/packages/eqapi_client/lib/src/eqapi_client.dart @@ -1,5 +1,3 @@ -// ignore_for_file: deprecated_consistency - import 'package:dio/dio.dart'; import 'package:eqapi_client/src/children/auth.dart'; import 'package:eqapi_client/src/children/objects.dart'; diff --git a/packages/eqapi_types/lib/src/model/v1/earthquake.dart b/packages/eqapi_types/lib/src/model/v1/earthquake.dart index 205926125..180976dd0 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake.dart @@ -7,11 +7,12 @@ part 'earthquake.g.dart'; @freezed class EarthquakeV1 with _$EarthquakeV1 implements V1Database { const factory EarthquakeV1({ + required int eventId, + required String status, DateTime? arrivalTime, int? depth, int? epicenterCode, int? epicenterDetailCode, - required int eventId, String? headline, List? intensityCities, List? intensityPrefectures, @@ -28,7 +29,6 @@ class EarthquakeV1 with _$EarthquakeV1 implements V1Database { List? maxIntensityRegionIds, JmaLgIntensity? maxLpgmIntensity, DateTime? originTime, - required String status, String? text, }) = _EarthquakeV1; @@ -40,11 +40,12 @@ class EarthquakeV1 with _$EarthquakeV1 implements V1Database { @freezed class EarthquakeV1Base with _$EarthquakeV1Base { const factory EarthquakeV1Base({ + required int eventId, + required String status, DateTime? arrivalTime, int? depth, int? epicenterCode, int? epicenterDetailCode, - required int eventId, String? headline, double? latitude, double? longitude, @@ -54,7 +55,6 @@ class EarthquakeV1Base with _$EarthquakeV1Base { List? maxIntensityRegionIds, JmaLgIntensity? maxLpgmIntensity, DateTime? originTime, - required String status, String? text, }) = _EarthquakeV1Base; diff --git a/packages/eqapi_types/lib/src/model/v1/eew.dart b/packages/eqapi_types/lib/src/model/v1/eew.dart index adfc5d888..0d7565420 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.dart @@ -14,11 +14,13 @@ class EewV1 with _$EewV1 implements V1Database { required String status, required String infoType, required DateTime reportTime, + required bool isCanceled, + required bool isLastInfo, + required bool? isPlum, + required EewAccuracy? accuracy, int? serialNo, String? headline, - required bool isCanceled, bool? isWarning, - required bool isLastInfo, DateTime? originTime, DateTime? arrivalTime, String? hypoName, @@ -31,8 +33,6 @@ class EewV1 with _$EewV1 implements V1Database { JmaForecastLgIntensity? forecastMaxLpgmIntensity, bool? forecastMaxLpgmIntensityIsOver, List? regions, - required bool? isPlum, - required EewAccuracy? accuracy, }) = _EewV1; factory EewV1.fromJson(Map json) => _$EewV1FromJson(json); diff --git a/packages/eqapi_types/lib/src/model/v1/telegram.dart b/packages/eqapi_types/lib/src/model/v1/telegram.dart index d2c34ec45..1b153c963 100644 --- a/packages/eqapi_types/lib/src/model/v1/telegram.dart +++ b/packages/eqapi_types/lib/src/model/v1/telegram.dart @@ -15,10 +15,10 @@ class TelegramV1 with _$TelegramV1 implements V1Database { required String infoType, required DateTime pressTime, required DateTime reportTime, + required Map body, DateTime? validTime, int? serialNo, String? headline, - required Map body, }) = _TelegramV1; factory TelegramV1.fromJson(Map json) => diff --git a/packages/eqmonitor_lints/lib/analysis_options.yaml b/packages/eqmonitor_lints/lib/analysis_options.yaml index bea5d1f36..ea7673268 100644 --- a/packages/eqmonitor_lints/lib/analysis_options.yaml +++ b/packages/eqmonitor_lints/lib/analysis_options.yaml @@ -3,6 +3,9 @@ include: package:yumemi_lints/flutter/3.24/recommended.yaml linter: rules: diagnostic_describe_all_properties: false + avoid_print: ignore + lines_longer_than_80_chars: ignore + document_ignores: false analyzer: errors: @@ -10,6 +13,8 @@ analyzer: invalid_annotation_target: ignore plugins: - custom_lint + exclude: + - "**/*.*.dart" custom_lint: rules: diff --git a/packages/extensions/lib/src/string.dart b/packages/extensions/lib/src/string.dart index 6a6ca799b..dae6486a7 100644 --- a/packages/extensions/lib/src/string.dart +++ b/packages/extensions/lib/src/string.dart @@ -2,7 +2,7 @@ extension StringExtension on String { /// 全角を半角に変換する String get toHalfWidth { - return split('').map((String char) { + return split('').map((char) { final charCode = char.codeUnitAt(0); if (charCode >= 0xFF01 && charCode <= 0xFF5E) { return String.fromCharCode(charCode - 0xFEE0); @@ -16,7 +16,7 @@ extension StringExtension on String { /// 半角を全角に変換する String get toFullWidth { - return split('').map((String char) { + return split('').map((char) { final charCode = char.codeUnitAt(0); if (charCode >= 0x0021 && charCode <= 0x007E) { return String.fromCharCode(charCode + 0xFEE0); diff --git a/packages/jma_code_table_converter_internal/analysis_options.yaml b/packages/jma_code_table_converter_internal/analysis_options.yaml index 122959d8e..99a1aa108 100644 --- a/packages/jma_code_table_converter_internal/analysis_options.yaml +++ b/packages/jma_code_table_converter_internal/analysis_options.yaml @@ -1 +1,4 @@ include: package:eqmonitor_lints/analysis_options.yaml +analyzer: + errors: + avoid_print: ignore diff --git a/packages/jma_code_table_converter_internal/bin/jma_code_table_converter_internal.dart b/packages/jma_code_table_converter_internal/bin/jma_code_table_converter_internal.dart index 75cdb7240..30a3c9aa3 100644 --- a/packages/jma_code_table_converter_internal/bin/jma_code_table_converter_internal.dart +++ b/packages/jma_code_table_converter_internal/bin/jma_code_table_converter_internal.dart @@ -1,10 +1,10 @@ -import "dart:io"; +import 'dart:io'; -import "package:jma_code_table_converter_internal/jma_code_table_converter_internal.dart"; -import "package:jma_code_table_types/jma_code_table.pb.dart"; +import 'package:jma_code_table_converter_internal/jma_code_table_converter_internal.dart'; +import 'package:jma_code_table_types/jma_code_table.pb.dart'; Future main(List arguments) async { - print("Converting JMA code table..."); + print('Converting JMA code table...'); final converter = JmaCodeTableConverter(); final table = JmaCodeTable( areaForecastLocalEew: await converter.convert22(), @@ -15,7 +15,7 @@ Future main(List arguments) async { ); // mkdir output - final outputDir = Directory("output"); + final outputDir = Directory('output'); if (!outputDir.existsSync()) { outputDir.createSync(); } @@ -24,13 +24,13 @@ Future main(List arguments) async { file.deleteSync(); } // json - final jsonFile = File("output/jma_code_table.json"); + final jsonFile = File('output/jma_code_table.json'); await jsonFile.writeAsString(table.toBuilder().writeToJson()); // binary - final binaryPath = "output/jma_code_table.pb"; + const binaryPath = 'output/jma_code_table.pb'; final binaryFile = File(binaryPath); await binaryFile.writeAsBytes(table.writeToBuffer()); - print("Done."); - print("Output: ${binaryPath}"); + print('Done.'); + print('Output: $binaryPath'); } 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 de3319258..9f2ed6fe2 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 @@ -6,98 +6,108 @@ class JmaCodeTableConverter { Future>> _getCsv(String fileName) async { final file = File(fileName); if (!file.existsSync()) { - throw Exception("File not found: $fileName"); + throw Exception('File not found: $fileName'); } final lines = await file.readAsLines(); return lines .map((line) => line.split(',')) - .where((e) => e.length != 0) + .where((e) => e.isNotEmpty) .toList(); } Future convert22() async { - final csv = await _getCsv("tmp/output_22.csv"); + final csv = await _getCsv('tmp/output_22.csv'); // ["Code", "Name"]以降を取得 final index = csv.indexWhere( - (line) => line[0] == "Code" && line[1] == "Name", + (line) => line[0] == 'Code' && line[1] == 'Name', ); final data = csv .sublist(index + 1) .where((e) => e.length == 4) - .where((e) => e[0] != "None"); - return AreaForecastLocalEew(items: [ - for (final e in data) - AreaForecastLocalEew_AreaForecastLocalEewItem( - code: e[0], - name: e[1], - nameKana: e[2], - description: e[3] == "None" ? "" : e[3], - ), - ]); + .where((e) => e[0] != 'None'); + return AreaForecastLocalEew( + items: [ + for (final e in data) + AreaForecastLocalEew_AreaForecastLocalEewItem( + code: e[0], + name: e[1], + nameKana: e[2], + description: e[3] == 'None' ? '' : e[3], + ), + ], + ); } Future convert23() async { - final csv = await _getCsv("tmp/output_23.csv"); + final csv = await _getCsv('tmp/output_23.csv'); // ["Code", "Name"]以降を取得 final index = csv.indexWhere( - (line) => line[0] == "Code" && line[1] == "Name", + (line) => line[0] == 'Code' && line[1] == 'Name', ); final data = csv .sublist(index + 1) .where((e) => e.length == 2) - .where((e) => e[0] != "None"); - return AreaInformationPrefectureEarthquake(items: [ - for (final e in data) - AreaInformationPrefectureEarthquake_AreaInformationPrefectureEarthquakeItem( - code: e[0], - name: e[1], - ), - ]); + .where((e) => e[0] != 'None'); + return AreaInformationPrefectureEarthquake( + items: [ + for (final e in data) + AreaInformationPrefectureEarthquake_AreaInformationPrefectureEarthquakeItem( + code: e[0], + name: e[1], + ), + ], + ); } Future convert41() async { - final csv = await _getCsv("tmp/output_41.csv"); + final csv = await _getCsv('tmp/output_41.csv'); // ["Code", "Name"]以降を取得 final index = csv.indexWhere( - (line) => line[0] == "Code" && line[1] == "Name", + (line) => line[0] == 'Code' && line[1] == 'Name', ); final data = csv.sublist(index + 1).where((e) => e.length == 2); - return AreaEpicenter(items: [ - for (final e in data) - AreaEpicenter_AreaEpicenterItem( - code: e[0], - name: e[1], - ), - ]); + return AreaEpicenter( + items: [ + for (final e in data) + AreaEpicenter_AreaEpicenterItem( + code: e[0], + name: e[1], + ), + ], + ); } Future convert42() async { - final csv = await _getCsv("tmp/output_42.csv"); + final csv = await _getCsv('tmp/output_42.csv'); final index = csv.indexWhere( - (line) => line[0] == "Code" && line[1] == "Name", + (line) => line[0] == 'Code' && line[1] == 'Name', ); final data = csv.sublist(index + 1).where((e) => e.length == 3); - return AreaEpicenterAbbreviation(items: [ - for (final e in data) - AreaEpicenterAbbreviation_AreaEpicenterAbbreviationItem( - code: e[0], - name: e[1], - ), - ]); + return AreaEpicenterAbbreviation( + items: [ + for (final e in data) + AreaEpicenterAbbreviation_AreaEpicenterAbbreviationItem( + code: e[0], + name: e[1], + ), + ], + ); } Future convert43() async { - final csv = await _getCsv("tmp/output_43.csv"); + final csv = await _getCsv('tmp/output_43.csv'); final index = csv.indexWhere( - (line) => line[0] == "Code" && line[1] == "Name", + (line) => line[0] == 'Code' && line[1] == 'Name', ); final data = csv.sublist(index + 1).where((e) => e.length == 2); - return AreaEpicenterDetail(items: [ - for (final e in data) - AreaEpicenterDetail_AreaEpicenterDetailItem( - code: e[0], - name: e[1], - ), - ]); + return AreaEpicenterDetail( + items: [ + for (final e in data) + AreaEpicenterDetail_AreaEpicenterDetailItem( + code: e[0], + name: e[1], + ), + ], + ); } } diff --git a/packages/jma_code_table_types/analysis_options.yaml b/packages/jma_code_table_types/analysis_options.yaml deleted file mode 100644 index 122959d8e..000000000 --- a/packages/jma_code_table_types/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_map/analysis_options.yaml b/packages/jma_map/analysis_options.yaml deleted file mode 100644 index 122959d8e..000000000 --- a/packages/jma_map/analysis_options.yaml +++ /dev/null @@ -1 +0,0 @@ -include: package:eqmonitor_lints/analysis_options.yaml diff --git a/packages/jma_map/bin/jma_map_protobuf_gen.dart b/packages/jma_map/bin/jma_map_protobuf_gen.dart index 038d62cee..658f55c68 100644 --- a/packages/jma_map/bin/jma_map_protobuf_gen.dart +++ b/packages/jma_map/bin/jma_map_protobuf_gen.dart @@ -54,10 +54,13 @@ Future> _parseGeoJsonToJmaMap( if (geometryType == 'Polygon') { for (final lists in coordinates) { for (final list in lists as List) { + final ld = list as List; + final lat = ld[1] as double; + final lng = ld[0] as double; latLngs.add( LatLng( - lat: list[1] as double, - lng: list[0] as double, + lat: lat, + lng: lng, ), ); } @@ -66,10 +69,13 @@ Future> _parseGeoJsonToJmaMap( for (final lists in coordinates) { for (final list in lists as List) { for (final l in list as List) { + final ld = l as List; + final lat = ld[1] as double; + final lng = ld[0] as double; latLngs.add( LatLng( - lat: l[1] as double, - lng: l[0] as double, + lat: lat, + lng: lng, ), ); } @@ -78,20 +84,26 @@ Future> _parseGeoJsonToJmaMap( } else if (geometryType == 'MultiLineString') { for (final e in coordinates) { for (final list in e as List) { + final ld = list as List; + final lat = ld[1] as double; + final lng = ld[0] as double; latLngs.add( LatLng( - lat: list[1] as double, - lng: list[0] as double, + lat: lat, + lng: lng, ), ); } } } else if (geometryType == 'LineString') { for (final list in coordinates) { + final ld = list as List; + final lat = ld[1] as double; + final lng = ld[0] as double; latLngs.add( LatLng( - lat: list[1] as double, - lng: list[0] as double, + lat: lat, + lng: lng, ), ); } diff --git a/packages/jma_parameter_api_client/pubspec.yaml b/packages/jma_parameter_api_client/pubspec.yaml index c0613c391..f5fff6817 100644 --- a/packages/jma_parameter_api_client/pubspec.yaml +++ b/packages/jma_parameter_api_client/pubspec.yaml @@ -17,6 +17,6 @@ dependencies: dev_dependencies: build_runner: ^2.4.7 - retrofit_generator: ^9.1.2 eqmonitor_lints: path: ../eqmonitor_lints + retrofit_generator: ^9.1.2 diff --git a/packages/jma_parameter_converter_internal/build.yaml b/packages/jma_parameter_converter_internal/build.yaml new file mode 100644 index 000000000..47a9f5bf4 --- /dev/null +++ b/packages/jma_parameter_converter_internal/build.yaml @@ -0,0 +1,11 @@ +targets: + $default: + builders: + source_gen|combining_builder: + options: + ignore_for_file: + - type=lint + - duplicate_ignore + json_serializable: + options: + checked: true diff --git a/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart b/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart index 4176a7922..47a923745 100644 --- a/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart +++ b/packages/jma_parameter_converter_internal/lib/converter/earthquake.dart @@ -3,10 +3,10 @@ import 'dart:io'; import 'package:collection/collection.dart'; import 'package:http/http.dart' as http; +import 'package:jma_parameter_converter_internal/dmdata/earthquake.dart' + as dmdata; import 'package:jma_parameter_types/earthquake_param.pb.dart'; -import '../dmdata/earthquake.dart' as dmdata; - Future fromDmdataEarthquakeParameter( dmdata.EarthquakeParameter parameter, ) async { @@ -44,7 +44,7 @@ Future fromDmdataEarthquakeParameter( ), ), ); - print("itemsGroupByRegionAndCity: ${itemsGroupByRegionAndCity.length}"); + print('itemsGroupByRegionAndCity: ${itemsGroupByRegionAndCity.length}'); final regions = itemsGroupByRegionAndCity.entries.map( (e) => EarthquakeParameterRegionItem( code: e.key.code, @@ -53,14 +53,14 @@ Future fromDmdataEarthquakeParameter( (e) => EarthquakeParameterCityItem( code: e.key.code, name: e.key.name, - stations: (e.value.map( + stations: e.value.map( (e) => e.$2, - )), + ), ), ), ), ); - print("regions: ${regions.length}"); + print('regions: ${regions.length}'); return EarthquakeParameter( regions: regions, ); @@ -71,14 +71,14 @@ Future getArv({ required double longitude, }) async { // Cacheのチェック - final cacheFile = File("cache/${latitude}_$longitude.json"); - if (await cacheFile.exists()) { + final cacheFile = File('cache/${latitude}_$longitude.json'); + if (cacheFile.existsSync()) { 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; } @@ -91,13 +91,13 @@ Future getArv({ ); 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.writeAsString( + cacheFile.writeAsStringSync( jsonEncode(json), ); - print("ARV: $arv"); + print('ARV: $arv'); return null; } diff --git a/packages/jma_parameter_converter_internal/lib/converter/tsunami.dart b/packages/jma_parameter_converter_internal/lib/converter/tsunami.dart index fe13ef799..d907d1da5 100644 --- a/packages/jma_parameter_converter_internal/lib/converter/tsunami.dart +++ b/packages/jma_parameter_converter_internal/lib/converter/tsunami.dart @@ -1,7 +1,6 @@ +import 'package:jma_parameter_converter_internal/dmdata/tsunami.dart' as dmdata; import 'package:jma_parameter_types/tsunami_param.pb.dart'; -import '../dmdata/tsunami.dart' as dmdata; - TsunamiParameter fromDmdataTsunamiParameter(dmdata.TsunamiParameter parameter) { return TsunamiParameter( items: parameter.items.map( 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 9a955442f..e866247bc 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/common.g.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/common.g.dart @@ -1,5 +1,7 @@ // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, duplicate_ignore + part of 'common.dart'; // ************************************************************************** @@ -8,10 +10,17 @@ part of 'common.dart'; _$ParameterRegionImpl _$$ParameterRegionImplFromJson( Map json) => - _$ParameterRegionImpl( - code: json['code'] as String, - name: json['name'] as String, - kana: json['kana'] as String, + $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( @@ -23,10 +32,17 @@ Map _$$ParameterRegionImplToJson( }; _$ParameterCityImpl _$$ParameterCityImplFromJson(Map json) => - _$ParameterCityImpl( - code: json['code'] as String, - name: json['name'] as String, - kana: json['kana'] as String, + $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.g.dart b/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart index 9c1a52f99..ffcd08a65 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/earthquake.g.dart @@ -1,5 +1,7 @@ // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, duplicate_ignore + part of 'earthquake.dart'; // ************************************************************************** @@ -8,16 +10,27 @@ part of 'earthquake.dart'; _$EarthquakeParameterImpl _$$EarthquakeParameterImplFromJson( Map json) => - _$EarthquakeParameterImpl( - responseId: json['responseId'] as String, - responseTime: DateTime.parse(json['responseTime'] as String), - status: json['status'] as String, - changeTime: DateTime.parse(json['changeTime'] as String), - version: json['version'] as String, - items: (json['items'] as List) - .map((e) => - EarthquakeParmaeterItem.fromJson(e as Map)) - .toList(), + $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( @@ -33,17 +46,28 @@ Map _$$EarthquakeParameterImplToJson( _$EarthquakeParmaeterItemImpl _$$EarthquakeParmaeterItemImplFromJson( Map json) => - _$EarthquakeParmaeterItemImpl( - region: ParameterRegion.fromJson(json['region'] as Map), - city: ParameterCity.fromJson(json['city'] as Map), - noCode: json['noCode'] as String, - code: json['code'] as String, - name: json['name'] as String, - kana: json['kana'] as String, - status: json['status'] as String, - owner: json['owner'] as String, - latitude: doubleFromString(json['latitude'] as String), - longitude: doubleFromString(json['longitude'] as String), + $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( 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 c2e27082a..585a60075 100644 --- a/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.g.dart +++ b/packages/jma_parameter_converter_internal/lib/dmdata/tsunami.g.dart @@ -1,5 +1,7 @@ // GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint, duplicate_ignore + part of 'tsunami.dart'; // ************************************************************************** @@ -8,15 +10,27 @@ part of 'tsunami.dart'; _$TsunamiParameterImpl _$$TsunamiParameterImplFromJson( Map json) => - _$TsunamiParameterImpl( - responseId: json['responseId'] as String, - responseTime: DateTime.parse(json['responseTime'] as String), - status: json['status'] as String, - changeTime: DateTime.parse(json['changeTime'] as String), - version: json['version'] as String, - items: (json['items'] as List) - .map((e) => TsunamiParameterItem.fromJson(e as Map)) - .toList(), + $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( @@ -32,15 +46,24 @@ Map _$$TsunamiParameterImplToJson( _$TsunamiParameterItemImpl _$$TsunamiParameterItemImplFromJson( Map json) => - _$TsunamiParameterItemImpl( - area: json['area'] as String?, - prefecture: json['prefecture'] as String, - code: json['code'] as String, - name: json['name'] as String, - kana: json['kana'] as String, - owner: json['owner'] as String, - latitude: doubleFromString(json['latitude'] as String), - longitude: doubleFromString(json['longitude'] as String), + $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( diff --git a/packages/kyoshin_observation_point_converter_internal/bin/kyoshin_observation_point_converter_internal.dart b/packages/kyoshin_observation_point_converter_internal/bin/kyoshin_observation_point_converter_internal.dart index aa719552a..87a7e2f8c 100644 --- a/packages/kyoshin_observation_point_converter_internal/bin/kyoshin_observation_point_converter_internal.dart +++ b/packages/kyoshin_observation_point_converter_internal/bin/kyoshin_observation_point_converter_internal.dart @@ -5,24 +5,24 @@ import 'package:kyoshin_observation_point_converter_internal/kyoshin_observation Future main(List args) async { final path = args.isNotEmpty ? args[0] : null; if (path == null || path.isEmpty) { - print("Usage: kyoshin_observation_point_converter_internal "); + print('Usage: kyoshin_observation_point_converter_internal '); return; } final converter = KyoshinObservationPointConverter(); - print("Loading GeoJSON..."); + print('Loading GeoJSON...'); final geojson = await converter.loadMap(); - print("Converting Kyoshin Observation Point..."); + print('Converting Kyoshin Observation Point...'); final points = await converter.readFile(path); final table = await converter.convert(points, geojson); // delete output file if exists final file = ( - json: File("kyoshin_observation_point.json"), - binary: File("kyoshin_observation_point.pb"), + json: File('kyoshin_observation_point.json'), + binary: File('kyoshin_observation_point.pb'), ); - if (await file.json.exists()) { + if (file.json.existsSync()) { await file.json.delete(); } - if (await file.binary.exists()) { + if (file.binary.existsSync()) { await file.binary.delete(); } @@ -31,5 +31,5 @@ Future main(List args) async { // binary await file.binary.writeAsBytes(table.writeToBuffer()); - print("Done."); + print('Done.'); } 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 e92786fe6..73d7f3adf 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 @@ -14,7 +14,7 @@ class KyoshinObservationPointConverter { .map((e) { try { return ObservationModel.fromJson(e as Map); - } catch (_) { + } on Exception catch (_) { return null; } }) @@ -69,7 +69,7 @@ class KyoshinObservationPointConverter { }) async { // Cacheのチェック final cacheFile = File('cache/${latitude}_$longitude.json'); - if (await cacheFile.exists()) { + if (cacheFile.existsSync()) { final json = jsonDecode(await cacheFile.readAsString()) as Map; final arvStr = (((json['features'] as List?)?.first @@ -91,7 +91,7 @@ class KyoshinObservationPointConverter { as Map?)?['properties'] as Map?)?['ARV'] as String?; final arv = double.tryParse(arvStr.toString()); - cacheFile.writeAsString( + cacheFile.writeAsStringSync( jsonEncode(json), ); print('ARV: $arv'); diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml index 4326c91f0..75c5b7cee 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml +++ b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml @@ -6,12 +6,12 @@ environment: sdk: ^3.5.4 dependencies: + geojson_vi: ^2.2.4 http: ^1.2.1 kyoshin_observation_point_types: git: url: https://github.com/YumNumm/EQMonitor.git path: packages/kyoshin_observation_point_types - geojson_vi: ^2.2.4 maps_toolkit: ^3.0.0 dev_dependencies: diff --git a/packages/kyoshin_observation_point_types/analysis_options.yaml b/packages/kyoshin_observation_point_types/analysis_options.yaml index 122959d8e..6f44707f2 100644 --- a/packages/kyoshin_observation_point_types/analysis_options.yaml +++ b/packages/kyoshin_observation_point_types/analysis_options.yaml @@ -1 +1,6 @@ include: package:eqmonitor_lints/analysis_options.yaml + +analyzer: + exclude: + - "**/*" + diff --git a/packages/lat_lng/lib/src/lat_lng_boundary.dart b/packages/lat_lng/lib/src/lat_lng_boundary.dart index 103f9eaf5..d3f683fd0 100644 --- a/packages/lat_lng/lib/src/lat_lng_boundary.dart +++ b/packages/lat_lng/lib/src/lat_lng_boundary.dart @@ -34,7 +34,10 @@ class LatLngBoundary { } factory LatLngBoundary.fromList(List points) { - assert(points.isNotEmpty && points.length > 1); + assert( + points.isNotEmpty && points.length > 1, + 'points must be not empty', + ); var northEastLat = double.negativeInfinity; var northEastLon = double.negativeInfinity; var southWestLat = double.infinity; From d8dd6792aada43c8554022876833ee184f2a3361 Mon Sep 17 00:00:00 2001 From: YumNumm <73390859+YumNumm@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:54:56 +0000 Subject: [PATCH 6/9] Auto format --- .../earthquake_history_early_parameter.g.dart | 4 +- .../kmoni/viewmodel/kmoni_settings.g.dart | 2 +- .../eqapi_client/lib/src/children/v1.g.dart | 4 +- .../lib/src/model/v1/earthquake.freezed.dart | 188 ++++++++--------- .../lib/src/model/v1/earthquake.g.dart | 20 +- .../lib/src/model/v1/eew.freezed.dart | 189 +++++++++--------- .../eqapi_types/lib/src/model/v1/eew.g.dart | 32 +-- .../lib/src/model/v1/telegram.freezed.dart | 65 +++--- .../lib/src/model/v1/telegram.g.dart | 4 +- 9 files changed, 254 insertions(+), 254 deletions(-) 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 a898aaa97..5db7eb99f 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 @@ -55,10 +55,10 @@ Map _$$EarthquakeHistoryEarlyParameterImplToJson( }; const _$EarthquakeEarlySortTypeEnumMap = { - EarthquakeEarlySortType.originTime: 'origin_time', + EarthquakeEarlySortType.originTime: 'originTime', EarthquakeEarlySortType.magnitude: 'magnitude', EarthquakeEarlySortType.depth: 'depth', - EarthquakeEarlySortType.maxIntensity: 'max_intensity', + EarthquakeEarlySortType.maxIntensity: 'maxIntensity', }; const _$JmaIntensityEnumMap = { diff --git a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart index aba164c75..683a63688 100644 --- a/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart +++ b/app/lib/feature/home/features/kmoni/viewmodel/kmoni_settings.g.dart @@ -52,7 +52,7 @@ const _$KmoniMarkerTypeEnumMap = { // RiverpodGenerator // ************************************************************************** -String _$kmoniSettingsHash() => r'16a1d4dff95ea66075a34354e8c49a12d5580d9f'; +String _$kmoniSettingsHash() => r'4e3546335ab6ac8e8670e19e2bf2971168479979'; /// See also [KmoniSettings]. @ProviderFor(KmoniSettings) diff --git a/packages/eqapi_client/lib/src/children/v1.g.dart b/packages/eqapi_client/lib/src/children/v1.g.dart index b3ce6e104..1556d2c78 100644 --- a/packages/eqapi_client/lib/src/children/v1.g.dart +++ b/packages/eqapi_client/lib/src/children/v1.g.dart @@ -115,17 +115,17 @@ class _V1 implements V1 { @override Future>> getEarthquakeRegions({ + required String regionCode, int limit = 10, int offset = 0, - required String regionCode, String? intensityLte, String? intensityGte, }) async { final _extra = {}; final queryParameters = { + r'regionCode': regionCode, r'limit': limit, r'offset': offset, - r'regionCode': regionCode, r'intensityLte': intensityLte, r'intensityGte': intensityGte, }; 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 c65d0d93b..5196523e9 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake.freezed.dart @@ -20,11 +20,12 @@ EarthquakeV1 _$EarthquakeV1FromJson(Map json) { /// @nodoc mixin _$EarthquakeV1 { + int get eventId => throw _privateConstructorUsedError; + String get status => throw _privateConstructorUsedError; DateTime? get arrivalTime => throw _privateConstructorUsedError; int? get depth => throw _privateConstructorUsedError; int? get epicenterCode => throw _privateConstructorUsedError; int? get epicenterDetailCode => throw _privateConstructorUsedError; - int get eventId => throw _privateConstructorUsedError; String? get headline => throw _privateConstructorUsedError; List? get intensityCities => throw _privateConstructorUsedError; @@ -48,7 +49,6 @@ mixin _$EarthquakeV1 { List? get maxIntensityRegionIds => throw _privateConstructorUsedError; JmaLgIntensity? get maxLpgmIntensity => throw _privateConstructorUsedError; DateTime? get originTime => throw _privateConstructorUsedError; - String get status => throw _privateConstructorUsedError; String? get text => throw _privateConstructorUsedError; /// Serializes this EarthquakeV1 to a JSON map. @@ -68,11 +68,12 @@ abstract class $EarthquakeV1CopyWith<$Res> { _$EarthquakeV1CopyWithImpl<$Res, EarthquakeV1>; @useResult $Res call( - {DateTime? arrivalTime, + {int eventId, + String status, + DateTime? arrivalTime, int? depth, int? epicenterCode, int? epicenterDetailCode, - int eventId, String? headline, List? intensityCities, List? intensityPrefectures, @@ -89,7 +90,6 @@ abstract class $EarthquakeV1CopyWith<$Res> { List? maxIntensityRegionIds, JmaLgIntensity? maxLpgmIntensity, DateTime? originTime, - String status, String? text}); } @@ -108,11 +108,12 @@ class _$EarthquakeV1CopyWithImpl<$Res, $Val extends EarthquakeV1> @pragma('vm:prefer-inline') @override $Res call({ + Object? eventId = null, + Object? status = null, Object? arrivalTime = freezed, Object? depth = freezed, Object? epicenterCode = freezed, Object? epicenterDetailCode = freezed, - Object? eventId = null, Object? headline = freezed, Object? intensityCities = freezed, Object? intensityPrefectures = freezed, @@ -129,10 +130,17 @@ class _$EarthquakeV1CopyWithImpl<$Res, $Val extends EarthquakeV1> Object? maxIntensityRegionIds = freezed, Object? maxLpgmIntensity = freezed, Object? originTime = freezed, - Object? status = null, 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 @@ -149,10 +157,6 @@ class _$EarthquakeV1CopyWithImpl<$Res, $Val extends EarthquakeV1> ? _value.epicenterDetailCode : epicenterDetailCode // ignore: cast_nullable_to_non_nullable as int?, - 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 @@ -217,10 +221,6 @@ class _$EarthquakeV1CopyWithImpl<$Res, $Val extends EarthquakeV1> ? _value.originTime : originTime // ignore: cast_nullable_to_non_nullable as DateTime?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, text: freezed == text ? _value.text : text // ignore: cast_nullable_to_non_nullable @@ -238,11 +238,12 @@ abstract class _$$EarthquakeV1ImplCopyWith<$Res> @override @useResult $Res call( - {DateTime? arrivalTime, + {int eventId, + String status, + DateTime? arrivalTime, int? depth, int? epicenterCode, int? epicenterDetailCode, - int eventId, String? headline, List? intensityCities, List? intensityPrefectures, @@ -259,7 +260,6 @@ abstract class _$$EarthquakeV1ImplCopyWith<$Res> List? maxIntensityRegionIds, JmaLgIntensity? maxLpgmIntensity, DateTime? originTime, - String status, String? text}); } @@ -276,11 +276,12 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ + Object? eventId = null, + Object? status = null, Object? arrivalTime = freezed, Object? depth = freezed, Object? epicenterCode = freezed, Object? epicenterDetailCode = freezed, - Object? eventId = null, Object? headline = freezed, Object? intensityCities = freezed, Object? intensityPrefectures = freezed, @@ -297,10 +298,17 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> Object? maxIntensityRegionIds = freezed, Object? maxLpgmIntensity = freezed, Object? originTime = freezed, - Object? status = null, 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 @@ -317,10 +325,6 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> ? _value.epicenterDetailCode : epicenterDetailCode // ignore: cast_nullable_to_non_nullable as int?, - 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 @@ -385,10 +389,6 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> ? _value.originTime : originTime // ignore: cast_nullable_to_non_nullable as DateTime?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, text: freezed == text ? _value.text : text // ignore: cast_nullable_to_non_nullable @@ -401,11 +401,12 @@ class __$$EarthquakeV1ImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeV1Impl implements _EarthquakeV1 { const _$EarthquakeV1Impl( - {this.arrivalTime, + {required this.eventId, + required this.status, + this.arrivalTime, this.depth, this.epicenterCode, this.epicenterDetailCode, - required this.eventId, this.headline, final List? intensityCities, final List? intensityPrefectures, @@ -422,7 +423,6 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { final List? maxIntensityRegionIds, this.maxLpgmIntensity, this.originTime, - required this.status, this.text}) : _intensityCities = intensityCities, _intensityPrefectures = intensityPrefectures, @@ -436,6 +436,10 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { factory _$EarthquakeV1Impl.fromJson(Map json) => _$$EarthquakeV1ImplFromJson(json); + @override + final int eventId; + @override + final String status; @override final DateTime? arrivalTime; @override @@ -445,8 +449,6 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { @override final int? epicenterDetailCode; @override - final int eventId; - @override final String? headline; final List? _intensityCities; @override @@ -550,13 +552,11 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { @override final DateTime? originTime; @override - final String status; - @override final String? text; @override String toString() { - return 'EarthquakeV1(arrivalTime: $arrivalTime, depth: $depth, epicenterCode: $epicenterCode, epicenterDetailCode: $epicenterDetailCode, eventId: $eventId, headline: $headline, intensityCities: $intensityCities, intensityPrefectures: $intensityPrefectures, intensityRegions: $intensityRegions, intensityStations: $intensityStations, latitude: $latitude, longitude: $longitude, lpgmIntensityPrefectures: $lpgmIntensityPrefectures, lpgmIntensityRegions: $lpgmIntensityRegions, lpgmIntenstiyStations: $lpgmIntenstiyStations, magnitude: $magnitude, magnitudeCondition: $magnitudeCondition, maxIntensity: $maxIntensity, maxIntensityRegionIds: $maxIntensityRegionIds, maxLpgmIntensity: $maxLpgmIntensity, originTime: $originTime, status: $status, text: $text)'; + return 'EarthquakeV1(eventId: $eventId, status: $status, arrivalTime: $arrivalTime, depth: $depth, epicenterCode: $epicenterCode, epicenterDetailCode: $epicenterDetailCode, headline: $headline, intensityCities: $intensityCities, intensityPrefectures: $intensityPrefectures, intensityRegions: $intensityRegions, intensityStations: $intensityStations, latitude: $latitude, longitude: $longitude, lpgmIntensityPrefectures: $lpgmIntensityPrefectures, lpgmIntensityRegions: $lpgmIntensityRegions, lpgmIntenstiyStations: $lpgmIntenstiyStations, magnitude: $magnitude, magnitudeCondition: $magnitudeCondition, maxIntensity: $maxIntensity, maxIntensityRegionIds: $maxIntensityRegionIds, maxLpgmIntensity: $maxLpgmIntensity, originTime: $originTime, text: $text)'; } @override @@ -564,6 +564,8 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { return identical(this, other) || (other.runtimeType == runtimeType && other is _$EarthquakeV1Impl && + (identical(other.eventId, eventId) || other.eventId == eventId) && + (identical(other.status, status) || other.status == status) && (identical(other.arrivalTime, arrivalTime) || other.arrivalTime == arrivalTime) && (identical(other.depth, depth) || other.depth == depth) && @@ -571,7 +573,6 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { other.epicenterCode == epicenterCode) && (identical(other.epicenterDetailCode, epicenterDetailCode) || other.epicenterDetailCode == epicenterDetailCode) && - (identical(other.eventId, eventId) || other.eventId == eventId) && (identical(other.headline, headline) || other.headline == headline) && const DeepCollectionEquality() @@ -604,7 +605,6 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { other.maxLpgmIntensity == maxLpgmIntensity) && (identical(other.originTime, originTime) || other.originTime == originTime) && - (identical(other.status, status) || other.status == status) && (identical(other.text, text) || other.text == text)); } @@ -612,11 +612,12 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { @override int get hashCode => Object.hashAll([ runtimeType, + eventId, + status, arrivalTime, depth, epicenterCode, epicenterDetailCode, - eventId, headline, const DeepCollectionEquality().hash(_intensityCities), const DeepCollectionEquality().hash(_intensityPrefectures), @@ -633,7 +634,6 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { const DeepCollectionEquality().hash(_maxIntensityRegionIds), maxLpgmIntensity, originTime, - status, text ]); @@ -655,11 +655,12 @@ class _$EarthquakeV1Impl implements _EarthquakeV1 { abstract class _EarthquakeV1 implements EarthquakeV1 { const factory _EarthquakeV1( - {final DateTime? arrivalTime, + {required final int eventId, + required final String status, + final DateTime? arrivalTime, final int? depth, final int? epicenterCode, final int? epicenterDetailCode, - required final int eventId, final String? headline, final List? intensityCities, final List? intensityPrefectures, @@ -676,12 +677,15 @@ abstract class _EarthquakeV1 implements EarthquakeV1 { final List? maxIntensityRegionIds, final JmaLgIntensity? maxLpgmIntensity, final DateTime? originTime, - required final String status, final String? text}) = _$EarthquakeV1Impl; factory _EarthquakeV1.fromJson(Map json) = _$EarthquakeV1Impl.fromJson; + @override + int get eventId; + @override + String get status; @override DateTime? get arrivalTime; @override @@ -691,8 +695,6 @@ abstract class _EarthquakeV1 implements EarthquakeV1 { @override int? get epicenterDetailCode; @override - int get eventId; - @override String? get headline; @override List? get intensityCities; @@ -725,8 +727,6 @@ abstract class _EarthquakeV1 implements EarthquakeV1 { @override DateTime? get originTime; @override - String get status; - @override String? get text; /// Create a copy of EarthquakeV1 @@ -743,11 +743,12 @@ EarthquakeV1Base _$EarthquakeV1BaseFromJson(Map json) { /// @nodoc mixin _$EarthquakeV1Base { + int get eventId => throw _privateConstructorUsedError; + String get status => throw _privateConstructorUsedError; DateTime? get arrivalTime => throw _privateConstructorUsedError; int? get depth => throw _privateConstructorUsedError; int? get epicenterCode => throw _privateConstructorUsedError; int? get epicenterDetailCode => throw _privateConstructorUsedError; - int get eventId => throw _privateConstructorUsedError; String? get headline => throw _privateConstructorUsedError; double? get latitude => throw _privateConstructorUsedError; double? get longitude => throw _privateConstructorUsedError; @@ -757,7 +758,6 @@ mixin _$EarthquakeV1Base { List? get maxIntensityRegionIds => throw _privateConstructorUsedError; JmaLgIntensity? get maxLpgmIntensity => throw _privateConstructorUsedError; DateTime? get originTime => throw _privateConstructorUsedError; - String get status => throw _privateConstructorUsedError; String? get text => throw _privateConstructorUsedError; /// Serializes this EarthquakeV1Base to a JSON map. @@ -777,11 +777,12 @@ abstract class $EarthquakeV1BaseCopyWith<$Res> { _$EarthquakeV1BaseCopyWithImpl<$Res, EarthquakeV1Base>; @useResult $Res call( - {DateTime? arrivalTime, + {int eventId, + String status, + DateTime? arrivalTime, int? depth, int? epicenterCode, int? epicenterDetailCode, - int eventId, String? headline, double? latitude, double? longitude, @@ -791,7 +792,6 @@ abstract class $EarthquakeV1BaseCopyWith<$Res> { List? maxIntensityRegionIds, JmaLgIntensity? maxLpgmIntensity, DateTime? originTime, - String status, String? text}); } @@ -810,11 +810,12 @@ class _$EarthquakeV1BaseCopyWithImpl<$Res, $Val extends EarthquakeV1Base> @pragma('vm:prefer-inline') @override $Res call({ + Object? eventId = null, + Object? status = null, Object? arrivalTime = freezed, Object? depth = freezed, Object? epicenterCode = freezed, Object? epicenterDetailCode = freezed, - Object? eventId = null, Object? headline = freezed, Object? latitude = freezed, Object? longitude = freezed, @@ -824,10 +825,17 @@ class _$EarthquakeV1BaseCopyWithImpl<$Res, $Val extends EarthquakeV1Base> Object? maxIntensityRegionIds = freezed, Object? maxLpgmIntensity = freezed, Object? originTime = freezed, - Object? status = null, 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 @@ -844,10 +852,6 @@ class _$EarthquakeV1BaseCopyWithImpl<$Res, $Val extends EarthquakeV1Base> ? _value.epicenterDetailCode : epicenterDetailCode // ignore: cast_nullable_to_non_nullable as int?, - 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 @@ -884,10 +888,6 @@ class _$EarthquakeV1BaseCopyWithImpl<$Res, $Val extends EarthquakeV1Base> ? _value.originTime : originTime // ignore: cast_nullable_to_non_nullable as DateTime?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, text: freezed == text ? _value.text : text // ignore: cast_nullable_to_non_nullable @@ -905,11 +905,12 @@ abstract class _$$EarthquakeV1BaseImplCopyWith<$Res> @override @useResult $Res call( - {DateTime? arrivalTime, + {int eventId, + String status, + DateTime? arrivalTime, int? depth, int? epicenterCode, int? epicenterDetailCode, - int eventId, String? headline, double? latitude, double? longitude, @@ -919,7 +920,6 @@ abstract class _$$EarthquakeV1BaseImplCopyWith<$Res> List? maxIntensityRegionIds, JmaLgIntensity? maxLpgmIntensity, DateTime? originTime, - String status, String? text}); } @@ -936,11 +936,12 @@ class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ + Object? eventId = null, + Object? status = null, Object? arrivalTime = freezed, Object? depth = freezed, Object? epicenterCode = freezed, Object? epicenterDetailCode = freezed, - Object? eventId = null, Object? headline = freezed, Object? latitude = freezed, Object? longitude = freezed, @@ -950,10 +951,17 @@ class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> Object? maxIntensityRegionIds = freezed, Object? maxLpgmIntensity = freezed, Object? originTime = freezed, - Object? status = null, 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 @@ -970,10 +978,6 @@ class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> ? _value.epicenterDetailCode : epicenterDetailCode // ignore: cast_nullable_to_non_nullable as int?, - 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 @@ -1010,10 +1014,6 @@ class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> ? _value.originTime : originTime // ignore: cast_nullable_to_non_nullable as DateTime?, - status: null == status - ? _value.status - : status // ignore: cast_nullable_to_non_nullable - as String, text: freezed == text ? _value.text : text // ignore: cast_nullable_to_non_nullable @@ -1026,11 +1026,12 @@ class __$$EarthquakeV1BaseImplCopyWithImpl<$Res> @JsonSerializable() class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { const _$EarthquakeV1BaseImpl( - {this.arrivalTime, + {required this.eventId, + required this.status, + this.arrivalTime, this.depth, this.epicenterCode, this.epicenterDetailCode, - required this.eventId, this.headline, this.latitude, this.longitude, @@ -1040,13 +1041,16 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { final List? maxIntensityRegionIds, this.maxLpgmIntensity, this.originTime, - required this.status, this.text}) : _maxIntensityRegionIds = maxIntensityRegionIds; factory _$EarthquakeV1BaseImpl.fromJson(Map json) => _$$EarthquakeV1BaseImplFromJson(json); + @override + final int eventId; + @override + final String status; @override final DateTime? arrivalTime; @override @@ -1056,8 +1060,6 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { @override final int? epicenterDetailCode; @override - final int eventId; - @override final String? headline; @override final double? latitude; @@ -1085,13 +1087,11 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { @override final DateTime? originTime; @override - final String status; - @override final String? text; @override String toString() { - return 'EarthquakeV1Base(arrivalTime: $arrivalTime, depth: $depth, epicenterCode: $epicenterCode, epicenterDetailCode: $epicenterDetailCode, eventId: $eventId, headline: $headline, latitude: $latitude, longitude: $longitude, magnitude: $magnitude, magnitudeCondition: $magnitudeCondition, maxIntensity: $maxIntensity, maxIntensityRegionIds: $maxIntensityRegionIds, maxLpgmIntensity: $maxLpgmIntensity, originTime: $originTime, status: $status, text: $text)'; + return 'EarthquakeV1Base(eventId: $eventId, status: $status, arrivalTime: $arrivalTime, depth: $depth, epicenterCode: $epicenterCode, epicenterDetailCode: $epicenterDetailCode, headline: $headline, latitude: $latitude, longitude: $longitude, magnitude: $magnitude, magnitudeCondition: $magnitudeCondition, maxIntensity: $maxIntensity, maxIntensityRegionIds: $maxIntensityRegionIds, maxLpgmIntensity: $maxLpgmIntensity, originTime: $originTime, text: $text)'; } @override @@ -1099,6 +1099,8 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { return identical(this, other) || (other.runtimeType == runtimeType && other is _$EarthquakeV1BaseImpl && + (identical(other.eventId, eventId) || other.eventId == eventId) && + (identical(other.status, status) || other.status == status) && (identical(other.arrivalTime, arrivalTime) || other.arrivalTime == arrivalTime) && (identical(other.depth, depth) || other.depth == depth) && @@ -1106,7 +1108,6 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { other.epicenterCode == epicenterCode) && (identical(other.epicenterDetailCode, epicenterDetailCode) || other.epicenterDetailCode == epicenterDetailCode) && - (identical(other.eventId, eventId) || other.eventId == eventId) && (identical(other.headline, headline) || other.headline == headline) && (identical(other.latitude, latitude) || @@ -1125,7 +1126,6 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { other.maxLpgmIntensity == maxLpgmIntensity) && (identical(other.originTime, originTime) || other.originTime == originTime) && - (identical(other.status, status) || other.status == status) && (identical(other.text, text) || other.text == text)); } @@ -1133,11 +1133,12 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { @override int get hashCode => Object.hash( runtimeType, + eventId, + status, arrivalTime, depth, epicenterCode, epicenterDetailCode, - eventId, headline, latitude, longitude, @@ -1147,7 +1148,6 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { const DeepCollectionEquality().hash(_maxIntensityRegionIds), maxLpgmIntensity, originTime, - status, text); /// Create a copy of EarthquakeV1Base @@ -1169,11 +1169,12 @@ class _$EarthquakeV1BaseImpl implements _EarthquakeV1Base { abstract class _EarthquakeV1Base implements EarthquakeV1Base { const factory _EarthquakeV1Base( - {final DateTime? arrivalTime, + {required final int eventId, + required final String status, + final DateTime? arrivalTime, final int? depth, final int? epicenterCode, final int? epicenterDetailCode, - required final int eventId, final String? headline, final double? latitude, final double? longitude, @@ -1183,12 +1184,15 @@ abstract class _EarthquakeV1Base implements EarthquakeV1Base { final List? maxIntensityRegionIds, final JmaLgIntensity? maxLpgmIntensity, final DateTime? originTime, - required final String status, final String? text}) = _$EarthquakeV1BaseImpl; factory _EarthquakeV1Base.fromJson(Map json) = _$EarthquakeV1BaseImpl.fromJson; + @override + int get eventId; + @override + String get status; @override DateTime? get arrivalTime; @override @@ -1198,8 +1202,6 @@ abstract class _EarthquakeV1Base implements EarthquakeV1Base { @override int? get epicenterDetailCode; @override - int get eventId; - @override String? get headline; @override double? get latitude; @@ -1218,8 +1220,6 @@ abstract class _EarthquakeV1Base implements EarthquakeV1Base { @override DateTime? get originTime; @override - String get status; - @override String? get text; /// Create a copy of EarthquakeV1Base 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 db41d3f5e..0c8f36fbf 100644 --- a/packages/eqapi_types/lib/src/model/v1/earthquake.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/earthquake.g.dart @@ -14,6 +14,8 @@ _$EarthquakeV1Impl _$$EarthquakeV1ImplFromJson(Map json) => 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()), @@ -21,7 +23,6 @@ _$EarthquakeV1Impl _$$EarthquakeV1ImplFromJson(Map json) => $checkedConvert('epicenter_code', (v) => (v as num?)?.toInt()), epicenterDetailCode: $checkedConvert( 'epicenter_detail_code', (v) => (v as num?)?.toInt()), - eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), headline: $checkedConvert('headline', (v) => v as String?), intensityCities: $checkedConvert( 'intensity_cities', @@ -83,16 +84,15 @@ _$EarthquakeV1Impl _$$EarthquakeV1ImplFromJson(Map json) => (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), originTime: $checkedConvert('origin_time', (v) => v == null ? null : DateTime.parse(v as String)), - status: $checkedConvert('status', (v) => 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', - 'eventId': 'event_id', 'intensityCities': 'intensity_cities', 'intensityPrefectures': 'intensity_prefectures', 'intensityRegions': 'intensity_regions', @@ -110,11 +110,12 @@ _$EarthquakeV1Impl _$$EarthquakeV1ImplFromJson(Map json) => Map _$$EarthquakeV1ImplToJson(_$EarthquakeV1Impl 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, - 'event_id': instance.eventId, 'headline': instance.headline, 'intensity_cities': instance.intensityCities, 'intensity_prefectures': instance.intensityPrefectures, @@ -131,7 +132,6 @@ Map _$$EarthquakeV1ImplToJson(_$EarthquakeV1Impl instance) => 'max_intensity_region_ids': instance.maxIntensityRegionIds, 'max_lpgm_intensity': _$JmaLgIntensityEnumMap[instance.maxLpgmIntensity], 'origin_time': instance.originTime?.toIso8601String(), - 'status': instance.status, 'text': instance.text, }; @@ -163,6 +163,8 @@ _$EarthquakeV1BaseImpl _$$EarthquakeV1BaseImplFromJson( 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()), @@ -170,7 +172,6 @@ _$EarthquakeV1BaseImpl _$$EarthquakeV1BaseImplFromJson( $checkedConvert('epicenter_code', (v) => (v as num?)?.toInt()), epicenterDetailCode: $checkedConvert( 'epicenter_detail_code', (v) => (v as num?)?.toInt()), - eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), headline: $checkedConvert('headline', (v) => v as String?), latitude: $checkedConvert('latitude', (v) => (v as num?)?.toDouble()), longitude: @@ -190,16 +191,15 @@ _$EarthquakeV1BaseImpl _$$EarthquakeV1BaseImplFromJson( (v) => $enumDecodeNullable(_$JmaLgIntensityEnumMap, v)), originTime: $checkedConvert('origin_time', (v) => v == null ? null : DateTime.parse(v as String)), - status: $checkedConvert('status', (v) => 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', - 'eventId': 'event_id', 'magnitudeCondition': 'magnitude_condition', 'maxIntensity': 'max_intensity', 'maxIntensityRegionIds': 'max_intensity_region_ids', @@ -211,11 +211,12 @@ _$EarthquakeV1BaseImpl _$$EarthquakeV1BaseImplFromJson( 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, - 'event_id': instance.eventId, 'headline': instance.headline, 'latitude': instance.latitude, 'longitude': instance.longitude, @@ -225,7 +226,6 @@ Map _$$EarthquakeV1BaseImplToJson( 'max_intensity_region_ids': instance.maxIntensityRegionIds, 'max_lpgm_intensity': _$JmaLgIntensityEnumMap[instance.maxLpgmIntensity], 'origin_time': instance.originTime?.toIso8601String(), - 'status': instance.status, 'text': instance.text, }; 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 8a4162635..cb26e38f5 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.freezed.dart @@ -27,11 +27,13 @@ mixin _$EewV1 { String get status => throw _privateConstructorUsedError; String get infoType => throw _privateConstructorUsedError; DateTime get reportTime => throw _privateConstructorUsedError; + bool get isCanceled => throw _privateConstructorUsedError; + bool get isLastInfo => throw _privateConstructorUsedError; + bool? get isPlum => throw _privateConstructorUsedError; + EewAccuracy? get accuracy => throw _privateConstructorUsedError; int? get serialNo => throw _privateConstructorUsedError; String? get headline => throw _privateConstructorUsedError; - bool get isCanceled => throw _privateConstructorUsedError; bool? get isWarning => throw _privateConstructorUsedError; - bool get isLastInfo => throw _privateConstructorUsedError; DateTime? get originTime => throw _privateConstructorUsedError; DateTime? get arrivalTime => throw _privateConstructorUsedError; String? get hypoName => throw _privateConstructorUsedError; @@ -48,8 +50,6 @@ mixin _$EewV1 { throw _privateConstructorUsedError; List? get regions => throw _privateConstructorUsedError; - bool? get isPlum => throw _privateConstructorUsedError; - EewAccuracy? get accuracy => throw _privateConstructorUsedError; /// Serializes this EewV1 to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -73,11 +73,13 @@ abstract class $EewV1CopyWith<$Res> { String status, String infoType, DateTime reportTime, + bool isCanceled, + bool isLastInfo, + bool? isPlum, + EewAccuracy? accuracy, int? serialNo, String? headline, - bool isCanceled, bool? isWarning, - bool isLastInfo, DateTime? originTime, DateTime? arrivalTime, String? hypoName, @@ -89,9 +91,7 @@ abstract class $EewV1CopyWith<$Res> { bool? forecastMaxIntensityIsOver, JmaForecastLgIntensity? forecastMaxLpgmIntensity, bool? forecastMaxLpgmIntensityIsOver, - List? regions, - bool? isPlum, - EewAccuracy? accuracy}); + List? regions}); $EewAccuracyCopyWith<$Res>? get accuracy; } @@ -118,11 +118,13 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> Object? status = null, Object? infoType = null, Object? reportTime = null, + Object? isCanceled = null, + Object? isLastInfo = null, + Object? isPlum = freezed, + Object? accuracy = freezed, Object? serialNo = freezed, Object? headline = freezed, - Object? isCanceled = null, Object? isWarning = freezed, - Object? isLastInfo = null, Object? originTime = freezed, Object? arrivalTime = freezed, Object? hypoName = freezed, @@ -135,8 +137,6 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> Object? forecastMaxLpgmIntensity = freezed, Object? forecastMaxLpgmIntensityIsOver = freezed, Object? regions = freezed, - Object? isPlum = freezed, - Object? accuracy = freezed, }) { return _then(_value.copyWith( id: null == id @@ -167,6 +167,22 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> ? _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 @@ -175,18 +191,10 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> ? _value.headline : headline // ignore: cast_nullable_to_non_nullable as String?, - isCanceled: null == isCanceled - ? _value.isCanceled - : isCanceled // ignore: cast_nullable_to_non_nullable - as bool, isWarning: freezed == isWarning ? _value.isWarning : isWarning // ignore: cast_nullable_to_non_nullable as bool?, - isLastInfo: null == isLastInfo - ? _value.isLastInfo - : isLastInfo // ignore: cast_nullable_to_non_nullable - as bool, originTime: freezed == originTime ? _value.originTime : originTime // ignore: cast_nullable_to_non_nullable @@ -235,14 +243,6 @@ class _$EewV1CopyWithImpl<$Res, $Val extends EewV1> ? _value.regions : regions // ignore: cast_nullable_to_non_nullable as List?, - 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?, ) as $Val); } @@ -276,11 +276,13 @@ abstract class _$$EewV1ImplCopyWith<$Res> implements $EewV1CopyWith<$Res> { String status, String infoType, DateTime reportTime, + bool isCanceled, + bool isLastInfo, + bool? isPlum, + EewAccuracy? accuracy, int? serialNo, String? headline, - bool isCanceled, bool? isWarning, - bool isLastInfo, DateTime? originTime, DateTime? arrivalTime, String? hypoName, @@ -292,9 +294,7 @@ abstract class _$$EewV1ImplCopyWith<$Res> implements $EewV1CopyWith<$Res> { bool? forecastMaxIntensityIsOver, JmaForecastLgIntensity? forecastMaxLpgmIntensity, bool? forecastMaxLpgmIntensityIsOver, - List? regions, - bool? isPlum, - EewAccuracy? accuracy}); + List? regions}); @override $EewAccuracyCopyWith<$Res>? get accuracy; @@ -320,11 +320,13 @@ class __$$EewV1ImplCopyWithImpl<$Res> Object? status = null, Object? infoType = null, Object? reportTime = null, + Object? isCanceled = null, + Object? isLastInfo = null, + Object? isPlum = freezed, + Object? accuracy = freezed, Object? serialNo = freezed, Object? headline = freezed, - Object? isCanceled = null, Object? isWarning = freezed, - Object? isLastInfo = null, Object? originTime = freezed, Object? arrivalTime = freezed, Object? hypoName = freezed, @@ -337,8 +339,6 @@ class __$$EewV1ImplCopyWithImpl<$Res> Object? forecastMaxLpgmIntensity = freezed, Object? forecastMaxLpgmIntensityIsOver = freezed, Object? regions = freezed, - Object? isPlum = freezed, - Object? accuracy = freezed, }) { return _then(_$EewV1Impl( id: null == id @@ -369,6 +369,22 @@ class __$$EewV1ImplCopyWithImpl<$Res> ? _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 @@ -377,18 +393,10 @@ class __$$EewV1ImplCopyWithImpl<$Res> ? _value.headline : headline // ignore: cast_nullable_to_non_nullable as String?, - isCanceled: null == isCanceled - ? _value.isCanceled - : isCanceled // ignore: cast_nullable_to_non_nullable - as bool, isWarning: freezed == isWarning ? _value.isWarning : isWarning // ignore: cast_nullable_to_non_nullable as bool?, - isLastInfo: null == isLastInfo - ? _value.isLastInfo - : isLastInfo // ignore: cast_nullable_to_non_nullable - as bool, originTime: freezed == originTime ? _value.originTime : originTime // ignore: cast_nullable_to_non_nullable @@ -437,14 +445,6 @@ class __$$EewV1ImplCopyWithImpl<$Res> ? _value._regions : regions // ignore: cast_nullable_to_non_nullable as List?, - 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?, )); } } @@ -460,11 +460,13 @@ class _$EewV1Impl implements _EewV1 { 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, - required this.isCanceled, this.isWarning, - required this.isLastInfo, this.originTime, this.arrivalTime, this.hypoName, @@ -476,9 +478,7 @@ class _$EewV1Impl implements _EewV1 { this.forecastMaxIntensityIsOver, this.forecastMaxLpgmIntensity, this.forecastMaxLpgmIntensityIsOver, - final List? regions, - required this.isPlum, - required this.accuracy}) + final List? regions}) : _regions = regions; factory _$EewV1Impl.fromJson(Map json) => @@ -499,16 +499,20 @@ class _$EewV1Impl implements _EewV1 { @override final DateTime reportTime; @override + final bool isCanceled; + @override + final bool isLastInfo; + @override + final bool? isPlum; + @override + final EewAccuracy? accuracy; + @override final int? serialNo; @override final String? headline; @override - final bool isCanceled; - @override final bool? isWarning; @override - final bool isLastInfo; - @override final DateTime? originTime; @override final DateTime? arrivalTime; @@ -540,14 +544,9 @@ class _$EewV1Impl implements _EewV1 { return EqualUnmodifiableListView(value); } - @override - final bool? isPlum; - @override - final EewAccuracy? accuracy; - @override String toString() { - return 'EewV1(id: $id, eventId: $eventId, type: $type, schemaType: $schemaType, status: $status, infoType: $infoType, reportTime: $reportTime, serialNo: $serialNo, headline: $headline, isCanceled: $isCanceled, isWarning: $isWarning, isLastInfo: $isLastInfo, originTime: $originTime, arrivalTime: $arrivalTime, hypoName: $hypoName, depth: $depth, latitude: $latitude, longitude: $longitude, magnitude: $magnitude, forecastMaxIntensity: $forecastMaxIntensity, forecastMaxIntensityIsOver: $forecastMaxIntensityIsOver, forecastMaxLpgmIntensity: $forecastMaxLpgmIntensity, forecastMaxLpgmIntensityIsOver: $forecastMaxLpgmIntensityIsOver, regions: $regions, isPlum: $isPlum, accuracy: $accuracy)'; + return 'EewV1(id: $id, eventId: $eventId, type: $type, schemaType: $schemaType, status: $status, infoType: $infoType, reportTime: $reportTime, isCanceled: $isCanceled, isLastInfo: $isLastInfo, isPlum: $isPlum, accuracy: $accuracy, serialNo: $serialNo, headline: $headline, isWarning: $isWarning, originTime: $originTime, arrivalTime: $arrivalTime, hypoName: $hypoName, depth: $depth, latitude: $latitude, longitude: $longitude, magnitude: $magnitude, forecastMaxIntensity: $forecastMaxIntensity, forecastMaxIntensityIsOver: $forecastMaxIntensityIsOver, forecastMaxLpgmIntensity: $forecastMaxLpgmIntensity, forecastMaxLpgmIntensityIsOver: $forecastMaxLpgmIntensityIsOver, regions: $regions)'; } @override @@ -565,16 +564,19 @@ class _$EewV1Impl implements _EewV1 { other.infoType == infoType) && (identical(other.reportTime, reportTime) || other.reportTime == reportTime) && + (identical(other.isCanceled, isCanceled) || + other.isCanceled == isCanceled) && + (identical(other.isLastInfo, isLastInfo) || + other.isLastInfo == isLastInfo) && + (identical(other.isPlum, isPlum) || other.isPlum == isPlum) && + (identical(other.accuracy, accuracy) || + other.accuracy == accuracy) && (identical(other.serialNo, serialNo) || other.serialNo == serialNo) && (identical(other.headline, headline) || other.headline == headline) && - (identical(other.isCanceled, isCanceled) || - other.isCanceled == isCanceled) && (identical(other.isWarning, isWarning) || other.isWarning == isWarning) && - (identical(other.isLastInfo, isLastInfo) || - other.isLastInfo == isLastInfo) && (identical(other.originTime, originTime) || other.originTime == originTime) && (identical(other.arrivalTime, arrivalTime) || @@ -601,10 +603,7 @@ class _$EewV1Impl implements _EewV1 { forecastMaxLpgmIntensityIsOver) || other.forecastMaxLpgmIntensityIsOver == forecastMaxLpgmIntensityIsOver) && - const DeepCollectionEquality().equals(other._regions, _regions) && - (identical(other.isPlum, isPlum) || other.isPlum == isPlum) && - (identical(other.accuracy, accuracy) || - other.accuracy == accuracy)); + const DeepCollectionEquality().equals(other._regions, _regions)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -618,11 +617,13 @@ class _$EewV1Impl implements _EewV1 { status, infoType, reportTime, + isCanceled, + isLastInfo, + isPlum, + accuracy, serialNo, headline, - isCanceled, isWarning, - isLastInfo, originTime, arrivalTime, hypoName, @@ -634,9 +635,7 @@ class _$EewV1Impl implements _EewV1 { forecastMaxIntensityIsOver, forecastMaxLpgmIntensity, forecastMaxLpgmIntensityIsOver, - const DeepCollectionEquality().hash(_regions), - isPlum, - accuracy + const DeepCollectionEquality().hash(_regions) ]); /// Create a copy of EewV1 @@ -664,11 +663,13 @@ abstract class _EewV1 implements EewV1 { 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, - required final bool isCanceled, final bool? isWarning, - required final bool isLastInfo, final DateTime? originTime, final DateTime? arrivalTime, final String? hypoName, @@ -680,9 +681,7 @@ abstract class _EewV1 implements EewV1 { final bool? forecastMaxIntensityIsOver, final JmaForecastLgIntensity? forecastMaxLpgmIntensity, final bool? forecastMaxLpgmIntensityIsOver, - final List? regions, - required final bool? isPlum, - required final EewAccuracy? accuracy}) = _$EewV1Impl; + final List? regions}) = _$EewV1Impl; factory _EewV1.fromJson(Map json) = _$EewV1Impl.fromJson; @@ -701,16 +700,20 @@ abstract class _EewV1 implements EewV1 { @override DateTime get reportTime; @override + bool get isCanceled; + @override + bool get isLastInfo; + @override + bool? get isPlum; + @override + EewAccuracy? get accuracy; + @override int? get serialNo; @override String? get headline; @override - bool get isCanceled; - @override bool? get isWarning; @override - bool get isLastInfo; - @override DateTime? get originTime; @override DateTime? get arrivalTime; @@ -734,10 +737,6 @@ abstract class _EewV1 implements EewV1 { bool? get forecastMaxLpgmIntensityIsOver; @override List? get regions; - @override - bool? get isPlum; - @override - EewAccuracy? get accuracy; /// Create a copy of EewV1 /// with the given fields replaced by the non-null parameter values. 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 2bbee6ea8..0de0e0991 100644 --- a/packages/eqapi_types/lib/src/model/v1/eew.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/eew.g.dart @@ -21,11 +21,17 @@ _$EewV1Impl _$$EewV1ImplFromJson(Map json) => $checkedCreate( 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?), - isCanceled: $checkedConvert('is_canceled', (v) => v as bool), isWarning: $checkedConvert('is_warning', (v) => v as bool?), - isLastInfo: $checkedConvert('is_last_info', (v) => v as bool), originTime: $checkedConvert('origin_time', (v) => v == null ? null : DateTime.parse(v as String)), arrivalTime: $checkedConvert('arrival_time', @@ -52,12 +58,6 @@ _$EewV1Impl _$$EewV1ImplFromJson(Map json) => $checkedCreate( ?.map((e) => EstimatedIntensityRegion.fromJson( e as Map)) .toList()), - isPlum: $checkedConvert('is_plum', (v) => v as bool?), - accuracy: $checkedConvert( - 'accuracy', - (v) => v == null - ? null - : EewAccuracy.fromJson(v as Map)), ); return val; }, @@ -66,18 +66,18 @@ _$EewV1Impl _$$EewV1ImplFromJson(Map json) => $checkedCreate( 'schemaType': 'schema_type', 'infoType': 'info_type', 'reportTime': 'report_time', - 'serialNo': 'serial_no', 'isCanceled': 'is_canceled', - 'isWarning': 'is_warning', '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', - 'isPlum': 'is_plum' + 'forecastMaxLpgmIntensityIsOver': 'forecast_max_lpgm_intensity_is_over' }, ); @@ -90,11 +90,13 @@ Map _$$EewV1ImplToJson(_$EewV1Impl instance) => 'status': instance.status, 'info_type': instance.infoType, 'report_time': instance.reportTime.toIso8601String(), + 'is_canceled': instance.isCanceled, + 'is_last_info': instance.isLastInfo, + 'is_plum': instance.isPlum, + 'accuracy': instance.accuracy, 'serial_no': instance.serialNo, 'headline': instance.headline, - 'is_canceled': instance.isCanceled, 'is_warning': instance.isWarning, - 'is_last_info': instance.isLastInfo, 'origin_time': instance.originTime?.toIso8601String(), 'arrival_time': instance.arrivalTime?.toIso8601String(), 'hypo_name': instance.hypoName, @@ -110,8 +112,6 @@ Map _$$EewV1ImplToJson(_$EewV1Impl instance) => 'forecast_max_lpgm_intensity_is_over': instance.forecastMaxLpgmIntensityIsOver, 'regions': instance.regions, - 'is_plum': instance.isPlum, - 'accuracy': instance.accuracy, }; const _$JmaForecastIntensityEnumMap = { 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 4124943ab..dab4d2ea4 100644 --- a/packages/eqapi_types/lib/src/model/v1/telegram.freezed.dart +++ b/packages/eqapi_types/lib/src/model/v1/telegram.freezed.dart @@ -28,10 +28,10 @@ mixin _$TelegramV1 { String get infoType => throw _privateConstructorUsedError; DateTime get pressTime => throw _privateConstructorUsedError; DateTime get reportTime => throw _privateConstructorUsedError; + Map get body => throw _privateConstructorUsedError; DateTime? get validTime => throw _privateConstructorUsedError; int? get serialNo => throw _privateConstructorUsedError; String? get headline => throw _privateConstructorUsedError; - Map get body => throw _privateConstructorUsedError; /// Serializes this TelegramV1 to a JSON map. Map toJson() => throw _privateConstructorUsedError; @@ -58,10 +58,10 @@ abstract class $TelegramV1CopyWith<$Res> { String infoType, DateTime pressTime, DateTime reportTime, + Map body, DateTime? validTime, int? serialNo, - String? headline, - Map body}); + String? headline}); } /// @nodoc @@ -87,10 +87,10 @@ class _$TelegramV1CopyWithImpl<$Res, $Val extends TelegramV1> Object? infoType = null, Object? pressTime = null, Object? reportTime = null, + Object? body = null, Object? validTime = freezed, Object? serialNo = freezed, Object? headline = freezed, - Object? body = null, }) { return _then(_value.copyWith( id: null == id @@ -125,6 +125,10 @@ class _$TelegramV1CopyWithImpl<$Res, $Val extends TelegramV1> ? _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 @@ -137,10 +141,6 @@ class _$TelegramV1CopyWithImpl<$Res, $Val extends TelegramV1> ? _value.headline : headline // ignore: cast_nullable_to_non_nullable as String?, - body: null == body - ? _value.body - : body // ignore: cast_nullable_to_non_nullable - as Map, ) as $Val); } } @@ -162,10 +162,10 @@ abstract class _$$TelegramV1ImplCopyWith<$Res> String infoType, DateTime pressTime, DateTime reportTime, + Map body, DateTime? validTime, int? serialNo, - String? headline, - Map body}); + String? headline}); } /// @nodoc @@ -189,10 +189,10 @@ class __$$TelegramV1ImplCopyWithImpl<$Res> Object? infoType = null, Object? pressTime = null, Object? reportTime = null, + Object? body = null, Object? validTime = freezed, Object? serialNo = freezed, Object? headline = freezed, - Object? body = null, }) { return _then(_$TelegramV1Impl( id: null == id @@ -227,6 +227,10 @@ class __$$TelegramV1ImplCopyWithImpl<$Res> ? _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 @@ -239,10 +243,6 @@ class __$$TelegramV1ImplCopyWithImpl<$Res> ? _value.headline : headline // ignore: cast_nullable_to_non_nullable as String?, - body: null == body - ? _value._body - : body // ignore: cast_nullable_to_non_nullable - as Map, )); } } @@ -259,10 +259,10 @@ class _$TelegramV1Impl implements _TelegramV1 { required this.infoType, required this.pressTime, required this.reportTime, + required final Map body, this.validTime, this.serialNo, - this.headline, - required final Map body}) + this.headline}) : _body = body; factory _$TelegramV1Impl.fromJson(Map json) => @@ -284,12 +284,6 @@ class _$TelegramV1Impl implements _TelegramV1 { final DateTime pressTime; @override final DateTime reportTime; - @override - final DateTime? validTime; - @override - final int? serialNo; - @override - final String? headline; final Map _body; @override Map get body { @@ -298,9 +292,16 @@ class _$TelegramV1Impl implements _TelegramV1 { return EqualUnmodifiableMapView(_body); } + @override + final DateTime? validTime; + @override + final int? serialNo; + @override + final String? headline; + @override String toString() { - return 'TelegramV1(id: $id, eventId: $eventId, type: $type, schemaType: $schemaType, status: $status, infoType: $infoType, pressTime: $pressTime, reportTime: $reportTime, validTime: $validTime, serialNo: $serialNo, headline: $headline, body: $body)'; + return 'TelegramV1(id: $id, eventId: $eventId, type: $type, schemaType: $schemaType, status: $status, infoType: $infoType, pressTime: $pressTime, reportTime: $reportTime, body: $body, validTime: $validTime, serialNo: $serialNo, headline: $headline)'; } @override @@ -320,13 +321,13 @@ class _$TelegramV1Impl implements _TelegramV1 { other.pressTime == pressTime) && (identical(other.reportTime, reportTime) || other.reportTime == reportTime) && + const DeepCollectionEquality().equals(other._body, _body) && (identical(other.validTime, validTime) || other.validTime == validTime) && (identical(other.serialNo, serialNo) || other.serialNo == serialNo) && (identical(other.headline, headline) || - other.headline == headline) && - const DeepCollectionEquality().equals(other._body, _body)); + other.headline == headline)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -341,10 +342,10 @@ class _$TelegramV1Impl implements _TelegramV1 { infoType, pressTime, reportTime, + const DeepCollectionEquality().hash(_body), validTime, serialNo, - headline, - const DeepCollectionEquality().hash(_body)); + headline); /// Create a copy of TelegramV1 /// with the given fields replaced by the non-null parameter values. @@ -372,10 +373,10 @@ abstract class _TelegramV1 implements TelegramV1 { 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, - required final Map body}) = _$TelegramV1Impl; + final String? headline}) = _$TelegramV1Impl; factory _TelegramV1.fromJson(Map json) = _$TelegramV1Impl.fromJson; @@ -397,13 +398,13 @@ abstract class _TelegramV1 implements TelegramV1 { @override DateTime get reportTime; @override + Map get body; + @override DateTime? get validTime; @override int? get serialNo; @override String? get headline; - @override - Map get body; /// Create a copy of TelegramV1 /// with the given fields replaced by the non-null parameter values. 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 9ccc77d10..179cd566e 100644 --- a/packages/eqapi_types/lib/src/model/v1/telegram.g.dart +++ b/packages/eqapi_types/lib/src/model/v1/telegram.g.dart @@ -24,11 +24,11 @@ _$TelegramV1Impl _$$TelegramV1ImplFromJson(Map json) => $checkedConvert('press_time', (v) => DateTime.parse(v as String)), reportTime: $checkedConvert( '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)), serialNo: $checkedConvert('serial_no', (v) => (v as num?)?.toInt()), headline: $checkedConvert('headline', (v) => v as String?), - body: $checkedConvert('body', (v) => v as Map), ); return val; }, @@ -53,8 +53,8 @@ Map _$$TelegramV1ImplToJson(_$TelegramV1Impl instance) => 'info_type': instance.infoType, 'press_time': instance.pressTime.toIso8601String(), 'report_time': instance.reportTime.toIso8601String(), + 'body': instance.body, 'valid_time': instance.validTime?.toIso8601String(), 'serial_no': instance.serialNo, 'headline': instance.headline, - 'body': instance.body, }; From dfddb3f91340e1a39613ba7da9f72b5c20fdbf49 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 19:52:51 +0900 Subject: [PATCH 7/9] =?UTF-8?q?chore:=20Add=20altive=5Flints=20as=20a=20de?= =?UTF-8?q?v=5Fdependencies=20-=20custom=5Flints=E3=82=92=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=95=E3=81=9B=E3=82=8B=E3=81=9F=E3=82=81..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pubspec.lock | 2 +- app/pubspec.yaml | 1 + packages/eqapi_client/pubspec.yaml | 1 + packages/eqapi_types/pubspec.yaml | 1 + packages/extensions/pubspec.yaml | 1 + packages/jma_code_table_converter_internal/pubspec.lock | 2 +- packages/jma_code_table_converter_internal/pubspec.yaml | 1 + packages/jma_code_table_types/pubspec.yaml | 1 + packages/jma_map/pubspec.yaml | 1 + packages/jma_parameter_api_client/pubspec.yaml | 1 + packages/jma_parameter_converter_internal/pubspec.lock | 2 +- packages/jma_parameter_converter_internal/pubspec.yaml | 1 + packages/jma_parameter_types/pubspec.yaml | 1 + .../kyoshin_observation_point_converter_internal/pubspec.lock | 2 +- .../kyoshin_observation_point_converter_internal/pubspec.yaml | 1 + packages/kyoshin_observation_point_types/pubspec.yaml | 1 + packages/lat_lng/pubspec.yaml | 1 + packages/notification_setting_types/pubspec.lock | 2 +- packages/notification_setting_types/pubspec.yaml | 1 + 19 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/pubspec.lock b/app/pubspec.lock index 460ecc448..66b4416bf 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -31,7 +31,7 @@ packages: source: hosted version: "2.3.0" altive_lints: - dependency: transitive + dependency: "direct dev" description: name: altive_lints sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 531c0266e..e09461a25 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -93,6 +93,7 @@ dependencies: web_socket_client: ^0.1.4 dev_dependencies: + altive_lints: ^1.16.0 analyzer: ^6.7.0 build_runner: ^2.4.13 custom_lint: ^0.7.0 diff --git a/packages/eqapi_client/pubspec.yaml b/packages/eqapi_client/pubspec.yaml index 822bf8cf3..ec04105a2 100644 --- a/packages/eqapi_client/pubspec.yaml +++ b/packages/eqapi_client/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: retrofit: ^4.0.3 dev_dependencies: + altive_lints: ^1.16.0 build_runner: ^2.4.7 eqmonitor_lints: path: ../eqmonitor_lints diff --git a/packages/eqapi_types/pubspec.yaml b/packages/eqapi_types/pubspec.yaml index 324e10d37..66a2458a7 100644 --- a/packages/eqapi_types/pubspec.yaml +++ b/packages/eqapi_types/pubspec.yaml @@ -18,6 +18,7 @@ dependencies: path: packages/lat_lng dev_dependencies: + altive_lints: ^1.16.0 build_runner: ^2.4.6 eqmonitor_lints: path: ../eqmonitor_lints diff --git a/packages/extensions/pubspec.yaml b/packages/extensions/pubspec.yaml index e51b890a1..3c11d5a80 100644 --- a/packages/extensions/pubspec.yaml +++ b/packages/extensions/pubspec.yaml @@ -7,3 +7,4 @@ environment: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/jma_code_table_converter_internal/pubspec.lock b/packages/jma_code_table_converter_internal/pubspec.lock index 4533a2e34..fa5301fb7 100644 --- a/packages/jma_code_table_converter_internal/pubspec.lock +++ b/packages/jma_code_table_converter_internal/pubspec.lock @@ -15,7 +15,7 @@ packages: source: sdk version: "0.3.2" altive_lints: - dependency: transitive + dependency: "direct dev" description: name: altive_lints sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 diff --git a/packages/jma_code_table_converter_internal/pubspec.yaml b/packages/jma_code_table_converter_internal/pubspec.yaml index a71d51d26..ec7d8961e 100644 --- a/packages/jma_code_table_converter_internal/pubspec.yaml +++ b/packages/jma_code_table_converter_internal/pubspec.yaml @@ -16,3 +16,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/jma_code_table_types/pubspec.yaml b/packages/jma_code_table_types/pubspec.yaml index bc2a08c72..d7870f54f 100644 --- a/packages/jma_code_table_types/pubspec.yaml +++ b/packages/jma_code_table_types/pubspec.yaml @@ -11,3 +11,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/jma_map/pubspec.yaml b/packages/jma_map/pubspec.yaml index 0dac391e3..634c62395 100644 --- a/packages/jma_map/pubspec.yaml +++ b/packages/jma_map/pubspec.yaml @@ -12,3 +12,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/jma_parameter_api_client/pubspec.yaml b/packages/jma_parameter_api_client/pubspec.yaml index f5fff6817..22911b016 100644 --- a/packages/jma_parameter_api_client/pubspec.yaml +++ b/packages/jma_parameter_api_client/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: retrofit: ^4.0.3 dev_dependencies: + altive_lints: ^1.16.0 build_runner: ^2.4.7 eqmonitor_lints: path: ../eqmonitor_lints diff --git a/packages/jma_parameter_converter_internal/pubspec.lock b/packages/jma_parameter_converter_internal/pubspec.lock index 6804f9989..76a72a310 100644 --- a/packages/jma_parameter_converter_internal/pubspec.lock +++ b/packages/jma_parameter_converter_internal/pubspec.lock @@ -15,7 +15,7 @@ packages: source: sdk version: "0.3.2" altive_lints: - dependency: transitive + dependency: "direct dev" description: name: altive_lints sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 diff --git a/packages/jma_parameter_converter_internal/pubspec.yaml b/packages/jma_parameter_converter_internal/pubspec.yaml index 097cd00bd..267958e5e 100644 --- a/packages/jma_parameter_converter_internal/pubspec.yaml +++ b/packages/jma_parameter_converter_internal/pubspec.yaml @@ -19,6 +19,7 @@ dependencies: json_annotation: ^4.8.1 dev_dependencies: + altive_lints: ^1.16.0 build_runner: ^2.4.4 eqmonitor_lints: path: ../eqmonitor_lints diff --git a/packages/jma_parameter_types/pubspec.yaml b/packages/jma_parameter_types/pubspec.yaml index 2058b4610..86ed5919e 100644 --- a/packages/jma_parameter_types/pubspec.yaml +++ b/packages/jma_parameter_types/pubspec.yaml @@ -12,3 +12,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec.lock b/packages/kyoshin_observation_point_converter_internal/pubspec.lock index 4e7cd76a9..8a41b0eca 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec.lock +++ b/packages/kyoshin_observation_point_converter_internal/pubspec.lock @@ -15,7 +15,7 @@ packages: source: sdk version: "0.3.2" altive_lints: - dependency: transitive + dependency: "direct dev" description: name: altive_lints sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml index 75c5b7cee..6f184bc0c 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml +++ b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml @@ -17,3 +17,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/kyoshin_observation_point_types/pubspec.yaml b/packages/kyoshin_observation_point_types/pubspec.yaml index 309a89a90..a1338bd7c 100644 --- a/packages/kyoshin_observation_point_types/pubspec.yaml +++ b/packages/kyoshin_observation_point_types/pubspec.yaml @@ -11,3 +11,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/lat_lng/pubspec.yaml b/packages/lat_lng/pubspec.yaml index 1a9a5b396..49b270229 100644 --- a/packages/lat_lng/pubspec.yaml +++ b/packages/lat_lng/pubspec.yaml @@ -11,3 +11,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 diff --git a/packages/notification_setting_types/pubspec.lock b/packages/notification_setting_types/pubspec.lock index 9f4266e7a..50818204c 100644 --- a/packages/notification_setting_types/pubspec.lock +++ b/packages/notification_setting_types/pubspec.lock @@ -15,7 +15,7 @@ packages: source: sdk version: "0.3.2" altive_lints: - dependency: transitive + dependency: "direct dev" description: name: altive_lints sha256: e9cace896453be6f97b9b41e3d02bd7f7c8c96c3fbe5e900a4d47d6f8d5c99d0 diff --git a/packages/notification_setting_types/pubspec.yaml b/packages/notification_setting_types/pubspec.yaml index 329ab996b..e332a91db 100644 --- a/packages/notification_setting_types/pubspec.yaml +++ b/packages/notification_setting_types/pubspec.yaml @@ -10,3 +10,4 @@ dependencies: dev_dependencies: eqmonitor_lints: path: ../eqmonitor_lints + altive_lints: ^1.16.0 From 2dee173f7b3b734dd3674cf777f522d10fc2c38c Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 19:56:00 +0900 Subject: [PATCH 8/9] sort deps --- packages/extensions/pubspec.yaml | 2 +- packages/jma_code_table_converter_internal/pubspec.yaml | 2 +- packages/jma_parameter_types/pubspec.yaml | 2 +- .../kyoshin_observation_point_converter_internal/pubspec.yaml | 2 +- packages/kyoshin_observation_point_types/pubspec.yaml | 2 +- packages/lat_lng/pubspec.yaml | 2 +- packages/notification_setting_types/pubspec.yaml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/extensions/pubspec.yaml b/packages/extensions/pubspec.yaml index 3c11d5a80..1fc3c3ee5 100644 --- a/packages/extensions/pubspec.yaml +++ b/packages/extensions/pubspec.yaml @@ -5,6 +5,6 @@ version: 1.0.0 environment: sdk: ^3.5.4 dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 diff --git a/packages/jma_code_table_converter_internal/pubspec.yaml b/packages/jma_code_table_converter_internal/pubspec.yaml index ec7d8961e..46f2eeec2 100644 --- a/packages/jma_code_table_converter_internal/pubspec.yaml +++ b/packages/jma_code_table_converter_internal/pubspec.yaml @@ -14,6 +14,6 @@ dependencies: path: packages/eqapi_types dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 diff --git a/packages/jma_parameter_types/pubspec.yaml b/packages/jma_parameter_types/pubspec.yaml index 86ed5919e..6a7230811 100644 --- a/packages/jma_parameter_types/pubspec.yaml +++ b/packages/jma_parameter_types/pubspec.yaml @@ -10,6 +10,6 @@ dependencies: protobuf: ^3.1.0 dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 diff --git a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml index 6f184bc0c..078f60d2f 100644 --- a/packages/kyoshin_observation_point_converter_internal/pubspec.yaml +++ b/packages/kyoshin_observation_point_converter_internal/pubspec.yaml @@ -15,6 +15,6 @@ dependencies: maps_toolkit: ^3.0.0 dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 diff --git a/packages/kyoshin_observation_point_types/pubspec.yaml b/packages/kyoshin_observation_point_types/pubspec.yaml index a1338bd7c..9e50416fe 100644 --- a/packages/kyoshin_observation_point_types/pubspec.yaml +++ b/packages/kyoshin_observation_point_types/pubspec.yaml @@ -9,6 +9,6 @@ dependencies: protobuf: ^3.1.0 dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 diff --git a/packages/lat_lng/pubspec.yaml b/packages/lat_lng/pubspec.yaml index 49b270229..edaad0125 100644 --- a/packages/lat_lng/pubspec.yaml +++ b/packages/lat_lng/pubspec.yaml @@ -9,6 +9,6 @@ dependencies: latlong2: ^0.9.0 dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 diff --git a/packages/notification_setting_types/pubspec.yaml b/packages/notification_setting_types/pubspec.yaml index e332a91db..435aa53b5 100644 --- a/packages/notification_setting_types/pubspec.yaml +++ b/packages/notification_setting_types/pubspec.yaml @@ -8,6 +8,6 @@ dependencies: protobuf: ^3.1.0 dev_dependencies: + altive_lints: ^1.16.0 eqmonitor_lints: path: ../eqmonitor_lints - altive_lints: ^1.16.0 From 569d59847d2f36074564c950b7483c01bcb98a28 Mon Sep 17 00:00:00 2001 From: YumNumm Date: Fri, 29 Nov 2024 20:19:48 +0900 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20altive=5Flints=E3=81=AB=E6=80=92?= =?UTF-8?q?=E3=82=89=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E9=83=A8=E5=88=86?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/component/button/action_button.dart | 24 ++++++++----------- app/lib/core/component/chip/custom_chip.dart | 1 + .../component/chip/depth_filter_chip.dart | 1 + .../component/chip/intensity_filter_chip.dart | 1 + .../component/chip/magnitude_filter_chip.dart | 1 + .../container/bordered_container.dart | 1 + .../jma_forecast_intensity_icon.dart | 2 ++ .../jma_forecast_lg_intensity_icon.dart | 1 + .../intenisty/jma_intensity_icon.dart | 1 + .../intenisty/jma_lg_intensity_icon.dart | 1 + .../component/sheet/basic_modal_sheet.dart | 1 + .../sheet/sheet_floating_action_buttons.dart | 1 + app/lib/core/component/widget/blend_mask.dart | 2 ++ .../component/widget/dio_exception_text.dart | 6 ++++- .../core/component/widget/error_widget.dart | 2 ++ app/lib/core/foundation/result.dart | 7 +++++- app/lib/core/hook/use_sheet_controller.dart | 10 ++++++-- app/lib/core/router/router.dart | 23 ++++++++++++++++-- .../donation/ui/donation_choice_modal.dart | 1 + .../donation/ui/donation_executed_screen.dart | 1 + .../ui/earthquake_history_screen.dart | 1 + .../component/bar_sheet.dart | 1 + .../ui/components/bar_sheet.dart | 1 + .../ui/earthquake_history_early_screen.dart | 1 + .../render/map_components_renderer.dart | 1 + .../kmoni/data/kmoni_data_source.dart | 1 + .../kmoni/use_case/kmoni_use_case.dart | 1 + .../home/features/map/view/main_map_view.dart | 5 +++- .../page/information_history_page.dart | 21 ++++++++++------ .../information_history_details_page.dart | 1 + .../earthquake_history_config_page.dart | 3 +++ .../display_settings/ui/display_settings.dart | 3 ++- .../ui/notification_local_settings_page.dart | 1 + .../ui/notification_remote_settings_page.dart | 2 ++ ...ation_remote_settings_earthquake_page.dart | 5 +++- ...notification_remote_settings_eew_page.dart | 1 + .../setup/component/background_image.dart | 7 +++++- app/lib/feature/setup/pages/kmoni_warn.dart | 6 ++++- .../setup/pages/notification_setting.dart | 6 ++++- .../setup/pages/quick_guide_about_eew.dart | 6 ++++- .../eqmonitor_lints/lib/analysis_options.yaml | 1 + ..._observation_point_converter_internal.dart | 1 + 42 files changed, 130 insertions(+), 34 deletions(-) diff --git a/app/lib/core/component/button/action_button.dart b/app/lib/core/component/button/action_button.dart index 3a22510ec..0b14ebfee 100644 --- a/app/lib/core/component/button/action_button.dart +++ b/app/lib/core/component/button/action_button.dart @@ -48,21 +48,17 @@ class ActionButton extends StatelessWidget { padding: const EdgeInsets.symmetric( vertical: 4, ), - child: Row( - children: [ - Flexible( - child: Center( - child: Text( - text, - style: Theme.of(context).textTheme.titleMedium!.copyWith( - fontWeight: FontWeight.bold, - color: Colors.white, - letterSpacing: 1.1, - ), - ), - ), + child: Flexible( + child: Center( + child: Text( + text, + style: Theme.of(context).textTheme.titleMedium!.copyWith( + fontWeight: FontWeight.bold, + color: Colors.white, + letterSpacing: 1.1, + ), ), - ], + ), ), ); diff --git a/app/lib/core/component/chip/custom_chip.dart b/app/lib/core/component/chip/custom_chip.dart index 6d5072a57..7933a3238 100644 --- a/app/lib/core/component/chip/custom_chip.dart +++ b/app/lib/core/component/chip/custom_chip.dart @@ -7,6 +7,7 @@ class CustomChip extends StatelessWidget { this.borderWidth = 0, super.key, }); + final Widget child; final Color? backgroundColor; final double borderWidth; diff --git a/app/lib/core/component/chip/depth_filter_chip.dart b/app/lib/core/component/chip/depth_filter_chip.dart index 04464916c..4cbb68095 100644 --- a/app/lib/core/component/chip/depth_filter_chip.dart +++ b/app/lib/core/component/chip/depth_filter_chip.dart @@ -58,6 +58,7 @@ class _DepthFilterModal extends HookWidget { this.currentMin = initialMin, this.currentMax = initialMax, }); + final int? currentMin; final int? currentMax; diff --git a/app/lib/core/component/chip/intensity_filter_chip.dart b/app/lib/core/component/chip/intensity_filter_chip.dart index 9cd845433..04ff6a78e 100644 --- a/app/lib/core/component/chip/intensity_filter_chip.dart +++ b/app/lib/core/component/chip/intensity_filter_chip.dart @@ -60,6 +60,7 @@ class _IntensityFilterModal extends HookWidget { this.currentMin = initialMin, this.currentMax = initialMax, }); + final JmaIntensity? currentMin; final JmaIntensity? currentMax; diff --git a/app/lib/core/component/chip/magnitude_filter_chip.dart b/app/lib/core/component/chip/magnitude_filter_chip.dart index 298402138..61c93f2ba 100644 --- a/app/lib/core/component/chip/magnitude_filter_chip.dart +++ b/app/lib/core/component/chip/magnitude_filter_chip.dart @@ -58,6 +58,7 @@ class _MagnitudeFilterModal extends HookWidget { this.currentMin = MagnitudeFilterChip.initialMin, this.currentMax = MagnitudeFilterChip.initialMax, }); + final double? currentMin; final double? currentMax; diff --git a/app/lib/core/component/container/bordered_container.dart b/app/lib/core/component/container/bordered_container.dart index e589104c0..6e9be94fd 100644 --- a/app/lib/core/component/container/bordered_container.dart +++ b/app/lib/core/component/container/bordered_container.dart @@ -14,6 +14,7 @@ class BorderedContainer extends StatelessWidget { this.onPressed, super.key, }); + final Widget child; final Color? accentColor; final EdgeInsetsGeometry padding; 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 c3aad18fb..a60dc19fa 100644 --- a/app/lib/core/component/intenisty/jma_forecast_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_forecast_intensity_icon.dart @@ -15,6 +15,7 @@ class JmaForecastIntensityWidget extends ConsumerWidget { super.key, this.size = 50, }); + final JmaForecastIntensity intensity; final IntensityIconType type; final double size; @@ -114,6 +115,7 @@ class JmaForecastIntensityIcon extends ConsumerWidget { this.size = 50, this.showSuffix = true, }); + final JmaForecastIntensity intensity; final IntensityIconType type; final double size; 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 e0320c417..7c73c2e58 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 @@ -15,6 +15,7 @@ class JmaForecastLgIntensityWidget extends ConsumerWidget { super.key, this.size = 50, }); + final JmaForecastLgIntensity intensity; final IntensityIconType type; final double size; diff --git a/app/lib/core/component/intenisty/jma_intensity_icon.dart b/app/lib/core/component/intenisty/jma_intensity_icon.dart index 414e253ce..3d355d75c 100644 --- a/app/lib/core/component/intenisty/jma_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_intensity_icon.dart @@ -15,6 +15,7 @@ class JmaIntensityIcon extends ConsumerWidget { this.size = 50, this.showSuffix = true, }); + final JmaIntensity intensity; final IntensityIconType type; final double size; 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 b82a53b89..242bd9115 100644 --- a/app/lib/core/component/intenisty/jma_lg_intensity_icon.dart +++ b/app/lib/core/component/intenisty/jma_lg_intensity_icon.dart @@ -14,6 +14,7 @@ class JmaLgIntensityIcon extends ConsumerWidget { super.key, this.size = 50, }); + final JmaLgIntensity intensity; final IntensityIconType type; final double size; diff --git a/app/lib/core/component/sheet/basic_modal_sheet.dart b/app/lib/core/component/sheet/basic_modal_sheet.dart index c41c8d2ff..e8f885768 100644 --- a/app/lib/core/component/sheet/basic_modal_sheet.dart +++ b/app/lib/core/component/sheet/basic_modal_sheet.dart @@ -9,6 +9,7 @@ class BasicModalSheet extends HookWidget { super.key, this.hasAppBar = true, }); + final SheetController controller; final List children; final bool hasAppBar; 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 f5bb29717..c87c0ce85 100644 --- a/app/lib/core/component/sheet/sheet_floating_action_buttons.dart +++ b/app/lib/core/component/sheet/sheet_floating_action_buttons.dart @@ -21,6 +21,7 @@ class SheetFloatingActionButtons extends HookWidget { final List fab; final SheetController controller; + @override Widget build(BuildContext context) { final size = MediaQuery.sizeOf(context); diff --git a/app/lib/core/component/widget/blend_mask.dart b/app/lib/core/component/widget/blend_mask.dart index 4c1478032..43277ec12 100644 --- a/app/lib/core/component/widget/blend_mask.dart +++ b/app/lib/core/component/widget/blend_mask.dart @@ -9,6 +9,7 @@ class BlendMask extends SingleChildRenderObjectWidget { super.key, super.child, }); + final BlendMode blendMode; final double opacity; @@ -27,6 +28,7 @@ class BlendMask extends SingleChildRenderObjectWidget { class RenderBlendMask extends RenderProxyBox { RenderBlendMask(this.blendMode, this.opacity); + BlendMode blendMode; double opacity; diff --git a/app/lib/core/component/widget/dio_exception_text.dart b/app/lib/core/component/widget/dio_exception_text.dart index 770ee8bab..3737aabeb 100644 --- a/app/lib/core/component/widget/dio_exception_text.dart +++ b/app/lib/core/component/widget/dio_exception_text.dart @@ -2,7 +2,11 @@ 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; @override diff --git a/app/lib/core/component/widget/error_widget.dart b/app/lib/core/component/widget/error_widget.dart index 4509c05e1..c62e10c09 100644 --- a/app/lib/core/component/widget/error_widget.dart +++ b/app/lib/core/component/widget/error_widget.dart @@ -10,6 +10,7 @@ class ErrorInfoWidget extends StatelessWidget { this.onRefresh, super.key, }); + final Object error; final void Function()? onRefresh; @@ -82,6 +83,7 @@ class ErrorInfoWidget extends StatelessWidget { class _DeviceIdText extends ConsumerWidget { const _DeviceIdText(); + @override Widget build(BuildContext context, WidgetRef ref) { final state = ref.watch(apiAuthenticationPayloadProvider).valueOrNull; diff --git a/app/lib/core/foundation/result.dart b/app/lib/core/foundation/result.dart index ef4bce82a..5ef62bb9c 100644 --- a/app/lib/core/foundation/result.dart +++ b/app/lib/core/foundation/result.dart @@ -32,12 +32,17 @@ sealed class Result { /// Resultクラスに準拠したSuccessクラス final class Success extends Result { const Success(this.value); + final S value; } /// 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 8fc93b505..9e7cb78f5 100644 --- a/app/lib/core/hook/use_sheet_controller.dart +++ b/app/lib/core/hook/use_sheet_controller.dart @@ -9,7 +9,10 @@ SheetController useSheetController({ class _UseSheetControllerHook extends Hook { // ignore: unused_element - const _UseSheetControllerHook({this.debugLabel = 'useSheetController'}); + const _UseSheetControllerHook({ + this.debugLabel = 'useSheetController', + }); + final String debugLabel; @override @@ -19,7 +22,10 @@ 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/router/router.dart b/app/lib/core/router/router.dart index 7a143192b..b1978a9d3 100644 --- a/app/lib/core/router/router.dart +++ b/app/lib/core/router/router.dart @@ -84,6 +84,7 @@ class GoRouterRedirectException implements Exception { ) class SetupRoute extends GoRouteData { const SetupRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const SetupScreen(); @@ -92,6 +93,7 @@ class SetupRoute extends GoRouteData { @TypedGoRoute(path: '/earthquake-history') class EarthquakeHistoryRoute extends GoRouteData { const EarthquakeHistoryRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const EarthquakeHistoryScreen(); @@ -118,6 +120,7 @@ class EarthquakeHistoryDetailsRoute extends GoRouteData { @TypedGoRoute(path: '/information-history') class InformationHistoryRoute extends GoRouteData { const InformationHistoryRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const InformationHistoryPage(); @@ -130,7 +133,9 @@ class InformationHistoryDetailsRoute extends GoRouteData { const InformationHistoryDetailsRoute({ required this.$extra, }); + final InformationV3 $extra; + @override Widget build(BuildContext context, GoRouterState state) => InformationHistoryDetailsPage( @@ -153,6 +158,7 @@ class InformationHistoryDetailsRoute extends GoRouteData { ) class HomeRoute extends GoRouteData { const HomeRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const HomeView(); } @@ -160,6 +166,7 @@ class HomeRoute extends GoRouteData { @TypedGoRoute(path: '/talker') class TalkerRoute extends GoRouteData { const TalkerRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const TalkerPage(); } @@ -241,6 +248,7 @@ class SettingsRoute extends GoRouteData { class NotificationRoute extends GoRouteData { const NotificationRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const NotificationRemoteSettingsPage(); @@ -248,6 +256,7 @@ class NotificationRoute extends GoRouteData { class DisplayRoute extends GoRouteData { const DisplayRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const DisplaySettingsScreen(); @@ -255,6 +264,7 @@ class DisplayRoute extends GoRouteData { class NotificationEarthquakeRoute extends GoRouteData { const NotificationEarthquakeRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const NotificationRemoteSettingsEarthquakePage(); @@ -262,6 +272,7 @@ class NotificationEarthquakeRoute extends GoRouteData { class NotificationEewRoute extends GoRouteData { const NotificationEewRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const NotificationRemoteSettingsEewPage(); @@ -304,7 +315,10 @@ class TermOfServiceRoute extends GoRouteData { required this.$extra, this.showAcceptButton = false, }); - final void Function({bool isAccepted})? $extra; + + final void Function({ + bool isAccepted, + })? $extra; final bool showAcceptButton; @override @@ -317,6 +331,7 @@ class TermOfServiceRoute extends GoRouteData { class ColorSchemeConfigRoute extends GoRouteData { const ColorSchemeConfigRoute(); + @override Widget build(BuildContext context, GoRouterState state) => const ColorSchemeConfigPage(); @@ -327,7 +342,10 @@ class PrivacyPolicyRoute extends GoRouteData { required this.$extra, this.showAcceptButton = false, }); - final void Function({bool isAccepted})? $extra; + + final void Function({ + bool isAccepted, + })? $extra; final bool showAcceptButton; @override @@ -378,6 +396,7 @@ class DonationExecutedRoute extends GoRouteData { const DonationExecutedRoute({ required this.$extra, }); + final DonationExecutedRouteExtra $extra; @override diff --git a/app/lib/feature/donation/ui/donation_choice_modal.dart b/app/lib/feature/donation/ui/donation_choice_modal.dart index f2eda5122..dee14d63c 100644 --- a/app/lib/feature/donation/ui/donation_choice_modal.dart +++ b/app/lib/feature/donation/ui/donation_choice_modal.dart @@ -9,6 +9,7 @@ class DonationChoiceModal extends HookConsumerWidget { const DonationChoiceModal._({ required this.choices, }); + final List choices; static Future show( diff --git a/app/lib/feature/donation/ui/donation_executed_screen.dart b/app/lib/feature/donation/ui/donation_executed_screen.dart index 7cf91779c..ae8738317 100644 --- a/app/lib/feature/donation/ui/donation_executed_screen.dart +++ b/app/lib/feature/donation/ui/donation_executed_screen.dart @@ -19,6 +19,7 @@ class DonationExecutedScreen extends HookConsumerWidget { required this.result, super.key, }); + final (StoreProduct, CustomerInfo) result; @override 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 6de934e34..69d91a108 100644 --- a/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart +++ b/app/lib/feature/earthquake_history/ui/earthquake_history_screen.dart @@ -54,6 +54,7 @@ class _SearchParameter extends StatelessWidget { required this.parameter, required this.onChanged, }); + final EarthquakeHistoryParameter parameter; final void Function(EarthquakeHistoryParameter) onChanged; diff --git a/app/lib/feature/earthquake_history_details/component/bar_sheet.dart b/app/lib/feature/earthquake_history_details/component/bar_sheet.dart index 0f35cfd3c..20d593775 100644 --- a/app/lib/feature/earthquake_history_details/component/bar_sheet.dart +++ b/app/lib/feature/earthquake_history_details/component/bar_sheet.dart @@ -12,6 +12,7 @@ class BarBottomSheet extends StatelessWidget { this.shape, this.elevation, }); + final Widget child; final Widget? control; final Clip? clipBehavior; diff --git a/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart b/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart index 0f35cfd3c..20d593775 100644 --- a/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart +++ b/app/lib/feature/earthquake_history_early/ui/components/bar_sheet.dart @@ -12,6 +12,7 @@ class BarBottomSheet extends StatelessWidget { this.shape, this.elevation, }); + final Widget child; final Widget? control; final Clip? clipBehavior; 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 3a6362f12..635c7045a 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 @@ -86,6 +86,7 @@ class _SearchParameter extends StatelessWidget { required this.parameter, required this.onChanged, }); + final EarthquakeHistoryEarlyParameter parameter; final void Function(EarthquakeHistoryEarlyParameter) onChanged; diff --git a/app/lib/feature/home/component/render/map_components_renderer.dart b/app/lib/feature/home/component/render/map_components_renderer.dart index fefdd38ca..6d8c25704 100644 --- a/app/lib/feature/home/component/render/map_components_renderer.dart +++ b/app/lib/feature/home/component/render/map_components_renderer.dart @@ -97,6 +97,7 @@ class _HypocenterPainter extends CustomPainter { const _HypocenterPainter({ required this.type, }); + final HypocenterType type; @override diff --git a/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart b/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart index 53d121ab7..4ac8a64bd 100644 --- a/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart +++ b/app/lib/feature/home/features/kmoni/data/kmoni_data_source.dart @@ -15,6 +15,7 @@ KmoniDataSource kmoniDataSource(Ref ref) => class KmoniDataSource { KmoniDataSource(this.dio); + final Dio dio; final _urlGenerator = KmoniWebApiUrlGenerator(); diff --git a/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart b/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart index bb8d87433..3f666f303 100644 --- a/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart +++ b/app/lib/feature/home/features/kmoni/use_case/kmoni_use_case.dart @@ -158,6 +158,7 @@ class KmoniUseCase { class KmoniIsolateArg { KmoniIsolateArg(this.$1, this.$2, this.$3); + final List $1; final List $2; final RealtimeDataType $3; diff --git a/app/lib/feature/home/features/map/view/main_map_view.dart b/app/lib/feature/home/features/map/view/main_map_view.dart index a48a08aaa..b6a94fd3b 100644 --- a/app/lib/feature/home/features/map/view/main_map_view.dart +++ b/app/lib/feature/home/features/map/view/main_map_view.dart @@ -19,7 +19,10 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:maplibre_gl/maplibre_gl.dart'; class MainMapView extends HookConsumerWidget { - const MainMapView({super.key}); + const MainMapView({ + super.key, + }); + @override Widget build(BuildContext context, WidgetRef ref) { ref.watch(mainMapViewModelProvider); 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 33113279b..a1caa49ab 100644 --- a/app/lib/feature/information_history/page/information_history_page.dart +++ b/app/lib/feature/information_history/page/information_history_page.dart @@ -11,7 +11,10 @@ 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); @@ -46,7 +49,8 @@ class InformationHistoryPage extends HookConsumerWidget { title: Text('地震・津波に関するお知らせ'), ), switch (state) { - AsyncData(:final value) => _InformationDataView(data: value), + AsyncData(:final value) => + _InformationDataSliverListView(data: value), AsyncError(:final error) => SliverFillRemaining( child: ErrorInfoWidget( error: error, @@ -54,7 +58,7 @@ class InformationHistoryPage extends HookConsumerWidget { ref.invalidate(informationHistoryViewModelProvider), ), ), - _ => const _Loading(), + _ => const _LoadingSliverview(), }, ], ), @@ -69,8 +73,11 @@ class InformationHistoryPage extends HookConsumerWidget { } } -class _InformationDataView extends HookConsumerWidget { - const _InformationDataView({required this.data}); +class _InformationDataSliverListView extends HookConsumerWidget { + const _InformationDataSliverListView({ + required this.data, + }); + final List data; @override @@ -124,8 +131,8 @@ class _InformationDataView extends HookConsumerWidget { } } -class _Loading extends StatelessWidget { - const _Loading(); +class _LoadingSliverview extends StatelessWidget { + const _LoadingSliverview(); @override Widget build(BuildContext context) { 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 aba3b439e..33427a150 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 @@ -10,6 +10,7 @@ class InformationHistoryDetailsPage extends HookConsumerWidget { required this.data, super.key, }); + final InformationV3 data; @override 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 552a824b4..546db458d 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 @@ -169,6 +169,7 @@ class _EarthquakeHistoryDetailConfigBody extends HookConsumerWidget { required this.showCitySelector, required this.hasLpgmIntensity, }); + final bool showCitySelector; final bool hasLpgmIntensity; @@ -252,6 +253,7 @@ class _IntensityFillModeSegmentedControl extends ConsumerStatefulWidget { const _IntensityFillModeSegmentedControl({ required this.showCitySelector, }); + final bool showCitySelector; @override @@ -336,6 +338,7 @@ class _IntensityModeSegmentedControl extends StatelessWidget { required this.onSelected, required this.selected, }); + final void Function(_IntensityMode) onSelected; final _IntensityMode selected; 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 8a074a732..72a7da27e 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 @@ -23,6 +23,7 @@ class DisplaySettingsScreen extends StatelessWidget { class _Body extends StatelessWidget { const _Body(); + @override Widget build(BuildContext context) { return SingleChildScrollView( @@ -108,7 +109,7 @@ class _ThemeSelector extends ConsumerWidget { ); } - final size = MediaQuery.of(context).size; + final size = MediaQuery.sizeOf(context); final width = size.width > 600.0 ? 300.0 : null; final choice = Center( 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 9d6e0f01e..43001f748 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 @@ -17,6 +17,7 @@ class NotificationLocalSettingsPage extends StatelessWidget { class _Body extends ConsumerWidget { const _Body(); + @override Widget build(BuildContext context, WidgetRef ref) { return Container(); 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 f9e1d0c9e..60c26eacd 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 @@ -112,6 +112,7 @@ class NotificationRemoteSettingsPage extends HookConsumerWidget { class _Body extends ConsumerWidget { const _Body(); + @override Widget build(BuildContext context, WidgetRef ref) { final state = ref.watch(notificationRemoteSettingsNotifierProvider); @@ -151,6 +152,7 @@ class _Data extends StatelessWidget { const _Data({ required this.state, }); + final NotificationRemoteSettingsState state; @override 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 1093c9965..4f65ceaf3 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 @@ -182,6 +182,7 @@ class _RegionsChoiceView extends ConsumerWidget { required this.regions, required this.global, }); + final List regions; final JmaForecastIntensity? global; @@ -222,7 +223,9 @@ 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( 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 c08d3d00b..55594d1dc 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 @@ -183,6 +183,7 @@ class _RegionsChoiceView extends ConsumerWidget { required this.regions, required this.global, }); + final List regions; final JmaForecastIntensity? global; diff --git a/app/lib/feature/setup/component/background_image.dart b/app/lib/feature/setup/component/background_image.dart index 8ae78d1ab..347f2dfa9 100644 --- a/app/lib/feature/setup/component/background_image.dart +++ b/app/lib/feature/setup/component/background_image.dart @@ -9,6 +9,7 @@ class SetupBackgroundImageWidget extends HookWidget { required this.child, super.key, }); + final Widget child; @override @@ -62,7 +63,11 @@ 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; diff --git a/app/lib/feature/setup/pages/kmoni_warn.dart b/app/lib/feature/setup/pages/kmoni_warn.dart index 5cba57268..1753db5ea 100644 --- a/app/lib/feature/setup/pages/kmoni_warn.dart +++ b/app/lib/feature/setup/pages/kmoni_warn.dart @@ -5,7 +5,11 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; class KmoniWarnPage extends ConsumerWidget { - const KmoniWarnPage({required this.onNext, super.key}); + const KmoniWarnPage({ + required this.onNext, + super.key, + }); + final void Function() onNext; @override diff --git a/app/lib/feature/setup/pages/notification_setting.dart b/app/lib/feature/setup/pages/notification_setting.dart index 56c2b0c24..f337745ac 100644 --- a/app/lib/feature/setup/pages/notification_setting.dart +++ b/app/lib/feature/setup/pages/notification_setting.dart @@ -7,7 +7,11 @@ 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; @override 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 69c1fe64d..3a6b6a674 100644 --- a/app/lib/feature/setup/pages/quick_guide_about_eew.dart +++ b/app/lib/feature/setup/pages/quick_guide_about_eew.dart @@ -3,7 +3,11 @@ 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; @override diff --git a/packages/eqmonitor_lints/lib/analysis_options.yaml b/packages/eqmonitor_lints/lib/analysis_options.yaml index ea7673268..b0ea39fdf 100644 --- a/packages/eqmonitor_lints/lib/analysis_options.yaml +++ b/packages/eqmonitor_lints/lib/analysis_options.yaml @@ -21,3 +21,4 @@ custom_lint: - prefer_clock_now: false - avoid_hardcoded_color: false - avoid_hardcoded_japanese: false + - avoid_single_child: false 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 73d7f3adf..5dac80fcd 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 @@ -126,6 +126,7 @@ class ObservationModel { y: (json['Point'] as Map)['Y'] as int, ); } + final String code; final String name; final String region;