APIResponse.schema constructor Null safety

APIResponse.schema(
  1. String? description,
  2. APISchemaObject schema,
  3. {Iterable<String> contentTypes = const ["application/json"],
  4. Map<String, APIHeader?>? headers}
)

Implementation

APIResponse.schema(
  this.description,
  APISchemaObject schema, {
  Iterable<String> contentTypes = const ["application/json"],
  this.headers,
}) {
  content = contentTypes.fold({}, (prev, elem) {
    prev![elem] = APIMediaType(schema: schema);
    return prev;
  });
}