fromValue static method

ResourceCode fromValue(
  1. int val
)

Returns the ResourceCode associated with the given value.

Throws an error if no match is found.

Implementation

static ResourceCode fromValue(int val) {
  return values.firstWhere((element) => element.value == val);
}