factory<T extends Enumerable> static method

T factory<T extends Enumerable>(
  1. List<T> values,
  2. dynamic rawValue
)

Implementation

static T factory<T extends Enumerable>(List<T> values, rawValue) {
  assert(values.length > 0, "The 'values' is empty");

  // other cases: String, bool
  return values.firstWhere((o) => o.rawValue == rawValue,);
}