refactor: Migrate from pathsegment routing
This commit is contained in:
parent
b7dac8365a
commit
b715eff839
15 changed files with 20 additions and 23 deletions
|
|
@ -218,7 +218,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
);
|
||||
final roomId = success.result;
|
||||
if (roomId == null) return;
|
||||
context.go(['', 'rooms', roomId].join('/'));
|
||||
context.go('/rooms/$roomId');
|
||||
}
|
||||
|
||||
void leaveChat() async {
|
||||
|
|
@ -1055,7 +1055,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
future: room.leave,
|
||||
);
|
||||
if (result.error == null) {
|
||||
context.go(['', 'rooms', result.result!].join('/'));
|
||||
context.go('/rooms/${result.result!}');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ChatAppBarTitle extends StatelessWidget {
|
|||
highlightColor: Colors.transparent,
|
||||
onTap: controller.isArchived
|
||||
? null
|
||||
: () => context.go(['', 'rooms', room.id, 'details'].join('/')),
|
||||
: () => context.go('/rooms/${room.id}/details'),
|
||||
child: Row(
|
||||
children: [
|
||||
Hero(
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ class EncryptionButton extends StatelessWidget {
|
|||
? Colors.orange
|
||||
: null,
|
||||
),
|
||||
onPressed: () =>
|
||||
context.go(['', 'rooms', room.id, 'encryption'].join('/')),
|
||||
onPressed: () => context.go('/rooms/${room.id}/encryption'),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () =>
|
||||
context.go(['', 'rooms', controller.roomId!].join('/')),
|
||||
onPressed: () => context.go('/rooms/${controller.roomId!}'),
|
||||
),
|
||||
title: Text(L10n.of(context)!.encryption),
|
||||
actions: [
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class ChatListItem extends StatelessWidget {
|
|||
}
|
||||
|
||||
if (room.membership == Membership.leave) {
|
||||
context.go(['', 'archive', room.id].join('/'));
|
||||
context.go('/rooms/archive/${room.id}');
|
||||
}
|
||||
|
||||
if (room.membership == Membership.join) {
|
||||
|
|
@ -86,7 +86,7 @@ class ChatListItem extends StatelessWidget {
|
|||
Matrix.of(context).shareContent = null;
|
||||
}
|
||||
|
||||
context.go(['', 'rooms', room.id].join('/'));
|
||||
context.go('/rooms/${room.id}');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
}
|
||||
return;
|
||||
}
|
||||
context.go(['', 'rooms', spaceChild.roomId].join('/'));
|
||||
context.go('/rooms/${spaceChild.roomId}');
|
||||
}
|
||||
|
||||
void _onSpaceChildContextMenu([
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class StoriesHeader extends StatelessWidget {
|
|||
);
|
||||
if (result.error != null) return;
|
||||
}
|
||||
context.go(['', 'stories', roomId].join('/'));
|
||||
context.go('/stories/$roomId');
|
||||
}
|
||||
|
||||
void _contextualActions(BuildContext context, Room room) async {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class NewGroupController extends State<NewGroup> {
|
|||
},
|
||||
);
|
||||
if (roomID.error == null) {
|
||||
context.go(['', 'rooms', roomID.result!, 'invite'].join('/'));
|
||||
context.go('/rooms/${roomID.result!}/invite');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ class StoryPageController extends State<StoryPage> {
|
|||
currentEvent!.senderFromMemoryOrFallback.startDirectChat(),
|
||||
);
|
||||
if (roomIdResult.error != null) return;
|
||||
context.go(['', 'rooms', roomIdResult.result!].join('/'));
|
||||
context.go('/rooms/${roomIdResult.result!}');
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
|||
.startDirectChat(user?.id ?? widget.profile!.userId),
|
||||
);
|
||||
if (roomIdResult.error != null) return;
|
||||
widget.outerContext.go(['', 'rooms', roomIdResult.result!].join('/'));
|
||||
widget.outerContext.go('/rooms/${roomIdResult.result!}');
|
||||
Navigator.of(context, rootNavigator: false).pop();
|
||||
break;
|
||||
case UserBottomSheetAction.ignore:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue