fetchGroupInfoFromServer method

Future<ChatGroup> fetchGroupInfoFromServer(
  1. String groupId
)

~english Fetches group details including group ID, name, description, basic settings, owner and admins.

Param groupId The group ID.

Returns The group instance.

Throws Exception description, see ChatError. ~end

~chinese 获取群组详情,包含群组 ID、名称、描述、基本属性、群主和管理员。

Param groupId 群组 ID。

Return 群组实例。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError. ~end

Implementation

Future<ChatGroup> fetchGroupInfoFromServer(String groupId) async {
  Map req = {"groupId": groupId};
  Map result = await platform_interface.Client.instance.groupManager
      .callNativeMethod(ChatMethodKeys.getGroupSpecificationFromServer, req);
  try {
    ChatError.hasErrorFromResult(result);
    return ChatGroup.fromJson(
      result[ChatMethodKeys.getGroupSpecificationFromServer],
    );
  } catch (e) {
    rethrow;
  }
}