decode static method

ExperimentKind? decode(
  1. dynamic json
)

Implementation

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

  switch (json) {
    case 'EMBED':
      return ExperimentKind.EMBED;
    case 'POPUP':
      return ExperimentKind.POPUP;
    case 'TOOLTIP':
      return ExperimentKind.TOOLTIP;
    case 'CONFIG':
      return ExperimentKind.CONFIG;
    default:
      return ExperimentKind.UNKNOWN;
  }
}