Group: style

Maturity: stable

Linter v0.1.56

Since info is static, may be stale

View all Lint Rules

Using the Linter

DO NOT pass null as an argument where a closure is expected.

Often a closure that is passed to a method will only be called conditionally, so that tests and "happy path" production calls do not reveal that null will result in an exception being thrown.

This rule only catches null literals being passed where closures are expected in the following locations:


Static functions

Instance methods


[1, 3, 5].firstWhere((e) => e.isOdd, orElse: null);


[1, 3, 5].firstWhere((e) => e.isOdd, orElse: () => null);