GitHunt
PI

piashcse/flutter-movie-clean-architecture

Flutter Movie ๐Ÿ“ฑ app built with Riverpod, GoRouter, Dio, and Freezed based on Clean Architecture. It offers a clean, scalable, and maintainable codebase for Flutter development

Flutter Movie Clean Architecture

Flutter
Dart
Riverpod
Localization
badge-Android
badge-iOS
GitHub license
GitHub

Flutter Movie App built with Riverpod, Clean Architecture, and GoRouter that showcases movies and TV series fetched from TMDB API. It includes now playing, popular, top-rated, and upcoming Movies, TV series and Celebrity with support for pagination, search, and detailed views.

โœจ Features

Movies

  • ๐ŸŽž Now Playing, Popular, Top Rated & Upcoming movie sections
  • ๐Ÿ” Movie Detail Pages with Cast & Crew
  • ๐ŸŽฏ Recommended Movies
  • ๐Ÿ” Search Movies
  • ๐Ÿ‘ค Artist/Actor Detail Page with navigation from movie cast
  • โค๏ธ Favorite Movies (saved locally using Hive database)

TV Series

  • ๐Ÿ“บ Airing Today, On The Air, Popular & Upcoming TV series sections
  • ๐Ÿ” TV Series Detail Pages with Cast & Crew
  • ๐ŸŽฏ Recommended TV Series
  • ๐Ÿ” Search TV Series
  • ๐Ÿ‘ค Artist/Actor Detail Page with navigation from TV series cast
  • โค๏ธ Favorite TV Series (saved locally using Hive database)

Celebrity

  • ๐ŸŒŸ Popular and Trending Celebrities/Persons sections
  • ๐Ÿ” Celebrity Search functionality
  • ๐Ÿ‘ค Celebrity Detail Page with navigation from movie/tv cast
  • โค๏ธ Favorite Celebrities (saved locally using Hive database)

Common Features

  • ๐Ÿ“ƒ Pagination (infinite scroll)
  • ๐Ÿ”„ Bottom Navigation
  • ๐ŸŒ Multi-language Support with Localization (English & Spanish)
  • ๐Ÿงญ Declarative Routing with GoRouter
  • ๐Ÿงฑ Clean Architecture (Presentation / Domain / Data)
  • ๐Ÿงช Riverpod State Management
  • ๐ŸŒ Network layer using Dio with Logging
  • ๐Ÿš€ Smooth UX with loading indicators
  • โค๏ธ Favorite Management with Local Storage (Hive)

๐Ÿ—๏ธ Architecture

This project follows Clean Architecture principles with clear separation of concerns:


Fig. Clean Architecture

Layers:

  • Presentation Layer: UI components, state management, and user interactions
  • Domain Layer: Business logic, entities, and use cases
  • Data Layer: External data sources (APIs, databases)

๐Ÿ“ Project Structure

