From 2ebefddbe010e4d27c39833620a68a71a2303629 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 1 Aug 2021 07:54:44 +0200 Subject: [PATCH] feat: Implement basic space editing --- lib/pages/chat_list.dart | 5 +++++ lib/pages/views/chat_list_view.dart | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/pages/chat_list.dart b/lib/pages/chat_list.dart index aa0eb155..dd5e4fc9 100644 --- a/lib/pages/chat_list.dart +++ b/lib/pages/chat_list.dart @@ -48,6 +48,11 @@ class ChatListController extends State { setState(() => _activeSpaceId = spaceId); } + void editSpace(BuildContext context, String spaceId) { + Scaffold.of(context).openEndDrawer(); + VRouter.of(context).to('/rooms/$spaceId'); + } + List get spaces => Matrix.of(context).client.rooms.where((r) => r.isSpace).toList(); diff --git a/lib/pages/views/chat_list_view.dart b/lib/pages/views/chat_list_view.dart index 18281020..427505d6 100644 --- a/lib/pages/views/chat_list_view.dart +++ b/lib/pages/views/chat_list_view.dart @@ -348,6 +348,11 @@ class ChatListView extends StatelessWidget { title: Text(space.displayname), onTap: () => controller.setActiveSpaceId( context, space.id), + trailing: IconButton( + icon: Icon(Icons.edit_outlined), + onPressed: () => + controller.editSpace(context, space.id), + ), ); }, ),