Dart: The named parameter 'key' is required, but there's no corresponding argument
A constructor or function marked required for a parameter was called without it.
The named parameter is required, but there's no corresponding argumentThe named parameter 'title' is required, but there's no corresponding argumentRequired named parameter 'x' must be providedToo few positional arguments 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
- Supply the named argument
- Make it optional with
this.value = defaultValueor nullablethis.value - Update call sites after package upgrades
Detailed fix by platform
Dart
MyCard(title: 'Hello')where the constructor isconst MyCard({super.key, required this.title});
How to diagnose
- Parameter — Name in the message?
- Call site — Passing it?
- Default — Possible?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Bad state: No element Dart: Bad state: No element — .first, .last or .single on an empty list
- LateInitializationError: Field has not been initialized Dart: LateInitializationError: Field 'controller' has not been initialized
- Non-nullable instance field must be initialized Dart: Non-nullable instance field 'name' must be initialized. Try adding an initializer expression, or a generative constructor that initializes it, or mark it 'late'
Most viewed in Flutter / Dart
- setState() called after dispose() Flutter: setState() called after dispose(): _MyState#1a2b3 (lifecycle state: defunct, not mounted)
- A RenderFlex overflowed Flutter: A RenderFlex overflowed by x pixels on the right/bottom
- Null check operator used on a null value Dart/Flutter: Null check operator used on a null value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026