# Dart: The named parameter 'key' is required, but there's no corresponding argument

**Code:** `The named parameter is required, but there's no corresponding argument` · **Category:** Flutter / Dart · **Seen on:** Flutter

A constructor or function marked `required` for a parameter was called without it.

## Meaning

Pass the argument, or give the parameter a default value or make it nullable. After null-safety migration many old widgets need `required` params. For `Key? key` the usual signature is `const MyWidget({super.key})`.

## Common causes

- Missing required argument at the call site
- Parameter declared required but never needed
- Constructor changed in a package upgrade
- Widget used without its mandatory data
- Wrong named parameter name

## Quick fix

1. Supply the named argument
2. Make it optional with `this.value = defaultValue` or nullable `this.value`
3. Update call sites after package upgrades

## Detailed fix by platform

### Dart

1. `MyCard(title: 'Hello')` where the constructor is `const MyCard({super.key, required this.title});`

## How to diagnose

1. **Parameter** — Name in the message?
2. **Call site** — Passing it?
3. **Default** — Possible?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/flutter/required-named-parameter)
