1. Select configuration

Configuration information should be filled in, including package name, description, version, and home page link.

2. Run the package command

2.1. Test release

flutter packages pub publish --dry-run
Copy the code

First try, see again no problem, no error can be released.

2.2. Issue commands

flutter packages pub publish
Copy the code

Or:

flutter packages pub publish --server=https://pub.dartlang.org
Copy the code

3. Error reporting

3.1. Waiting for verification

Waiting for your authorization...
Authorization received, processing...
Connection closed before full header was received
Copy the code

The first time, Google account is required for binding verification. After clicking the link successfully, if this error is reported, it proves that the terminal agent command needs to be opened (it needs to jump over the wall). The operation of each software is different.

Remember to operate in the terminal at the root of the project.

3.2. Judgment and verification

curl google.com
Copy the code

This display proves that the terminal agent has been successfully enabled.

<HTML><HEAD><meta http-equiv="content-type" content="text/html; charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML>Copy the code

3.3. The correct LICENSE

Waiting for your authorization...
Authorization received, processing...
Successfully authorized.
Uploading...
LICENSE file `LICENSE` contains generic TODO.
pub finished with exit code 1
Copy the code

If you report this error, you can directly change the LICENSE file and delete TODO.

package_1 <some license text> -------------------------------------------------------------------------------- package_2  <some license text>Copy the code

4. The release is successful

Uploading...
Successfully uploaded package.
Copy the code

Show this, on behalf of your successful release, congratulations!!