
Dart pub
Dart pub is the package manager for finding and managing shared libraries and tools for Dart.
What Dart pub is
Dart pub is the package manager for finding and managing shared libraries and tools for Dart. It resolves compatible package versions for your project and installed Dart SDK, with selected versions recorded in a lockfile so teams can keep application dependencies consistent. Packages can come from pub.dev, other hosted repositories, Git repositories, local paths, or supported SDKs. Use it from the Dart or Flutter command-line tools, or through package workflows in Dart-aware IDEs. Pub can publish packages to pub.dev, but packages published there cannot depend on Git or local paths in their pubspec. Before publishing, it checks for possible secret leaks with limited patterns and may warn or refuse publication. Its security advisories use the GitHub Advisory Database for Dart and Flutter packages. Pub can often resolve dependencies offline from its shared cache. It is free and open source, supports Windows, Linux, and macOS, and focuses on Dart packages.
Good
- Resolves dependencies against the installed Dart SDK.
- Supports hosted, Git, local-path, and SDK package sources.
- Lockfiles help teams use consistent dependency versions.
- Offline resolution can use the shared package cache.
- Works with Dart and Flutter command-line tools.
Watch out
- Publishing to pub.dev disallows Git and local-path dependencies.
- Package workflows focus on Dart.
Who it suits
Pub suits Dart developers who need to manage or publish packages across projects. It also fits teams that want lockfiles to keep dependency versions consistent.
Verdict
Pub brings dependency management and package publishing into Dart and Flutter development workflows. Its lockfiles, offline resolution, and IDE support are useful, with a publishing restriction on Git and local-path dependencies.
The facts
Each one read from Dart pub's own pages, with the date it was checked.
What it does
- Automated publishing
- After publishing a package’s first version, publishers can configure automated publishing through GitHub Actions or Google Cloud service accounts.checked 7 Oct 2026
- Command line
- Pub can be used from the command line with the `dart pub` tool.checked 7 Oct 2026
- Command line and IDEs
- Pub can be used through the dart or Flutter command-line tools, and most Dart-savvy IDEs support package workflows.checked 28 Sep 2026
- Dependency management
- Pub resolves package versions that work together and with the installed Dart SDK.checked 28 Sep 2026
- Dependency resolution
- Pub manages dependency versions to find versions compatible with each other and with the Dart SDK version.checked 7 Oct 2026
- IDE support
- The page says most Dart-savvy IDEs support creating, downloading, updating, and publishing packages.checked 7 Oct 2026
- Lockfiles
- Pub creates a `pubspec.lock` file listing the specific versions of a package’s direct and transitive dependencies.checked 7 Oct 2026
- Lockfile support
- Yeschecked 21 Sep 2026
- Offline installation
- Yeschecked 21 Sep 2026
- Offline use
- Pub can often resolve dependencies offline from packages already stored in its shared system cache.checked 28 Sep 2026
- Package formats
- Dart packageschecked 21 Sep 2026
- Package integrity
- Pub uses SHA256 content hashes maintained by pub.dev to validate package integrity.checked 7 Oct 2026
- Package sources
- Packages can come from pub.dev, the local file system, or other locations such as Git repositories.checked 7 Oct 2026
- Private registry auth
- Yeschecked 21 Sep 2026
- Production installs
- The `dart pub get --enforce-lockfile` command fails if dependency constraints cannot be satisfied with the exact locked versions and content hashes.checked 7 Oct 2026
- Publication permanence
- Published packages generally cannot be unpublished, though publishers can upload new versions and mark packages as discontinued.checked 7 Oct 2026
- Publisher verification
- pub.dev verifies verified-publisher identities through domain ownership checks using Google Search Console logic.checked 28 Sep 2026
- Publishing
- The `dart pub publish` command validates a package and uploads it to pub.dev.checked 7 Oct 2026
- Publishing limit
- Packages published to pub.dev cannot have Git or local path dependencies in their pubspec.checked 28 Sep 2026
- Publishing limits
- The publishing guide recommends package sizes below 100 MB compressed and 256 MB uncompressed.checked 7 Oct 2026
- Purpose
- Pub is Dart’s package manager for managing package dependencies.checked 7 Oct 2026
- Secret detection
- Before publishing, pub checks for potential secret leaks using limited patterns and warns or refuses publication when it detects a possible leak.checked 28 Sep 2026
Money
- Free plan
- Yeschecked 21 Sep 2026
Where it runs
- SDK platforms
- The Dart SDK system requirements list Windows, Linux, and macOS.checked 7 Oct 2026


