Dart pub
dart.dev
- Free plan
- Windows
- macOS
- Linux
What Dart pub is
Dart pub is the package manager for finding, using, and publishing Dart libraries and tools. It resolves versions that fit together with the installed Dart SDK, then records selected direct and transitive versions in a pubspec.lock file. Dependencies may come from pub.dev, another hosted repository, a Git repository, a local path, or a supported SDK. Developers can work through the dart or Flutter command-line tools, and most Dart-aware IDEs support package workflows. Pub can publish packages to pub.dev and checks for possible secret leaks before publication, warning or refusing when limited patterns indicate a risk. Security advisories use the GitHub Advisory Database for Dart and Flutter packages. Offline resolution can use packages already in the shared cache. Production installs can enforce locked versions and content hashes, while SHA256 hashes help validate integrity. Pub supports Windows, Linux, and macOS, with workspace, private registry authentication, and lockfile support.
Who it suits
Pub suits Dart developers managing dependencies, publishing packages, or maintaining consistent application builds. It also fits teams using Dart or Flutter command-line and IDE workflows.
Good to know, and what to watch
- Resolves compatible Dart SDK dependencies
- Supports hosted, Git, local, and SDK sources
- Lockfiles preserve selected dependency versions
- Offline installation can use the shared cache
- Provides package integrity hashes
- Published packages cannot use Git dependencies
- Published packages cannot use local-path dependencies
- Secret checks use limited patterns
- Published packages generally cannot be unpublished
The verdict
Dart pub covers dependency resolution, publishing, lockfiles, security advisories, and offline use in a free, open-source tool. Its workflows are focused on Dart packages and the Dart SDK.
What the maker publishes
- Automated publishing
- Automated publishing can authenticate with temporary OpenID Connect tokens from GitHub Actions or Google Cloud IAM. source
- Automated publishing
- After publishing a package’s first version, publishers can configure automated publishing through GitHub Actions or Google Cloud service accounts. source
- Command line
- Pub can be used from the command line with the `dart pub` tool. source
- Command line and IDEs
- Pub can be used through the dart or Flutter command-line tools, and most Dart-savvy IDEs support package workflows. source
- Dependency management
- Pub resolves package versions that work together and with the installed Dart SDK. source
- Dependency resolution
- Yes source
- Dependency resolution
- Pub manages dependency versions to find versions compatible with each other and with the Dart SDK version. source
- Free plan
- Yes source
- IDE support
- The page says most Dart-savvy IDEs support creating, downloading, updating, and publishing packages. source
- Lockfiles
- Pub creates a `pubspec.lock` file listing the specific versions of a package’s direct and transitive dependencies. source
- Lockfile support
- Yes source
- Offline installation
- Yes source
- Offline use
- Pub can often resolve dependencies offline from packages already stored in its shared system cache. source
- Package formats
- Dart packages source
- Package integrity
- Pub uses SHA256 content hashes maintained by pub.dev to validate package integrity. source
- Package sources
- Dependencies can come from pub.dev, another hosted repository, a Git repository, a local path, or a supported SDK. source
- Package sources
- Packages can come from pub.dev, the local file system, or other locations such as Git repositories. source
- Private registry auth
- Yes source
- Production installs
- The `dart pub get --enforce-lockfile` command fails if dependency constraints cannot be satisfied with the exact locked versions and content hashes. source
- Publication permanence
- Published packages generally cannot be unpublished, though publishers can upload new versions and mark packages as discontinued. source
- Publisher verification
- pub.dev verifies verified-publisher identities through domain ownership checks using Google Search Console logic. source
- Publishing
- The dart pub publish command uploads packages to pub.dev for others to download and use. source
- Publishing
- The `dart pub publish` command validates a package and uploads it to pub.dev. source
- Publishing limit
- Packages published to pub.dev cannot have Git or local path dependencies in their pubspec. source
Checked against the maker's pages on 7 Oct 2026.