Search
K

The hard way

Instead of using the onepub pub private command to make a package private you can achieve the same objective by manually adding the publish_to key to your pubspec.yaml.
There is no advantage to doing it the hard way. We provide these details so you fully understand what the onepub pub private command is doing.
Find your organisation's publish_to URL on your OnePub profile page:
Edit the pubspec.yaml of the package you wish to publish and add the publish_to keyword:
name: mypackage
description: A simple command-line application.
version: 1.0.0
publish_to: https://onepub.dev/api/xxxxxxxx
To publish the package, login into OnePub (if you haven't already) then run the dart (or flutter) publish command.
onepub login
cd mypackage
dart pub publish