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.
- π Now Playing, Popular, Top Rated & Upcoming movie sections (paginated)
- π Movie Detail Pages with Cast & Crew
- π― Recommended Movies
- π Search Movies (debounced)
- π€ Artist/Actor Detail Page with navigation from movie cast
- β€οΈ Favorite Movies (saved locally using Hive database)
- πΊ Airing Today, On The Air, Popular & Upcoming TV series sections (paginated)
- π TV Series Detail Pages with Cast & Crew
- π― Recommended TV Series
- π Search TV Series (debounced)
- π€ Artist/Actor Detail Page with navigation from TV series cast
- β€οΈ Favorite TV Series (saved locally using Hive database)
- π Popular and Trending Celebrities/Persons sections (paginated)
- π Celebrity Search functionality (debounced)
- π€ Celebrity Detail Page with navigation from movie/tv cast
- β€οΈ Favorite Celebrities (saved locally using Hive database)
- π Infinite Scroll Pagination across all list views
- π Bottom Navigation with tab switching
- π Multi-language Support with Localization (English & Spanish)
- π§ Declarative Routing with GoRouter
- π§± Clean Architecture (Presentation / Domain / Data) β no empty abstraction layers
- π§ͺ Riverpod State Management
- π Network layer using Dio with Logging
- π Smooth UX with loading indicators and cached images
- β€οΈ Favorite Management with Local Storage (Hive)
- π¨ Dark/Light/System Theme Toggle (persisted)
- π Unified Universal Search with debounced API calls
This project follows Clean Architecture principles with pragmatic simplifications:
- Presentation Layer: UI components (pages/widgets), state management (Riverpod providers)
- Domain Layer: Business entities, repository interfaces
- Data Layer: Remote data sources (Dio), local persistence (Hive), repository implementations, data models
- No empty use case layer: Use cases that only delegate to repositories were removed. Providers call repositories directly. Use cases are only added when they contain actual business logic.
- Shared entities: Duplicate
Cast/Crewclasses across features merged intocore/entities/credit_entity.dart. - Shared widgets:
MediaCard,DescriptionSection,RecommendationsSection,CreditsSectionreused across movie and TV series features. - Favorites as a proper feature: Favorites provider and model moved from
core/hive/andmovie/intofeatures/favorites/with proper Clean Architecture layers.
flutter_movie_clean_architecture/
βββ .env # TMDB API key (gitignored)
βββ lib/
β βββ main.dart
β βββ core/
β β βββ config/
β β β βββ app_constant.dart # URLs, reads apiKey from .env
β β βββ entities/
β β β βββ credit_entity.dart # Shared Cast/Crew entities
β β βββ hive/
β β β βββ hive_helper.dart # Hive initialization
β β βββ localization/
β β β βββ app_localizations.dart
β β β βββ localization_helper.dart
β β βββ network/
β β β βββ dio_provider.dart # Dio HTTP client
β β βββ theme/
β β β βββ app_theme.dart
β β β βββ theme_providers.dart # ThemeModeNotifier (direct Hive)
β β β βββ theme_toggle_widget.dart
β β βββ utils/
β β β βββ pagination_consumer_state.dart # Reusable pagination logic
β β β βββ utils.dart
β β βββ widgets/
β β βββ media_card.dart # Unified card for movie/tv/person
β β βββ detail_sections.dart # Shared Description/Recommendations/Credits
β βββ routing/
β β βββ app_router.dart
β βββ presentation/
β β βββ pages/
β β β βββ main_tab_page.dart
β β βββ widgets/
β β βββ universal_search.dart # Debounced universal search
β βββ features/
β βββ celebrity/
β β βββ data/
β β β βββ datasources/
β β β βββ models/
β β β βββ repositories/
β β βββ domain/
β β β βββ entities/
β β β βββ repositories/
β β βββ presentation/
β β βββ pages/
β β βββ providers/
β βββ favorites/ # Proper Clean Architecture layers
β β βββ data/models/
β β β βββ favorite_model.dart
β β β βββ favorite_model.g.dart
β β βββ presentation/providers/
β β β βββ favorite_provider.dart # Single favorites StateNotifier
β β βββ favorites_page.dart
β βββ movie/
β β βββ data/
β β β βββ datasources/
β β β βββ models/
β β β βββ repositories/
β β βββ domain/
β β β βββ entities/
β β β βββ repositories/
β β βββ presentation/
β β βββ pages/
β β β βββ movie_main_page.dart
β β β βββ movie_detail_page.dart
β β β βββ artist_detail_page.dart
β β β βββ now_playing_page.dart # Paginated
β β β βββ popular_page.dart # Paginated
β β β βββ top_rated_page.dart
β β β βββ upcoming_movies_page.dart
β β βββ providers/
β β βββ movie_provider.dart
β βββ tv_series/
β βββ data/
β βββ domain/
β βββ presentation/
β βββ pages/
β βββ providers/
βββ test/
βββ pubspec.yaml
βββ analysis_options.yaml
βββ .env
βββ .gitignore
- Flutter SDK (3.24.1 or higher)
- Dart SDK (3.8.0 or higher)
- Git
- TMDB API Key (free, register at https://www.themoviedb.org/settings/api)
- Clone the repository:
git clone git@github.com:piashcse/flutter-movie-clean-architecture.git
cd flutter-movie-clean-architecture- Set up environment variables:
# Edit .env and add your TMDB API key
TMDB_API_KEY=your_api_key_here- Install dependencies:
flutter pub get- Generate code (build runner):
flutter pub run build_runner build --delete-conflicting-outputs- Run the app:
flutter run- Flutter - Google's UI toolkit
- Riverpod - Composable state management
- GoRouter - Declarative routing
- Dio - HTTP client
- flutter_dotenv - Environment variable management
- JsonSerializable - JSON code generation
- Flutter Localizations - Multi-language support
- PrettyDioLogger - HTTP request logging
- Hive - Local key-value database
- CachedNetworkImage - Image caching
Mehedi Hassan Piash
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.








