decode method Null safety

APIType? decode(
  1. String type
)

Implementation

static APIType? decode(String type) {
  switch (type) {
    case "string":
      return APIType.string;
    case "number":
      return APIType.number;
    case "integer":
      return APIType.integer;
    case "boolean":
      return APIType.boolean;
    case "array":
      return APIType.array;
    case "object":
      return APIType.object;
    default:
      return null;
  }
}