decode method Null safety

void decode(
  1. KeyedArchive object
)
override

Implementation

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

  summary = object.decode("summary");
  description = object.decode("description");
  parameters =
      object.decodeObjects("parameters", () => new APIParameter.empty());

  final methodNames = [
    "get",
    "put",
    "post",
    "delete",
    "options",
    "head",
    "patch",
    "trace"
  ];
  methodNames.forEach((methodName) {
    if (!object.containsKey(methodName)) {
      return;
    }
    operations ??= {};
    operations![methodName] = object.decodeObject(
        methodName, () => new APIOperation.empty()) as APIOperation;
  });
}