Skip to content

Instantly share code, notes, and snippets.

@zafarivaev
Created March 7, 2020 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zafarivaev/c6613620eff48df25beb0aa34723124f to your computer and use it in GitHub Desktop.
Save zafarivaev/c6613620eff48df25beb0aa34723124f to your computer and use it in GitHub Desktop.
Widget _currentWidget = HomeWidget();
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
switch (index) {
case 0:
_currentWidget = HomeWidget();
break;
case 1:
_currentWidget = SearchWidget();
break;
case 2:
_currentWidget = ProfileWidget();
break;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment