encode method Null safety

void encode(
  1. KeyedArchive object
)
override

Implementation

void encode(KeyedArchive object) {
  super.encode(object);

  if (content == null) {
    throw new ArgumentError(
        "APIRequestBody must have non-null values for: 'content'.");
  }

  object.encode("description", description);
  object.encode("required", _required);
  object.encodeObjectMap("content", content);
}