How hadikachmar3/advanced_flutter_mvvm_with_provider_riverpod_bloc works
Project Overview
• Purpose: This is a cross-platform Flutter movie app built using Clean Architecture with an MVVM pattern. It demonstrates several state management approaches (setState, Provider, Riverpod, BLoC) and interacts with a REST API for fetching movie data, along with local state management for things like favorites and theme preferences.
File Structure
• Presentation Layer:
• Located in “lib/screens” and “lib/widgets”.
• Screens such as movies_screen.dart, movie_details.dart, favorites_screen.dart, and splash_screen.dart represent the visible UI.
• Widgets (e.g., favorite_btn, movies_widget, genre list) provide reusable UI components.
• Domain & Model Layer:
• “lib/models” contains core domain entities like movies_model.dart and movies_genre.dart.
• Data & Service Layer:
• “lib/repository” (movies_repo.dart) acts as an abstraction for data operations.
• “lib/service” includes api_service.dart (REST API communication), init_getit.dart (dependency injection), and navigation_service.dart.
• State Management:
• MVVM is implemented with variations for different state management techniques. The folder organization along with the README pointers shows that state handling is decoupled into view models (implicitly managed within screens and possibly via providers, Riverpod or BLoC classes).
• User Interface Layer
• ViewModel Layer (or Controller layer in MVVM)
• Domain Layer
• Data Layer
• Dependency Injection & Navigation
• External Systems:
• Relationships & Data Flow:
Highlighting Architectural Patterns and Design Principles
• MVVM Pattern: Clearly separate the UI (View) from the business logic (ViewModel) and the Domain/Data layer.
• Clean Architecture: Illustrate dependency direction (i.e., inner layers, such as Models and Repository, do not depend on outer layers like UI).
• State Management Variants: Optionally annotate notes that explain how different state management techniques (setState, Provider, Riverpod, BLoC) are interchangeable in this MVVM structure.
• Cross-Platform Considerations: Although not the main focus, denote that the core Flutter app is platform-agnostic while separate directories (android, ios, etc.) handle platform-specific build concerns.