title: How can I add navigation code to flutter list view?
body: <blockquote>
    <p>I am having trouble inserting navigation links within my code below. I would like to learn how to insert navigation links within the second</p>
  </blockquote>
  
  <pre><code>onPressed: () {
  </code></pre>
  
  <p>//TODO(implement). 
  }</p>
  
  <blockquote>
    <p>The ListView Widgets: Approved, Pending etc are the items that should contain links to other pages. The pages will be accessed by clicking on the FontAwesome.chevronRight</p>
  </blockquote>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:font_awesome_flutter/font_awesome_flutter.dart';
  
  class AppTab2 extends StatefulWidget {
    @override
    _AppTab2State createState() =&gt; _AppTab2State();
  }
  
  class _AppTab2State extends State&lt;AppTab2&gt; {
    PageController _pageController = PageController(initialPage: 2);
  
    @override
    build(BuildContext context) {
      final Map&lt;String, Widget&gt; pages = &lt;String, Widget&gt;{
        'My Music': Center(
          child: Text('My Music not implemented'),
        ),
        'Shared': Center(
          child: Text('Shared not implemented'),
        ),
        'Feed': Feed(),
      };
      TextTheme textTheme = Theme.of(context).textTheme;
      return Stack(
        children: [
          Container(
            decoration: BoxDecoration(
                // Gradient color the background
                gradient: LinearGradient(
              begin: FractionalOffset.topCenter,
              end: FractionalOffset.bottomCenter,
              colors: [
                const Color.fromARGB(255, 253, 72, 72),
                const Color.fromARGB(255, 87, 97, 249),
              ],
              stops: [0.0, 1.0],
            )),
  //          child: Align(
  //            alignment: FractionalOffset.bottomCenter,
  //            child: Container(
  //              padding: const EdgeInsets.all(10.0),
  //              child: Text(
  //                'Demo',
  //                style: textTheme.headline.copyWith(
  //                  color: Colors.grey.shade800.withOpacity(0.8),
  //                  fontWeight: FontWeight.bold,
  //                ),
  //              ),
  //            ),
  //          ),
          ),
          Scaffold(
            backgroundColor: Colors.white,
  //          appBar: AppBar(
  //            backgroundColor: const Color(0x00000000),
  //            elevation: 0.0,
  //            leading: Center(
  //              child: ClipOval(
  //                child: Image.network(
  //                  'http://i.imgur.com/TtNPTe0.jpg',
  //                ),
  //              ),
  //            ),
  //            actions: [
  //              IconButton(
  //                icon: Icon(Icons.add),
  //                onPressed: () {
  //                  // TODO: implement
  //                },
  //              ),
  //            ],
  ////            title: const Text('tofu\'s songs'),
  //            bottom: CustomTabBar(
  //              pageController: _pageController,
  //              pageNames: pages.keys.toList(),
  //            ),
  //          ),
            body: PageView(
              controller: _pageController,
              children: pages.values.toList(),
            ),
          ),
        ],
      );
    }
  }
  
  class CustomTabBar extends AnimatedWidget implements PreferredSizeWidget {
    CustomTabBar({this.pageController, this.pageNames})
        : super(listenable: pageController);
  
    final PageController pageController;
    final List&lt;String&gt; pageNames;
  
    @override
    final Size preferredSize = Size(0.0, 40.0);
  
    @override
    Widget build(BuildContext context) {
      TextTheme textTheme = Theme.of(context).textTheme;
      return Container(
        height: 40.0,
        margin: const EdgeInsets.all(10.0),
        padding: const EdgeInsets.symmetric(horizontal: 20.0),
        decoration: BoxDecoration(
          color: Colors.grey.shade800.withOpacity(0.5),
          borderRadius: BorderRadius.circular(20.0),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: List.generate(pageNames.length, (int index) {
            return InkWell(
                child: Text(pageNames[index],
                    style: textTheme.subhead.copyWith(
                      fontSize: 30.0,
                      fontFamily: 'OpenSans',
                      color: Colors.white.withOpacity(
                        index == pageController.page ? 1.0 : 0.2,
                      ),
                    )),
                onTap: () {
                  pageController.animateToPage(
                    index,
                    curve: Curves.easeOut,
                    duration: const Duration(milliseconds: 300),
                  );
                });
          }),
        ),
      );
    }
  }
  
  class Feed extends StatefulWidget {
    @override
    _FeedState createState() =&gt; _FeedState();
  }
  
  class _FeedState extends State&lt;Feed&gt; {
    @override
    Widget build(BuildContext context) {
      return ListView(
        children: [
          Content(
            title: 'Approved',
          ),
          Content(
            title: 'Pending',
          ),
          Content(
            title: 'Published',
          ),
          Content(
            title: 'Withdrawn',
          ),
          Content(
            title: 'Declined',
          ),
          Content(
            title: 'Content Rights',
          ),
        ],
      );
    }
  }
  
  class Content extends StatefulWidget {
    const Content({
      this.title,
    });
  
    final String title;
  
    @override
    _ContentState createState() =&gt; _ContentState();
  }
  
  class _ContentState extends State&lt;Content&gt; {
    @override
    Widget build(BuildContext context) {
      TextTheme textTheme = Theme.of(context).textTheme;
      return Container(
          margin: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 5.0),
          padding: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
          decoration: BoxDecoration(
            color: Colors.grey.shade300.withOpacity(0.5),
            borderRadius: BorderRadius.circular(5.0),
          ),
          child: IntrinsicHeight(
            child: Row(
              children: &lt;Widget&gt;[
  //              Container(
  //                margin:
  //                    const EdgeInsets.only(top: 4.0, bottom: 4.0, right: 10.0),
  //                child: CircleAvatar(
  //                  backgroundImage: NetworkImage(
  //                      'http://thecatapi.com/api/images/get?format=src'
  //                      '&amp;size=small&amp;type=jpg#${title.hashCode}'),
  //                  radius: 20.0,
  //                ),
  //              ),
                SizedBox(
                  height: 15.0,
                ),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children: &lt;Widget&gt;[
                      Text(widget.title, style: textTheme.subhead),
                    ],
                  ),
                ),
                Container(
                  margin: EdgeInsets.symmetric(horizontal: 5.0),
                  child: InkWell(
                    child: Icon(
                      FontAwesomeIcons.chevronRight,
                      size: 25.0,
                      color: Colors.deepPurpleAccent,
                    ),
                    onTap: () {
                      // TODO(implement)
                    },
                  ),
                ),
                Container(
                  margin: EdgeInsets.symmetric(horizontal: 5.0),
                  child: InkWell(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: &lt;Widget&gt;[
  //                      Icon(Icons.favorite, size: 25.0),
  //                      Text('${likes ?? ''}'),
                      ],
                    ),
                    onTap: () {
                      // TODO(implement)
                    },
                  ),
                ),
              ],
            ),
          ));
    }
  }
  </code></pre>