fetchGroupInfoFromServer method

Future<ChatGroup> fetchGroupInfoFromServer(
  1. String groupId, {
  2. @Deprecated('') bool? fetchMembers,
})

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.

Implementation

Future<ChatGroup> fetchGroupInfoFromServer(
  String groupId, {
  @Deprecated('') bool? fetchMembers,
}) async {
  Map req = {"groupId": groupId};
  req.putIfNotNull("fetchMembers", fetchMembers);
  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;
  }
}