fromNativeValue static method

MediaPlaybackState? fromNativeValue(
  1. int? value
)

Gets a possible MediaPlaybackState instance from a native value.

Implementation

static MediaPlaybackState? fromNativeValue(int? value) {
  if (value != null) {
    try {
      return MediaPlaybackState.values
          .firstWhere((element) => element.toNativeValue() == value);
    } catch (e) {
      return null;
    }
  }
  return null;
}