Book Image

Dart By Example

By : David Mitchell
Book Image

Dart By Example

By: David Mitchell

Overview of this book

Table of Contents (17 chapters)
Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Handout notes


There is nothing like a tangible handout to give presentation attendees. This can be achieved with a variation of the overview display:

Instead of duplicating the overview code, the function can be parameterized with an optional parameter in the method declaration. This is declared with square brackets [] around the declaration and a default value that is used if no parameter is specified:

void buildOverview([bool addNotes = false])

This is called by the presentation overview display without requiring any parameters:

buildOverview();

This is called by the handouts display without requiring any parameters:

buildOverview(true);

If this parameter is set, an additional Div element is added for the Notes area and the CSS is adjusted for the benefit of the print layout.

Comparing optional positional and named parameters

The addNotes parameter is declared as an optional positional parameter, so an optional value can be specified without naming the parameter. The first parameter is matched...