Cinemapedia uses GoRouter for declarative, URL-based navigation. The router configuration is defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juuaaann456/DMI-Practica06/llms.txt
Use this file to discover all available pages before exploring further.
lib/config/router/app_router.dart and exported as the appRouter instance.
Router configuration
MovieScreen route is nested under HomeScreen, making its full resolved path /movie/:id.
Routes
| Route | Name constant | Screen | Description |
|---|---|---|---|
/ | HomeScreen.name ('home-screen') | HomeScreen | Main screen with all movie categories |
/movie/:id | MovieScreen.name ('movie-screen') | MovieScreen | Movie detail screen for a specific film |
The movieId path parameter
The :id segment in /movie/:id is a named path parameter. GoRouter extracts it from state.pathParameters:
movieId string is passed directly to MovieScreen as a required constructor parameter:
If the
:id parameter is missing or cannot be parsed, the router falls back to the string 'no-id'.Navigating to a movie detail
Navigation from a list item to the detail screen is triggered by aGestureDetector tap inside MovieHorizontalListview. It uses GoRouter’s context.push() with the movie’s ID interpolated into the path:
User taps a movie poster
The
GestureDetector in _Slide (inside MovieHorizontalListview) fires its onTap callback.GoRouter pushes the detail route
context.push('/movie/${movie.id}') adds /movie/:id on top of the current navigation stack, keeping HomeScreen in the back stack.Route name constants
Both screens define a staticname constant that is referenced in the router config. Using the constant instead of a raw string prevents typos and makes renaming safer: