deprecated_export_use
The ability to import '{0}' indirectly is deprecated.
Description
#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;
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。