Siloé Bezerra Bispo
Siloé Bezerra Bispo

Reputation: 2244

Navigate in inner tab

I want navigate in inner tab. I have tree tabs, in the first tab I want that I can click in a button and go to another Screen, but without launch a new fullscreen over the screen with tabs.

In my code, I want that when I'm in the HomeScreen I can go to another screen like a subapp. How can I go?

that is my TabController code:

return DefaultTabController(
      length: 3,
      child: Scaffold(
        bottomNavigationBar: TabBar(
          tabs: [
            Tab(icon: Icon(Icons.directions_car)),
            Tab(icon: Icon(Icons.directions_transit)),
            Tab(icon: Icon(Icons.directions_bike)),
          ],
        ),

        body: TabBarView(
          children: [
            HomeScreen(), //-> Go to the SelectedItemScreen
            Screen2(),
            Screen3(),
          ],
        ),
      ),

Upvotes: 0

Views: 50

Answers (1)

Gazihan Alankus
Gazihan Alankus

Reputation: 11984

This may help: https://github.com/flutter/flutter/issues/18546#issuecomment-397885240

You should hold a reference to this TabController and do tabController.index = 0.

Upvotes: 1

Related Questions