How to Install a Dart Package

Install Dart or Flutter packages hosted on pckgs.io into your project.


Prerequisites

  • The Dart SDK installed.
  • For private packages: authentication configured. See How to Authenticate.

Add the Hosted Dependency

In your pubspec.yaml, specify the package with the pckgs.io hosted URL:

dependencies:
  my_package:
    hosted:
      name: my_package
      url: https://dart.pckgs.io/<YOUR_ORG_NAME>
    version: ^1.0.0

Then run:

dart pub get

The package will be resolved and downloaded from pckgs.io.

Upgrade a Package

To upgrade to the latest compatible version:

dart pub upgrade my_package

Related

Need help? Contact us here or at [email protected].