← ClaudeAtlas

flutter-architecturelisted

Current (2026) Flutter app architecture from the Flutter team's official guide, Very Good Ventures and LeanCode - UI layer (View + ViewModel/Cubit/Notifier) and data layer (Repository + Service), feature folders, dependency injection, Result/Command patterns, networking and JSON models, go_router, monorepos with pub workspaces, day-one project setup, scaling teams, legacy refactoring. Use this whenever creating a new Flutter project or feature, deciding folder structure, adding a repository/API/service layer, choosing packages, reviewing Flutter code for maintainability, or scaling a Flutter team - even if the user only asks "where should this file go".
abugeek/flutter-skills · ★ 0 · Data & Documents · score 72
Install: claude install-skill abugeek/flutter-skills
# Flutter architecture Verified 2026-09-25 against docs.flutter.dev/app-architecture (Flutter 3.47), engineering.verygood.ventures, and pub.dev. For Dart syntax and widget code style, see the `flutter-dart-style` skill. For state libraries, see `flutter-state-management`. **Core rule (Flutter team, "strongly recommend"): separate the UI layer from the data layer, keep widgets dumb, and let data flow one way.** Everything else is scaled to the project's size. ## 1. The layers ``` View (widget) ──calls commands/methods──▶ ViewModel | Cubit | Notifier ──▶ Repository ──▶ Service ◀──────────── listens to immutable state ◀───────────── returns models / Result ◀─ raw data ``` - **Service**: wraps exactly one external source (REST client, DB, platform plugin, SharedPreferences). No business logic. Returns raw/API models. - **Repository**: the **source of truth** for one kind of data (`UserRepository`, `BookingRepository`). It combines services, caches, retries, maps API models to domain models, and exposes `Future<Result<T>>` or `Stream<T>`. No Flutter imports. **Define it as an abstract class** (officially "strongly recommend"), so tests use fakes and dev/staging use other implementations. - **ViewModel / Cubit / Notifier**: one per screen or feature. Turns repository data into UI state and exposes actions (Commands/methods). No `BuildContext`, no widgets. - **View**: layout, simple `if`s, animation, routing. No business logic. - **Domain layer / use-cases: conditional.**