Can I use a TabBar and TabBarView as an in page widget?

Viewed 28377

In course of my exploration of the flutter framework I came across a problem, I didn't know how to solve. Can I use TabBar in combination with TabBarView as a child of other widgets?

2 Answers

If you have variable height in TabBarView, you can use Expanded.

body:
    ...
    new Expanded(
        child: new TabBarView(
          controller: _controller,
          children: <Widget>[
            new Card(
              child: new ListTile(
                leading: const Icon(Icons.home),
                title: new TextField(
                  decoration: const InputDecoration(hintText: 'Search for address...'),
                ),
              ),
            ),//Card
            .... 
            ....
          ],//Widget
        ),//TabBarView
      ),//Expanded
Related