always_require_non_null_named_parameters

Group: style

Maturity: deprecated

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

Since info is static, may be stale
recommendedflutterhas-fix

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.

BAD:

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

GOOD:

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

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

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