Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated part note #5932

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/content/guides/libraries/create-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ to share software such as libraries and tools.
This page tells you how to create a standard shared
[package](/tools/pub/glossary#package).


## Creating a new package

To create the initial directory and structure for a package,
Expand All @@ -19,10 +18,6 @@ and the `package` template:
$ dart create -t package <PACKAGE_NAME>
```

{% comment %}
TODO: Add coverage of packages that contain tools.
{% endcomment %}

## What makes a package

The following diagram shows the simplest layout of a package:
Expand Down Expand Up @@ -59,9 +54,11 @@ In most cases, each class should be in its own mini library, unless
you have a situation where two classes are tightly coupled.

:::note
You may have heard of the `part` directive, which allows
you to split a library into multiple Dart files. We recommend
that you avoid using `part` and create mini libraries instead.
You might know about the `part` directive.
This directive allows you to split a library into multiple Dart files.
Though part files can incorporate generated code into a library,
the Dart team doesn't recommend using them.
Instead, create small libraries.
:::

Create a "main" library file directly under lib,
Expand Down