flutter-development-guidelines-cursorrules-prompt-file

A set of Cursor coding rules for Flutter apps, using MVVM architecture, Riverpod for state management, Material widgets, and Dart style conventions. Flutter is a toolkit for building apps from shared code.

In plain words
What is it for?
Use it when creating or changing Flutter application code, especially files under models, viewmodels, views, services, and utilities.
Why use it?
It gives the agent consistent guidance for organising files, naming code, sharing reusable components, and separating screens, logic, services, and data.

Cursor rule

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/patrickjs/awesome-cursorrules/flutter-development-guidelines-cursorrules-prompt-file
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules
Per session 506 This file is loaded in full into every session.
When invoked 506 The same file — it is already loaded in full.
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.00506 $0.00506
Opus 5 $0.00253 $0.00253
Sonnet 5 $0.00101 $0.00101
Haiku 4.5 $0.00051 $0.00051

Measured 3d ago against content hash 331032920e08, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flutter-development-guidelines-cursorrules-prompt-file 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 3d ago.

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.

rules/flutter-development-guidelines-cursorrules-prompt-file.mdc · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code style and structure

  • Write concise and efficient source code.
  • Strive for source code that is easy to read and maintain, and provide accurate examples.
  • Avoid duplication of code: modularise widgets and functions into reusable components.
  • Use descriptive variable names: use names with auxiliary verbs such as isLoading, hasError.

Directory structure under /lib.

  • /lib/models/: data models and type definitions (Models)
  • /lib/viewmodels/: state management and business logic (ViewModel)
  • /lib/views/widgets/: reusable widgets (View)
  • /lib/views/screens/: per-screen widgets (View)
  • /lib/services/: service classes for API calls and data access
  • /lib/utils/: helper functions and constants

Naming conventions

  • Directories and files: use snakeCase (e.g. auth_wizard.dart).
  • UpperCamelCase: use for class names/enumerations/typedefs/type parameters, etc.
  • LowerCamelCase: used for variables/functions/class members (properties, methods), etc.
  • lowercase_with_underscores (snakeCase): for files/directories/packages/libraries, etc.

Import.

  • Place imports starting with dart: first (use lowercase_with_underscores for the import prefix).
  • Next, import third-party packages (package:).
  • Finally, import relative paths and files in the project.

Using Dart.

  • Take advantage of type safety: use static typing in all code and utilise type inference wherever possible.

UI and styling.

  • Use Material widgets.
  • Unify theming: use ThemeData to apply consistent styles.

Performance optimisation.

  • Prefer StatelessWidget when state is not required.
  • Make use of const constructors: if widgets are immutable, use const to optimise builds.

State management.

  • Use riverpod to implement efficient state management.
  • Manage state within the ViewModel and link it to the View.

Software architecture

Use MVVM (Model View ViewModel).

Key rules.

  • To improve code readability, lines should not exceed 80 characters in length.
  • Use braces {} for all flow control structures (if, for, while, etc.).
  • Use comment-outs proactively to help understand and maintain code.
  • Use single quotes, avoid the use of double quotes and use consistent string literals to improve readability.

Read the full file on GitHub · 54 lines

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. 3d ago First seen · 54 lines · 0 tokens per session scan A 331032920e08

Subscribe to this mod's changes

flutter-development-guidelines-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,694 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 506 tokens to every session, about $0.0025 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.