Packaging with Dart Pub

The Dart SDK already includes the nifty little package management tool named pub, which is capable of resolving and installing dependencies. The Dart pub command can install packages from a central repository, publicly available Git repositories, or even your local filesystem.

The most common pub action is installing an application’s dependencies. The pub get command will do this, but it needs a YAML configuration file first.

If we are so set in our JavaScript ways, we might want JSON.stringify and JSON.parse instead of the encode/decode methods that are built into the internal dart:convert library. The json package, which is available on the central pub.dartlang.org repository, does just that. The pubspec.yaml configuration ...

Get Dart 1 for Everyone now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.