searchResultItem2DartSearchResultItem static method

Future<V2TimMessageSearchResultItem> searchResultItem2DartSearchResultItem(
  1. dynamic jsonItem
)

Implementation

static Future<V2TimMessageSearchResultItem> searchResultItem2DartSearchResultItem(jsonItem) async {
  List list = List.empty(growable: true);
  if (jsonItem["msg_search_result_item_message_array"] != null) {
    for (Map<String, dynamic> item in jsonItem["msg_search_result_item_message_array"]) {
      list.add((await convertMessage2Dart(item)).toJson());
    }
  }
  return V2TimMessageSearchResultItem.fromJson({
    "conversationID": jsonItem["msg_search_result_item_conv_id"],
    "messageCount": jsonItem["msg_search_result_item_total_message_count"],
    "messageList": list,
  });
}