rafalbednarczuk / curved_navigation_bar

Animated Curved Navigation Bar in Flutter
BSD 2-Clause "Simplified" License
683 stars 239 forks source link

the navigation is not re-rendering when one item changes or when called #137

Closed kristijorgji closed 3 months ago

kristijorgji commented 1 year ago

I have two issues with this library, in priority order are: 1 even if _buildNavigation method is called I can see "i am re-rendering" being printed but the items don't change. 2 If one of the items is streambuilder or blocbuilder and is re-rendered the full navigation does not re-render.

I can fix issue 1 with one ugly solution by providing always a random key, like this: key: Key(randomInt(0, 10000)) This will force the navigation to rerender and do what i want to do but will break my integration tests that find the navigation by id.

Widget _buildNavigation() {
print(' i am re-rendering');

return CurvedNavigationBar(
      key: HomePageKeys.bottomNavigationMenu,
      onTap: _onItemTapped,
      index: _currentIndex,
      height: 40,
      color: AppColors.Black,
      backgroundColor: backgroundColor,
      buttonBackgroundColor: AppColors.Primary,
      animationDuration: const Duration(milliseconds: 300),
      animationCurve: Curves.easeOutCubic,
      items: <Widget>[
        StreamBuilder(
            stream: stream,
            builder: (context, snapshot) {
              return Text(snapshot.data);
              );
            }),
      ],
    );
}
rafalbednarczuk commented 3 months ago

Could you provide a full example of what you exactly want to achieve? It might be not a problem with the curved_navigation_bar but in your code, I need full reproducible sample to look into it

rafalbednarczuk commented 3 months ago

closing as I can't reproduce, I'll reopen if someone finds a reproducible sample