Chapter 3. Libraries
Dart programs are organized into modular units called libraries. We saw our first library in Chapter 1. You might imagine this was the points library shown at the end of that chapter, but in fact, it was our “Hello World” program. A trivial library perhaps, but a library all the same. Here it is again:
main(){ print('Hello World'); }
As you can see, there is no requirement for an explicit library declaration like the one we saw in points. Most libraries do have such a declaration, which is useful for various reasons we shall illustrate below. However, for quick, simple tasks, it is convenient to be able to just write a function and run it. In Dart we always seek to enable experimentation with the language with a minimum ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access