rowTabs method
Implementation
Widget rowTabs(
List<TabData> tabs,
Function(int position, String title, Color? tabColor) onTabChangedListener,
) {
return SafeArea(
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: tabs
.map(
(t) => TabItem(
key: t.key,
tabStyle: tabStyle,
selected: t.key == tabs[currentSelected].key,
iconData: t.iconData,
title: t.title,
iconColor: inactiveIconColor ?? Colors.black,
textColor: textColor ?? Colors.black,
backGroundGradientColor: t.tabGradient,
tabColor: t.tabColor ?? inactiveIconColor ?? Colors.black,
borderRadius: t.borderRadius,
callbackFunction: (uniqueKey) {
int selected = tabs.indexWhere((tabData) =>
tabData.key.toString() == uniqueKey.toString());
_setSelected(uniqueKey);
_initAnimationAndStart(_circleAlignX, 1);
onTabChangedListener(
selected, t.title, inactiveIconColor ?? Colors.black);
},
),
)
.toList(),
),
);
}