extends makes one class inherit from another. A subclass constructor uses : super(...) to initialize inherited fields, and @override plus a same-named method replaces the parent's version. super.method() still reaches the parent body.

Program

Play the program to build a Car that extends Vehicle and overrides describe.

inheritance_extends.dart
class Vehicle {
  final String name;
  final int wheels;
  Vehicle(this.name, this.wheels);
  String describe() => '$name has $wheels wheels';
}

class Car extends Vehicle {
  final int doors;
  Car(String name, this.doors) : super(name, 4);
  @override
  String describe() => '${super.describe()} and $doors doors';
}

void main() {
  var c = Car('Sedan', 4);
  print(c.describe());
}
extends `class Car extends Vehicle` makes `Car` inherit from `Vehicle`.
super constructor `: super(name, 4)` forwards to the parent constructor so inherited fields are initialized.
override `@override` plus a same-named method replaces the parent's; `super.describe()` still reaches the parent body.