add scrollbar to chips

This commit is contained in:
Henry Hiles 2026-09-16 15:56:45 -04:00
commit 8bc153024e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -83,34 +83,38 @@ final class const EmojiPicker({
), ),
SizedBox( SizedBox(
height: 48, height: 48,
child: SuperListView( child: Scrollbar(
scrollDirection: .horizontal,
controller: categoryScrollController, controller: categoryScrollController,
listController: categoryListController, child: SuperListView(
children: combined scrollDirection: .horizontal,
.mapIndexed( controller: categoryScrollController,
(index, category) => Padding( listController: categoryListController,
padding: .symmetric(horizontal: 4), children: combined
child: FilterChip( .mapIndexed(
label: Text(category.name), (index, category) => Padding(
avatar: category.icon, padding: .symmetric(horizontal: 4),
selected: selectedCategory.value == index, child: FilterChip(
showCheckmark: false, label: Text(category.name),
onSelected: (_) { avatar: category.icon,
selectedCategory.value = index; selected: selectedCategory.value == index,
showCheckmark: false,
onSelected: (_) {
selectedCategory.value = index;
listController.animateToItem( listController.animateToItem(
index: index, index: index,
scrollController: scrollController, scrollController: scrollController,
curve: (_) => Curves.easeInOut, curve: (_) => Curves.easeInOut,
duration: (_) => Duration(milliseconds: 300), duration: (_) =>
alignment: 0, Duration(milliseconds: 300),
); alignment: 0,
}, );
},
),
), ),
), )
) .toList(),
.toList(), ),
), ),
), ),
Expanded( Expanded(