From 0a6a3529a0909594e1fb8960fc8aadf236910a70 Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Sun, 1 May 2022 12:13:40 +0200 Subject: [PATCH] fix: spces bottom sheet not scrollable Signed-off-by: TheOneWithTheBraid --- lib/pages/chat_list/spaces_drawer.dart | 95 +++++++++++++------------- pubspec.lock | 16 ++++- 2 files changed, 63 insertions(+), 48 deletions(-) diff --git a/lib/pages/chat_list/spaces_drawer.dart b/lib/pages/chat_list/spaces_drawer.dart index 298c3ef6d..14d846b28 100644 --- a/lib/pages/chat_list/spaces_drawer.dart +++ b/lib/pages/chat_list/spaces_drawer.dart @@ -29,54 +29,55 @@ class SpacesDrawer extends StatelessWidget { controller.snapBackSpacesSheet(); return false; }, - child: ListView.builder( - shrinkWrap: true, - itemCount: spaceHierarchy.length, - itemBuilder: (BuildContext context, int index) { - if (index == 0) { - return ListTile( - selected: currentIndex == index, - leading: const Icon(Icons.keyboard_arrow_down), - title: Text(L10n.of(context)!.allChats), - onTap: () => controller.setActiveSpacesEntry( - context, - null, - ), - ); - } else { - final space = spaceHierarchy.keys.toList()[index]; - final room = space.getSpace(context)!; - return ListTile( - selected: currentIndex == index, - leading: Avatar( - mxContent: room.avatar, - name: space.getName(context), - size: 24, - fontSize: 12, - ), - title: Text(space.getName(context)), - subtitle: room.topic.isEmpty - ? null - : Tooltip( - message: room.topic, - child: Text( - room.topic.replaceAll('\n', ' '), - softWrap: false, - overflow: TextOverflow.fade, + child: Column( + children: List.generate( + spaceHierarchy.length, + (index) { + if (index == 0) { + return ListTile( + selected: currentIndex == index, + leading: const Icon(Icons.keyboard_arrow_down), + title: Text(L10n.of(context)!.allChats), + onTap: () => controller.setActiveSpacesEntry( + context, + null, + ), + ); + } else { + final space = spaceHierarchy.keys.toList()[index]; + final room = space.getSpace(context)!; + return ListTile( + selected: currentIndex == index, + leading: Avatar( + mxContent: room.avatar, + name: space.getName(context), + size: 24, + fontSize: 12, + ), + title: Text(space.getName(context)), + subtitle: room.topic.isEmpty + ? null + : Tooltip( + message: room.topic, + child: Text( + room.topic.replaceAll('\n', ' '), + softWrap: false, + overflow: TextOverflow.fade, + ), ), - ), - onTap: () => controller.setActiveSpacesEntry( - context, - space, - ), - trailing: IconButton( - icon: const Icon(Icons.edit), - tooltip: L10n.of(context)!.edit, - onPressed: () => controller.editSpace(context, room.id), - ), - ); - } - }, + onTap: () => controller.setActiveSpacesEntry( + context, + space, + ), + trailing: IconButton( + icon: const Icon(Icons.edit), + tooltip: L10n.of(context)!.edit, + onPressed: () => controller.editSpace(context, room.id), + ), + ); + } + }, + ), ), ); } diff --git a/pubspec.lock b/pubspec.lock index 8922a3dc5..741d45cea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: adaptive_dialog url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.6.1" adaptive_theme: dependency: "direct main" description: @@ -878,6 +878,13 @@ packages: description: flutter source: sdk version: "0.0.0" + intersperse: + dependency: transitive + description: + name: intersperse + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" intl: dependency: "direct main" description: @@ -978,6 +985,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.2" + macos_ui: + dependency: transitive + description: + name: macos_ui + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.1" markdown: dependency: transitive description: