fromValue static method

SafeBrowsingThreat? fromValue(
  1. int? value
)

Gets a possible SafeBrowsingThreat instance from int value.

Implementation

static SafeBrowsingThreat? fromValue(int? value) {
  if (value != null) {
    try {
      return SafeBrowsingThreat.values
          .firstWhere((element) => element.toValue() == value);
    } catch (e) {
      return null;
    }
  }
  return null;
}