flutter app expert
via PatrickJS/awesome-cursorrules
Expert guidance for Flutter development with clean architecture, BLoC pattern, and Material 3 design.
What is flutter app expert?
This rule provides comprehensive Flutter development best practices covering architecture, state management, widget design, performance, and testing. Use it when building Flutter apps to maintain code quality, follow clean architecture principles, and implement proper patterns like BLoC and dependency injection.
- Guides clean architecture implementation with feature-based project structure and separation of concerns
- Recommends BLoC pattern for state management with proper dependency injection using GetIt
- Provides widget composition and lifecycle best practices including const constructors and proper keys
- Covers performance optimization for images, list views, and build methods
- Establishes testing strategies including unit, widget, and integration tests with mocking
- Advises on routing with GoRouter, localization, null safety, and error handling patterns
Applies to
File patterns this rule matches.
Rule definition (reference)
Source of truth, from the repository.
// Flutter App Expert .cursorrules
// Flexibility Notice
// Note: This is a recommended project structure, but be flexible and adapt to existing project structures. // Do not enforce these structural patterns if the project follows a different organization. // Focus on maintaining consistency with the existing project architecture while applying Flutter best practices.
// Flutter Best Practices
const flutterBestPractices = [ "Adapt to existing project architecture while maintaining clean code principles", "Use Flutter 3.x features and Material 3 design", "Implement clean architecture with BLoC pattern", "Follow proper state management principles", "Use proper dependency injection", "Implement proper error handling", "Follow platform-specific design guidelines", "Use proper localization techniques", ];
// Project Structure
// Note: This is a reference structure. Adapt to the project's existing organization
const projectStructure = lib/ core/ constants/ theme/ utils/ widgets/ features/ feature_name/ data/ datasources/ models/ repositories/ domain/ entities/ repositories/ usecases/ presentation/ bloc/ pages/ widgets/ l10n/ main.dart test/ unit/ widget/ integration/;
// Coding Guidelines
const codingGuidelines = `
- Use proper null safety practices
- Implement proper error handling with Either type
- Follow proper naming conventions
- Use proper widget composition
- Implement proper routing using GoRouter
- Use proper form validation
- Follow proper state management with BLoC
- Implement proper dependency injection using GetIt
- Use proper asset management
- Follow proper testing practices `;
// Widget Guidelines
const widgetGuidelines = `
- Keep widgets small and focused
- Use const constructors when possible
- Implement proper widget keys
- Follow proper layout principles
- Use proper widget lifecycle methods
- Implement proper error boundaries
- Use proper performance optimization techniques
- Follow proper accessibility guidelines `;
// Performance Guidelines
const performanceGuidelines = `
- Use proper image caching
- Implement proper list view optimization
- Use proper build methods optimization
- Follow proper state management patterns
- Implement proper memory management
- Use proper platform channels when needed
- Follow proper compilation optimization techniques `;
// Testing Guidelines
const testingTestingGuidelines = `
- Write unit tests for business logic
- Implement widget tests for UI components
- Use integration tests for feature testing
- Implement proper mocking strategies
- Use proper test coverage tools
- Follow proper test naming conventions
- Implement proper CI/CD testing `;
Related rules
Flutter development with MVVM, Riverpod state management, and Material Design.
Cursor rules for Flutter Riverpod state management and Clean Architecture patterns.

Modern Fortran best practices for scientific computing with modules, explicit interfaces, and memory safety.
GameMaker Language best practices for scripts, objects, events, and performance-conscious game code.
Convert test scripts to business-readable Gherkin (Given-When-Then) format for QA documentation.
Structure commit messages with type, scope, and description for semantic versioning and automated changelog generation.