avoid_renaming_method_parameters
The parameter name '{0}' doesn't match the name '{1}' in the overridden method.
Description
#The analyzer produces this diagnostic when a method that overrides a method from a superclass changes the names of the parameters.
Example
#The following code produces this diagnostic because the parameter of the method m
in B
is named b
, which is different from the name of the overridden method's parameter in A
:
dart
class A {
void m(int a) {}
}
class B extends A {
@override
void m(int b) {}
}
Common fixes
#Rename one of the parameters so that they are the same:
dart
class A {
void m(int a) {}
}
class B extends A {
@override
void m(int a) {}
}
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.