AI rules for Flutter and Dart
This guide covers how you can leverage AI rules to streamline your Flutter and Dart development.
Overview
#AI-powered editors use rules files to provide context and instructions to an underlying LLM. These files help you:
- Customize AI behavior to your team's needs.
 - Enforce project best practices for code style and design.
 - Provide critical project context to the AI.
 
Environments that support rules
#Many AI environments support rules files to guide LLM behavior. Here are some common examples and their corresponding rule file names:
| Environment | Rules File | Installation Instructions | 
|---|---|---|
| Copilot powered IDEs | copilot-instructions.md | 
                        Configure .github/copilot-instructions.md | 
| Cursor | cursor.md | 
                        Configure cursorrules.md | 
| Firebase Studio | airules.md | 
                        Configure airules.md | 
| Gemini CLI | GEMINI.md | 
                        Configure GEMINI.md | 
| JetBrains IDEs | guidelines.md | 
                        Configure guidelines.md | 
| VS Code | .instructions.md | 
                        Configure .instructions.md | 
| Windsurf | guidelines.md | 
                        Configure guidelines.md | 
Create rules for your editor
#You can adapt our Flutter and Dart rules template for your specific environment. To do so, follow these steps:
- 
                    
Download the Flutter and Dart rules template: rules.md
 - 
                    
In an LLM like Gemini, attach the
rules.mdfile that you downloaded in the last step. - 
                    
Provide a prompt to reformat the file for your desired editor.
Example prompt:
Convert the attached rules.md file into a guidelines.md file for Gemini CLI. Make sure to use the styles required for a guidelines.md file. - 
                    
Review the LLM's output and make any necessary adjustments.
 - 
                    
Follow your environment's instructions to add the new rules file. This may involve adding to an existing file or creating a new one.
 - 
                    
Verify that your AI assistant is using the new rules to guide its responses.
 
Unless stated otherwise, the documentation on this site reflects Flutter 3.35.5. Page last updated on 2025-10-30. View source or report an issue.