fromValue static method

PushPlatforms? fromValue(
  1. String? 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 PushPlatforms? fromValue(String? value) {
  if (value == null) return null;
  for (final option in PushPlatforms.values) {
    if (option.type == value) {
      return option;
    }
  }
  return null;
}