pub global activate dart_style
pub global run dart_style:format -w [path_to_dart_code]
If you've activated dart_style and added the right path to your environment, you can run dart_formatter directly.
But if you were scripting this in gulp, pub global run dart_style:format is the way to go