fromValue static method

RepliesOptions? fromValue(
  1. int? value
)

Returns the option for value, or null when value is null or is not a known option.

An absent or unrecognised value is treated as unset rather than an error: the key may be missing from the response, and the server may send an option a given SDK build does not know yet.

Implementation

static RepliesOptions? fromValue(int? value) {
  if (value == null) return null;
  for (final option in RepliesOptions.values) {
    if (option.value == value) {
      return option;
    }
  }
  return null;
}