> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dart Super Initializer

A super-initializer parameter (often referred to as a super parameter) is a syntactic feature in Dart that allows a subclass constructor to forward arguments directly to a superclass constructor without explicitly passing them through the initializer list. By applying the `super.` prefix to a parameter in the subclass constructor signature, the Dart compiler automatically binds and routes that argument to the corresponding parameter in the superclass.

## Syntax Comparison

Prior to the introduction of super initializers, forwarding parameters required declaring the parameter in the subclass and explicitly passing it via the initializer list:

```dart theme={"dark"}
class Base {
  final int id;
  Base(this.id);
}

// Legacy approach
class Derived extends Base {
  final String name;
  
  Derived(int id, this.name) : super(id); 
}
```

Using a super initializer, the parameter is forwarded inline directly from the constructor signature:

```dart theme={"dark"}
// Modern approach using super parameters
class Derived extends Base {
  final String name;
  
  Derived(super.id, this.name); 
}
```

## Parameter Resolution Mechanics

The compiler resolves `super.` parameters differently depending on whether they are positional or named.

**1. Positional Parameters**
When `super.` is applied to positional parameters, the Dart compiler maps them to the superclass constructor's positional parameters based strictly on their declaration order.

```dart theme={"dark"}
class Point2D {
  final double x;
  final double y;
  Point2D(this.x, this.y);
}

class Point3D extends Point2D {
  final double z;
  
  // super.x maps to the first positional parameter (x)
  // super.y maps to the second positional parameter (y)
  Point3D(super.x, super.y, this.z); 
}
```

**2. Named Parameters**
When `super.` is applied to named parameters, the compiler maps them to the superclass constructor's named parameters by matching the exact identifier. Declaration order is irrelevant.

```dart theme={"dark"}
class Configuration {
  final bool isDebug;
  final String environment;
  
  Configuration({required this.isDebug, this.environment = 'prod'});
}

class AppConfig extends Configuration {
  final int port;
  
  // Maps directly to 'isDebug' and 'environment' in the superclass
  AppConfig({
    required this.port,
    required super.isDebug,
    super.environment,
  });
}
```

## Technical Constraints and Behavior

* **Type Inference:** The type of a `super.` parameter is implicitly inferred from the corresponding parameter in the superclass constructor. Explicitly declaring the type (e.g., `int super.id`) is redundant unless you are intentionally restricting the parameter to a stricter subtype.
* **Interaction with Explicit Super Invocations:** Super parameters can be combined with an explicit super constructor call (e.g., `: super.named(...)`) in the initializer list, but strict rules apply to prevent argument duplication or ambiguity:
  * **Positional Parameters:** If a constructor uses positional super parameters, the explicit super constructor invocation **cannot contain any positional arguments**. It is a compile-time error to mix positional super parameters with explicitly passed positional arguments in the `super(...)` call.
  * **Named Parameters:** Named super parameters can be used alongside an explicit super call, provided the explicit call only provides *other* named arguments. You cannot pass a named argument in the `super(...)` call if a `super.` parameter is already forwarding it.

```dart theme={"dark"}
class Base {
  final int x;
  final int y;
  final String label;
  
  Base.custom(this.x, this.y, {required this.label});
}

class Derived extends Base {
  // Valid: Positional super parameters map to x and y.
  // The explicit super call provides the named argument 'label'.
  // No positional arguments are passed in super.custom(...).
  Derived(super.x, super.y) : super.custom(label: 'Default'); 
}
```

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Dart Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
