Widget build()

in nav2-usability/scenario_code/lib/nested-routing/nested_routing_navi.dart [144:187]


  Widget build(BuildContext context) {
    return Column(
      children: [
        TabBar(
          controller: _tabController,
          onTap: (newIndex) => setState(() {
            _currentIndex = newIndex;
          }),
          labelColor: Theme.of(context).primaryColor,
          tabs: [
            Tab(icon: Icon(Icons.bathtub), text: 'New'),
            Tab(icon: Icon(Icons.group), text: 'All'),
          ],
        ),
        Expanded(
          child: TabBarView(
            controller: _tabController,
            children: [
              NaviStack(
                active: _currentIndex == 0,
                pages: (context) => [
                  NaviPage.material(
                    key: ValueKey('New'),
                    route: NaviRoute(path: ['new']),
                    child: NewBooksScreen(),
                  )
                ],
              ),
              NaviStack(
                active: _currentIndex == 1,
                pages: (context) => [
                  NaviPage.material(
                    key: ValueKey('All'),
                    route: NaviRoute(path: ['all']),
                    child: AllBooksScreen(),
                  )
                ],
              ),
            ],
          ),
        ),
      ],
    );
  }