dart format command to replace the whitespace in your program
with formatting that follows
This is the same formatting that you can get
when using an IDE or editor that has Dart support.
Provide a list of files or directories to the
dart format command.
For example, here’s how to format all the Dart files
in or under the current directory:
$ dart format .
To specify multiple files or directories,
use a space-delimited list.
The following command formats all Dart files under the
plus one Dart file under the
$ dart format lib bin/updater.dart
If you don’t want to overwrite the files,
-o show or
-o json to get the contents of the formatted files,
-o none to see only which files would change.
$ dart format -o show bin/my_app.dart
To make the command have an exit code of
if any formatting changes occur,
This exit code is often used with continuous integration (CI)
to indicate that a check should fail.
$ dart format -o none --set-exit-if-changed bin/my_app.dart
For information on additional command-line options,
dart help command or see the documentation for the
$ dart help format