badge on work list in bottom navigation bar.

merge-requests/1/merge
Sikander Saleem 3 years ago
parent 68146ecd97
commit 04520250a5

@ -323,68 +323,74 @@ class _DashboardScreenState extends State<DashboardScreen> {
drawer: SafeArea( drawer: SafeArea(
child: AppDrawer(), child: AppDrawer(),
), ),
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: SizedBox(
items: <BottomNavigationBarItem>[ height: 70,
BottomNavigationBarItem( child: BottomNavigationBar(
icon: Padding( items: <BottomNavigationBarItem>[
padding: const EdgeInsets.all(4.0), BottomNavigationBarItem(
child: SvgPicture.asset( icon: SvgPicture.asset(
"assets/icons/home.svg", "assets/icons/home.svg",
width: 20, color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
height: 20, ).paddingAll(4),
), label: LocaleKeys.home.tr(),
), ),
label: LocaleKeys.home.tr(), BottomNavigationBarItem(
), icon: SvgPicture.asset(
BottomNavigationBarItem(
icon: Padding(
padding: const EdgeInsets.all(4.0),
child: SvgPicture.asset(
"assets/icons/create_req.svg", "assets/icons/create_req.svg",
width: 20, color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
height: 20, ).paddingAll(4),
), label: LocaleKeys.createRequest.tr(),
), ),
label: LocaleKeys.createRequest.tr(), BottomNavigationBarItem(
), icon: Stack(
BottomNavigationBarItem( alignment: Alignment.centerLeft,
icon: Padding( children: [
padding: const EdgeInsets.all(4.0), SvgPicture.asset(
child: SvgPicture.asset( "assets/icons/work_list.svg",
"assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
width: 20, ).paddingAll(4),
height: 20, Consumer<DashboardProviderModel>(
builder: (cxt, data, child) {
if (data.workListCounter == 0) {
return const SizedBox();
}
return Positioned(
right: 0,
top: 0,
child: Container(
padding: const EdgeInsets.only(left: 4, right: 4),
alignment: Alignment.center,
decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
child: data.workListCounter.toString().toText10(color: Colors.white),
),
);
},
),
],
), ),
label: LocaleKeys.workList.tr(),
), ),
label: LocaleKeys.workList.tr(), BottomNavigationBarItem(
), icon: SvgPicture.asset(
BottomNavigationBarItem(
icon: Padding(
padding: const EdgeInsets.all(4.0),
child: SvgPicture.asset(
"assets/icons/item_for_sale.svg", "assets/icons/item_for_sale.svg",
width: 20, color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
height: 20, ).paddingAll(4),
), label: LocaleKeys.itemsForSale.tr(),
), ),
label: LocaleKeys.itemsForSale.tr(), ],
), currentIndex: currentIndex,
], selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
currentIndex: currentIndex, unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
selectedLabelStyle: TextStyle( type: BottomNavigationBarType.fixed,
fontSize: 8, selectedItemColor: MyColors.grey3AColor,
color: Color(0xff989898), backgroundColor: MyColors.backgroundColor,
fontWeight: FontWeight.w600, selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
), unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
unselectedLabelStyle: TextStyle( onTap: (int index) {
fontSize: 8, currentIndex = index;
color: Color(0xff989898), setState(() {});
fontWeight: FontWeight.w600, },
), ),
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.black,
backgroundColor: Color(0xffF8F8F8),
onTap: (index) {},
), ),
); );
} }

Loading…
Cancel
Save