undefined_super_member
(Previously known as undefined_super_method
)
The getter '{0}' isn't defined in a superclass of '{1}'.
The method '{0}' isn't defined in a superclass of '{1}'.
The operator '{0}' isn't defined in a superclass of '{1}'.
The setter '{0}' isn't defined in a superclass of '{1}'.
Description
#The analyzer produces this diagnostic when an inherited member (method, getter, setter, or operator) is referenced using super
, but there's no member with that name in the superclass chain.
Examples
#The following code produces this diagnostic because Object
doesn't define a method named n
:
class C {
void m() {
super.n();
}
}
The following code produces this diagnostic because Object
doesn't define a getter named g
:
class C {
void m() {
super.g;
}
}
Common fixes
#If the inherited member you intend to invoke has a different name, then make the name of the invoked member match the inherited member.
If the member you intend to invoke is defined in the same class, then remove the super.
.
If the member isn't defined, then either add the member to one of the superclasses or remove the invocation.
Unless stated otherwise, the documentation on this site reflects Dart 3.7.3. Page last updated on 2025-05-08. View source or report an issue.