missing_override_of_must_be_overridden
Missing concrete implementation of '{0}'.
Missing concrete implementations of '{0}' and '{1}'.
Missing concrete implementations of '{0}', '{1}', and {2} more.
Description
#The analyzer produces this diagnostic when an instance member that has the
@mustBeOverridden
annotation isn't overridden in a subclass.
Example
#The following code produces this diagnostic because the class B
doesn't
have an override of the inherited method A.m
when A.m
is annotated
with @mustBeOverridden
:
import 'package:meta/meta.dart';
class A {
@mustBeOverridden
void m() {}
}
class B extends A {}
Common fixes
#If the annotation is appropriate for the member, then override the member in the subclass:
import 'package:meta/meta.dart';
class A {
@mustBeOverridden
void m() {}
}
class B extends A {
@override
void m() {}
}
If the annotation isn't appropriate for the member, then remove the annotation:
class A {
void m() {}
}
class B extends A {}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。