fromValue static method

UserPreferredContentMode? fromValue(
  1. int? value
)

Gets a possible UserPreferredContentMode instance from int value.

Implementation

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