title: How to use TabController
body: <p>I just learned flutter, I was confused how to use the TabController, I had followed what was described on the official website, but an error appeared, and I don't know how to fix it.</p>
  
  <p>I just want to change the title and leading from the appbar when changing tabs.</p>
  
  <pre><code>final List&lt;ChangeTitleAndLeading&gt; _data = [
    new ChangeTitleAndLeading(title: "Home", leading: Icon(Icons.home)),
    new ChangeTitleAndLeading(title: "Profile", leading: Icon(Icons.person)),
    new ChangeTitleAndLeading(title: "Friends", leading: Icon(Icons.people))
  ];
  
  ChangeTitleAndLeading _handler;
  TabController _controller;
  
  @override
  void initState() {
    super.initState();
  
    _checkEmailVerification();
  
    _controller = TabController(vsync: this, length: 3);
    _handler = _data[0];
    _controller.addListener(_handleSelected);
  }
  
  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
  
  void _handleSelected() {
    setState(() {
      _handler = _data[_controller.index];
    });
  }
  
  return MaterialApp(
    theme: new ThemeData(
      primarySwatch: Colors.teal,
    ),
    home: new Scaffold(
      appBar: new AppBar(
        leading: Icon(Icons.home),
        title: new Text("Home"),
        bottom: new TabBar(
          controller: _controller,
          tabs: _tabs,
        ),
      ),
  
      body: TabBarView(
        controller: _controller,
        children: _pages,
      ),
  
      floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: () {
            print('Current Index: ${_handler.title}');
          }
      ),
  
  class ChangeTitleAndLeading {
    final String title;
    final Widget leading;
  
    ChangeTitleAndLeading({
      @required this.title,
      @required this.leading
    }) :
      assert(title != null),
      assert(leading != null);
  }
  </code></pre>
  
  <p>Error log:</p>
  
  <blockquote>
    <p>Error Log:
        I/flutter (19638): No TabController for TabBarView.
        I/flutter (19638): When creating a TabBarView, you must either provide an explicit TabController using the "controller"
        I/flutter (19638): property or you must ensure that there is a DefaultTabController above the TabBarView.
    I/flutter (19638): In this case, there was neither an explicit controller nor a default controller.
        ════════════════════════════════════════════════════════════════════════════════════════════════════</p>
    
    <p>I/flutter (19638): Another exception was thrown: No TabController for TabBar.</p>
  </blockquote>
  
  <p>And when i change this:
   <code>leading: Icon(Icons.home),</code> to <code>leading: _handler.leading,</code>
  and this:
   <code>title: new Text("Home"),</code> to <code>title: new Text(_handler.title),</code>
  always return error <code>_handler.leading</code> or <code>_handler.title</code> was null</p>
  
  <p><a href="https://imgur.com/gallery/jjsdIsq" rel="noreferrer">Image</a></p>