# Flutter

This example uses the following parsers:

* [to-flutter](/reference/parsers/to-flutter.md) to generate your design tokens as dart files
* [svgo](/reference/parsers/svgo.md) to optimize and generate icons as SVG files

{% tabs %}
{% tab title="CLI configuration" %}
If you use the CLI, you need to fill three properties:

* `repository` is `@organization/repository`
* `personalAccessToken` which you can generate [in your account settings](https://specifyapp.com/user/personal-access-tokens)
* `rules` are where you provide parsers and compatible options

```json
{
  "version": "2",
  "repository": "@organization/repository",
  // Only use the personalAccessToken when working with the CLI
  "personalAccessToken": "<your-personal-access-token>",
  "rules": [
    {
      "name": "Generate tokens for Flutter",
      "parsers": [
        {
          "name": "to-flutter",
          "output": {
            "type": "file",
            "filePath": "public/tokens.dart"
          }
        }
      ]
    },
    {
      "name": "Optimize and generate icons as SVG files",
      "parsers": [
        {
          "name": "svgo",
          "output": {
            "type": "directory",
            "directoryPath": "public/vectors"
          }
        }
      ]
    }
  ]
}
```

{% endtab %}

{% tab title="GitHub Configuration" %}
If you use the GitHub, you need to fill 4 properties:

* `repository` is `@organization/repository`
* `head` lets you set the branch your PR will be created on
* `base` lets you set the branch your PR will be merged on
* `rules` lets you transform tokens by chaining parsers

{% hint style="info" %}
Make sure you have connected your GitHub account with your Specify account. Head toward [this article](https://help.specifyapp.com/en/articles/4722440-add-github-as-a-destination) to learn more.
{% endhint %}

```json
{
  "version": "2",
  "repository": "@organization/repository",
  "head": "specifyrc-json",
  "base": "main",
  "rules": [
    {
      "name": "Generate tokens for Flutter",
      "parsers": [
        {
          "name": "to-flutter",
          "output": {
            "type": "file",
            "filePath": "public/tokens.dart"
          }
        }
      ]
    },
    {
      "name": "Optimize and generate icons as SVG files",
      "parsers": [
        {
          "name": "svgo",
          "output": {
            "type": "directory",
            "directoryPath": "public/vectors"
          }
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.specifyapp.com/resources/parser-rules-templates/flutter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
