Implicit Interfaces and implements
Treat any class as an interface.
Every Class Is an Interface
In Dart, each class quietly defines an implicit interface: the full set of its public methods and getters that others can promise to provide.
implements vs extends
With extends you inherit code. With implements you only adopt the shape and must rewrite every member yourself.
class Robot implements Greeter {}All lessons in this course
- Abstract Classes and Abstract Methods
- Implicit Interfaces and implements
- Polymorphism Through Shared Types
- Composition Over Inheritance