findByValue static method

TransactionContractType? findByValue(
  1. int value
)

Finds and returns a TransactionContractType by its value.

Returns null if the contract type with the specified value is not found.

Implementation

static TransactionContractType? findByValue(int value) {
  try {
    return values.firstWhere((element) => element.value == value);
  } on StateError {
    return null;
  }
}