prefer_if_null_operators_with_default_bool

Group: style

Maturity: stable

Code Sharp v0.0.1

Since info is static, may be stale
recommendedflutter

View all Lint Rules

Using the Linter

Prefer using if null operators with default bool value instead of null checks in conditional expressions.

BAD:


final isEmpty = a == null ? true : a.isEmpty();

GOOD:


final isEmpty = a?.isEmpty() ?? true;