implementation_imports
Import of a library in the 'lib/src' directory of another package.
Description
#The analyzer produces this diagnostic when an import references a library
that's inside the lib/src
directory of a different package, which
violates the convention for pub
packages.
Example
#The following code, assuming that it isn't part of the ffi
package,
produces this diagnostic because the library being imported is inside the
top-level src
directory:
dart
import 'package:ffi/src/allocation.dart';
Common fixes
#If the library being imported contains code that's part of the public API, then import the public library that exports the public API:
dart
import 'package:ffi/ffi.dart';
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。