toChatItemType method

ChatItemType toChatItemType()

Implementation

ChatItemType toChatItemType() {
  switch (this) {
    case 'TYPING':
      return ChatItemType.typing;
    case 'PARTICIPANT_JOINED':
      return ChatItemType.participantJoined;
    case 'PARTICIPANT_LEFT':
      return ChatItemType.participantLeft;
    case 'CHAT_ENDED':
      return ChatItemType.chatEnded;
    case 'TRANSFER_SUCCEEDED':
      return ChatItemType.transferSucceeded;
    case 'TRANSFER_FAILED':
      return ChatItemType.transferFailed;
    case 'MESSAGE':
      return ChatItemType.message;
    case 'EVENT':
      return ChatItemType.event;
    case 'ATTACHMENT':
      return ChatItemType.attachment;
    case 'CONNECTION_ACK':
      return ChatItemType.connectionAck;
  }
  throw Exception('$this is not known in enum ChatItemType');
}