updateGroupAvatar method
Changes the group avatar. Only the group owner can call this method.
Param groupId The group ID.
Param avatarUrl The new group avatar URL.
Returns The updated group instance.
Throws Exception description, see ChatError.
Implementation
Future<ChatGroup> updateGroupAvatar({
required String groupId,
required String avatarUrl,
}) async {
try {
Map req = {
"groupId": groupId,
"avatarUrl": avatarUrl,
};
Map result = await platform_interface.Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.updateGroupAvatar, req);
ChatError.hasErrorFromResult(result);
return ChatGroup.fromJson(result[ChatMethodKeys.updateGroupAvatar]);
} catch (e) {
rethrow;
}
}