O'Reilly logo

The Dart Programming Language by Gilad Bracha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required