jb3rndt / PersistentBottomNavBarV2

A highly customizable persistent bottom navigation bar for Flutter
https://pub.dev/packages/persistent_bottom_nav_bar_v2
BSD 3-Clause "New" or "Revised" License
49 stars 56 forks source link

Inactive icon shown as gray even though its set as white. #182

Closed TOMSLAUS closed 1 month ago

TOMSLAUS commented 1 month ago

How can I make innactive icons be white (the same color as active one) ? Heres the code to recreate my issue

PersistentTabView:

PersistentTabView(
  tabs: routers.navBarsItems(context),
  navBarBuilder: (navBarConfig) => Style6BottomNavBar(
    navBarDecoration: NavBarDecoration(color: Constants.primaryColor),
    navBarConfig: navBarConfig,
  ),
  gestureNavigationEnabled: true,
  controller: authModel.tabController,
  resizeToAvoidBottomInset: true,
  popAllScreensOnTapOfSelectedTab: false,
  popActionScreens: PopActionScreensType.all,
  screenTransitionAnimation: const ScreenTransitionAnimation(
    curve: Curves.ease,
    duration: Duration(milliseconds: 200),
  ),
)

Nav bar items:

List<PersistentTabConfig> navBarsItems(BuildContext context) {
  return [
    PersistentTabConfig(
      screen: TeamDashBoardPage(),
      item: ItemConfig(
        activeForegroundColor: Colors.white,
        inactiveBackgroundColor: Colors.white,
        icon: const FaIcon(
          FontAwesomeIcons.house,
        ),
        title: (t.misc.home),
      ),
    ),
    PersistentTabConfig(
      screen: UserPaymentsPage(),
      item: ItemConfig(
        activeForegroundColor: Colors.white,
        inactiveBackgroundColor: Colors.white,
        icon: const FaIcon(FontAwesomeIcons.creditCard),
        title: (t.user.myPayments),
      ),
    ),
    PersistentTabConfig(
      screen: ProfilePage(),
      item: ItemConfig(
        activeForegroundColor: Colors.white,
        inactiveBackgroundColor: Colors.white,
        icon: const FaIcon(FontAwesomeIcons.user),
        title: (t.user.profile),
      ),
    ),
  ];
}
jb3rndt commented 1 month ago

In your TabConfig it should refer to the foregroundColor instead of the backgroundColor:

...
inactiveForegroundColor: Colors.white,
...