I have built a tabbed application with two tabs. The second tab has "Logout" option. On click of log out, the user must be taken to the login page. I am getting the login page here, but the problem is that I am also getting the two tabs at the bottom. Kindly help as I am new to flutter app development.
Below is the way I have built the tabs,
List<Widget> _children = [
Test1(), //this is the first tab
Test2(), //this is the second tab that has logout option
];
home: DefaultTabController(
length: 2,
child: Scaffold(
bottomNavigationBar: BottomNavigationBar(
onTap: onTabTapped,
currentIndex: _currentIndex,
items: [
BottomNavigationBarItem(
icon: new Icon(CustomIcons.home),
title: new Text(''),
),
BottomNavigationBarItem(
icon: new Icon(CustomIcons.profile),
title: new Text(''),
),
],
),
body: _children[_currentIndex],
),
),
Below is the code called on logout,
Navigator.of(context).pushNamedAndRemoveUntil('/login', (Route<dynamic> route) => false);
On log out, I am getting the login page but the tabs are also visible. Even the Navigator.pop(context) is giving me the same result. How do I pop the tabs? Please let me know...