APISchemaObject.array constructor Null safety

APISchemaObject.array(
  1. {APIType? ofType,
  2. APISchemaObject? ofSchema}
)

Implementation

APISchemaObject.array({APIType? ofType, APISchemaObject? ofSchema})
    : type = APIType.array {
  if (ofType != null) {
    items = new APISchemaObject()..type = ofType;
  } else if (ofSchema != null) {
    items = ofSchema;
  } else {
    throw new ArgumentError(
        "Invalid 'APISchemaObject.array' with neither 'ofType' or 'ofSchema' specified.");
  }
}