flutter_movie_clean_architecture/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ app_constant.dart          # Application constants (API keys, URLs)
โ”‚   โ”‚   โ”œโ”€โ”€ hive/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ favorite_model.dart        # Favorite item model
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ favorite_model.g.dart      # Generated Hive adapter
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ hive_helper.dart           # Hive database helper
โ”‚   โ”‚   โ”œโ”€โ”€ localization/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_localizations.dart     # Localization setup
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ localization_helper.dart   # Localization helper
โ”‚   โ”‚   โ”œโ”€โ”€ network/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ dio_provider.dart          # Dio HTTP client configuration
โ”‚   โ”‚   โ”œโ”€โ”€ theme/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_theme.dart             # Theme definitions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ theme_providers.dart       # Theme state management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ theme_toggle_widget.dart   # Theme toggle widget
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ repository/
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ theme_repository.dart  # Theme repository interface
โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ”‚       โ”œโ”€โ”€ pagination_consumer_state.dart # Pagination state management
โ”‚   โ”‚       โ””โ”€โ”€ utils.dart                 # Utility functions
โ”‚   โ”œโ”€โ”€ features/
โ”‚   โ”‚   โ”œโ”€โ”€ celebrity/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ datasources/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ celebrity_remote_data_source.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ person_model.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ person_list_response.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ repositories/
โ”‚   โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ celebrity_repository_impl.dart
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ entities/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ person.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ repositories/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ celebrity_repository.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ usecases/
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_popular_persons.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_trending_persons.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ search_persons.dart
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ presentation/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ celebrity_main_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ celebrity_search_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ popular_persons_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ trending_persons_page.dart
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ providers/
โ”‚   โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ celebrity_provider.dart
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ widgets/
โ”‚   โ”‚   โ”‚           โ””โ”€โ”€ person_card.dart
โ”‚   โ”‚   โ”œโ”€โ”€ favorites/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ favorites_page.dart
โ”‚   โ”‚   โ”œโ”€โ”€ movie/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ datasources/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ movie_remote_data_source.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ movie_detail_model.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ movie_model.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ credit_model.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ repositories/
โ”‚   โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ movie_repository_impl.dart
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ entities/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ movie.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ movie_detail.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ credit_entity.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ artist_detail.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ repositories/
โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ movie_repository.dart
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ usecases/
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_all_artist_movies.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_movie_detail.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_movie_credits.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_movie_search.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_now_playing.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_popular.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_top_rated.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_up_coming.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ get_recommended_movie.dart
โ”‚   โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ get_artist_detail.dart
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ presentation/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ artist_detail_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ movie_detail_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ movie_main_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ now_playing_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ popular_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ top_rated_page.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ up_coming_page.dart
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ providers/
โ”‚   โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ movie_provider.dart
โ”‚   โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ favorite_provider.dart
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ widgets/
โ”‚   โ”‚   โ”‚           โ””โ”€โ”€ movie_card.dart
โ”‚   โ”‚   โ””โ”€โ”€ tv_series/
โ”‚   โ”‚       โ”œโ”€โ”€ data/
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ datasources/
โ”‚   โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ tv_series_remote_data_source.dart
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ tv_series_detail_model.dart
โ”‚   โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ tv_series_model.dart
โ”‚   โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ tv_series_credit_model.dart
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ repositories/
โ”‚   โ”‚       โ”‚       โ””โ”€โ”€ tv_series_repository_impl.dart
โ”‚   โ”‚       โ”œโ”€โ”€ domain/
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ entities/
โ”‚   โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ tv_series.dart
โ”‚   โ”‚       โ”‚   โ”‚   โ”œโ”€โ”€ tv_series_detail.dart
โ”‚   โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ tv_series_credit_entity.dart
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ repositories/
โ”‚   โ”‚       โ”‚   โ”‚   โ””โ”€โ”€ tv_series_repository.dart
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ usecases/
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_airing_today.dart
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_on_the_air.dart
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_popular_tv_series.dart
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_upcoming_tv_series.dart
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_tv_series_detail.dart
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_tv_series_credits.dart
โ”‚   โ”‚       โ”‚       โ”œโ”€โ”€ get_recommended_tv_series.dart
โ”‚   โ”‚       โ”‚       โ””โ”€โ”€ get_tv_series_search.dart
โ”‚   โ”‚       โ””โ”€โ”€ presentation/
โ”‚   โ”‚           โ”œโ”€โ”€ pages/
โ”‚   โ”‚           โ”‚   โ”œโ”€โ”€ airing_today_page.dart
โ”‚   โ”‚           โ”‚   โ”œโ”€โ”€ on_the_air_page.dart
โ”‚   โ”‚           โ”‚   โ”œโ”€โ”€ popular_tv_series_page.dart
โ”‚   โ”‚           โ”‚   โ”œโ”€โ”€ tv_series_detail_page.dart
โ”‚   โ”‚           โ”‚   โ”œโ”€โ”€ tv_series_main_page.dart
โ”‚   โ”‚           โ”‚   โ””โ”€โ”€ upcoming_tv_series_page.dart
โ”‚   โ”‚           โ”œโ”€โ”€ providers/
โ”‚   โ”‚           โ”‚   โ””โ”€โ”€ tv_series_provider.dart
โ”‚   โ”‚           โ””โ”€โ”€ widgets/
โ”‚           โ”‚       โ””โ”€โ”€ tv_series_card.dart
โ”‚   โ”œโ”€โ”€ presentation/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ main_tab_page.dart
โ”‚   โ”‚   โ””โ”€โ”€ widgets/
โ”‚   โ”‚       โ””โ”€โ”€ universal_search.dart
โ”‚   โ”œโ”€โ”€ routing/
โ”‚   โ”‚   โ””โ”€โ”€ app_router.dart
โ”‚   โ””โ”€โ”€ main.dart
โ”œโ”€โ”€ android/
โ”œโ”€โ”€ assets/
โ”œโ”€โ”€ build/
โ”œโ”€โ”€ ios/
โ”œโ”€โ”€ screen_shots/
โ”œโ”€โ”€ test/
โ”œโ”€โ”€ pubspec.yaml
โ”œโ”€โ”€ pubspec.lock
โ”œโ”€โ”€ analysis_options.yaml
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

๐Ÿš€ Getting Started

Prerequisites

  • Flutter SDK (3.24.1 or higher)
  • Dart SDK (3.8.0 or higher)
  • Git

Installation

  1. Clone the repository:
git clone git@github.com:piashcse/flutter-movie-clean-architecture.git
cd flutter-movie-clean-architecture
  1. Install dependencies:
flutter pub get
  1. Generate code (build runner):
flutter pub run build_runner build --delete-conflicting-outputs

This command generates code for:

  • JsonSerializable (JSON serialization/deserialization)
  • Hive adapters (local database models)
  1. Run the app:
flutter run

After running the app, you can:

  • Browse movies, TV series, and celebrities
  • View detailed information about each item
  • Save your favorite items using the heart icon on detail pages
  • Access your saved favorites through the Favorites tab

๐Ÿ› ๏ธ Built With

  • Flutter - Google's UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase
  • Riverpod - A simple, composable, and testable state management solution for Flutter
  • GoRouter - Declarative routing package for Flutter, designed to work seamlessly with state management and deep linking
  • Dio - A powerful HTTP client for Dart, supporting interceptors, global configuration, FormData, request cancellation, and more
  • JsonSerializable - Generates code for converting between Dart objects and JSON, making serialization easy
  • Flutter Localizations - Internationalization and localization support for multi-language applications
  • PrettyDioLogger - Pretty logging for Dio HTTP requests and responses
  • Hive - Lightweight and blazing fast key-value database written in pure Dart
  • Hive Flutter - Extension for Hive that enables Flutter specific features
  • CachedNetworkImage - Displays network images with caching and placeholder support

๐Ÿ‘จโ€๐Ÿ’ป Developed By

Mehedi Hassan Piash

Twitter
Medium
Linkedin
Web
Blog

๐Ÿ“„ License

Copyright 2025 piashcse (Mehedi Hassan Piash)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
piashcse/flutter-movie-clean-architecture | GitHunt