PersistentBottomNavBarV2 icon indicating copy to clipboard operation
PersistentBottomNavBarV2 copied to clipboard

Style 3 - Text color not listening to inactive color setting

Open kyleb-app opened this issue 3 years ago • 2 comments

I am using style 3 of this nav bar, and the text color is not listening to the inactive color setting. It is only showing in the active color for all nav items.

Screenshot

I apologize for the code formatted in this issue, I can not find out how to make it support code better. I clicked the code button?

List<PersistentBottomNavBarItem> _navBarsItems() {
    return [
      PersistentBottomNavBarItem(
        icon: SvgPicture.asset(
            'assets/images/home.svg',
            semanticsLabel: 'Home Button',
            color: _controller.index == 0 ? color_bluepurple : Colors.grey,
        ),
        title: "Home",
        activeColorPrimary: Color(0xFF623CEA),
        inactiveColorPrimary: Colors.grey,
      ),
      PersistentBottomNavBarItem(
        icon: SvgPicture.asset(
          'assets/images/products.svg',
          semanticsLabel: 'Products Button',
          color: _controller.index == 1 ? color_bluepurple : Colors.grey,
        ),
        title: "Products",
        activeColorPrimary: Color(0xFF623CEA),
        inactiveColorPrimary: Colors.grey,
      ),
      PersistentBottomNavBarItem(
        icon: SvgPicture.asset(
          'assets/images/restock.svg',
          semanticsLabel: 'Products Button',
          color: _controller.index == 2 ? color_bluepurple : Colors.grey,
        ),
        title: "Restock",
        activeColorPrimary: Color(0xFF623CEA),
        inactiveColorPrimary: Colors.grey,
      ),
      PersistentBottomNavBarItem(
        icon: SvgPicture.asset(
          'assets/images/more.svg',
          semanticsLabel: 'Products Button',
          color: _controller.index == 3 ? color_bluepurple : Colors.grey,
        ),
        title: "More",
        activeColorPrimary: Color(0xFF623CEA),
        inactiveColorPrimary: Colors.grey,
      ),

    ];
  }

return PersistentTabView(
        context,
        controller: _controller,
        screens: _buildScreens(),
        items: _navBarsItems(),
        confineInSafeArea: true,
        backgroundColor: Colors.white,
        // Default is Colors.white.
        handleAndroidBackButtonPress: true,
        // Default is true.
        resizeToAvoidBottomInset: true,
        // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
        stateManagement: false,
        // Default is true.
        hideNavigationBarWhenKeyboardShows: true,
        // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
        decoration: NavBarDecoration(
          borderRadius: BorderRadius.circular(10.0),
          colorBehindNavBar: Colors.white,
        ),
        popAllScreensOnTapOfSelectedTab: true,
        popActionScreens: PopActionScreensType.all,
        itemAnimationProperties: ItemAnimationProperties( // Navigation Bar's items animation properties.
          duration: Duration(milliseconds: 200),
          curve: Curves.ease,
        ),
        screenTransitionAnimation: ScreenTransitionAnimation( // Screen transition animation on change of selected tab.
          animateTabTransition: true,
          curve: Curves.ease,
          duration: Duration(milliseconds: 200),
        ),
        navBarStyle: NavBarStyle
            .style3, // Choose the nav bar style with this property.
      );

kyleb-app avatar Oct 20 '22 23:10 kyleb-app

Was able to fix this by setting activeColorPrimary to something like: _controller.index == 1 ? color_bluepurple : Colors.grey,

kyleb-app avatar Oct 20 '22 23:10 kyleb-app

Okay, yeah the issue was fixed with the latest PR, but I just didnt publish that... Gonna do that now, should work afterwards

jb3rndt avatar Oct 30 '22 09:10 jb3rndt

Please reopen if the issue persists

jb3rndt avatar Nov 13 '22 16:11 jb3rndt