fix: Let bottom space bar scroll

This commit is contained in:
Krille Fear 2021-11-15 10:09:23 +01:00
parent a5f1925f03
commit ecd93b0a37

View File

@ -29,41 +29,48 @@ class SpacesBottomBar extends StatelessWidget {
false) || false) ||
(sync.rooms?.leave?.isNotEmpty ?? false)), (sync.rooms?.leave?.isNotEmpty ?? false)),
builder: (context, snapshot) { builder: (context, snapshot) {
return SalomonBottomBar( return Container(
itemPadding: const EdgeInsets.all(8), height: 56,
currentIndex: currentIndex, alignment: Alignment.center,
onTap: (i) => controller.setActiveSpaceId( child: SingleChildScrollView(
context, scrollDirection: Axis.horizontal,
i == 0 ? null : controller.spaces[i - 1].id, child: SalomonBottomBar(
), itemPadding: const EdgeInsets.all(8),
selectedItemColor: Theme.of(context).colorScheme.primary, currentIndex: currentIndex,
items: [ onTap: (i) => controller.setActiveSpaceId(
SalomonBottomBarItem( context,
icon: const Icon(CupertinoIcons.chat_bubble_2), i == 0 ? null : controller.spaces[i - 1].id,
activeIcon: const Icon(CupertinoIcons.chat_bubble_2_fill), ),
title: Text(L10n.of(context).allChats), selectedItemColor: Theme.of(context).colorScheme.primary,
items: [
SalomonBottomBarItem(
icon: const Icon(CupertinoIcons.chat_bubble_2),
activeIcon: const Icon(CupertinoIcons.chat_bubble_2_fill),
title: Text(L10n.of(context).allChats),
),
...controller.spaces
.map((space) => SalomonBottomBarItem(
icon: InkWell(
borderRadius: BorderRadius.circular(28),
onTap: () => controller.setActiveSpaceId(
context,
space.id,
),
onLongPress: () =>
controller.editSpace(context, space.id),
child: Avatar(
space.avatar,
space.displayname,
size: 24,
fontSize: 12,
),
),
title: Text(space.displayname),
))
.toList(),
],
), ),
...controller.spaces ),
.map((space) => SalomonBottomBarItem(
icon: InkWell(
borderRadius: BorderRadius.circular(28),
onTap: () => controller.setActiveSpaceId(
context,
space.id,
),
onLongPress: () =>
controller.editSpace(context, space.id),
child: Avatar(
space.avatar,
space.displayname,
size: 24,
fontSize: 12,
),
),
title: Text(space.displayname),
))
.toList(),
],
); );
}), }),
); );