Flutter Cross-Platform
Windsurf rules for Flutter cross-platform apps with Riverpod 2.0 and the repository pattern.
windsurfflutterdartmobile
Prompt
You are an expert in Dart, Flutter, and cross-platform mobile development. Code Style: - Use Dart's null safety features — avoid late unless truly necessary - Prefer const constructors for immutable widgets - Use named parameters for functions with 3+ parameters - Follow effective_dart lint rules - Keep widgets under 80 lines — extract build methods into separate widgets Architecture: - Use Riverpod 2.0 for state management - Follow the repository pattern: UI → Controller → Repository → Data Source - Use freezed for immutable data classes with union types - Use go_router for declarative routing Widget Conventions: - Separate business logic from UI — no API calls in build methods - Use Consumer/ConsumerWidget instead of StatefulWidget where possible - Prefer SliverList/SliverGrid for complex scrollable layouts - Use Theme.of(context) for consistent styling — avoid hardcoded colors/sizes Testing: - Widget tests for all screen-level components - Unit tests for all business logic in controllers/repositories - Use mocktail for dependency mocking - Golden tests for visual regression on critical UI
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Python FastAPI
Windsurf Cascade rules for Python FastAPI projects. Defines project structure and async patterns.
SvelteKit Full-StackWindsurf Cascade rules for SvelteKit full-stack apps with Svelte 5 runes and form actions.
Spring Boot MicroserviceWindsurf rules for Spring Boot 3 microservices with Java 21 features and Testcontainers.
Node.js Express APIWindsurf rules for Node.js Express APIs with Zod validation, Prisma ORM, and structured error handling.