How to publish Flutter Flutter series of code to the public library

Hello, welcome to my attention herein, this is about the sixth series of articles Flutter, Flutter introduced beginning from simple, step by step take you into the world of Flutter. You have some of the best mobile development experience, if not do not worry, at the bottom of my columns give me a message, I will do my best to answer you.

Last column, written in a very simple but also very practical, talking about how to jump between the interface Flutter. This column I'll teach you how to publish an open source library to write their own Flutter

I still have to teach before we realize the infinite loop Flutter Banner with unlimited slide Banner with Flutter implemented please add a link description , you can directly with dart in the public library "banner_gallery_library" to do a keyword search in the project directly banner_gallery_library: ^ 0.0.2 references.

How to write their own Flutter project into Dart public libraries provide to others practical?

1. Flutter first to write your project , I will not described in detail, related articles Banner achieve before you can reference.

2. Supplementary pubspec.yaml, content README.md, CHANGELOG.md three files . Which pubspec.yaml documents required to complete the project name, version number, author, home, dependent dart version, and so on. Can refer to the following format:

name: banner_gallery_library
description:  It's an infinity banner gallery widget in flutter.
version: 0.0.2
author: H3c <[email protected]>
homepage: https://github.com/h3clikejava/BannerGalleryInFlutter

environment:
  sdk: ">=1.23.0 <2.0.0"

3. Enter the project directory in a terminal, execute the command line to check:

flutter packages pub publish --dry-run

If there are code issues, or description of the error by the command will automatically check it out, a problem can be solved directly to Google.
4. Publish
If the previous step self-test no problem, you can publish the. Continue until the command line:

flutter packages pub publish

Note : Here will encounter a pit, is the need for Google to verify the account, you must ××× to be successful, but also global ×××! ! !
For example, I encountered this problem with SS ××× no effect. Finally even with a Netgear router ×××'s only success.

Looks great! Are you ready to upload your package (y/n)? y
Uploading...
Failed to upload the package.
pub finished with exit code 1

Guess you like

Origin blog.51cto.com/14295695/2415035