TheDocumentation 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.
infrastructure/models/moviedb/ directory contains two classes that mirror the JSON structure returned by TheMovieDB REST API. They are used only inside the datasource layer; the rest of the app works exclusively with the domain Movie entity.
Class hierarchy
MovieDbResponse
Represents the full JSON object returned by paginated endpoints such as /movie/now_playing, /movie/popular, /movie/upcoming, /movie/top_rated, and the region-filtered discover endpoint.
moviedb_response.dart
Fields
Optional screening window. Only present on the
/movie/now_playing endpoint. null for popular, upcoming, top-rated, and discover responses.Current page number returned by the API.
List of movie entries for the current page. Each entry is deserialized as a
MovieMovieDB object.Total number of pages available for the query. Mapped from
total_pages in the JSON.Total number of movies matching the query across all pages. Mapped from
total_results in the JSON.Dates
Represents the theatrical screening window included in now-playing responses.
moviedb_response.dart
Fields
Latest date in the now-playing window. Parsed from an ISO 8601 date string (
"YYYY-MM-DD").Earliest date in the now-playing window. Parsed from an ISO 8601 date string (
"YYYY-MM-DD").MovieMovieDB
Mirrors the shape of a single movie object inside the results array. Field names in fromJson match the snake_case keys used by TheMovieDB API.
movie_moviedb.dart
Fields
Whether the movie has an adult content rating. Defaults to
false when absent from the JSON.Raw path segment for the backdrop image (e.g.
"/abc123.jpg"). Empty string when not provided. The mapper prepends the TMDB image base URL.Array of genre IDs from the
genre_ids JSON key.Unique TheMovieDB movie identifier.
ISO 639-1 language code. Mapped from
original_language.Title in the original language. Mapped from
original_title.Plot summary. Defaults to an empty string when the API omits this field.
TheMovieDB popularity metric, coerced to
double with ?.toDouble().Raw path segment for the poster image (e.g.
"/xyz456.jpg"). Empty string when not provided. Mapped from poster_path.Parsed from the
release_date string. Falls back to DateTime(1900) when the field is null, empty, or unparseable. Mapped from release_date.Localised display title.
true for video releases.Average rating, coerced to
double. Mapped from vote_average.Total vote count. Mapped from
vote_count.MovieMapper
MovieMapper.movieDBToEntity() is the single function that converts a MovieMovieDB infrastructure model into a domain Movie entity. It lives in lib/infrastructure/mappers/movie_mapper.dart.
movie_mapper.dart
Transformations applied
| Field | Raw value (API) | Mapped value (domain) |
|---|---|---|
backdropPath | "/abc.jpg" | "http://image.tmdb.org/t/p/w500/abc.jpg" |
backdropPath | "" (empty) | Placeholder image URL |
posterPath | "/xyz.jpg" | "http://image.tmdb.org/t/p/w500/xyz.jpg" |
posterPath | "" (empty) | "no-poster" |
| All other fields | — | Passed through unchanged |
The image base URL uses HTTP, not HTTPS. If your environment or device policy requires HTTPS, update the base URL constant in
MovieMapper and adjust any network security configuration accordingly.