APISchemaObject.map constructor Null safety

APISchemaObject.map(
  1. {APIType? ofType,
  2. APISchemaObject? ofSchema,
  3. bool any = false}
)

Implementation

APISchemaObject.map(
    {APIType? ofType, APISchemaObject? ofSchema, bool any: false})
    : type = APIType.object {
  if (ofType != null) {
    additionalPropertySchema = new APISchemaObject()..type = ofType;
  } else if (ofSchema != null) {
    additionalPropertySchema = ofSchema;
  } else if (any) {
  } else {
    throw new ArgumentError(
        "Invalid 'APISchemaObject.map' with neither 'ofType', 'any' or 'ofSchema' specified.");
  }
}