Flutter Cursor Rules
Cursor rules for Flutter: widget architecture, state management, performance, and production Flutter best practices.
- Use const constructors wherever possible to optimize widget rebuilds - Prefer StatelessWidget with external state management over StatefulWidget - Use Riverpod or Bloc for app-level state; setState only for ephemeral local state - Extract complex widget subtrees into separate widget classes for reuse - Use ListView.builder and GridView.builder for long lists; never ListView with children - Add semantic labels to all tappable widgets for accessibility - Use ThemeExtension for custom design tokens beyond the default ThemeData - Profile with Flutter DevTools before optimizing; measure jank with frame timing
How to use with Cursor
Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.
Related Rules
Python Cursor Rules
Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.
TypeScript Cursor Rules
Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.
React Cursor Rules
Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.
Next.js Cursor Rules
Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.