← ClaudeAtlas

flutter-architecting-appslisted

Architects scalable Flutter applications using layered separation of concerns. Use when structuring a new app or refactoring existing code into maintainable layers.
openplaybooks-dev/converge · ★ 3 · AI & Automation · score 74
Install: claude install-skill openplaybooks-dev/converge
# Architecting Flutter Applications ## Contents - [Core Principles](#core-principles) - [Architectural Layers](#architectural-layers) - [Workflow: Implementing a Feature](#workflow-implementing-a-feature) - [Examples](#examples) ## Core Principles 1. **Separation of Concerns:** Decouple UI rendering from business logic and data fetching by organizing code into distinct layers separated by feature. 2. **Single Source of Truth (SSOT):** Centralize application state and data in the Data layer. Only the SSOT component can modify its respective data. 3. **Unidirectional Data Flow (UDF):** State flows *down* from Data to UI. Events flow *up* from UI to Data. 4. **UI as State Function:** Widgets rebuild reactively when immutable state objects change: `UI = f(state)`. ## Architectural Layers ### UI Layer (Presentation) - **Views:** Lean widgets focused on presentation. Minimal logic — only routing, animations, or simple UI conditionals. - **ViewModels / Providers:** Manage UI state. Transform domain models into presentation-friendly formats. Trigger rebuilds when data changes. ### Logic Layer (Domain) — Optional - **Use Cases / Interactors:** Orchestrate complex business logic involving multiple repositories. - Omit for standard CRUD applications — connect Views directly to Repositories via Providers. ### Data Layer (Model) - **Services:** Stateless API wrappers. Handle HTTP requests, platform APIs, system resources. - **Repositories:** The SSOT. Handle caching, data transform