// Flutter App Expert .cursorrules
Add this skill
npx mdskills install PatrickJS/cursor-flutter-app-expertComprehensive Flutter guidelines covering architecture, performance, and testing best practices
1// Flutter App Expert .cursorrules23// Flexibility Notice45// Note: This is a recommended project structure, but be flexible and adapt to existing project structures.6// Do not enforce these structural patterns if the project follows a different organization.7// Focus on maintaining consistency with the existing project architecture while applying Flutter best practices.89// Flutter Best Practices1011const flutterBestPractices = [12 "Adapt to existing project architecture while maintaining clean code principles",13 "Use Flutter 3.x features and Material 3 design",14 "Implement clean architecture with BLoC pattern",15 "Follow proper state management principles",16 "Use proper dependency injection",17 "Implement proper error handling",18 "Follow platform-specific design guidelines",19 "Use proper localization techniques",20];2122// Project Structure2324// Note: This is a reference structure. Adapt to the project's existing organization2526const projectStructure = `27lib/28 core/29 constants/30 theme/31 utils/32 widgets/33 features/34 feature_name/35 data/36 datasources/37 models/38 repositories/39 domain/40 entities/41 repositories/42 usecases/43 presentation/44 bloc/45 pages/46 widgets/47 l10n/48 main.dart49test/50 unit/51 widget/52 integration/53`;5455// Coding Guidelines5657const codingGuidelines = `581. Use proper null safety practices592. Implement proper error handling with Either type603. Follow proper naming conventions614. Use proper widget composition625. Implement proper routing using GoRouter636. Use proper form validation647. Follow proper state management with BLoC658. Implement proper dependency injection using GetIt669. Use proper asset management6710. Follow proper testing practices68`;6970// Widget Guidelines7172const widgetGuidelines = `731. Keep widgets small and focused742. Use const constructors when possible753. Implement proper widget keys764. Follow proper layout principles775. Use proper widget lifecycle methods786. Implement proper error boundaries797. Use proper performance optimization techniques808. Follow proper accessibility guidelines81`;8283// Performance Guidelines8485const performanceGuidelines = `861. Use proper image caching872. Implement proper list view optimization883. Use proper build methods optimization894. Follow proper state management patterns905. Implement proper memory management916. Use proper platform channels when needed927. Follow proper compilation optimization techniques93`;9495// Testing Guidelines9697const testingTestingGuidelines = `981. Write unit tests for business logic992. Implement widget tests for UI components1003. Use integration tests for feature testing1014. Implement proper mocking strategies1025. Use proper test coverage tools1036. Follow proper test naming conventions1047. Implement proper CI/CD testing105`;106107
Full transparency — inspect the skill content before installing.