edsonbonfim / scroll_bars

Hide or show app bar and bottom navigation bar while scrolling.
48 stars 14 forks source link

[scroll_bottom_navigation_bar] BottomNavigationItems overflowed by 2.0 pixels on the bottom. #25

Open greyovo opened 2 years ago

greyovo commented 2 years ago

image

I have tried adjusting BottomNavigationBar's iconSize, (selected / unselected) fontSize, or wrapping the whole Scaffold with SafeArea(), but none of them works. Any workaround here?

My code:

  Widget _buildAppContainer() {
    return Scaffold(
      appBar: AppBar(toolbarHeight: 0, elevation: 0),
      body: ValueListenableBuilder<int>(
        valueListenable: appScrollController.bottomNavigationBar.tabNotifier,
        builder: (context, tabIndex, child) => _pageOptions[tabIndex],
      ),
      bottomNavigationBar: ScrollBottomNavigationBar(
        controller: appScrollController,
        showUnselectedLabels: false,
        items: const [
          BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
          BottomNavigationBarItem(icon: Icon(Icons.cloud_circle), label: 'Cloud'),
          BottomNavigationBarItem(icon: Icon(Icons.groups), label: 'Team'),
          BottomNavigationBarItem(icon: Icon(Icons.face), label: 'Me'),
        ],
        currentIndex: _selectedIndex,
        onTap: (index) => onTapNavItem(index),
        type: BottomNavigationBarType.shifting,
      ),
    );
  }
greyovo commented 2 years ago

I temporarily set Icon's size in BottomNavigationBarItem to '22.0' and fixed it:

BottomNavigationBarItem(icon: Icon(Icons.home, size: 22), label: 'Home')

But it is still a bug since setting BottomNavigationBar's iconSize or (selected / unselected) fontSize has NO effect on either icon size or text size.