getByValue static method

Cap? getByValue(
  1. int? i
)

Implementation

static Cap? getByValue(int? i) {
  if (i == null) return null;
  try {
    return Cap.values.firstWhere((x) => x.value == i);
  } catch (_) {
    return Cap.UNKNOWN;
  }
}