decode method Null safety

APIParameterLocation? decode(
  1. String location
)

Implementation

static APIParameterLocation? decode(String location) {
  switch (location) {
    case "query":
      return APIParameterLocation.query;
    case "header":
      return APIParameterLocation.header;
    case "path":
      return APIParameterLocation.path;
    case "cookie":
      return APIParameterLocation.cookie;
    default:
      return null;
  }
}