Short answer
Decide what the parameter means. If callers must always pass it, mark it required (required this.title). If it has a sensible fallback, give it a default value. If “not given” is a real state, make the type nullable (String? title) and handle null where it is used. The old @required annotation doesn’t count; use the required keyword.
Rather not fix it yourself? App Fix Ticket fixes one reproducible bug at a fixed price, with an optional Diagnosis that is credited toward the fix.
Why the parameter could be null, and the fix
01
A widget constructor from before null safety
“If the parameter can't be null, then either provide a default value” Dart, missing_default_value_for_parameter
Named parameters are optional unless marked required. A field like final String title with a constructor parameter {this.title} has no value when the caller leaves it out.
class MyCard extends StatelessWidget { const MyCard({super.key, required this.title, this.subtitle, this.elevation = 1}); final String title; // must be passed final String? subtitle; // may be missing final double elevation; // has a default }02
@required instead of required
Code migrated from older Flutter often still has @required from package:meta. With null safety, only the required keyword makes a named parameter mandatory.
// before MyCard({@required this.title}); // after MyCard({required this.title});03
Making it nullable without handling null
String? silences the error, but every use then has to deal with null, for example with ?? or an if check. Don’t add ! to make it compile, which turns the compile error into a runtime crash.
final String? subtitle; Text(subtitle ?? 'No subtitle')
Checked against the vendor’s docs on : Dart diagnostics: missing_default_value_for_parameter; Dart: Understanding null safety.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug. The Fix costs $1,200. If you need a Diagnosis first, its $450 fee counts toward the Fix.See scope and start
- from $450AI-Built App RescueFor a whole-app review, the $450 Launch Check is credited toward the optional $1,950 Rescue Sprint for up to five critical or high findings.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Flutter “Null check operator used on a null value” · Flutter “type ‘Null’ is not a subtype of type ‘String’” · Flutter “can’t be accessed in an initializer” · Flutter “Incorrect use of ParentDataWidget”