| Index: lib/src/whitespace.dart
|
| diff --git a/lib/src/whitespace.dart b/lib/src/whitespace.dart
|
| index 7c953056e19e1e08bb541ab09bbab66ff7b57596..0f7b2cba146c8fa47b389a316e150fe3dd7e97b5 100644
|
| --- a/lib/src/whitespace.dart
|
| +++ b/lib/src/whitespace.dart
|
| @@ -10,6 +10,9 @@ library dart_style.src.whitespace;
|
| /// We defer actually writing whitespace until a non-whitespace token is
|
| /// encountered to avoid trailing whitespace.
|
| class Whitespace {
|
| + /// No whitespace.
|
| + static const none = const Whitespace._("none");
|
| +
|
| /// A single non-breaking space.
|
| static const space = const Whitespace._("space");
|
|
|
| @@ -45,6 +48,23 @@ class Whitespace {
|
|
|
| final String name;
|
|
|
| + /// Gets the minimum number of newlines contained in this whitespace.
|
| + int get minimumLines {
|
| + switch (this) {
|
| + case Whitespace.newline:
|
| + case Whitespace.nestedNewline:
|
| + case Whitespace.newlineFlushLeft:
|
| + case Whitespace.oneOrTwoNewlines:
|
| + return 1;
|
| +
|
| + case Whitespace.twoNewlines:
|
| + return 2;
|
| +
|
| + default:
|
| + return 0;
|
| + }
|
| + }
|
| +
|
| const Whitespace._(this.name);
|
|
|
| String toString() => name;
|
|
|