Dart Analyze logoDart Analyze/
DRT-W1027

Don't use the Null type, unless you are positive that you don't want voidDRT-W1027

Major severityMajor
Bug Risk categoryBug Risk

DON'T use the type Null where void would work.

BAD:

Null f() {}
Future<Null> f() {}
Stream<Null> f() {}
f(Null x) {}

GOOD:

void f() {}
Future<void> f() {}
Stream<void> f() {}
f(void x) {}

Some exceptions include formulating special function types:

Null Function(Null, Null);

and for making empty literals which are safe to pass into read-only locations for any type of map or list:

<Null>[];
<int, Null>{};