← Map
Dart Island · Level 7
Learn Flutter

Inheritance & Polymorphism

Inheritance lets one class extend another, gaining all its fields and methods. Polymorphism means a child object can be used wherever a parent is expected — each responding in its own way.
12 games from family trees to full method-resolution tracing.
Core idea

When class Dog extends Animal, Dog gets everything Animal has, and can also add or change behaviour.

class Animal {
void speak() => print('...');
}
class Dog extends Animal {
@override
void speak() => print('Woof!');
}
Animal a = Dog();
a.speak(); // Woof! ← polymorphism
  • extends — inherit from a parent class
  • @override — replace a parent method with your own
  • super — call the parent's version of a method
  • abstract — a class that cannot be instantiated directly
Progress
0 / 12 mini-games solved
Stage 1

Family Tree

Drag child classes under their parent on a tree diagram.

1. Select a class. 2. Click the slot it extends from.

Animal
Island map