fromValue static method

NsgEnum fromValue(
  1. Type type,
  2. int v
)

Implementation

static NsgEnum fromValue(Type type, int v) {
  var map = _getAll(type);
  if (!map.containsKey(v)) {
    v = 0;
    return map[v]!;
    //throw Exception('Wrong value $v');
  }
  return map[v]!;
}