buildItemBuilder method
Implementation
@override
Widget? buildItemBuilder(
AntdScrollItemContext<T, AntdScrollPositionController<T>> ctx) {
var tab = ctx.data;
var index = ctx.index;
return ValueListenableBuilder(
valueListenable: scrollController.currentIndex,
builder: (context, value, _) {
var active = scrollController.currentIndex.value == index;
return AntdBox(
disabled: tab.disabled,
onTap: () {
scrollController.switchTo(index);
},
style:
(active ? style.activeTitleStyle : style.titleStyle)?.copyWith(
alignment: Alignment.center,
),
child: buildHeader(tab, index, active),
);
});
}