代码块:
bottomNavigationBar: NavigationBarTheme(
data: NavigationBarThemeData(
indicatorColor: appcolor.black,
backgroundColor: appcolor.white,
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
height: 60.h,
labelTextStyle: MaterialStateProperty.all(
TextStyle(fontWeight: FontWeight.bold, fontSize: 10.sp),
),
),
child: NavigationBar(
animationDuration: Duration(milliseconds: 300),
selectedIndex: pageindex,
onDestinationSelected: (value) {
setState(() {
pageindex = value;
});
vibration(type: FeedbackType.light);
},
destinations: [
NavigationDestination(
icon: SvgPicture.asset(
'assets/images/home.svg',
color: pageindex == 0 ? appcolor.white : null,
width: iconsize,
),
label: 'HOME'),
NavigationDestination(
icon: SvgPicture.asset('assets/images/Discovery.svg',
width: iconsize,
color: pageindex == 1 ? appcolor.white : null),
label: 'DISCOVERY'),
NavigationDestination(
icon: SvgPicture.asset('assets/images/Profile.svg',
width: iconsize,
color: pageindex == 2 ? appcolor.white : null),
label: 'PROFILE'),
],
),
),
评论