fromValue static method

Gets a possible ContentBlockerTriggerLoadContext instance from String value.

Implementation

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