setSpaceChild method
Adds or edits a child of this space.
Implementation
Future<void> setSpaceChild(
String roomId, {
List<String>? via,
String? order,
bool? suggested,
}) async {
if (!isSpace) throw Exception('Room is not a space!');
via ??= [client.userID!.domain!];
await client.setRoomStateWithKey(id, EventTypes.spaceChild, roomId, {
'via': via,
if (order != null) 'order': order,
if (suggested != null) 'suggested': suggested,
});
await client.setRoomStateWithKey(roomId, EventTypes.spaceParent, id, {
'via': via,
});
return;
}