Dart 3.10 is taking off with dot shorthands, stable build hooks, nuanced deprecation annotations, and more!Learn more
dart analyze
Thedart analyze command performs the samestatic analysis that you get when you use an IDE or editor that has Dart support.
To learn more information about this and otherdart commands, check out theDart command-line tool page.
Here's an example of performing static analysis over all the Dart files under the current directory:
$ dart analyze You can customize how the analyzer treats warnings and info-level issues. Normally the analyzer reports failure when it finds any errors or warnings, but not when it finds info-level issues. You can customize this behavior using the--fatal-infos and--no-fatal-warnings flags. For example, to make the analyzer fail when any issue is the--fatal-infos flag:
$ dart analyze --fatal-infosYou can add a directory or a single file argument:
$ dart analyze [<DIRECTORY> | <DART_FILE>]For example, here's the command to analyze thebin directory:
$ dart analyze binBefore Dart 2.13,dart analyze supported only directory arguments.
To customize the analysis, use an analysis options file or special comments in Dart source code, as described inCustomizing static analysis.
For information on command-line options, use the--help flag:
$ dart analyze --helpUnless stated otherwise, the documentation on this site reflects Dart 3.10.0. Page last updated on 2025-9-4.View source orreport an issue.