Calling super and Constructor Chaining
Reach the parent during construction.
Calling super and Constructor Chaining is a free Dart Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Dart Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Construction Order
When you build a subclass, its parent must be set up first. Dart guarantees the parent's constructor runs before the child's body begins. 🏗️
Meet super
The keyword super refers to the parent part of your object. You use it to reach the parent's constructor, methods, and fields from inside the child.
The Implicit super()
If you write nothing, Dart secretly calls the parent's no-argument constructor for you. This invisible super() is why parents always initialize first.
class Animal { Animal() => print('Animal'); }
class Dog extends Animal { Dog(); }Calling super Explicitly
When the parent needs arguments, you call super(...) in the constructor's initializer list, after a colon. It forwards values up the chain.
class Dog extends Animal {
Dog(String name) : super(name);
}Where super Goes
The super call lives in the initializer list, never in the constructor body. By the time the body runs, the parent is already fully built.
Dog(String name, this.breed) : super(name);Super Parameters
Modern Dart lets you forward arguments straight to the parent with super.field. It removes repetitive boilerplate in the parameter list.
class Dog extends Animal {
Dog(super.name);
}Calling super Methods
Inside an overridden method, super.method() runs the parent's original version. You extend behavior instead of fully replacing it.
@override
void speak() {
super.speak();
print('extra');
}Chaining Up the Tree
With several levels of inheritance, each constructor calls its own parent. This chain reaches the top, then runs bodies back down to your class.
Initializer Order
The full order is: initializer list and super first, then the parent body, then your child body. Fields are final-ready before any body runs.
When the Parent Needs Args
If the parent has no default constructor, you must call super with the right arguments. Skip it and Dart reports a compile error.
Redirecting With this
Within one class, a constructor can call another using this(...). That is sibling chaining, distinct from reaching upward with super.
Point.origin() : this(0, 0);Quick Check
Think about where the parent constructor call must appear.
Recap
You called super to run parent constructors and methods, forwarded values with super params, and redirected siblings with this. 🔗
Frequently asked questions
Is the “Calling super and Constructor Chaining” lesson free?
Yes — the full text of “Calling super and Constructor Chaining” is free to read here on the web, and the Dart Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Dart Academy course, upgrade to CoddyKit PRO.
What will I learn in “Calling super and Constructor Chaining”?
Reach the parent during construction. You practise Dart Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Dart Academy?
No prior experience is required. Dart Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Calling super and Constructor Chaining” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Dart Academy lesson?
Yes. Every Dart Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- extends and Method Overriding
- Calling super and Constructor Chaining
- Mixins With the with Keyword
- on Constraints and Mixin Order