DeepSource has joined Harness. Learn more
Dart Analyze logoDart Analyze/
DRT-W1142

Prefer using if null operatorsDRT-W1142

Major severityMajor
Anti-pattern categoryAnti-pattern

PREFER using if null operators instead of null checks in conditional expressions.

BAD:

v = a == null ? b : a;

GOOD:

v = a ?? b;