title: How to programmatically select BottomNavigationBar Tab in Flutter instead of built in onTap callback?
body: <p>I have been working with BottomNavigationBar in the flutter, but I am not able to select a Tab programmatically outside of onTap callback of BottomNavigationBar.</p>
  
  <p>The code with onTap callback, which is working:</p>
  
  <pre><code>    return new BottomNavigationBar(
    items: &lt;BottomNavigationBarItem&gt;[
      _bottomNavigationItem(Icons.account_circle, DrawerTitles.CONTACTS),
      _bottomNavigationItem(Icons.delete, DrawerTitles.DELETED_CONTACTS),
      _bottomNavigationItem(Icons.list, DrawerTitles.LOGS),
    ],
    onTap: (int index) {
      setState(() {
        navigationIndex = index;
        switch (navigationIndex) {
          case 0:
            handleBottomNavigationBarClicks(DrawerTitles.CONTACTS);
            break;
          case 1:
            handleBottomNavigationBarClicks(DrawerTitles.DELETED_CONTACTS);
            break;
          case 2:
            handleBottomNavigationBarClicks(DrawerTitles.LOGS);
            break;
        }
      });
    },
    currentIndex: navigationIndex,
    fixedColor: Colors.blue[400],
    type: BottomNavigationBarType.fixed,
  );
  </code></pre>
  
  <p>But I want to change the tabs outside of onTap callback.</p>
  
  <p>I have tried changing the index used by BottomNavigatioBar outside of onTap callBack, but it didn't work.</p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code>void changeTabs(int tabIndex) {
  setState(() {
       navigationIndex = tabIndex;
  });}
  </code></pre>
  
  <p>Here is a <a href="https://gist.github.com/harsh159357/62f338a196b0e5edad7aed5017dae3e5" rel="noreferrer">gist</a> for the code.</p>
  
  <p>Is there any way available to change Tabs?</p>