Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

dart.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.

Learn more
Experiment flags

Dart 3.11 is live!Learn more

Experiment flags

Using experiment flags with Dart tools.

The Dart SDK often contains experimental features, which you can try by passing flags to Dart tools.

Warning

Don't use experiments for production code. Experiments might have breaking changes or be removed without notice.

To use an experiment with Dart SDKcommand line tools, pass the corresponding flag to the tool.

For example, to enable the experimentssuper-mixins andno-slow-checks, add those flags to thedart command:

dart run --enable-experiment=super-mixins,no-slow-checks bin/main.dart

Or to theflutter command:

flutter run --enable-experiment=super-mixins,no-slow-checks

Using experiment flags with the Dart analyzer (command-line and IDE)

#

To enable experiments affecting analysis, use theenable-experiment key in theanalysis options file. Here's an example of enabling the experimentssuper-mixins andno-slow-checks inanalysis_options.yaml:

analysis_options.yaml
yaml
analyzer:enable-experiment:-super-mixins-no-slow-checks

Using experiment flags with IDEs

#

To enable experiments related to running or debugging apps in IDEs, edit the launch configuration.

Visual Studio Code

#

Inlaunch.json underconfigurations, add a newtoolArgs key containing the desired flags. Example:

launch.json
json
"configurations":[{"name":"Dart","program":"bin/main.dart","request":"launch","type":"dart","toolArgs":["--enable-experiment=super-mixins,no-slow-checks",],}]

For more information, consult the documentation forVS Code launch configurations.

Android Studio

#

UnderVMOptions add the desired flags. Example:

xml
<component name="ProjectRunConfigurationManager"><configuration default="false" name="Run main" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"><option name="VMOptions" value="--enable-experiment=non-nullable" /><option name="filePath" value="$PROJECT_DIR$/bin/main.dart" /><method v="2" /></configuration></component>

For more information, consult the instructions forAndroid Studio run/debug configurations.

More information

#
Was this page's content helpful?

Unless stated otherwise, the documentation on this site reflects Dart 3.11.0. Page last updated on 2025-05-14.View source orreport an issue.


[8]ページ先頭

©2009-2026 Movatter.jp