fix: use vrouter.toSegments

This commit is contained in:
Sorunome 2021-08-15 13:26:16 +02:00
commit 02e57474fe
22 changed files with 47 additions and 38 deletions

View file

@ -95,7 +95,8 @@ class _ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
widget.room.setPushRuleState(PushRuleState.notify));
break;
case 'details':
VRouter.of(context).to('/rooms/${widget.room.id}/details');
VRouter.of(context)
.toSegments(['rooms', widget.room.id, 'details']);
break;
}
},

View file

@ -102,8 +102,12 @@ class _ContactListTile extends StatelessWidget {
fontWeight: FontWeight.bold,
)
: null),
onTap: () => VRouter.of(context).to(
'/rooms/${Matrix.of(context).client.getDirectChatFromUserId(contact.senderId)}'),
onTap: () => VRouter.of(context).toSegments([
'rooms',
Matrix.of(context)
.client
.getDirectChatFromUserId(contact.senderId)
]),
);
});
}

View file

@ -21,7 +21,7 @@ class _EncryptionButtonState extends State<EncryptionButton> {
void _enableEncryptionAction() async {
if (widget.room.encrypted) {
VRouter.of(context).to('/rooms/${widget.room.id}/encryption');
VRouter.of(context).toSegments(['rooms', widget.room.id, 'encryption']);
return;
}
if (widget.room.joinRules == JoinRules.public) {

View file

@ -112,7 +112,7 @@ class ChatListItem extends StatelessWidget {
}
Matrix.of(context).shareContent = null;
}
VRouter.of(context).to('/rooms/${room.id}');
VRouter.of(context).toSegments(['rooms', room.id]);
}
}
}

View file

@ -18,7 +18,7 @@ class PublicRoomListItem extends StatelessWidget {
future: () => _joinRoomAndWait(context),
);
if (success.error == null) {
VRouter.of(context).toNamed('/rooms/${success.result}');
VRouter.of(context).toSegments(['rooms', success.result]);
}
}