π¬ Movie App
https://embed.figma.com/design/XUI0FcwkjT7dk5oW1YI2dp/Movies-app--Community-?node-id=6-686&m=dev&t=ZvejD5NqFyy0bQZ1-1&embed-host=notion&footer=false&theme=system
This section maps every key file to its purpose, location, and rationale.
lib/
βββ main.dart
β βββ Initializes dependencies (API, Repo, UseCases)
β Injects into MovieCubit via BlocProvider
β Loads the HomeScreen
βββ core/
β βββ theme/
β βββ app_theme.dart
β - Global dark theme (colors, fonts)
βββ movie_app/
β βββ domain/
β β βββ entities/
β β β βββ movie.dart
β β β - Core movie structure (id, title, rating, poster)
β β β - No Flutter or JSON logic
β β βββ usecases/
β β β βββ get_*.dart
β β β - Business logic
β β β - Calls execute() β returns List<Movie>
β β βββ infra/
β β βββ movie_repository.dart
β β - Abstract repository interface for use cases
β βββ infra/
β β βββ datasources/
β β β βββ movie_api_service.dart
β β β - Makes raw HTTP calls
β β βββ models/
β β β βββ movie_response.dart
β β β - Parses JSON
β β β - Maps to `Movie` via toEntity()
β β βββ repository/
β β βββ movie_repository_impl.dart
β β - Implements MovieRepository
β β - Connects API β DTO β Entity
β βββ presenter/
β β βββ controllers/
β β β βββ cubit/
β β β βββ movie_cubit.dart
β β β β - Uses injected UseCases
β β β β - fetchMoviesByCategory(), getFeaturedMovies()
β β β βββ movie_state.dart
β β β - State classes for UI: Loading, Loaded, Error
β β βββ ui/
β β βββ home_screen.dart
β β β - Main UI screen
β β β - Displays search, categories, movie grid
β β βββ widgets/
β β βββ search_bar_widget.dart
β β β - TextField + clear icon
β β βββ featured_movie_card.dart
β β β - Carousel for 2 top movies
β β βββ movie_grid.dart
β β β - GridView builder
β β βββ movie_poster_card.dart
β β - Shows each movie poster with rating
π― Each file belongs to a distinct layer: