Skip to content

Commit

Permalink
Updated part note (#5932)
Browse files Browse the repository at this point in the history
Fixes #2371

---------

Co-authored-by: Marya <111139605+MaryaBelanger@users.noreply.github.com>
  • Loading branch information
atsansone and MaryaBelanger authored Jul 3, 2024
1 parent 3e42082 commit a9e443d
Showing 1 changed file with 5 additions and 8 deletions.
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

0 comments on commit a9e443d

Please sign in to comment.