Avoid importing deprecated names from librariesDRT-W1296
The analyzer produces this diagnostic when one library imports a name from a second library, and the second library exports the name from a third library but has indicated that it won't export the third library in the future.
Example
Given a library a.dart
defining the class A
:
class A {}
And a second library b.dart
that exports a.dart
but has marked the
export as being deprecated:
import 'a.dart';
@deprecated
export 'a.dart';
The following code produces this diagnostic because the class A
won't be
exported from b.dart
in some future version:
import 'b.dart';
A? a;
Common fixes
If the name is available from a different library that you can import, then replace the existing import with an import for that library (or add an import for the defining library if you still need the old import):
import 'a.dart';
A? a;
If the name isn't available, then look for instructions from the library author or contact them directly to find out how to update your code.