{"filename":"flutter-development-guidelines-cursorrules-prompt-file.mdc","content":"---\ndescription: \"Cursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.\"\nglobs: **/*.dart\nalwaysApply: false\n---\n### Code style and structure\n- Write concise and efficient source code.\n- Strive for source code that is easy to read and maintain, and provide accurate examples.\n- Avoid duplication of code: modularise widgets and functions into reusable components.\n- Use descriptive variable names: use names with auxiliary verbs such as isLoading, hasError.\n\n### Directory structure under /lib.\n- /lib/models/: data models and type definitions (Models)\n- /lib/viewmodels/: state management and business logic (ViewModel)\n- /lib/views/widgets/: reusable widgets (View)\n- /lib/views/screens/: per-screen widgets (View)\n- /lib/services/: service classes for API calls and data access\n- /lib/utils/: helper functions and constants\n\n### Naming conventions\n- Directories and files: use snakeCase (e.g. auth_wizard.dart).\n- UpperCamelCase: use for class names/enumerations/typedefs/type parameters, etc.\n- LowerCamelCase: used for variables/functions/class members (properties, methods), etc.\n- lowercase_with_underscores (snakeCase): for files/directories/packages/libraries, etc.\n\n### Import.\n- Place imports starting with dart: first (use lowercase_with_underscores for the import prefix).\n- Next, import third-party packages (package:).\n- Finally, import relative paths and files in the project.\n\n### Using Dart.\n- Take advantage of type safety: use static typing in all code and utilise type inference wherever possible.\n\n### UI and styling.\n- Use Material widgets.\n- Unify theming: use ThemeData to apply consistent styles.\n\n### Performance optimisation.\n- Prefer StatelessWidget when state is not required.\n- Make use of const constructors: if widgets are immutable, use const to optimise builds.\n\n### State management.\n- Use riverpod to implement efficient state management.\n- Manage state within the ViewModel and link it to the View.\n\n### Software architecture\nUse MVVM (Model View ViewModel).\n\n### Key rules.\n- To improve code readability, lines should not exceed 80 characters in length.\n- Use braces {} for all flow control structures (if, for, while, etc.).\n- Use comment-outs proactively to help understand and maintain code.\n- Use single quotes, avoid the use of double quotes and use consistent string literals to improve readability.\n"}