January 2015
Intermediate to advanced
472 pages
9h 23m
English
CHAPTER 18
![]()
Understanding Dart Classes
In this chapter we will cover Dart classes, what constructors are, and how to create constructors for your classes. We’ll see named constructors, instance variables, and instance methods as well. Later we’ll see how inheritance works in Dart, and we’ll talk about static variables and methods.
As you know, Dart is an object-oriented language with classes and single inheritance. Everything in Dart is an object, including the built-in data types. An object is an instance of a class. To create an object, use the keyword new followed by the constructor of the class. See the following:
class Person { Person() { ...
Read now
Unlock full access