fromValue static method

AuthorityType fromValue(
  1. int? value
)

Creates an AuthorityType instance from the provided value.

Throws a MessageException if no AuthorityType is found for the given value.

Implementation

static AuthorityType fromValue(int? value) {
  try {
    return values.firstWhere((element) => element.value == value);
  } on StateError {
    throw MessageException("No AuthorityType found for the given value.",
        details: {"value": value});
  }
}