itemBtn method
Implementation
Widget itemBtn({
required String name,
required AssetsSvg icon,
required AssetsSvg selectedIcon,
required EmPage page,
}) {
bool isSelected = page == bloc?.state.page;
return Expanded(
child: Stack(
alignment: Alignment.topCenter,
children: [
Container(
height: 4,
margin: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
color: isSelected ? AppColors.bPrimaryColor : Colors.transparent,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(4),
bottomRight: Radius.circular(4),
),
),
),
TextButton(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
isSelected
? selectedIcon.load(height: 20)
: icon.load(height: 20),
Gaps.hXxs,
Text(
name,
style: AppTypography.caption.copyWith(
color: isSelected ? AppColors.bPrimaryColor : Colors.grey,
),
),
],
),
onPressed: () => bloc?.add(OnClickTab(page: page)),
),
],
),
);
}