title: Flutter Bottom Navigation Bar with PageView
body: <p>I want to build bottom navigation bar with a pageview. It will be 3 pages and you can transition left or right. I can slide but my navigation bar selected items color doesn't change. Can you help me?</p>
  
  <pre><code>class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() =&gt; _HomePageState();
  }
  class _HomePageState extends State&lt;HomePage&gt; {
  int _selectedIndex = 0;
  final PageController _pageController = PageController();
  
  @override
  Widget build(BuildContext context) {
  return Scaffold(
    bottomNavigationBar: BottomNavigationBar(
      items: [
        BottomNavigationBarItem(
            icon: Icon(Icons.portrait), title: Text('Profile')),
        BottomNavigationBarItem(icon: Icon(Icons.home), title: Text('Home')),
        BottomNavigationBarItem(
            icon: Icon(Icons.shopping_cart), title: Text('Shop'))
      ],
      onTap: _onTappedBar,
      selectedItemColor: Colors.orange,
      currentIndex: _selectedIndex,
    ),
    body: PageView(
      controller: _pageController,
      children: &lt;Widget&gt;[
        ProfilePage(),
        HomeTables(),
        ShoppingPage(),
      ],
    ),
  );
  }
  
  void _onTappedBar(int value) {
  setState(() {
    _selectedIndex = value;
  });
  _pageController.jumpToPage(value);
  }
  }
  </code></pre>