dart_style icon indicating copy to clipboard operation
dart_style copied to clipboard

Code with cascading calls inside an assert is moved too soon to a new line.

Open Jonas-Sander opened this issue 2 years ago • 0 comments

Actual

class Foo {
  final List<Foo> subsections;
  final bool aBoolWithSomeVeryLongName;

  Foo({
    this.subsections,
    this.aBoolWithSomeVeryLongName,
  }) : assert(subsections
                .where((element) => element.aBoolWithSomeVeryLongName)
                .length <=
            1);
}

Expected (Or something along these lines)

class Foo {
  final List<Foo> subsections;
  final bool aBoolWithSomeVeryLongName;

  Foo({
    this.subsections,
    this.aBoolWithSomeVeryLongName,
  }) : assert(subsections
                .where((element) => element.aBoolWithSomeVeryLongName)
                .length <= 1);
}

Jonas-Sander avatar Jun 16 '22 16:06 Jonas-Sander