Skip to content

Instantly share code, notes, and snippets.

@NocturnScholar
Created October 1, 2021 09:55
Show Gist options
  • Save NocturnScholar/897f17dc5e576a109031b23aea2e529f to your computer and use it in GitHub Desktop.
Save NocturnScholar/897f17dc5e576a109031b23aea2e529f to your computer and use it in GitHub Desktop.
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