toFlutterReadyState function

ReadyState toFlutterReadyState(
  1. int readyState
)

Implementation

PlatformInterface.ReadyState toFlutterReadyState(int readyState) {
  PlatformInterface.ReadyState flutterReadyState = PlatformInterface.ReadyState.have_nothing;

  switch (readyState) {
    case 0:
      flutterReadyState = PlatformInterface.ReadyState.have_nothing;
    case 1:
      flutterReadyState = PlatformInterface.ReadyState.have_metadata;
    case 2:
      flutterReadyState = PlatformInterface.ReadyState.have_current_data;
    case 3:
      flutterReadyState = PlatformInterface.ReadyState.have_future_data;
    case 4:
      flutterReadyState = PlatformInterface.ReadyState.have_enough_data;
    default:
      throw UnsupportedError("Unsupported readyState: $readyState");
  }

  return flutterReadyState;
}