flutter_ui_dev

A set of rules for building Flutter user interfaces with Dart. Flutter is a toolkit for making app screens, and the rules cover widgets, layout, animation, asynchronous work, and error handling.

In plain words
What is it for?
Use it when creating or editing Flutter screens, reusable UI components, Material or Cupertino designs, animations, and code that loads data asynchronously.
Why use it?
It gives the coding agent consistent guidance for organizing UI code and choosing suitable Flutter components without relying on a state-management library such as Riverpod.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/arenukvern/mcp_flutter/flutter_ui_dev
Clone the repo
git clone --depth 1 https://github.com/Arenukvern/mcp_flutter

Made for: Cursor.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 435 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00435
Opus 5 $0.00004 $0.00217
Sonnet 5 $0.00002 $0.00087
Haiku 4.5 $0.00001 $0.00044

Measured yesterday against content hash bc492b56eee1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flutter_ui_dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/flutter_ui_dev.mdc · 60 lines

What it actually says

Flutter widgets and concepts:

  • Dart 3.11 syntax for null safety, pattern matching, and more
  • Appropriate use of StatelessWidget, or Stateful widgets (NO riverpod)
  • Custom reusable widgets (use ui_kit) instead of methods
  • Cupertino or Material Design as appropriate
  • Proper error handling and async/await for asynchronous operations
  • flutter_animate for animations

Widget Composition Guidelines:

  1. Appropriate Widget Granularity:

    • Prefer fewer, more cohesive widgets over many tiny widgets
    • Extract new widget classes only when they are:
    • Reused in multiple places
    • Complex enough to warrant separation (>10 lines)
    • Logically independent with clear boundaries
    • For simpler UIs, use a single widget with well-commented sections
  2. Code Organization Hierarchy:

    • First preference: Use comments to separate logical sections within a widget
    • Second preference: Extract logical methods for complex sections (>10 && <30 lines)
    • Last preference: Create new widget classes
  3. Comment-Based Structure:

    • Use section comments to delineate logical UI parts:
    // Header section
    Column(
       children: [
          // Title
          Text('Title'),
          // Subtitle
          Text('Subtitle'),
       ],
    ),
    
  4. Refactoring Decision Tree:

    • Is the component reused? → Extract widget
    • Is the component >50 lines? → Consider extraction
    • Is the component logically independent? → Consider extraction
    • Otherwise → Keep in parent with comments
  5. Performance Considerations:

    • Be mindful that each widget adds overhead
    • Prefer fewer widgets for simpler screens
    • Use const constructors aggressively
  6. Documentation Balance:

    • For single-class approaches, use inline comments instead of class-level docs
    • Reserve detailed documentation for public APIs and complex widgets
    • Document the "why" more than the "what" when using comments
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 60 lines · 8 tokens per session scan A bc492b56eee1

Subscribe to this mod's changes

flutter_ui_dev is a cursor rule published in the GitHub repository Arenukvern/mcp_flutter (370 stars, last pushed 6d ago), licensed MIT. It adds 8 tokens to every session and 435 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.