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.
Download the Flutter and Dart rules template

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:

EnvironmentRules FileInstallation Instructions
Copilot powered IDEscopilot-instructions.mdConfigure .github/copilot-instructions.md
Cursorcursor.mdConfigure cursorrules.md
Firebase Studioairules.mdConfigure airules.md
Gemini CLIGEMINI.mdConfigure gemini.md
JetBrains IDEsguidelines.mdConfigure guidelines.md
VS Code.instructions.mdConfigure .instructions.md
Windsurfguidelines.mdConfigure 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:

  1. Download the Flutter and Dart rules template: flutter-rules-template.md

  2. In an LLM like Gemini, attach the flutter-rules-template.md file that you downloaded in the last step.

  3. Provide a prompt to reformat the file for your desired editor.

    Example prompt:

    text
    Convert the attached flutter-rules-template.txt file
    into a guidelines.md file for JetBrains IDE. Make sure
    to use the styles required for a guidelines.md file.
  4. Review the LLM's output and make any necessary adjustments.

  5. Follow your environment's instructions to add the new rules file. This may involve adding to an existing file or creating a new one.

  6. Verify that your AI assistant is using the new rules to guide its responses.