setJoinRules method
Changes the join rules. You should check first if the user is able to change it.
Implementation
Future<void> setJoinRules(JoinRules joinRules) async {
await client.setRoomStateWithKey(
id,
EventTypes.RoomJoinRules,
'',
{
'join_rule': joinRules.toString().replaceAll('JoinRules.', ''),
},
);
return;
}