getBottomNavigationBarItemIconWithBadge method

List<BottomNavigationBarItem> getBottomNavigationBarItemIconWithBadge({
  1. required bool showTabLabels,
})

Implementation

List<BottomNavigationBarItem> getBottomNavigationBarItemIconWithBadge(
    {required bool showTabLabels}) {
  List<BottomNavigationBarItem> bottomNavigationBarItemiconList = [];
  for (var element in widget.children) {
    Text? title = element.title as Text;
    String? titleString = title.data;
    bottomNavigationBarItemiconList.add(
      BottomNavigationBarItem(
        icon: NotificationBadge(
            count: element.badgeCount!, child: element.unSelectedLeading),
        activeIcon: NotificationBadge(
            count: element.badgeCount!, child: element.selectedLeading),
        label: showTabLabels ? titleString : null,
      ),
    );
  }
  return bottomNavigationBarItemiconList;
}