Navbar Anpassen #9
@@ -52,7 +52,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
|||||||
),
|
),
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
body: tabs[currentIndex],
|
body: tabs[currentIndex],
|
||||||
extendBody: true, // Enables floating effect
|
extendBody: true,
|
||||||
bottomNavigationBar: Padding(
|
bottomNavigationBar: Padding(
|
||||||
padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 8.0),
|
padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 8.0),
|
||||||
child: Material(
|
child: Material(
|
||||||
@@ -82,12 +82,12 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
|||||||
Widget _buildNavItem(IconData icon, String label, int index) {
|
Widget _buildNavItem(IconData icon, String label, int index) {
|
||||||
final isSelected = currentIndex == index;
|
final isSelected = currentIndex == index;
|
||||||
|
|
||||||
return Expanded( // makes each nav item occupy equal width = large horizontal hitbox
|
return Expanded(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => onTabTapped(index),
|
onTap: () => onTabTapped(index),
|
||||||
behavior: HitTestBehavior.opaque, // ensures the entire area is tappable
|
behavior: HitTestBehavior.opaque,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 5.0), // adds comfortable tap height
|
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
Reference in New Issue
Block a user