Abdirashid kherye
Abdirashid kherye

Reputation: 1

Change the bottom navigation index without opening screen on button press

I have a persistent bottom navigation bar with five tabs. On the index 2 screen, there are three tabs, with the last one being "Cart". all my screens, there's a floating cart details widget visible across all tabs. When the user clicks on the floating cart details, I want to navigate to tab 3 of index 2, now I can push to tab 3 but index is not chaning.

onpresed is comming all screen since I have flaoting cart details in all screen when I click I want to always change index to 2 and then 2 tab sicne cart screen is tab

Navigator.push(
  context,
  PageRouteBuilder(
    pageBuilder: (parentContext, animation, secondaryAnimation) {
      return HomeMenues(2);
    },
  ),
);

this olny push this creen for tab 3 but is not changing index

Upvotes: 0

Views: 54

Answers (0)

Related Questions