fromMap static method

MessageSource? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static MessageSource? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'messageSourceChatHistory':
      return MessageSourceChatHistory.fromMap(_map);
    case 'messageSourceMessageThreadHistory':
      return MessageSourceMessageThreadHistory.fromMap(_map);
    case 'messageSourceChatList':
      return MessageSourceChatList.fromMap(_map);
    case 'messageSourceNotification':
      return MessageSourceNotification.fromMap(_map);
    case 'messageSourceHistoryPreview':
      return MessageSourceHistoryPreview.fromMap(_map);
    case 'messageSourceScreenshot':
      return MessageSourceScreenshot.fromMap(_map);
    case 'messageSourceChatEventLog':
      return MessageSourceChatEventLog.fromMap(_map);
    case 'messageSourceSearch':
      return MessageSourceSearch.fromMap(_map);
    case 'messageSourceOther':
      return MessageSourceOther.fromMap(_map);
    case 'messageSourceForumTopicHistory':
      return MessageSourceForumTopicHistory.fromMap(_map);
    case null:
    default:
      return null;
  }
}