Tutorial · 1 min · beginner

Publish your plugin

Your plugin is written and it works. Publishing it to dartpub.dev takes about a minute, in two halves — a short form in the browser, then one command in your repository.

Your plugin is written and it works. Publishing it takes about a minute.

There are two halves, and you do them in order: a short form in the browser that claims the name, then one command in your repository that uploads the build. You only do the first half once, ever.

1. Claim the name

Go to Publish a new plugin and fill in four things:

  • Repository, as github.com/you/your_plugin. We check that you own it, which is what earns you the name.
  • Package name, what people will put in their pubspec.yaml, like dartnative_audio.
  • A one-line description saying what it does.
  • A longer description covering platforms, notable native dependencies, and anything a reader needs before adding it.

Your README and example are not pasted here. They are pushed straight from your repository in the next step, so they can never drift out of date.

2. Publish from your repository

In the plugin’s directory:

dn publish

That builds the native artifacts, uploads them with your README and example, and puts the plugin on dartpub.dev. The version it publishes is the version: in your pubspec.yaml.

Done. The plugin is live and anyone can add it.

Shipping a fix or a new version

The same command, every time. Nothing to re-claim and no form to fill in again:

  1. Bump version: in your pubspec.yaml.
  2. Add a section for it in CHANGELOG.md. It becomes the release notes on your plugin’s page.
  3. Run dn publish.

Every version you publish stays available. Someone who pinned an older one keeps working exactly as before, so a dependency can never disappear underneath them.