Dart Analyze logoDart Analyze/
DRT-W1063

Avoid redundant argument valuesDRT-W1063

Major severityMajor
Anti-pattern categoryAnti-pattern

DON'T pass an argument that matches the corresponding parameter's default value.

BAD:

void f({bool valWithDefault = true, bool? val}) {
  ...
}

void main() {
  f(valWithDefault: true);
}

GOOD:

void f({bool valWithDefault = true, bool? val}) {
  ...
}

void main() {
  f(valWithDefault: false);
  f();
}