Object orientation in Dart
As with most modern languages, Dart is designed to be object-oriented (OO). As initially mentioned in Chapter 2, An Introduction to Dart, OOP languages are based on the concept of objects that hold both data (called fields) and code (called methods). These objects are created from blueprints called classes that define the fields and methods an object will have.
For a deeper exploration of the fundamentals of OOP, it is worthwhile reading an excellent book named Learning Object-Oriented Programming by Gaston C. Hillar.
The terms discussed here may be new to you, but the key areas are covered in greater depth in the next sections of this chapter. Let's start with a brief overview of how Dart follows OOP principles.
Objects and classes
The starting point of OOP—objects—are instances of defined classes. In Dart, everything is an object—that is, every value stored in a variable is an instance of a class. Additionally, all...