How jve386/prova-tecnica-frontend_flutter works
• A multi-platform Flutter project (with folders for Android, iOS, Linux, macOS, Windows, and Web), intended to run across various devices.
• A clear separation of concerns following Clean Code and SOLID principles—dividing app functionality into layers (Presentation, Domain, and Data).
• The use of Provider for state management, ensuring that UI components (widgets and pages) remain decoupled from business logic.
• Integration with an external REST API to retrieve data, where HTTP calls are managed within a dedicated API Service.
Main Components
a. User Interface (UI) Layer:
• Widgets, pages, and other visual components located in the “lib/features/nonna_app/presentation” directory.
• Screens include Login, Product Catalog, Checkout, Profile pages, etc.
b. State Management Layer:
• The Provider-based modules (e.g., “lib/features/nonna_app/presentation/providers/product_providers.dart”) that handle dependency injection, global state, and updating the UI based on data changes.
c. Business Logic / Domain Layer:
• Domain entities and use-case logic found in “lib/features/nonna_app/domain/entities” which encapsulate core business rules.
d. Data Layer:
• Consists of models (in “lib/features/nonna_app/data/models”) for data representation and services (like “lib/features/nonna_app/data/services/api_service.dart”) that manage API interactions.
e. External Services:
• The REST API integration (HTTP calls) that provides external data combined with the Provider’s role in updating and distributing this state.
f. Platform-Specific Integration:
• Native code and assets provided in directories such as “android”, “ios”, “linux”, “macos”, “windows”, and “web” which support Flutter’s multi-platform capabilities.
Relationships and Data Flow
• These screens invoke actions on the Provider (state management) layer.
• The Provider acts as an intermediary: it handles business logic by interacting with the domain layer and fetches data via the API service in the data layer.
• The API Service makes network calls (HTTP GET) to the external REST API and returns JSON data.
• On data retrieval, the Provider updates the state, which in turn triggers UI updates.
• To note dependency injections (facilitated by Provider) that maintain low coupling between components.
Architectural Patterns and Design Principles
• Clean Code / SOLID architectural style and separation of concerns:
– UI for presentation,
– Provider handling state and dependency injection,
– Domain entities encapsulating business logic,
– Data models and services for API interactions.
• Optionally, use annotations or notes indicating how the Provider pattern ensures reactivity in Flutter.
Detail and Modularity
Overall, capture all layers, dependencies, and flows succinctly—making sure that even someone new to the project can quickly understand the system’s overall design and its interactions.