Chapter 7. Extending classes and interfaces
This chapter covers
- Building class and interface inheritance hierarchies
- Introducing the Object base class
- Understanding the dynamic type annotation
Object-oriented programming allows for more than just encapsulating data and behavior in a class. It allows you to extend existing behavior defined elsewhere, which promotes great code reuse. Reusing existing code lets you write less new code in your apps and has the added benefit that existing code should also be tested code.
In this chapter, we’ll examine class and interface inheritance in Dart, including how to provide new functionality by overriding existing methods and properties and how to write abstract classes that you can use only as parents ...