You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
car_customer_app/lib/views/dashboard/widgets/bottom_nav_bar.dart

63 lines
2.7 KiB
Dart

import 'package:car_customer_app/view_models/dashboard_view_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/theme/colors.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart';
class CustomBottomNavbar extends StatelessWidget {
const CustomBottomNavbar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
DashboardVM dashboardVM = context.watch<DashboardVM>();
return BottomNavigationBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: SvgPicture.asset(MyAssets.providersIcon).paddingAll(5),
activeIcon: SvgPicture.asset(MyAssets.providersIcon, color: MyColors.darkIconColor).paddingAll(5),
label: LocaleKeys.providers.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(MyAssets.appointmentsIcon).paddingAll(5),
activeIcon: SvgPicture.asset(MyAssets.appointmentsIcon, color: MyColors.darkIconColor).paddingAll(5),
label: LocaleKeys.appointments.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(
MyAssets.homeIcon,
color: MyColors.lightIconColor,
).paddingAll(5),
activeIcon: SvgPicture.asset(MyAssets.homeIcon, color: MyColors.darkIconColor).paddingAll(5),
label: LocaleKeys.home.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(MyAssets.announcementIcon).paddingAll(5),
activeIcon: SvgPicture.asset(MyAssets.announcementIcon, color: MyColors.darkIconColor).paddingAll(5),
label: LocaleKeys.ads.tr(),
),
BottomNavigationBarItem(
icon: SvgPicture.asset(MyAssets.settingsIcon).paddingAll(5),
activeIcon: SvgPicture.asset(MyAssets.settingsIcon, color: MyColors.darkIconColor).paddingAll(5),
label: LocaleKeys.settings.tr(),
),
],
currentIndex: dashboardVM.selectedNavbarBarIndex,
type: BottomNavigationBarType.fixed,
selectedItemColor: MyColors.darkIconColor,
showSelectedLabels: true,
showUnselectedLabels: true,
unselectedItemColor: MyColors.lightTextColor,
unselectedFontSize: 11,
selectedFontSize: 11,
selectedLabelStyle: const TextStyle(fontFamily: "Poppins"),
unselectedLabelStyle: const TextStyle(fontFamily: "Poppins"),
onTap: (index) => dashboardVM.onNavbarTapped(index),
);
}
}