Как настроить 2 уровня / строки TabBar, используя AppBar внизу? - PullRequest
0 голосов
/ 04 мая 2019

Можно ли настроить 2 уровня или строки TabBar, используя нижнюю часть AppBar, или мне нужно использовать другие методы?

Ниже приведен код и ожидаемое изображение:

Widget build(BuildContext context) {

    return new DefaultTabController(
        length: 2,
        child: new Scaffold(
          appBar: new AppBar(
            elevation: 0,
            centerTitle: false,
            bottom: new TabBar(
              tabs: <Widget>[
                new Tab(
                  text: "Tab1",
                ),
                new Tab(
                  text: "Tab2",
                ),
              ]
            ),

          ),

          body: new TabBarView(
            physics: NeverScrollableScrollPhysics(),

            children: <Widget>[
              new Container(
                child: Center(child: Text("Tab1 here"))
              ),
              new Container(
                  child: Center(child: Text("Tab2 here"))
              ),
            ]


          )

        )
    );
  }

2 уровня/ строки TabBar

...