add scrollbar to chips
This commit is contained in:
parent
128847dec2
commit
e2c171adec
1 changed files with 30 additions and 25 deletions
|
|
@ -83,34 +83,39 @@ final class const EmojiPicker({
|
|||
),
|
||||
SizedBox(
|
||||
height: 48,
|
||||
child: SuperListView(
|
||||
scrollDirection: .horizontal,
|
||||
child: Scrollbar(
|
||||
controller: categoryScrollController,
|
||||
listController: categoryListController,
|
||||
children: combined
|
||||
.mapIndexed(
|
||||
(index, category) => Padding(
|
||||
padding: .symmetric(horizontal: 4),
|
||||
child: FilterChip(
|
||||
label: Text(category.name),
|
||||
avatar: category.icon,
|
||||
selected: selectedCategory.value == index,
|
||||
showCheckmark: false,
|
||||
onSelected: (_) {
|
||||
selectedCategory.value = index;
|
||||
child: SuperListView(
|
||||
padding: .only(bottom: 12),
|
||||
scrollDirection: .horizontal,
|
||||
controller: categoryScrollController,
|
||||
listController: categoryListController,
|
||||
children: combined
|
||||
.mapIndexed(
|
||||
(index, category) => Padding(
|
||||
padding: .symmetric(horizontal: 4),
|
||||
child: FilterChip(
|
||||
label: Text(category.name),
|
||||
avatar: category.icon,
|
||||
selected: selectedCategory.value == index,
|
||||
showCheckmark: false,
|
||||
onSelected: (_) {
|
||||
selectedCategory.value = index;
|
||||
|
||||
listController.animateToItem(
|
||||
index: index,
|
||||
scrollController: scrollController,
|
||||
curve: (_) => Curves.easeInOut,
|
||||
duration: (_) => Duration(milliseconds: 300),
|
||||
alignment: 0,
|
||||
);
|
||||
},
|
||||
listController.animateToItem(
|
||||
index: index,
|
||||
scrollController: scrollController,
|
||||
curve: (_) => Curves.easeInOut,
|
||||
duration: (_) =>
|
||||
Duration(milliseconds: 300),
|
||||
alignment: 0,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
|
|
|||
Loading…
Reference in a new issue