CHAPTER 19

image

Implicit Interfaces and Abstract Classes

In this chapter we’ll cover interfaces and abstract classes in Dart. We’ll also see the difference between implementing interfaces and extending from a parent class.When you define a class, Dart implicitly defines an interface that contains all members of the instance and methods of the class and of the rest of the interfaces that implements.In short, if you want to write a class A that supports the API of a class B without inheriting the implementation of B, the A class must implement the B interface. To do this, when you define the class you can add the word implements followed by the classes ...

Get Web Programming with Dart 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.