Skip to content

Instantly share code, notes, and snippets.

@SteveOye
Last active May 22, 2020 01:37
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 SteveOye/31206dcac80700b917fda2846e38b03a to your computer and use it in GitHub Desktop.
Save SteveOye/31206dcac80700b917fda2846e38b03a to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Bottom Navigation',
theme: ThemeData(primarySwatch: Colors.green),
home: Scaffold(
appBar: AppBar(
title: Text('Bottom Navigation'),
),
body: _page[_selectedPage],
bottomNavigationBar: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(30), topLeft: Radius.circular(30)),
boxShadow: [
BoxShadow(color: Colors.black12, spreadRadius: 0, blurRadius: 5),
],
),
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.0),
topRight: Radius.circular(20.0),
),
child: BottomNavigationBar(
currentIndex: _selectedPage,
unselectedItemColor: Color.fromRGBO(58, 58, 58, 100),
selectedItemColor: Colors.green,
onTap: (int index) {
setState(() {
_selectedPage = index;
});
},
items: [
//BottomNavigationBarItems...
]
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment