toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = code;
  data['desc'] = desc;
  dynamic toJsonData = this.data;
  if (this.data == null) {
    data['data'] = this.data;
  } else {
    if (T == V2TimMessage) {
      toJsonData = (this.data as V2TimMessage).toJson();
    } else if (T == V2TimUserFullInfo) {
      toJsonData = (this.data as V2TimUserFullInfo).toJson();
    } else if (T == _getT<List<V2TimUserFullInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimUserFullInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupInfoResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupInfoResult).toJson())
          .toList();
    } else if (T == _getT<Map<String, String>>()) {
      toJsonData = this.data as Map<String, String>;
    } else if (T == V2TimGroupMemberInfoResult) {
      toJsonData = (this.data as V2TimGroupMemberInfoResult).toJson();
    } else if (T == _getT<List<V2TimGroupMemberFullInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupMemberFullInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimGroupMemberOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimGroupMemberOperationResult).toJson())
          .toList();
    } else if (T == V2TimGroupApplicationResult) {
      toJsonData = (this.data as V2TimGroupApplicationResult).toJson();
    } else if (T == V2TimConversation) {
      toJsonData = (this.data as V2TimConversation).toJson();
    } else if (T == V2TimConversationResult) {
      toJsonData = (this.data as V2TimConversationResult).toJson();
    } else if (T == _getT<List<V2TimFriendInfo>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendInfo).toJson())
          .toList();
    } else if (T == _getT<List<V2TimFriendInfoResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendInfoResult).toJson())
          .toList();
    } else if (T == V2TimFriendOperationResult) {
      toJsonData = (this.data as V2TimFriendOperationResult).toJson();
    } else if (T == _getT<List<V2TimFriendOperationResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendOperationResult).toJson())
          .toList();
    } else if (T == V2TimFriendCheckResult) {
      toJsonData = (this.data as V2TimFriendCheckResult).toJson();
    } else if (T == _getT<List<V2TimFriendCheckResult>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendCheckResult).toJson())
          .toList();
    } else if (T == V2TimFriendApplicationResult) {
      toJsonData = (this.data as V2TimFriendApplicationResult).toJson();
    } else if (T == _getT<List<V2TimFriendGroup>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimFriendGroup).toJson())
          .toList();
    } else if (T == _getT<List<V2TimMessage>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessage).toJson())
          .toList();
    } else if (T == V2TimMessageSearchResult) {
      toJsonData = (this.data as V2TimMessageSearchResult).toJson();
    } else if (T == V2TimSignalingInfo) {
      toJsonData = (this.data as V2TimSignalingInfo).toJson();
    } else if (T == V2TimMsgCreateInfoResult) {
      toJsonData = (this.data as V2TimMsgCreateInfoResult).toJson();
    } else if (T == V2TimGroupMessageReadMemberList) {
      toJsonData = (this.data as V2TimGroupMessageReadMemberList).toJson();
    } else if (T == _getT<List<V2TimMessageReceipt>>()) {
      toJsonData = (this.data as List)
          .map((e) => (e as V2TimMessageReceipt).toJson())
          .toList();
    } else {
      toJsonData = this.data;
    }
    data['data'] = toJsonData;
  }
  return data;
}