CallState.fromJson constructor

CallState.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CallState.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case CallStatePending.CONSTRUCTOR:
      return CallStatePending.fromJson(json);
    case CallStateExchangingKeys.CONSTRUCTOR:
      return CallStateExchangingKeys.fromJson(json);
    case CallStateReady.CONSTRUCTOR:
      return CallStateReady.fromJson(json);
    case CallStateHangingUp.CONSTRUCTOR:
      return CallStateHangingUp.fromJson(json);
    case CallStateDiscarded.CONSTRUCTOR:
      return CallStateDiscarded.fromJson(json);
    case CallStateError.CONSTRUCTOR:
      return CallStateError.fromJson(json);
    default:
      return const CallState();
  }
}