getRequiredNamedArg<T> static method
Get a required named argument with type checking.
Throws ArgumentD4rtException if the argument is missing.
For nullable required parameters (e.g., required bool? value),
null is a valid value — only absence is an error.
Implementation
static T getRequiredNamedArg<T>(
Map<String, Object?> named,
String paramName,
String methodName,
) {
if (!named.containsKey(paramName)) {
throw ArgumentD4rtException(
'$methodName: Missing required named argument "$paramName"',
);
}
final value = named[paramName];
if (value == null) return null as T;
return extractBridgedArg<T>(value, paramName);
}