fetchChatRoomInfoFromServer method Null safety

Future<EMChatRoom> fetchChatRoomInfoFromServer(
  1. String roomId,
  2. {bool fetchMembers = false}
)

Gets the details of the chat room from the server. By default, the details do not include the chat room member list.

Param roomId The chat room ID.

Return The chat room instance.

Throws A description of the exception. See {@link EMError}.

Implementation

Future<EMChatRoom> fetchChatRoomInfoFromServer(
  String roomId, {
  bool fetchMembers = false,
}) async {
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.fetchChatRoomInfoFromServer,
      {"roomId": roomId, "fetchMembers": fetchMembers});
  try {
    EMError.hasErrorFromResult(result);
    return EMChatRoom.fromJson(
        result[ChatMethodKeys.fetchChatRoomInfoFromServer]);
  } on EMError catch (e) {
    throw e;
  }
}