avoid-deprecated-usage
Warns when a deprecated element (annotated with @deprecated
or @Deprecated(...)
) is referenced in code.
note
This rule is the same as the standard Dart analyzer rule.
Use it if you would like to benefit from features like Baseline and slowly migrate from deprecated APIs instead of adding ignores in your code.
Example
❌ Bad:
void fn(SomeClass value) {
// LINT: 'Parent' is deprecated and should not be used.
final instance = SomeClass();
}
class SomeClass {}
✅ Good:
void fn(SomeOtherClass value) {
final instance = SomeOtherClass();
}