Skip to content
Blog

Super Parameters in Dart: Less Boilerplate in Widget Constructors

Super parameters let you forward named and positional arguments to a superclass constructor with the shorthand `super.`. Learn how they cut Flutter widget boilerplate, and how they pair with required named parameters.

Published on • October 21, 2026

AI Assistant

If you have written a Flutter StatefulWidget, you have typed the same three lines hundreds of times: a key parameter, a super.key call, and a comment telling yourself not to forget it. Super parameters exist to make that pattern shorter and harder to get wrong — a small language feature with an outsized effect on how much boilerplate Dart asks you to write.

Source: Super parameters and the Dart language evolution, The Dart Team.

The problem they solve

Before super parameters, forwarding arguments to a superclass constructor meant declaring a parameter and then explicitly passing it in the constructor’s initializer list:

class MyWidget extends StatelessWidget {
  MyWidget({Key? key, required this.title}) : super(key: key);
  final String title;
  // ...
}

That : super(key: key) is pure ceremony. The parameter exists only to be handed upward. Multiply it across every widget in an app and it is a meaningful amount of noise — and a place to make mistakes, since forgetting the forwarding silently drops the key.

The shorthand

Super parameters let you attach super. directly to the parameter declaration, and the forwarding happens automatically:

class MyWidget extends StatelessWidget {
  MyWidget({super.key, required this.title});
  final String title;
  // ...
}

The initializer list disappears. super.key declares a key parameter and forwards it to StatelessWidget’s constructor in one gesture. This is now the default shape you see in generated Flutter code, and it is why the trailing comment about not forgetting the key has largely vanished from the ecosystem.

Positional and named both work

The feature is not limited to named parameters. Positional super parameters forward positionally:

class Point {
  Point(this.x, this.y);
  final double x, y;
}

class ColoredPoint extends Point {
  ColoredPoint(super.x, super.y, this.color);
  final int color;
}

You can also rename the forwarded parameter if the subclass wants a different external name than the superclass parameter it maps to. And super parameters compose naturally with required and default values, which is what makes the widget case work so cleanly — {super.key, required this.title} reads as a single, complete declaration.

How they relate to primary constructors

Super parameters predate primary constructors, and the two solve adjacent problems. Super parameters shorten forwarding to a superclass. Primary constructors — where a parameter list in the class header both declares fields and acts as the constructor — shorten declaring a class that stores its arguments. In modern Dart, a small data class often needs neither an explicit constructor body nor a super-parameter dance; the header does the work. Understanding both keeps your constructor code at the length the language now intends.

Key takeaways

Super parameters (super.key, super.x) let a constructor forward arguments to its superclass without a separate parameter and initializer-list entry, cutting the boilerplate that dominated Flutter widget declarations. They work for positional and named parameters, compose with required and defaults, and can be renamed — which is exactly why {super.key, required this.title} became the idiomatic widget constructor. They shorten forwarding, while primary constructors shorten declaring; together they keep Dart constructors close to minimal.

Further reading