fix: use vrouter.toSegments
This commit is contained in:
parent
4a02f9d076
commit
02e57474fe
22 changed files with 47 additions and 38 deletions
|
|
@ -52,11 +52,11 @@ class ChatDetailsView extends StatelessWidget {
|
|||
SliverAppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
onPressed: () => VRouter.of(context)
|
||||
.path
|
||||
.startsWith('/spaces/')
|
||||
? VRouter.of(context).pop()
|
||||
: VRouter.of(context).to('/rooms/${controller.roomId}'),
|
||||
onPressed: () =>
|
||||
VRouter.of(context).path.startsWith('/spaces/')
|
||||
? VRouter.of(context).pop()
|
||||
: VRouter.of(context)
|
||||
.toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
elevation: Theme.of(context).appBarTheme.elevation,
|
||||
expandedHeight: 300.0,
|
||||
|
|
@ -264,7 +264,8 @@ class ChatDetailsView extends StatelessWidget {
|
|||
.visibilityOfTheChatHistory),
|
||||
subtitle: Text(
|
||||
room.historyVisibility.getLocalizedString(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
MatrixLocals(L10n.of(context))) ??
|
||||
'',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
leading: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('/rooms/${controller.roomId}'),
|
||||
VRouter.of(context).toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
title: Text(L10n.of(context).tapOnDeviceToVerify),
|
||||
bottom: PreferredSize(
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ class ChatPermissionsSettingsView extends StatelessWidget {
|
|||
? null
|
||||
: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('/rooms/${controller.roomId}'),
|
||||
onPressed: () => VRouter.of(context)
|
||||
.toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
title: Text(L10n.of(context).editChatPermissions),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ class ChatView extends StatelessWidget {
|
|||
'${controller.room.getUserByMXIDSync(controller.room.directChatMatrixID).mention} ',
|
||||
),
|
||||
)
|
||||
: () => VRouter.of(context)
|
||||
.to('/rooms/${controller.room.id}/details'),
|
||||
: () => VRouter.of(context).toSegments(
|
||||
['rooms', controller.room.id, 'details']),
|
||||
title: Text(
|
||||
controller.room.getLocalizedDisplayname(
|
||||
MatrixLocals(L10n.of(context))),
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
? null
|
||||
: IconButton(
|
||||
icon: Icon(Icons.close_outlined),
|
||||
onPressed: () =>
|
||||
VRouter.of(context).to('/rooms/${controller.roomId}'),
|
||||
onPressed: () => VRouter.of(context)
|
||||
.toSegments(['rooms', controller.roomId]),
|
||||
),
|
||||
titleSpacing: 0,
|
||||
title: DefaultAppBarSearchField(
|
||||
|
|
|
|||
|
|
@ -239,7 +239,8 @@ class SearchView extends StatelessWidget {
|
|||
.startDirectChat(foundProfile.userId),
|
||||
);
|
||||
if (roomID.error == null) {
|
||||
VRouter.of(context).to('/rooms/${roomID.result}');
|
||||
VRouter.of(context)
|
||||
.toSegments(['rooms', roomID.result]);
|
||||
}
|
||||
},
|
||||
leading: Avatar(
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ class MultipleEmotesSettingsView extends StatelessWidget {
|
|||
return ListTile(
|
||||
title: Text(packName),
|
||||
onTap: () async {
|
||||
VRouter.of(context)
|
||||
.to('/rooms/${room.id}/details/emotes/${keys[i]}');
|
||||
VRouter.of(context).toSegments(
|
||||
['rooms', room.id, 'details', 'emotes', keys[i]]);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue