Dart Analyze logoDart Analyze/
DRT-W1149

Prefer is! operatorDRT-W1149

Major severityMajor
Anti-pattern categoryAnti-pattern

When checking if an object is not of a specified type, it is preferable to use the 'is!' operator.

BAD:

if (!(foo is Foo)) {
  ...
}

GOOD:

if (foo is! Foo) {
  ...
}