What’s Next

We put our object-oriented knowledge from Chapter 7, Classes and Objects to some good use here. Along the way, we exposed a few of Dart’s warts. It is not possible, for instance, to pass class names as we would variables. It is not possible to define an instance variable in a subclass so that the superclass can see it. It is not possible for a superclass to access private methods of a subclass. Even though some of these realities may fly in the face of what we might expect in object-oriented code, Dart has some good reasons for this, as we will explore in upcoming chapters.

Regardless of the restrictions, we also found some fairly unobtrusive workarounds. And by workarounds, I mean “The Dart Way.” Better still, our object-oriented ...

Get Dart 1 for Everyone now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.