flutter-architecture_skill

This skill guides structuring Flutter apps with MVVM, feature-first organization, and clean layers to improve scalability, maintainability, and team

17

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill madteacher/mad-agents-skills --skill flutter-architecture

  • SKILL.md5.1 KB

Overview

This skill provides a practical, opinionated guide for architecting Flutter applications using the MVVM pattern, layered architecture, and a feature-first project organization. It focuses on scalability, team workflows, and maintainable code structure so you can build apps that are easy to extend and test. Use it to establish consistent boundaries between UI, Domain, and Data layers and to adopt recommended design patterns for robust apps.

How this skill works

The skill inspects your app-level needs (team size, feature count, complexity) and recommends either a feature-first or layer-first layout. It defines responsibilities for Views, ViewModels, Repositories, Services, and optional Domain use-cases, and shows how to expose state, handle errors, and implement unidirectional data flow. It also codifies practical patterns like Command, Result types, Repository abstraction, and offline-first strategies.

When to use it

  • Designing or refactoring a Flutter app architecture
  • Choosing between feature-first and layer-first project organization
  • Implementing MVVM with clear UI→logic separation
  • Scaling an app for multiple developers or teams
  • Adding new features while minimizing merge conflicts
  • Applying tested design patterns for error handling and offline support

Best practices

  • Prefer feature-first organization for medium/large apps and teams to keep features self-contained
  • Keep Views thin: move logic into ViewModels and expose state via streams or change notifiers
  • Make Repositories the single source of truth and aggregate Services for caching and retries
  • Use a Result type and Command pattern to encapsulate actions and errors consistently
  • Adopt unidirectional data flow: data → logic → UI for predictable state management
  • Introduce a Domain layer with use-cases when business logic grows complex

Example use cases

  • New team project with 10+ features: start feature-first to enable parallel work
  • Refactor a monolithic app: migrate modules into feature folders with clear data/domain/presentation boundaries
  • Implement offline-first behavior: repository handles cache, sync, and optimistic UI updates
  • Replace widget-heavy controllers: move UI logic into ViewModels and expose testable state
  • Add third-party APIs: wrap each API in a Service and expose through repositories

FAQ

Choose layer-first for small apps or solo projects with fewer than ~10 features where simpler navigation by type improves developer speed.

How do I test ViewModels and Repositories?

Unit-test ViewModels by mocking repositories and asserting exposed state changes. Test repositories by mocking Services and verifying caching, error handling, and retry logic.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
flutter-architecture skill by madteacher/mad-agents-skills | VeilStrat