fromJson static method

CockpitTextMatchMode fromJson(
  1. Object? json
)

Implementation

static CockpitTextMatchMode fromJson(Object? json) {
  if (json is String) {
    for (final mode in values) {
      if (mode.name == json) return mode;
    }
  }
  throw const FormatException(
    'Text match mode must be exact, contains, fuzzy, or regex.',
  );
}