Skip to content

Commit

Permalink
#128 - implement guide detail view - pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolaj-jalocha committed Aug 8, 2024
1 parent 9e07b05 commit 6e944f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/features/guide_view/guide_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "dart:async";

import "package:auto_route/auto_route.dart";
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
Expand Down Expand Up @@ -41,7 +43,9 @@ class GuideView extends ConsumerWidget {
),
),
GestureDetector(
onTap: ref.navigateGuideDetail,
onTap: () async {
unawaited(ref.navigateGuideDetail("1"));
},
child: Container(
padding: const EdgeInsets.all(10),
width: double.infinity,
Expand Down
2 changes: 1 addition & 1 deletion lib/features/navigator/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AppRouter extends _$AppRouter {
page: AboutUsRoute.page,
),
AutoRoute(
path: "guide-detail/:id",
path: "guide/:id",
page: GuideDetailRoute.page,
),
],
Expand Down
5 changes: 2 additions & 3 deletions lib/features/navigator/utils/navigation_commands.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ extension NavigationX on WidgetRef {
await _router.push(const AboutUsRoute());
}

// TODO(mikolaj-jalocha): add method parameter to navigate to guide detail.
Future<void> navigateGuideDetail() async {
await _router.push(GuideDetailRoute(id: "1"));
Future<void> navigateGuideDetail(String id) async {
await _router.push(GuideDetailRoute(id: id));
}
}

0 comments on commit 6e944f0

Please sign in to comment.