catalogFileFormatFromString function

CatalogFileFormat catalogFileFormatFromString(
  1. String value
)

Implementation

CatalogFileFormat catalogFileFormatFromString(String value) {
  switch (value.trim().toLowerCase()) {
    case 'json':
      return CatalogFileFormat.json;
    case 'yaml':
    case 'yml':
      return CatalogFileFormat.yaml;
    case 'csv':
      return CatalogFileFormat.csv;
    case 'arb':
      return CatalogFileFormat.arb;
    default:
      throw FormatException('Unsupported catalog format "$value".');
  }
}