avoid-unnecessary-overrides
preset: recommended
Warns when a parent declaration is overridden by a declaration without an implementation.
Example
❌ Bad:
abstract class B {
String get field;
void foo();
}
abstract class A extends B {
String get field; // LINT: Unnecessary override. Try removing it.
Future<void> foo(); // LINT: Unnecessary override. Try removing it.
}
mixin M on B {
String get field; // LINT: Unnecessary override. Try removing it.
}
✅ Good:
abstract class B {
String get field;
void foo();
}
class C extends B {
String get field => 'hi'; // Correct, has implementation
Future<void> foo() async { ... }
}