avoid_positional_boolean_parameters

Group: style

Maturity: stable

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

Since info is static, may be stale
effective dart

View all Lint Rules

Using the 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:

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

GOOD:

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