FormatCommand.run()now returns the value set in
?in initializing formal function-typed parameters (#960).
?:) when they are nested (#927).
abstractfields and variables (#946).
.when the target is parenthesized (#704).
Properly format trailing commas in assertions.
Improve indentation of adjacent strings. This fixes a regression introduced in 1.2.5 and hopefully makes adjacent strings generally look better.
Adjacent strings in argument lists now format the same regardless of whether the argument list contains a trailing comma. The rule is that if the argument list contains no other strings, then the adjacent strings do not get extra indentation. This keeps them lined up when doing so is unlikely to be confused as showing separate independent string arguments.
Previously, adjacent strings were never indented in argument lists without a trailing comma and always in argument lists that did. With this change, adjacent strings are still always indented in collection literals because readers are likely to interpret a series of unindented lines there as showing separate collection elements.
forelements inside collections (#779).
--fix-function-typedefsto convert the old typedef syntax for function types to the new preferred syntax.
--stdin-nameto specify name shown when reading from stdin (#739).
/** ... */doc comments into
constin all metadata annotations with --fix-optional-const` (#720).
Preserve whitespace in multi-line strings inside string interpolations (#711). Note! This bug means that dart_style 1.1.2 may make semantics changes to your strings. You should avoid that version and use 1.1.3.
Set max SDK version to <3.0.0, and adjusted other dependencies.
=as the named parameter default value separator.
.if the target expression is an argument list with a trailing comma (#548, #665).
<when a collection is in statement position (#589).
covariantmodifier on methods.
--set-exit-if-changedto set the exit code on a change (#365).
--versioncommand line argument (#240).
.in a method chain if the target splits (#255).
ifstatements without curly bodies better (#448).
--indentto specify leading indent (#464).
forfully split if initializers or updaters do (#375, #377).
indent argument to
new DartFormatter() is now a number of spaces, not indentation levels.
This version introduces a new n-way constraint system replacing the previous binary constraints. It‘s mostly an internal change, but allows us to fix a number of bugs that the old solver couldn’t express solutions to.
In particular, it forces argument and parameter lists to go one-per-line if they don't all fit in two lines. And it allows function and collection literals inside expressions to indent like expressions in some contexts. (#78, #97, #101, #123, #139, #141, #142, #143, et. al.)
Indent cascades more deeply when the receiver is a method call (#137).
Preserve newlines in collections containing line comments (#139).
Allow multiple variable declarations on one line if they fit (#155).
Prefer splitting at “.” on non-identifier method targets (#161).
Enforce a blank line before and after classes (#168).
More precisely control newlines between declarations (#173).
Preserve mandatory newlines in inline block comments (#178).
Splitting inside type parameter and type argument lists (#184).
Nest blocks deeper inside a wrapped conditional operator (#186).
Split named arguments if the positional arguments split (#189).
Re-indent line doc comments even if they are flush left (#192).
Nest cascades like expressions (#200, #203, #205, #221, #236).
Prefer splitting after
=> over other options (#217).
Nested non-empty collections force surrounding ones to split (#223).
Allow splitting inside with and implements clauses (#228, #259).
Allow splitting after
= in a constructor initializer (#242).
=> function's parameters split, split after the
=> too (#250).
Allow splitting between successive index operators (#256).
Correctly indent wrapped constructor initializers (#257).
Set failure exit code for malformed input when reading from stdin (#359).
Do not nest blocks inside single-argument function and method calls.
Do nest blocks inside
testpackage runner internally.
--dry-runoption to show files that need formatting (#67).
await forstatements (#154).
-tflag to preserve compatibility with old formatter (#166).
--machineflag for machine-readable output (#164).