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.
.
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。