deprecated_member_use_from_same_package     
              
Avoid using deprecated elements from within the package in which they are declared.
Details
#Elements that are annotated with @Deprecated should not be referenced from
within the package in which they are declared.
AVOID using deprecated elements.
...
BAD:
dart
// Declared in one library:
class Foo {
  @Deprecated("Use 'm2' instead")
  void m1() {}
  void m2({
      @Deprecated('This is an old parameter') int? p,
  })
}
@Deprecated('Do not use')
int x = 0;
// In the same or another library, but within the same package:
void m(Foo foo) {
  foo.m1();
  foo.m2(p: 7);
  x = 1;
}Deprecated elements can be used from within other deprecated elements, in order to allow for the deprecation of a collection of APIs together as one unit.
GOOD:
dart
// Declared in one library:
class Foo {
  @Deprecated("Use 'm2' instead")
  void m1() {}
  void m2({
      @Deprecated('This is an old parameter') int? p,
  })
}
@Deprecated('Do not use')
int x = 0;
// In the same or another library, but within the same package:
@Deprecated('Do not use')
void m(Foo foo) {
  foo.m1();
  foo.m2(p: 7);
  x = 1;
}
Enable
#To enable the deprecated_member_use_from_same_package rule,
add deprecated_member_use_from_same_package under linter > rules in your
analysis_options.yaml file:
analysis_options.yaml
yaml
linter:
  rules:
    - deprecated_member_use_from_same_packageIf you're instead using the YAML map syntax to configure linter rules,
add deprecated_member_use_from_same_package: true under linter > rules:
analysis_options.yaml
yaml
linter:
  rules:
    deprecated_member_use_from_same_package: true