refactor: Migrate routes to go router

This commit is contained in:
krille-chan 2023-08-07 18:40:02 +02:00
commit ee957ab1f6
No known key found for this signature in database
52 changed files with 584 additions and 612 deletions

View file

@ -120,7 +120,7 @@ class StoryPageController extends State<StoryPage> {
void share() async {
Matrix.of(context).shareContent = currentEvent?.content;
hold();
VRouter.of(context).to('share');
context.go('share');
}
void displaySeenByUsers() async {
@ -199,7 +199,7 @@ class StoryPageController extends State<StoryPage> {
return room.ownPowerLevel >= 100;
}
String get roomId => VRouter.of(context).pathParameters['roomid'] ?? '';
String get roomId => GoRouterState.of(context).pathParameters['roomid'] ?? '';
Future<VideoPlayerController?>? loadVideoControllerFuture;
@ -228,9 +228,9 @@ class StoryPageController extends State<StoryPage> {
void skip() {
if (index + 1 >= max) {
if (isOwnStory) {
VRouter.of(context).to('/stories/create');
context.go('/rooms/stories/create');
} else {
VRouter.of(context).to('/rooms');
context.go('/rooms');
}
return;
}
@ -497,7 +497,8 @@ class StoryPageController extends State<StoryPage> {
currentEvent!.senderFromMemoryOrFallback.startDirectChat(),
);
if (roomIdResult.error != null) return;
VRouter.of(context).toSegments(['rooms', roomIdResult.result!]);
context.go(['', 'rooms', roomIdResult.result!].join('/'));
break;
}
}