avoid_positional_boolean_parameters

Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.31)

View the Project on GitHub dart-lang/linter

AVOID positional boolean parameters.

Positional boolean parameters are a bad practice because they are very ambiguous. Using named boolean parameters is much more readable because it inherently describes what the boolean value represents.

BAD:

new Task(true);
new Task(false);
new ListBox(false, true, true);
new Button(false);

GOOD:

new Task.oneShot();
new Task.repeating();
new ListBox(scroll: true, showScrollbars: true);
new Button(ButtonState.enabled);