Skip to main content

Creating and publishing an organization-scoped package

As an organization member, you can create and publish public and private packages within the organization's scope.

Note

Before creating and publishing packages, ensure you are logged in to your dartpm account using dartpm login. You must also have the appropriate permissions within your organization to publish packages.

Creating an organization-scoped package

  1. On the command line, create a Flutter package:

    flutter create --template=package hello
  2. Navigate to the root directory of your package:

    cd hello    
  3. To create an organization-scoped package, update pubspec.yaml:

    publish_to: "https://dartpm.com/registry/<scope-name>"

Publishing a private organization-scoped package

By default, dart pub publish will publish a scoped package as private.

Any scoped package is published as private by default. However, if you have an organization that does not have the Private Packages feature, dart pub publish will publish public package.

  1. On the command line, navigate to the package directory.

  2. Run dart pub publish.

Private packages will say private below the package name on the dartpm website.

Publishing a public organization-scoped package

By default, dart pub publish will publish a scoped package as private.

To publish an organization-scoped package as public, follow these steps:

  1. On the command line, navigate to the package directory.

  2. Run dart pub publish.

  3. After publishing, the package visibility depends on your organization's settings:

    • If your organization has the Private Packages feature, the package will be published as private by default. You can change it to public through the web interface.
    • If your organization does not have the Private Packages feature, the package will be published as public automatically.

Public packages will say public below the package name on the dartpm website.