How natanvalimcardoso/to_do_list_flutter works
Main Components
• Mobile Platform Layers:
• Android and iOS folders represent the native platform configurations.
• Flutter Layers (Clean Architecture Layers):
• Presentation Layer (UI): Found under lib/app/modules/to_do/presentation, containing UI pages, widgets, and BLoC files (bloc, event, state).
• Domain Layer: Located under lib/app/modules/to_do/domain, which holds entities, errors, repositories’ interfaces, and usecases.
• Data Layer: Split into two parts:
○ Infra/Data Layer: Contains implementations of repositories, models, and data sources (both local and remote) under lib/app/modules/to_do/data/infra.
○ External/Data Layer: Contains external datasources' implementations in lib/app/modules/to_do/data/external.
• Core Utilities:
• Core constants (API endpoints, routes, themes, etc.) found in lib/core.
• Routing logic in lib/core/routes/app_router.dart.
• Dependency injections are managed via GetIt, observable in the injections folder under lib/app/injections and lib/app/to_do_module_injection.dart.
• Testing:
• A dedicated test directory that mirrors the main structure and ensures unit tests for all functional layers.
Establish Relationships/Interactions
• Presentation Layer (UI) interacts with the Domain Layer by dispatching events and receiving states from the BLoC.
• The Domain Layer encapsulates the business logic through its usecases. It talks to abstract repositories (interfaces) that define what data operations can be performed.
• The Data Layer provides concrete implementations of these repositories by integrating with both local (to_do_local_datasource) and remote (to_do_remote_datasource) data sources.
• Dependency injection (GetIt) connects these layers by providing the necessary instances, ensuring loose coupling.
• Routing and theme constants from the core folder ensure a consistent look and feel as well as navigation across the app.
Architectural Patterns/Principles Highlighted
• Clean Architecture – separating concerns clearly amongst Presentation, Domain, and Data layers.
• BLoC Pattern – enabling a clear separation between UI and business logic.
• Dependency Injection (GetIt) – providing scalable and testable code.
• Modularization – individual modules (like the to_do module) help in maintaining clear component boundaries.
Relevant Technologies, Frameworks, and Libraries
• Flutter/Dart for the primary development.
• BLoC for state management.
• GetIt for dependency injection.
• Unit testing framework as integrated by Flutter’s testing tools.
• Native Android and iOS development files for platform-specific configurations.
• Use of MaterialApp under themes (with Dark/Light modes) from lib/core/themes.
Elements
• Component Labels:
• Mobile Platforms (Android, iOS)
• Presentation Layer: UI (Pages, Widgets), BLoC Components.
• Domain Layer: Usecases, Entities, Repositories (Interfaces).
• Data Layer: Local and Remote Data Sources, Repository Implementations.
• Core Utilities: Routes, Themes, Constants.
• Dependency Injection (GetIt) module.
• From UI ➔ BLoC ➔ Domain Usecases.
• Domain Usecases ➔ (via Interface) ➔ Data Repositories.
• Data Repositories ➔ External DataSources and Local DataSources.
• Data flowing back from Data Layer up to UI through state changes.
• Visual Differentiation:
– Start with drawing three large sections for the Presentation, Domain, and Data layers.
– Within the Presentation section, list the screens/pages (ToDoPage, ToDoDetailsPage) along with the BLoC and widget components.
– In the Domain section, list key usecases (add, update, delete, sync), entities, and repository interfaces.
– For the Data layer, divide it into two sub-sections: Infra implementations (repository implementations, model conversions) and External sources (local and remote datasource implementations).
– Finally, add a peripheral block for Core Utilities (routes, themes, constants) and note the native configuration parts (Android and iOS directories) indicating platform-specific configurations.