Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

震度詳細画面の 都道府県ごとの震度が誤っていた問題を修正 #510

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions lib/core/router/router.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:eqmonitor/app.dart';
import 'package:eqmonitor/core/provider/shared_preferences.dart';
import 'package:eqmonitor/feature/earthquake_history/model/state/earthquake_history_item.dart';
import 'package:eqmonitor/feature/earthquake_history/page/earthquake_history.dart';
import 'package:eqmonitor/feature/earthquake_history_details/screen/earthquake_history_details.dart';
import 'package:eqmonitor/feature/eew_detailed_history/eew_detailed_history_screen.dart';
Expand Down Expand Up @@ -57,29 +58,34 @@ class EarthquakeHistoryRoute extends GoRouteData {
}

@TypedGoRoute<EarthquakeHistoryDetailsRoute>(
path: '/earthquake-history/:eventId',
path: '/earthquake-history-detailed',
)
class EarthquakeHistoryDetailsRoute extends GoRouteData {
const EarthquakeHistoryDetailsRoute(this.eventId);
final int eventId;
const EarthquakeHistoryDetailsRoute({
required this.$extra,
});
final EarthquakeHistoryItem $extra;
@override
Widget build(BuildContext context, GoRouterState state) {
return EarthquakeHistoryDetailsPage(
eventId: eventId,
);
}
Widget build(BuildContext context, GoRouterState state) =>
EarthquakeHistoryDetailsPage(
data: $extra,
);
}

@TypedGoRoute<EewDetailedHistoryRoute>(
path: '/eew-detailed-history/:eventId',
@TypedGoRoute<EewHisotryDetailRoute>(
path: '/eew-history-detailed',
)
class EewDetailedHistoryRoute extends GoRouteData {
const EewDetailedHistoryRoute(this.eventId);
final int eventId;
class EewHisotryDetailRoute extends GoRouteData {
const EewHisotryDetailRoute({
required this.$extra,
});

final EarthquakeHistoryItem $extra;

@override
Widget build(BuildContext context, GoRouterState state) =>
EewDetailedHistoryScreen(
eventId: eventId,
data: $extra,
);
}

Expand Down
44 changes: 24 additions & 20 deletions lib/core/router/router.g.dart

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

6 changes: 2 additions & 4 deletions lib/feature/earthquake_history/page/earthquake_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class EarthquakeHistoryPage extends HookConsumerWidget {
.fetch,
child: const Text('再読み込み'),
),

],
),
);
Expand Down Expand Up @@ -137,9 +136,8 @@ class EarthquakeHistoryListView extends ConsumerWidget {
final item = data[index];
return EarthquakeHistoryTileWidget(
item: item,
onTap: (p0) => context.push(
EarthquakeHistoryDetailsRoute(p0.eventId).location,
),
onTap: (p0) =>
EarthquakeHistoryDetailsRoute($extra: p0).push<void>(context),
showBackgroundColor: shouldShowBackgroundColor,
);
},
Expand Down
Loading
Loading