Skip to main content

Documentation 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.

Movie is the central data structure used by every layer of the app — providers, widgets, and repositories all pass Movie objects. It lives in the domain layer, which means it has no dependency on Flutter, Riverpod, or any external package.

Class definition

lib/domain/entities/movie.dart
class Movie {
  final bool adult;
  final String backdropPath;
  final List<int> genreIds;
  final int id;
  final String originalLanguage;
  final String originalTitle;
  final String overview;
  final double popularity;
  final String posterPath;
  final DateTime releaseDate;
  final String title;
  final bool video;
  final double voteAverage;
  final int voteCount;

  Movie({
    required this.adult,
    required this.backdropPath,
    required this.genreIds,
    required this.id,
    required this.originalLanguage,
    required this.originalTitle,
    required this.overview,
    required this.popularity,
    required this.posterPath,
    required this.releaseDate,
    required this.title,
    required this.video,
    required this.voteAverage,
    required this.voteCount,
  });
}

Fields

adult
bool
required
Indicates whether the movie is restricted to adult audiences.
backdropPath
String
required
Absolute URL to the backdrop image (w500 size). Built by MovieMapper from the raw path returned by the API. Defaults to a placeholder image URL when the API returns an empty string.
genreIds
List<int>
required
List of TheMovieDB genre identifiers associated with the movie.
id
int
required
Unique TheMovieDB identifier for the movie.
originalLanguage
String
required
ISO 639-1 language code of the movie’s original language (e.g. "en", "es").
originalTitle
String
required
Title of the movie in its original language.
overview
String
required
Short plot summary. May be an empty string if the API did not provide one.
popularity
double
required
TheMovieDB popularity score. Higher values indicate more views and interactions on the platform.
posterPath
String
required
Absolute URL to the poster image (w500 size). Built by MovieMapper. Falls back to the string "no-poster" when the API returns an empty string.
releaseDate
DateTime
required
Theatrical release date. When the API returns a null or empty date string, MovieMapper defaults this to DateTime(1900).
title
String
required
Localised display title of the movie.
video
bool
required
true if the entry is a video release rather than a theatrical film.
voteAverage
double
required
Average user rating on TheMovieDB, on a scale of 0 to 10.
voteCount
int
required
Total number of user votes that make up voteAverage.

Domain layer design

Movie is a plain Dart class — no json_serializable, no freezed, no Flutter imports. This is intentional:
  • The domain layer stays portable and testable without a Flutter environment.
  • All serialization logic lives in MovieMovieDB.fromJson() in the infrastructure layer.
  • All API-to-domain transformation logic lives in MovieMapper.movieDBToEntity().
Widgets and providers never instantiate Movie directly; they receive instances that have already been mapped from MovieMovieDB by the datasource layer.
If you add a new field to Movie, you must also add it to MovieMovieDB, update MovieMovieDB.fromJson() / toJson(), and update MovieMapper.movieDBToEntity().

Build docs developers (and LLMs) love