decode static method

CollectionKind? decode(
  1. dynamic json
)

Implementation

static CollectionKind? decode(dynamic json) {
  if (json == null) {
    return null;
  }
  if (json is! String) {
    return null;
  }

  switch (json) {
    case 'CAROUSEL':
      return CollectionKind.CAROUSEL;
    case 'SCROLL':
      return CollectionKind.SCROLL;
    case 'GRID':
      return CollectionKind.GRID;
    default:
      return CollectionKind.UNKNOWN;
  }
}