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
47 stars 48 forks source link

[Bug]: bottom navigation bar shadow not affecting #141

Closed FaisalMohammadi closed 3 months ago

FaisalMohammadi commented 3 months ago

Version

5.2.0

What happened?

i am trying to set the shadow in DecoratedNavBar (navBarDecoration), but nothing happening. I have also tryed to do like this.

DecoratedBox(
      position: DecorationPosition.background,
      decoration: NavBarDecoration(
        borderRadius: bottomBarBorderRadius,
        color: Colors.white,
        padding: EdgeInsets.zero,
        boxShadow: <BoxShadow>[
          BoxShadow(
            color: Colors.black45.withOpacity(0.05),
            blurRadius: 15,
            offset: const Offset(0.0, -15),
          ),
        ],
      ),
      child: SafeArea(
        top: false,
        child: Container(
          clipBehavior: Clip.none,
          padding: EdgeInsets.zero,
          height: navBarConfig.navBarHeight,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: navBarConfig.items.map((item) {
              int index = navBarConfig.items.indexOf(item);
              int currentIndex = navBarConfig.selectedIndex;
              bool isSelected = currentIndex == index;
              return Expanded(
                child: InkWell(
                  onTap: () {
                    navBarConfig.onItemSelected(index);
                  },
                  child: index == 2
                      ? _buildBottomBarAddButton()
                      : _buildBottomBarItem(
                          item: item,
                          size: size,
                          bottomNavigationBarLogic:
                              bottomNavigationBarProvider,
                          index: index,
                          currentIndex: currentIndex,
                          icon: item.icon,
                          isSelected: isSelected,
                        ),
                ),
              );
            }).toList(),
          ),
        ),
      ),
    );

but still somehow i am not able to see the shadow. The setting for shadow is correct i am sure but it does not appear. i dont know am i doing something wrong or their is something or some setting that i am missing or dont see?

Code to reproduce the problem

DecoratedBox(
      position: DecorationPosition.background,
      decoration: NavBarDecoration(
        borderRadius: bottomBarBorderRadius,
        color: Colors.white,
        padding: EdgeInsets.zero,
        boxShadow: <BoxShadow>[
          BoxShadow(
            color: Colors.black45.withOpacity(0.05),
            blurRadius: 15,
            offset: const Offset(0.0, -15),
          ),
        ],
      ),
      child: SafeArea(
        top: false,
        child: Container(
          clipBehavior: Clip.none,
          padding: EdgeInsets.zero,
          height: navBarConfig.navBarHeight,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: navBarConfig.items.map((item) {
              int index = navBarConfig.items.indexOf(item);
              int currentIndex = navBarConfig.selectedIndex;
              bool isSelected = currentIndex == index;
              return Expanded(
                child: InkWell(
                  onTap: () {
                    navBarConfig.onItemSelected(index);
                  },
                  child: index == 2
                      ? _buildBottomBarAddButton()
                      : _buildBottomBarItem(
                          item: item,
                          size: size,
                          bottomNavigationBarLogic:
                              bottomNavigationBarProvider,
                          index: index,
                          currentIndex: currentIndex,
                          icon: item.icon,
                          isSelected: isSelected,
                        ),
                ),
              );
            }).toList(),
          ),
        ),
      ),
    );

Relevant log output

No response

Screenshots

grafik
FaisalMohammadi commented 3 months ago

Please anybody who can help, i need this fix as soon as possible.

jb3rndt commented 3 months ago

I found the problem, working on a solution.

jb3rndt commented 3 months ago

Fixed with version 5.2.1 :)

FaisalMohammadi commented 3 months ago

Thanks man that was quick. I can confirm this is fixed. 😀