Dart Analyze logoDart Analyze/
DRT-W1103

Use matching super parameter namesDRT-W1103

Major severityMajor
Anti-pattern categoryAnti-pattern

DO use super parameter names that match their corresponding super constructor's parameter names.

BAD:

class Rectangle {
  final int width;
  final int height;

  Rectangle(this.width, this.height);
}

class ColoredRectangle extends Rectangle {
  final Color color;

  ColoredRectangle(
    this.color,
    super.height, // Bad, actually corresponds to the `width` parameter.
    super.width, // Bad, actually corresponds to the `height` parameter.
  );
}

GOOD:

class Rectangle {
  final int width;
  final int height;

  Rectangle(this.width, this.height);
}

class ColoredRectangle extends Rectangle {
  final Color color;

  ColoredRectangle(
    this.color,
    super.width,
    super.height,
  );
}