getIcon method Null safety
- {required bool isSelected}
Returns an icon for a specific tab.
Will return filled icon if available and isSelected
is true.
Implementation
IconData getIcon({required bool isSelected}) {
switch (this) {
case BottomNavigationTab.home:
return isSelected ? AppIcons.homeFilled : AppIcons.home;
case BottomNavigationTab.search:
return isSelected ? AppIcons.searchFilled : AppIcons.search;
case BottomNavigationTab.reels:
return AppIcons.reels;
case BottomNavigationTab.store:
return AppIcons.shop;
case BottomNavigationTab.profile:
// TODO: Replace with proper icon from design.
return Icons.person_outline_rounded;
}
}