querySessionList static method

Future<List> querySessionList(
  1. int type
)

获取消息会话列表

Implementation

static Future<List> querySessionList(int type) async {
  Map map = await _channel.invokeMethod("querySessionList", {"type": type});

  if (map["result"] <= 0 || map["sessions"] == null) return [];

  List<LVIMSession> list = [];
  for (Map sessionMap in map["sessions"]) {
    LVIMSession session = new LVIMSession();
    session.unreadCount = sessionMap["unreadCount"];
    var msg = SendMessageResult.convertFromMap(sessionMap).msg;
    session.lastMsg = msg;
    list.add(session);
  }
  return list;
}