unnecessary_null_in_if_null_operators

Group: style

Maturity: stable

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

Since info is static, may be stale
pedantic

View all Lint Rules

Using the Linter

AVOID using null as an operand in if null operators.

Using null in an if null operator is redundant, regardless of which side null is used on.

GOOD:

var x = a ?? 1;

BAD:

var x = a ?? null;
var y = null ?? 1;