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.

The domain layer is the innermost ring of the architecture. It contains no framework imports and no knowledge of how data is fetched or displayed. Everything else depends on it.

Structure

lib/domain/
├── entities/
│   └── movie.dart
├── datasources/
│   └── movies_datasource.dart
└── repositories/
    └── movies_repository.dart

The Movie entity

Movie is the canonical representation of a film throughout the application. It is a plain Dart class with no serialization logic or external dependencies.
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,
  });
}

Field reference

FieldTypeDescription
idintUnique TheMovieDB identifier
titleStringLocalized movie title
originalTitleStringTitle in the original language
overviewStringPlot summary
posterPathStringFull URL to the poster image
backdropPathStringFull URL to the backdrop image
releaseDateDateTimeTheatrical release date
voteAveragedoubleAverage user rating (0–10)
voteCountintTotal number of ratings
popularitydoubleTheMovieDB popularity score
genreIdsList<int>Genre identifiers
originalLanguageStringISO 639-1 language code
adultboolWhether the film is adult-rated
videoboolWhether a video clip is available
posterPath and backdropPath on the domain entity are already full URLs. The infrastructure mapper is responsible for constructing them — the domain entity never knows about the image CDN.

Abstract datasource

MoviesDatasource is an abstract class that declares what operations any data source must support. The domain defines the contract; the infrastructure fulfills it.
import 'package:cinemapedia_220083/domain/entities/movie.dart';

abstract class MoviesDatasource {
  Future<List<Movie>> getNowPlaying({int page = 1});
  Future<List<Movie>> getPopular({int page = 1});
  Future<List<Movie>> getUpcoming({int page = 1});
  Future<List<Movie>> getTopRated({int page = 1});
  Future<List<Movie>> getMexicanMovies({int page = 1});
}
All methods accept a page parameter that defaults to 1, enabling pagination without forcing callers to supply it.

Abstract repository

MoviesRepository mirrors the datasource contract. The extra abstraction layer allows the application to swap datasources or add caching inside a repository implementation without changing the presentation layer.
import 'package:cinemapedia_220083/domain/entities/movie.dart';

abstract class MoviesRepository {
  Future<List<Movie>> getNowPlaying({int page = 1});
  Future<List<Movie>> getPopular({int page = 1});
  Future<List<Movie>> getUpcoming({int page = 1});
  Future<List<Movie>> getTopRated({int page = 1});
  Future<List<Movie>> getMexicanMovies({int page = 1});
}
The repository and datasource abstractions look identical here, but they serve different purposes. The datasource is about raw data access; the repository is where business logic (caching, merging sources, error handling) would live as the app grows.

Build docs developers (and LLMs) love