Generating documentation

When you publish a package, API documentation is automatically generated (as long as you use the comment type mentioned earlier) and published to dartdocs.org. You can, if necessary, generate the API documentation locally. 

First, configure the Flutter root environment in the following way:

export FLUTTER_ROOT=~/dev/flutter (on macOS or Linux)

set FLUTTER_ROOT=~/dev/flutter (on Windows)

You can generate a package documentation by running the following:

cd ~/dev/mypackage

$FLUTTER_ROOT/bin/cache/dart-sdk/bin/dartdoc (on macOS or Linux)

%FLUTTER_ROOT%incachedart-sdkindartdoc (on Windows)
During the writing of this book, there is an open issue regarding the previous command on Windows; please do have a look: https://github.com/dart-lang/dartdoc/issues/1949.

By default, the documentation is generated under the doc/api directory as static HTML files.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.172.249