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(
|
SizedBox(
|
||||||
height: 48,
|
height: 48,
|
||||||
child: SuperListView(
|
child: Scrollbar(
|
||||||
scrollDirection: .horizontal,
|
|
||||||
controller: categoryScrollController,
|
controller: categoryScrollController,
|
||||||
listController: categoryListController,
|
child: SuperListView(
|
||||||
children: combined
|
padding: .only(bottom: 12),
|
||||||
.mapIndexed(
|
scrollDirection: .horizontal,
|
||||||
(index, category) => Padding(
|
controller: categoryScrollController,
|
||||||
padding: .symmetric(horizontal: 4),
|
listController: categoryListController,
|
||||||
child: FilterChip(
|
children: combined
|
||||||
label: Text(category.name),
|
.mapIndexed(
|
||||||
avatar: category.icon,
|
(index, category) => Padding(
|
||||||
selected: selectedCategory.value == index,
|
padding: .symmetric(horizontal: 4),
|
||||||
showCheckmark: false,
|
child: FilterChip(
|
||||||
onSelected: (_) {
|
label: Text(category.name),
|
||||||
selectedCategory.value = index;
|
avatar: category.icon,
|
||||||
|
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(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue