fromString static method

SchemaVersion? fromString(
  1. String? s
)

Implementation

static SchemaVersion? fromString(String? s) {
  if (s == null) return null;
  switch (s) {
    case 'http://json-schema.org/draft-04/schema#':
      return draft4;
    case 'http://json-schema.org/draft-06/schema#':
      return draft6;
    case 'http://json-schema.org/draft-07/schema#':
      return draft7;
    case 'https://json-schema.org/draft-04/schema#':
      return draft4;
    case 'https://json-schema.org/draft-06/schema#':
      return draft6;
    case 'https://json-schema.org/draft-07/schema#':
      return draft7;
    case 'https://json-schema.org/draft/2019-09/schema':
      return draft2019_09;
    case 'https://json-schema.org/draft/2019-09/schema#':
      return draft2019_09;
    case 'https://json-schema.org/draft/2020-12/schema':
      return draft2020_12;
    case 'https://json-schema.org/draft/2020-12/schema#':
      return draft2020_12;
    default:
      return null;
  }
}