Use this file to discover all available pages before exploring further.
The dart command-line tool is the primary interface for Dart development. It provides a unified entry point for running Dart programs, managing packages, analyzing code, and more.
# Enable analyticsdart --enable-analytics# Disable analyticsdart --disable-analytics# Suppress analytics for a single rundart --suppress-analytics <command>
# Generate documentation for the current packagedart doc# Generate docs with a custom output directorydart doc --output=docs/api# Validate documentation without generatingdart doc --validate-links
# Enable assertsdart run --enable-asserts bin/main.dart# Set observatory portdart run --observe=8181 bin/main.dart# Enable experimentsdart run --enable-experiment=macros bin/main.dart
When running Dart programs, you can pass flags to the VM:
# Enable assertsdart --enable-asserts bin/main.dart# Set heap sizedart --old-gen-heap-size=2048 bin/main.dart# Enable observatory for debuggingdart --observe=8181 bin/main.dart# List all VM optionsdart --help --verbose
# Enable a single experimentdart --enable-experiment=macros run bin/main.dart# Enable multiple experimentsdart --enable-experiment=macros,inline-class run bin/main.dart# List available experimentsdart --enable-experiment=help
# Create a new projectdart create my_appcd my_app# Get dependenciesdart pub get# Analyze codedart analyze# Format codedart format .# Run testsdart test# Run the applicationdart run bin/my_app.dart# Compile to native executabledart compile exe bin/my_app.dart -o build/my_app