Rule

0 installs · 0 said it worked

PatrickJS@patrickjs·
CodingRule· for Cursor

Flutter MVVM and Riverpod coding rules for Cursor

Cursor rules guiding Flutter code toward MVVM structure, Riverpod state management, Material widgets, consistent naming, import ordering, and Dart style conventions.

People use this for

  • flutter riverpod cursor rules
  • flutter mvvm architecture
  • dart style guide rules
  • set up flutter project structure with riverpod and mvvm
  • i want cursor to follow my flutter coding conventions for state management
Name
flutter-mvvm-and-riverpod-coding-rules-for-cursor
Works with
Cursor
License
CC0(as observed at the source)
Version
v1 · updated Nov 29, 2026
Imported · UnclaimedCC0

Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.

Are you the author?Claim this profileRequest removal

Use this rule

$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/flutter-mvvm-and-riverpod-coding-rules-for-cursor-4ryr/export/mdc" -o .cursor/rules/flutter-mvvm-and-riverpod-coding-rules-for-cursor.mdc

Then open a new session; Cursor picks it up from .cursor/rules/.

Download flutter-mvvm-and-riverpod-coding-rules-for-cursor.mdc
Manual install

Save flutter-mvvm-and-riverpod-coding-rules-for-cursor.mdc as .cursor/rules/flutter-mvvm-and-riverpod-coding-rules-for-cursor.mdc for this project or ~/.cursor/rules/flutter-mvvm-and-riverpod-coding-rules-for-cursor.mdc for every project, then start a new session.

Rule


description: "Cursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines." globs: **/*.dart alwaysApply: false

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.

No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.

Tried it

Reports from people who added this rule to their editor. They roll up into the badges above.

No one has filed a report yet. Try the prompt and be the first.

License: CC0v1 · published Nov 29, 2026

Comments

No comments yet. If you tried this prompt, say how it went.