parseToEnum<T extends Object> static method

T parseToEnum<T extends Object>(
  1. List<T> enumList,
  2. String value
)

Implementation

static T parseToEnum<T extends Object>(List<T> enumList, String value) {
  return enumList.firstWhere((e) => describeEnum(e) == value);
}