concrete_class_with_abstract_member
'{0}' must have a method body because '{1}' isn't abstract.
Description
#The analyzer produces this diagnostic when a member of a concrete class is found that doesn't have a concrete implementation. Concrete classes aren't allowed to contain abstract members.
Example
#The following code produces this diagnostic because m
is an abstract
method but C
isn't an abstract class:
dart
class C {
void m();
}
Common fixes
#If it's valid to create instances of the class, provide an implementation for the member:
dart
class C {
void m() {}
}
If it isn't valid to create instances of the class, mark the class as being abstract:
dart
abstract class C {
void m();
}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。