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 "Cancelled":
      return CallEvent.cancelled;
    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;
    default:
      SignedCallLogger.d('$state is not a valid CallState.');
      throw ArgumentError('$state is not a valid CallState.');
  }
}