fetchGroupInfoFromServer method
~english Gets the group information from the server.
This method does not get member information. If member information is required, call fetchMemberListFromServer.
Param groupId
The group ID.
Param fetchMembers
Whether to get group members. By default, a list of 200 members is fetched.
Return The group instance.
Throws A description of the exception. See ChatError. ~end
~chinese 从服务器获取群组的详细信息。
该方法不获取成员。如需获取成员,使用 fetchMemberListFromServer。
Param groupId
群组 ID。
Return 群组描述。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end
Implementation
Future<ChatGroup> fetchGroupInfoFromServer(
String groupId, {
bool fetchMembers = false,
}) async {
Map req = {"groupId": groupId, "fetchMembers": fetchMembers};
Map result = await _channel.invokeMethod(
ChatMethodKeys.getGroupSpecificationFromServer, req);
try {
ChatError.hasErrorFromResult(result);
return ChatGroup.fromJson(
result[ChatMethodKeys.getGroupSpecificationFromServer]);
} on ChatError catch (e) {
throw e;
}
}