Created
April 14, 2020 02:20
Round radius bottom navigation bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget get bottomNavigationBar { | |
const double _iconSize = 36; | |
Widget _emptyText = Container( | |
width: 0, | |
height: 0, | |
); | |
if (Platform.isAndroid) { | |
_emptyText = Text(''); | |
} | |
return ClipRRect( | |
borderRadius: BorderRadius.all(Radius.circular(_iconSize)), | |
child: BottomNavigationBar( | |
items: <BottomNavigationBarItem>[ | |
BottomNavigationBarItem( | |
icon: Icon( | |
Icons.home, | |
), | |
title: _emptyText), | |
BottomNavigationBarItem( | |
icon: Icon( | |
Icons.search, | |
), | |
title: _emptyText), | |
BottomNavigationBarItem( | |
icon: Icon( | |
Icons.shopping_basket, | |
), | |
title: _emptyText), | |
BottomNavigationBarItem( | |
icon: Icon( | |
Icons.message, | |
), | |
title: _emptyText), | |
BottomNavigationBarItem( | |
icon: UserAvator.bottomBarIcon(url: _pageData['user_avatar_url']), | |
title: _emptyText) | |
], | |
onTap: (value) { | |
setState(() { | |
_selectedIndex = value; | |
}); | |
}, | |
iconSize: _iconSize, | |
currentIndex: _selectedIndex, | |
unselectedItemColor: MarcheColor.LightGrey, | |
selectedItemColor: MarcheColor.Red, | |
showSelectedLabels: false, | |
showUnselectedLabels: false, | |
type: BottomNavigationBarType.fixed, | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment