Skip to content
xgqfrms edited this page Jun 18, 2020 · 1 revision

dart-library-package

The Dart ecosystem uses packages to share software such as libraries and tools.

https://dart.dev/guides/packages

https://dart.dev/tools/pub/glossary#library-package

packages

library-package

https://dart.dev/guides/libraries/create-library-packages#organizing-a-library-package

pubspec.yaml file

pubspec.yaml file for a library is the same as for an application package—there is no special designation to indicate that the package is a library.

lib directory

如您所料,库代码位于lib目录下,并且对其他软件包是公共的。您可以根据需要在lib下创建任何层次结构。

按照约定,实现代码位于lib / src下。 lib / src下的代码被认为是私有的;其他软件包永远不需要导入src / ...

Clone this wiki locally