title: Trying to add a pageview controller without success....completely new at this
body: <p>I am completely new at coding and of course I am trying to tackle one of the largest projects I can think of.... anyways. I am running into a huge wall when it comes to my current stage of coding. I have a defaultTabController at the upper portion of the screen with the functionality to switch in between two tabs. I would also like to have a bottomNavigationBar at the bottom of the application with 5 buttons that navigate to additional pages.</p>
  <p>I have been attempting to add this code <code>PageView(controller: _pageController, children: &lt;Widget&gt;[],)</code> to the body of my code, yet I am either getting an overload of errors or only the top or bottom nav bars are active. If someone could show me what I'm doing wrong, I would be so grateful!</p>
  <pre><code>    class HomeScreen extends StatefulWidget {
    @override
    _HomeScreenState createState() =&gt; _HomeScreenState();
  }
  
  class _HomeScreenState extends State&lt;HomeScreen&gt; {
  
    int _currentTab = 0;
    PageController _pageController;
  
    @override
    void initState() {
      super.initState();
      _pageController = PageController();
    }
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: DefaultTabController(
          length: 2,
          child: Scaffold(
            extendBodyBehindAppBar: true,
            extendBody: true,
            appBar: AppBar(
              backgroundColor:
              Colors.grey.withOpacity(0.5),
                title: Text(
                  'TREBLE',
                  style: TextStyle(
                    color: Colors.black,
                      fontFamily: &quot;treblefont&quot;,
                      fontSize: (33.0)
            ),
            ),
              bottom: TabBar(
                tabs: &lt;Widget&gt;[
                  Tab(text: &quot;Following&quot;),
                  Tab(text: &quot;trending&quot;),
                ],
              )
            ),
            body:
            TabBarView(
              children: &lt;Widget&gt;[
                FeedScreen(),
                TrendingScreen(),
              ],
            ),
            bottomNavigationBar: CupertinoTabBar(
              currentIndex: _currentTab,
              onTap: (int index) {
                setState(() {
                  _currentTab = index;
                });
              },
              activeColor: Colors.black,
              backgroundColor: Colors.white.withOpacity(0.5),
              items: [
                BottomNavigationBarItem(
                  icon: Icon(
                    Icons.home,
                    size: 32.0,
                  ),
                ),
                BottomNavigationBarItem(
                  icon: Icon(
                    Icons.search,
                    size: 32.0,
                  ),
                ),
                BottomNavigationBarItem(
                  icon: Icon(
                    Icons.camera_enhance,
                    size: 32.0,
                  ),
                ),
                BottomNavigationBarItem(
                  icon: Icon(
                    Icons.notifications,
                    size: 32.0,
                  ),
                ),
                BottomNavigationBarItem(
                  icon: Icon(
                    Icons.account_circle,
                    size: 32.0,
                  ),
                ),
  
              ],
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>I attempt to insert the code here:</p>
  <pre><code>        )
        ),
        body:
  PageView(controller: _pageController, children: &lt;Widget&gt;[],)
        TabBarView(
          children: &lt;Widget&gt;[
            FeedScreen(),
            TrendingScreen(),
          ],
        ),
        bottomNavigationBar: CupertinoTabBar(
          currentIndex: _currentTab,
          onTap: (int index) {
            setState(() {
              _currentTab = index;
            });
          },
  </code></pre>
  <p><a href="https://i.stack.imgur.com/texyR.jpg" rel="nofollow noreferrer">line of code screenshot</a>
  <a href="https://i.stack.imgur.com/dQSu6.jpg" rel="nofollow noreferrer">Specific error readout screenshot</a></p>