title: How to create a dynamic TabBarView/ Render a new Tab with a function in Flutter?
body: <p>So I have been learning flutter in a while and I am stuck in this. Sorry if it is a noobish question. I am currently trying to build something like a Card Tab. The information and widget will be stored in a card.</p>
  
  <p>Imagine something like Tinder, where they have multiple card stack and swipe left and right to navigate.</p>
  
  <p>I plan to create that but I cannot seems to find a way to add/render a new card with a button. </p>
  
  <p>It's like adding something to the list, Flutter will use a ListView builder where we add to the list. But there is no TabBarView builder. Is this something that is not possible to do? I try putting a list inside a tab but it's still wont be the same.</p>
  
  <p>I created some basic skeleton here to help convey my meaning. So the card will be swipe left and right and there is a button in the appBar to add card. Lenght is 2 now and I wanted the button to render the 3rd card. Is this possible?</p>
  
  <p>Thanks in advance!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import 'package:flutter/material.dart';
  
  void main() {
    runApp(new MaterialApp(
      home: new CardStack(),
  
    ));
  }
  
  
  class CardStack extends StatefulWidget {
    @override
    _MainState createState() =&gt; new _MainState();
  }
  
  
  class _MainState extends State&lt;CardStack&gt; with SingleTickerProviderStateMixin {
  
    TabController _cardController;
  
    @override
    void initState() {
      super.initState();
      _cardController = new TabController(vsync: this, length: 2);
    }
  
    @override
    void dispose() {
      _cardController.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
  
      return new Scaffold(
        backgroundColor: Colors.grey[300],
        appBar: new AppBar(
            actions: &lt;Widget&gt;[
              new IconButton(
                icon: const Icon(Icons.add),
                tooltip: 'Add Tabs',
                onPressed: null,
              ),
            ],
            title: new Text("Title Here"),
            bottom: new PreferredSize(
            preferredSize: const Size.fromHeight(20.0),
            child: new Theme(
              data: Theme.of(context).copyWith(accentColor: Colors.grey),
              child: new Container(
                height: 50.0,
                alignment: Alignment.center,
                child: new TabPageSelector(controller: _cardController),
              ),
            )
          )
        ),
        body: new TabBarView(
          controller: _cardController,
          children: &lt;Widget&gt;[
            new Center(
              child: new Card(
                child: new Container(
                    height: 450.0,
                    width: 300.0,
                    child: new IconButton(
                      icon: new Icon(Icons.favorite, size: 100.0),
                      tooltip: 'Favorited',
                      onPressed: null,
                    )
                ),
              ),
            ),
            new Center(
              child: new Card(
                child: new Container(
                    height: 450.0,
                    width: 300.0,
                    child: new IconButton(
                      icon: new Icon(Icons.local_pizza, size: 50.0,),
                      tooltip: 'Pizza',
                      onPressed: null,
                    )
                ),
              ),
            ),
          ],
        ),
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>