flutter-best-practices
Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests.
Install / Use
npx skills add evanca/flutter-ai-rules --skill flutter-best-practicesInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of flutter-best-practices
flutter-best-practices scores 83/100 on our quality scale, 885th of 1,215 Content & Media skills we index.
Its SKILL.md is 6.5 KB long, well organised into 10 sections and no code examples: a thorough specification that gives an agent plenty to work with.
It has 646 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 19 days ago, so flutter-best-practices is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-10-04. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
flutter-best-practices compared with similar skills
All 4 of these similar skills score higher than flutter-best-practices; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| flutter-best-practices (this skill)by evanca | 83 | 646 | 19d ago | SKILL.md |
| siyuanby siyuan-note | 100 | 46.6k | today | MCP Server |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 12d ago | SKILL.md |
Frequently asked questions
- How do I install flutter-best-practices?
- Run
npx skills add evanca/flutter-ai-rules --skill flutter-best-practices. The install tabs above show the steps for each supported agent. - Which AI agents does flutter-best-practices work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is flutter-best-practices safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is flutter-best-practices still maintained?
- The repository was last updated 19 days ago, so flutter-best-practices is actively maintained.
Skill content
View source on GitHubname: flutter-best-practices description: "Use when writing, reviewing, refactoring, or planning Flutter/Dart code — screens, features, project structure, state management, folders, widgets, cubits/blocs, repositories, services, or tests." license: MIT
Flutter Best Practices
Standards for building maintainable Flutter apps, distilled from the official Flutter architecture guide and LeanCode's experience shipping 40+ Flutter projects (including a 30-developer banking app). Apply these when writing new code; when touching existing code, prefer consistency with the surrounding codebase and raise conflicts with these standards rather than silently rewriting.
How to use this skill
Read the reference file that matches the task. Read more than one when tasks overlap (e.g. a new feature touches both structure and coding style).
| Task | Read | |---|---| | Design layers, decide where logic lives, MVVM, repositories/services | references/architecture-layers.md | | Create/organize a feature, folder structure, state management wiring | references/feature-structure.md | | Write or review Dart/Flutter code, widgets, tests, lints | references/dart-coding-practices.md | | Multi-team/multi-package apps, monorepo, navigation, localization, API contracts, E2E tests | references/enterprise-scale.md | | App localization setup, reusable UI package string ownership, language picker visibility | references/localization-package-boundaries.md |
For a quick task (small widget fix, one-line review comment), the core rules below may be enough on their own.
Core rules (always apply)
Architecture
- Separate UI from data. Two broad layers: UI (views + view models /
cubits) and Data (repositories + services). Dependencies point one way:
View → ViewModel → Repository → Service. Lower layers never import upper layers. Repositories never depend on each other. - Views hold no business logic. Widgets may contain show/hide
conditionals, animation, layout, and simple routing logic — nothing that
transforms or decides about data. All data logic lives in the view model
(or cubit/bloc), which has no access to
BuildContext. - Organize by feature, not by layer. Everything a feature needs — state
management, widgets, models — lives under one feature directory. Don't
create top-level
blocs/,widgets/,models/buckets that scatter a feature across the tree. - State is immutable and explicit. Model UI state as a sealed/union type (initial / inProgress / failure / ready) so every case is handled exhaustively. One-off effects (snackbars, navigation) are events, not state.
- Add layers only when they pay for themselves. Start with view-model → API client. Introduce a repository when you need caching, offline, or merging sources. Introduce a use case only when logic merges multiple repositories, is genuinely complex, or is reused by several view models.
Coding
- Prefer intent-revealing widgets over
Container. UsePadding,SizedBox,ColoredBox,DecoratedBox,Center— they are const-able and self-describing.Containeris fine only when combining several properties at once. - Use modern Dart. Pattern matching (
if (x case final v?)), switch expressions with exhaustiveness, records and destructuring, collectionif/for/spreads instead of.add()loops, expression bodies for pass-through async functions (no redundantasync/await). - Prefix sliver-returning widgets with
Sliverso misuse in the wrong scroll context is caught at a glance. - Tests tell a story. Use expressive matchers (
isEmpty,throwsA,isA,completion) and minimize dependencies — plainText/SizedBoxover design-system widgets in test fixtures. Test cubits/view models in isolation from the widget tree. - Every
// ignore:gets a reason on the same or preceding line. Log errors with dedicatederror/stackTraceparameters, never string interpolation.
Workflow checklists
Adding a new feature/screen
- Read references/feature-structure.md and mirror the existing project's conventions for the feature directory.
- Define the state as a union type first; then the cubit/view model; then the widgets. Constructor-inject dependencies; scope them to the feature's widget subtree.
- Data comes in through a repository or typed API client — never fetched inside a widget.
- Add unit tests for the cubit/view model logic before wiring UI details.
Reviewing Flutter code
Check, in order of importance:
- Logic in the right layer (rule 1–2)? Any
BuildContextin business logic? - State modeled as immutable union types, all cases handled?
- Feature self-contained, or does it reach into another feature's internals?
- Widget choices (rule 6), modern Dart (rule 7), sliver naming (rule 8)?
- Tests present for logic, readable, minimal dependencies?
- Unexplained
// ignore:, string-interpolated error logs, deprecated patterns still spreading?
Starting a new project
- Read references/architecture-layers.md for the layer blueprint and references/feature-structure.md for the folder skeleton.
- If more than ~2 teams or clearly separable domains are involved, read references/enterprise-scale.md and consider a Melos monorepo with one package per domain from day one.
- Set up strict lints early (
leancode_lintor equivalent + custom rules) — retrofitting is far more expensive.
Package palette
Defaults that these standards assume (swap for project-local equivalents when the codebase already uses something else):
- State:
bloc(Cubit) +freezedfor union-type states;bloc_presentationfor one-off UI events - DI:
providerscoped to widget subtrees (accepting its lack of compile-time safety as the lesser evil) - Boilerplate reduction:
flutter_hooks - Monorepo:
melos - Localization:
flutter_localizations+intlwith.arbfiles - Lints:
leancode_lint - E2E/UI tests:
patrol
The official Flutter guide is state-management-agnostic (MVVM with ChangeNotifier works too); what matters is the layer separation, not the package. See the reference files for rationale and trade-offs.
Related Skills
siyuan
46.6kAn open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
