toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['conversationID'] = this.conversationID;
  data['keywordList'] = this.keywordList;
  data['type'] = this.type;
  data['userIDList'] =
      this.userIDList == null ? List.empty(growable: true) : this.userIDList;
  data['messageTypeList'] = this.messageTypeList == null
      ? List.empty(growable: true)
      : this.messageTypeList;
  data['searchTimePosition'] = this.searchTimePosition;
  data['searchTimePeriod'] = this.searchTimePeriod;
  data['pageSize'] = this.pageSize;
  data['pageIndex'] = this.pageIndex;
  return data;
}