Book Image

DART Cookbook

By : Ivo Balbaert
Book Image

DART Cookbook

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Dart Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Documenting your app


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.

Getting ready

Run pub get on your project before running the docgen tool. We will illustrate this with the bank_terminal_polymer app.

How to do it...

  1. In a command-line session at the top level of your app, run:

    docgen .
    
  2. 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 URL http://localhost:8080. The following is a screenshot from the BankAccount class documentation (you can change the view with the Options menu):

    Viewing documentation

How it works...

The command creates...