A project needs to be documented so that future developers can change and expand it. From release 1.2 onwards, the docgen
tool is provided as an API Documentation Generator, which generates and serves documentation for the Dart SDK and packages, as well as for your applications. This recipe is designed to show you how to best document the application you have built.
Run pub get
on your project before running the docgen
tool. We will illustrate this with the bank_terminal_polymer
app.
In a command-line session at the top level of your app, run:
docgen .
When the documentation is generated, issue the following command:
docgen --serve .
This installs the
dartdoc-viewer
tool and starts up a local web server for your docs, which you can access via the URLhttp://localhost:8080
. The following is a screenshot from theBankAccount
class documentation (you can change the view with the Options menu):