use_ super_ parameters
Details about the 'use_super_parameters' diagnostic produced by the Dart analyzer.
Parameter '{0}' could be a super parameter.
Parameters '{0}' could be super parameters.
Description
#
The analyzer produces this diagnostic when a parameter to a constructor is
passed to a super constructor without being referenced or modified and a
super parameter isn't used.
Example
#
The following code produces this diagnostic because the parameters of the
constructor for B are only used as arguments to the super constructor:
class A {
A({int? x, int? y});
}
class B extends A {
B({int? x, int? y}) : super(x: x, y: y);
}
Common fixes
#Use a super parameter to pass the arguments:
class A {
A({int? x, int? y});
}
class B extends A {
B({super.x, super.y});
}
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Report an issue.