Skip to content
This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Dart

Language-specific information about the way SonarQube Server 2025.2 supports the analysis of Dart.

For AI agents: You're in the SonarQube Server 2025.2 documentation. SonarQube Server 2025.2 is no longer patched. To get patches, upgrade to the latest version. For a list of all 2025.2 pages, see the SonarQube Server 2025.2 page index. For the whole site, see the page index or the full text. For another version, replace 2025.2 in the URL with that version. The latest version has no version number in its URL.

Supported versions

The level of support for a language is defined as follows:

  • Fully supported: Analysis will complete. All the language features are understood and examined.

  • Supported: Most language features are understood and examined but the version includes unsupported features. Analysis might break or provide incomplete results.

Version 2 is supported.

Versions 3 to 3.7 are fully supported.

Language-specific properties

You can discover and update Dart-specific Analysis parameters in the project Administration > Configuration > General Settings > Languages > Dart

Preparing the analysis

Before performing the analysis, we highly recommend:

  • retrieving all project dependencies declared in pubspec.yaml, for example, by``running flutter pub get for Flutter projects, dart pub get for Dart projects, etc.

  • performing a full and successful build of your Flutter or Dart project

Otherwise, you might get incomplete and potentially incorrect analysis results. Running flutter pub get or dart pub get alone may not be enough to produce a correct analysis, for example, when you analyze generated code.

Analyzing generated code

When code generation is done via automated source code generation, the analysis of generated code can only happen after the execution of source_gen, which requires a full build of the Flutter or Dart project containing the builders.

When code generation is done via lower-level packages such as build, the analysis should only happen once the source has been generated and persisted on disk.

{% hint style="warning" %}

Sonar provides the [`

sonarqube-scan-action` action](https://github.com/marketplace/actions/official-sonarqube-scan) to ease the configuration of the analysis in GitHub.

However, up to v3, the GitHub Action runs the analysis in a Docker container, which has only access to the directory where the project is checked out.

That means that the action does not have access to the directory where dependencies have been retrieved, after running flutter pub get, dart pub get, or a similar command, which may result in an incomplete and potentially incorrect analysis.

Therefore, we suggest either using v4 or above, which is based on a composite action instead, or SonarScanner CLI directly (see the "Running SonarScanner CLI from the zip file" section).

Last updated

Was this helpful?