Skip to main content

avoid-suspicious-super-overrides

Warns when a getter overrides a field that is already passed to the super constructor.

Example

❌ Bad:

sealed class DependencyIssue {
final String issueType;

const DependencyIssue({
required this.issueType,
});
}

class First extends DependencyIssue {
final String packageName;

// LINT: This getter overrides a field that is already passed to the super constructor.
// Consider removing it or referencing the super field.

String get issueType => 'hi';

const First({
required this.packageName,
}) : super(issueType: 'promotion');
}

✅ Good:

sealed class DependencyIssue {
final String issueType;

const DependencyIssue({
required this.issueType,
});
}

class First extends DependencyIssue {
final String packageName;

const First({
required this.packageName,
}) : super(issueType: 'promotion');
}