decode static 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 "file":
      return APIType.file;
    case "object":
      return APIType.object;
  }
  return null;
}