diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 44dfc19a6..e83f75e20 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -46,6 +46,11 @@ class AppRoutes { path: '/rooms', widget: ChatList(), stackedRoutes: [ + VWidget( + path: '/spaces/:roomid', + widget: ChatDetails(), + stackedRoutes: _chatDetailsRoutes, + ), VWidget(path: ':roomid', widget: Chat(), stackedRoutes: [ VWidget( path: 'encryption', @@ -103,6 +108,12 @@ class AppRoutes { widget: EmptyPage(), buildTransition: _fadeTransition, stackedRoutes: [ + VWidget( + path: '/spaces/:roomid', + widget: ChatDetails(), + buildTransition: _fadeTransition, + stackedRoutes: _chatDetailsRoutes, + ), VWidget( path: '/newprivatechat', widget: NewPrivateChat(), diff --git a/lib/pages/chat_list.dart b/lib/pages/chat_list.dart index 774c485dd..c190700e2 100644 --- a/lib/pages/chat_list.dart +++ b/lib/pages/chat_list.dart @@ -57,9 +57,10 @@ class ChatListController extends State { setState(() => _activeSpaceId = spaceId); } - void editSpace(BuildContext context, String spaceId) { + void editSpace(BuildContext context, String spaceId) async { Scaffold.of(context).openEndDrawer(); - VRouter.of(context).to('/rooms/$spaceId'); + await Matrix.of(context).client.getRoomById(spaceId).postLoad(); + VRouter.of(context).to('/spaces/$spaceId'); } List get spaces => diff --git a/lib/pages/views/chat_details_view.dart b/lib/pages/views/chat_details_view.dart index 9e6282d1b..18a31fe89 100644 --- a/lib/pages/views/chat_details_view.dart +++ b/lib/pages/views/chat_details_view.dart @@ -52,8 +52,11 @@ class ChatDetailsView extends StatelessWidget { SliverAppBar( leading: IconButton( icon: Icon(Icons.close_outlined), - onPressed: () => - VRouter.of(context).to('/rooms/${controller.roomId}'), + onPressed: () => VRouter.of(context) + .path + .startsWith('/spaces/') + ? VRouter.of(context).pop() + : VRouter.of(context).to('/rooms/${controller.roomId}'), ), elevation: Theme.of(context).appBarTheme.elevation, expandedHeight: 300.0,