getByValue static method

Lights? getByValue(
  1. int? i
)

Implementation

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