Skip to content

Commit

Permalink
feat(digital-guide): navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolaj-jalocha committed Jan 15, 2025
1 parent a484db9 commit a2bbb06
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "../../tabs/adapted_toilets/presentation/adapted_toilets_expansion_tile_c
import "../../tabs/amenities/presentation/amenities_expansion_tile_content.dart";
import "../../tabs/evacuation/evacuation_widget.dart";
import "../../tabs/localization/presentation/localization_expansion_tile_content.dart";
import "../../tabs/rooms/presentation/digital_guide_rooms_expansion_tile_content.dart";
import "../../tabs/surrounding/presentation/surroundings_expansion_tile_content.dart";

typedef TileContent = ({String title, List<Widget> content});
Expand Down Expand Up @@ -82,7 +83,11 @@ class DigitalGuideFeaturesSection extends ConsumerWidget {
),
(
title: context.localize.room_information,
content: [LocalizationExpansionTileContent()],
content: [
DigitalGuideRoomExpansionTileContent(
digitalGuideResponse: digitalGuideData,
),
],
),
(
title: context.localize.evacuation,
Expand Down
6 changes: 6 additions & 0 deletions lib/features/navigator/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import "../departments_view/departments_view.dart";
import "../digital_guide_view/presentation/digital_guide_view.dart";
import "../digital_guide_view/tabs/adapted_toilets/data/models/adapted_toilet.dart";
import "../digital_guide_view/tabs/adapted_toilets/presentation/adapted_toilet_detail_view.dart";
import "../digital_guide_view/tabs/rooms/data/models/digital_guide_room.dart";
import "../digital_guide_view/tabs/rooms/presentation/digital_guide_room_detail_view.dart";
import "../guide_detail_view/guide_detail_view.dart";
import "../guide_view/guide_view.dart";
import "../home_view/home_view.dart";
Expand All @@ -21,6 +23,7 @@ import "../sks-menu/presentation/sks_menu_screen.dart";
import "root_view.dart";

part "app_router.g.dart";

part "app_router.gr.dart";

class _NoTransitionRoute extends CustomRoute {
Expand Down Expand Up @@ -108,6 +111,9 @@ class AppRouter extends RootStackRouter {
path: "/aboutUs",
page: AboutUsRoute.page,
),
AutoRoute(
page: DigitalGuideRoomDetailRoute.page,
),
];
}

Expand Down
7 changes: 6 additions & 1 deletion lib/features/navigator/utils/navigation_commands.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import "package:flutter_riverpod/flutter_riverpod.dart";

import "../../buildings_view/model/building_model.dart";
import "../../digital_guide_view/tabs/adapted_toilets/data/models/adapted_toilet.dart";
import "../../digital_guide_view/tabs/rooms/data/models/digital_guide_room.dart";
import "../../parkings_view/models/parking.dart";
import "../app_router.dart";
import "../navigation_controller.dart";

/// just a one place to gather implementation details of navigation flow
/// - for easy maintainance
/// - for easy maintenance
extension NavigationX on WidgetRef {
NavigationController get _router =>
read(navigationControllerProvider.notifier);
Expand Down Expand Up @@ -85,4 +86,8 @@ extension NavigationX on WidgetRef {
Future<void> navigateAdaptedToiletDetails(AdaptedToilet adaptedToilet) async {
await _router.push(AdaptedToiletDetailRoute(adaptedToilet: adaptedToilet));
}

Future<void> navigateRoomDetails(DigitalGuideRoom room) async {
await _router.push(DigitalGuideRoomDetailRoute(room: room));
}
}

0 comments on commit a2bbb06

Please sign in to comment.