fromString static method

CallEvent? fromString(
  1. String state
)

parses the state of the call in a CallEvent

Implementation

static CallEvent? fromString(String state) {
  switch (state) {
    case "CallIsPlaced":
      return CallEvent.callIsPlaced;
    case "Ringing":
      return CallEvent.ringing;
    case "Cancelled":
      return CallEvent.cancelled;
    case "CancelledDueToRingTimeout":
      return CallEvent.cancelledDueToRingTimeout;
    case "Declined":
      return CallEvent.declined;
    case "Missed":
      return CallEvent.missed;
    case "Answered":
      return CallEvent.answered;
    case "CallInProgress":
      return CallEvent.callInProgress;
    case "Ended":
      return CallEvent.ended;
    case "ReceiverBusyOnAnotherCall":
      return CallEvent.receiverBusyOnAnotherCall;
    case "DeclinedDueToLoggedOutCuid":
      return CallEvent.declinedDueToLoggedOutCuid;
    case "DeclinedDueToNotificationsDisabled":
      return CallEvent.declinedDueToNotificationsDisabled;
    case "DeclinedDueToMicrophonePermissionsNotGranted":
      return CallEvent.declinedDueToMicrophonePermissionsNotGranted;
    case "DeclinedDueToMicrophonePermissionBlocked":
      return CallEvent.declinedDueToMicrophonePermissionBlocked;
    case "DeclinedDueToBusyOnVoIP":
      return CallEvent.declinedDueToBusyOnVoIP;
    case "DeclinedDueToBusyOnPSTN":
      return CallEvent.declinedDueToBusyOnPSTN;
    case "FailedDueToInternalError":
      return CallEvent.failedDueToInternalError;
    case "AppInitiatedCallDeclinedDueToNetworkQuality":
      return CallEvent.appInitiatedCallDeclinedDueToNetworkQuality;
    case "USER_INITIATED_CALL_DECLINED_ON_CANCEL_CTA":
      return CallEvent.userInitiatedCallDeclinedOnCancelCTA;
      // @todo Fix this once official support has been added in the native sdk
    default:
      SignedCallLogger.d('$state is not a valid value for CallEvent.');
      return null;
  }
}