MVP #141
@@ -82,8 +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 GestureDetector(
|
return Expanded( // makes each nav item occupy equal width = large horizontal hitbox
|
||||||
|
child: GestureDetector(
|
||||||
onTap: () => onTabTapped(index),
|
onTap: () => onTabTapped(index),
|
||||||
|
behavior: HitTestBehavior.opaque, // ensures the entire area is tappable
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 5.0), // adds comfortable tap height
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -103,8 +107,10 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onTabTapped(int index) {
|
void onTabTapped(int index) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
Reference in New Issue
Block a user