Using Dart's format
command enables you to format all dart files in a project. Setting the --set-exit-if-changed
flag will cause the formatter to return an exit code that can be used in CI to pass or fail a build.
$ dart format -o none --set-exit-if-changed