getRequiredArg<T> static method
Get a required positional argument with type checking.
Throws ArgumentError if the argument is missing or has wrong type.
Implementation
static T getRequiredArg<T>(
List<Object?> positional,
int index,
String paramName,
String methodName,
) {
if (positional.length <= index) {
throw ArgumentD4rtException(
'$methodName: Missing required argument "$paramName" at position $index. '
'Expected at least ${index + 1} arguments, got ${positional.length}',
);
}
return extractBridgedArg<T>(positional[index], paramName);
}