Created
October 1, 2021 09:55
-
-
Save NocturnScholar/897f17dc5e576a109031b23aea2e529f to your computer and use it in GitHub Desktop.
This file contains 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
class NavBar extends StatelessWidget { | |
final NotchedShape shape; | |
const NavBar({ | |
this.shape = const CircularNotchedRectangle(), | |
}); | |
@override | |
Widget build(BuildContext context) { | |
return BottomAppBar( | |
shape: shape, | |
color: Theme.of(Get.context!).primaryColor, | |
child: IconTheme( | |
data: IconThemeData(color: Theme.of(Get.context!).cardColor), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: <Widget>[ | |
IconButton( | |
tooltip: 'Utama', | |
icon: FaIcon(FontAwesomeIcons.home), | |
onPressed: () {}, | |
), | |
IconButton( | |
tooltip: 'Riwayat', | |
icon: FaIcon(FontAwesomeIcons.history), | |
onPressed: () {}, | |
), | |
Container( | |
width: 56, | |
height: 24, | |
), | |
IconButton( | |
tooltip: 'Simpan', | |
icon: FaIcon(FontAwesomeIcons.handHoldingHeart), | |
onPressed: () {}, | |
), | |
IconButton( | |
tooltip: 'Profil', | |
icon: FaIcon(FontAwesomeIcons.userAlt), | |
onPressed: () {}, | |
), | |
], | |
), | |
), | |
); | |
} | |
} | |
Tambah di dalam Scaffold: | |
floatingActionButton: FloatingActionButton( | |
elevation: 0, | |
backgroundColor: Theme.of(Get.context!).primaryColor, | |
onPressed: () {}, | |
child: Container( | |
padding: const EdgeInsets.all(8), | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(999), | |
color: Theme.of(Get.context!).cardColor, | |
), | |
child: Icon( | |
Icons.qr_code_scanner, | |
size: 30, | |
color: Theme.of(Get.context!).primaryColor, | |
), | |
), | |
tooltip: 'Test', | |
), | |
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, | |
bottomNavigationBar: NavBar(), | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment