O'Reilly logo

Web Programming with Dart by Patricia Juberias, Moises Belchin

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 18

image

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() { ...

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