getParameterByName method

ParameterReflection? getParameterByName(
  1. String name, {
  2. bool jsonName = false,
})

Returns a ParameterReflection by name.

Implementation

ParameterReflection? getParameterByName(String name,
    {bool jsonName = false}) {
  for (var p in normalParameters) {
    if (p.resolveName(jsonName) == name) return p;
  }

  for (var p in optionalParameters) {
    if (p.resolveName(jsonName) == name) return p;
  }

  for (var p in namedParameters.values) {
    if (p.resolveName(jsonName) == name) return p;
  }

  return null;
}