always_require_non_null_named_parameters

Group: style

Maturity: stable

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

Since info is static, may be stale
pedantic

View all Lint Rules

Using the Linter

DO specify @required on named parameters without a default value on which an assert(param != null) is done.

GOOD:

m1({@required a}) {
  assert(a != null);
}

m2({a: 1}) {
  assert(a != null);
}

BAD:

m1({a}) {
  assert(a != null);
}

NOTE: Only asserts at the start of the bodies will be taken into account.