getCallStateFromString static method

CallState getCallStateFromString({
  1. required String? state,
})

Implementation

static CallState getCallStateFromString({required String? state}) {
  log("callClientChannel: parseStringToCallState: string = $state");
  switch (state) {
    case 'NEW':
      return CallState.newCall;
    case 'CONNECTED':
      return CallState.connected;
    case 'ON_HOLD':
      return CallState.onHold;
    case 'DISCONNECTED':
      return CallState.disconnected;
    case 'ERROR':
      return CallState.error;
    default:
      return CallState.error;
  }
}