Chapter 5. Packages and Libraries

Libraries are powerful tools for creating and distributing components in Dart. Libraries give you an additional level of abstraction to reuse your classes and methods, while keeping your namespace clean and your designs modular. Libraries are also the foundation for Dart’s package system, Pub. It is Dart’s central repository for shared packages. This chapter looks at the constructs around libraries, their directory structures, and how to convert them to packages and publish them. Libraries help you adhere to the “separation of concern” principle, which advises breaking your code into distinct units, where each unit is an expert on only one subject.

Since the first launch of your application, you’ve been using ...

Get Write Web Apps with Dart: Develop and Design 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.