prefer_initializing_formals

Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.30)

View the Project on GitHub dart-lang/linter

DO use initializing formals when possible.

Using initializing formals when possible makes your code more terse.

BAD:

class Point {
  num x, y;
  Point(num x, num y) {
    this.x = x;
    this.y = y;
  }
}

GOOD:

class Point {
  num x, y;
  Point(this.x, this.y);
}