title: Flutter change CupertinoTabBar background color dynamically
body: <p>I want to change background color of tab. I have 5 tabs, and I want only first tab's background to be transparent. Also active color and inactive color too.</p>
  
  <p>tab bar code looks like this:</p>
  
  <pre><code>return new WillPopScope(
    onWillPop: () =&gt; new Future&lt;bool&gt;.value(true),
    child: new CupertinoTabScaffold(
      tabBar: new CupertinoTabBar(
        backgroundColor: Colors.white, //change here
        activeColor: Colors.black, // here 
        inactiveColor: Colors.grey, // here too
        items: const &lt;BottomNavigationBarItem&gt;[
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            title: Text('Home'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.access_time),
            title: Text('Timeline'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.chat_bubble_outline),
            title: Text('Talk'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.search),
            title: Text('Search'),
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.account_circle),
            title: Text('Profile'),
          ),
        ],
      ),
      tabBuilder: (BuildContext context, int index) {
        return new DefaultTextStyle(
          style: const TextStyle(
            fontFamily: '.SF UI Text',
            fontSize: 17.0,
            color: CupertinoColors.black,
          ),
          child: new CupertinoTabView(
            builder: (BuildContext context) {
              switch (index) {
                case 0:
                  return HomeScreen();
                  break;
                case 1:
                  return TimelineScreen();
                  break;
                case 2:
                  return TalkScreen();
                  break;
                case 3:
                  return SearchScreen();
                  break;
                case 4:
                  return ProfileScreen();
                  break;
                default:
                  break;
              }
            },
          ),
        );
      },
    ),
  );
  </code></pre>
  
  <p>I tried set variable <code>_currentIndex</code> and changed depends on which index user is but I can't call <code>setState</code> because error says:</p>
  
  <blockquote>
    <p>flutter: The following assertion was thrown building _TabSwitchingView(dirty, state:<br>
    flutter: _TabSwitchingViewState#86c7b):<br>
    flutter: setState() or markNeedsBuild() called during build.<br>
    flutter: This HomeScreen widget cannot be marked as needing to build because the framework is already in the<br>
    flutter: process of building widgets. A widget can be marked as needing to be built during the build phase<br>
    flutter: only if one of its ancestors is currently building. This exception is allowed because the framework<br>
    flutter: builds parent widgets before children, which means a dirty descendant will always be built.<br>
    flutter: Otherwise, the framework might not visit this widget during this build phase.</p>
  </blockquote>
  
  <p>Does anyone have an idea to acheive this? </p>