prefer-abstract-final-static-class
Suggests adding abstract final
to classes with only static members to avoid them being instantiated or being used in inheritance.
Example
❌ Bad:
// LINT: Add 'abstract final' to classes with only static members to avoid instantiation and use in inheritance.
class Static {
static final field = 'some value';
}
✅ Good:
abstract final class Static {
static final field = 'some value';
}
class SomeOtherClass { // Correct, has instance members
final String value;
const SomeOtherClass(this.value);
}