# Dart and Flutter

{% hint style="info" %}
Dart and Flutter is supported for Snyk Code and Snyk Open Source.
{% endhint %}

## Dart and Flutter for Snyk Code

{% hint style="info" %}
Code analysis support for Dart is in Early Access and is available only with Enterprise plans. To enable the feature, see [Snyk Preview](https://docs.snyk.io/snyk-platform-administration/snyk-preview).
{% endhint %}

For an overview of the supported security rules, visit [Dart and Flutter rules](https://docs.snyk.io/scan-with-snyk/snyk-code/snyk-code-security-rules/dart-and-flutter-rules).

### Supported frameworks and libraries

For Dart and Flutter with Snyk Code, Snyk supports the following frameworks and libraries:

{% columns %}
{% column %}

* crypto
* encrypt
* uuid
* basic\_utils
* pointycastle
* cryptography
* sqflite
* sqlite3
* drift
* realm
* http
* dio
* cupertino\_http
* web\_socket\_channel
* web
  {% endcolumn %}

{% column %}

* cronet\_http
* flutter\_inappwebview
* webview\_flutter
* twilio\_flutter
* dart\_eval
* google\_sign\_in
* flutter\_facebook\_auth
* sign\_in\_with\_apple
* flutter\_appauth
* openid\_client
* firebase\_auth
* amplify\_flutter
* flutter\_stripe
* nfc\_manager
* mobile\_scanner
* flutter
  {% endcolumn %}
  {% endcolumns %}

### Supported file formats

The following file formats are supported: `.dart`

### Available features

* Reports
* Interfile analysis

## Dart and Flutter for Snyk Open Source

### Available features

* Test your app's SBOM and packages using `pkg:pub` PURLs through the [SBOM test](https://docs.snyk.io/developer-tools/snyk-cli/commands/sbom-test) CLI command
* Test & monitor your Flutter apps native platform dependencies using [`snyk test`](https://docs.snyk.io/developer-tools/snyk-cli/commands/test) and [`snyk monitor`](https://docs.snyk.io/developer-tools/snyk-cli/commands/monitor) commands

### Testing a Dart applications pub dependency tree

Activate the pub [`sbom`](https://pub.dev/packages/sbom) package & create a minimal `sbom.yaml` file in the root folder of the repository:

```
dart pub global activate sbom
cat << EOF > sbom.yaml
type: spdx
spdx:
  SPDXFormat: 'tagvalue'
EOF
```

Use the dart `sbom` command to create a SBOM file & test it using the [`sbom test`](https://docs.snyk.io/developer-tools/snyk-cli/commands/sbom-test) command:

```
dart pub global run sbom
snyk sbom test --experimental --file sbom-pub.json
```

### Testing platform dependencies (iOS, macOS, Android) in Flutter apps

Flutter applications rely on native platform dependencies to handle lower-level tasks, such as analytics, hardware access, or integrating existing functionality. These dependencies can be added through pub packages to extend functionality or integrated directly into build systems like Gradle or Cocoapods.

Snyk’s regular open-source support can scan these packages; however, a complete app build is necessary to make them available in the repository and accessible to CLI tools.

You can start by building the application for all relevant platforms. This ensures that `pub` fetches all required packages, and the Flutter build system establishes the necessary links for the native build systems.

```
flutter build apk --debug
flutter build ios --debug --no-codesign
flutter build macos --debug
```

Next, run the `snyk monitor` command to scan for native dependencies:

```
snyk monitor --all-projects --exclude=example,.symlinks
```

The `--exclude` parameter removes duplicates and ignores example applications, which are part of the plugin source code but not included in regular application builds.

You are now able to view in the Snyk Web UI all native dependencies, including those introduced by third-party plugins.

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fgit-blob-9c9a0662e7b32f22a90a905187245ee1bb0b0dfa%2Fimage.png?alt=media" alt=""><figcaption><p>Snyk Project page showing dependencies in Flutter apps</p></figcaption></figure>


---

# 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.snyk.io/supported-languages/supported-languages-list/dart-and-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.
