Building the dialog package

The pub packaging system is a great resource for sharing finished packages online. If we want to keep a package local and private, we can create it locally and use it in much the same manner.

The package project structure

The package project is structured in a similar manner to a web application project, with a pubspec.yaml file being the main project file. Instead of a web folder, there is a lib folder containing the simple_dialog.dart file that declares our library and defines what is exposed outside the project:

The package project structure

This file contains any classes, functions, and references to other files—in this case, the two files in the ...

Get Dart: Scalable Application Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.