valueOf static method

Implementation

static NotificationServiceEventNames valueOf(String? value) {
  final lowerCaseValue = value?.toLowerCase();
  return NotificationServiceEventNames.values.firstWhere(
    (element) {
      return element.value == value ||
          element.name.toLowerCase() == lowerCaseValue;
    },
    orElse: () => throw Exception("Invalid enum name"),
  );
}