Skip to content

Commit 3c9d909

Browse files
authored
Merge pull request #203 from MostroP2P/fix/expand-tapping-area-navbar
Expanded the tapping area in the bottom navbar
2 parents add5b89 + ec1a40e commit 3c9d909

File tree

1 file changed

+52
-45
lines changed

1 file changed

+52
-45
lines changed

lib/shared/widgets/bottom_nav_bar.dart

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -75,55 +75,62 @@ class BottomNavBar extends ConsumerWidget {
7575
button: true,
7676
enabled: true,
7777
label: S.of(context)!.navigateToLabel(label),
78-
child: GestureDetector(
79-
onTap: () => _onItemTapped(context, index),
80-
child: SizedBox(
81-
height: double.infinity,
82-
child: Column(
83-
mainAxisAlignment: MainAxisAlignment.center,
84-
children: [
85-
const SizedBox(height: 2),
86-
SizedBox(
87-
height: 24,
88-
width: 24,
89-
child: Stack(
90-
clipBehavior: Clip.none,
91-
alignment: Alignment.center,
92-
children: [
93-
Icon(
94-
icon,
95-
color: iconColor,
96-
size: 24,
97-
),
98-
if (notificationCount != null && notificationCount > 0)
99-
Positioned(
100-
top: -2,
101-
right: -2,
102-
child: Container(
103-
width: 6,
104-
height: 6,
105-
decoration: const BoxDecoration(
106-
color: Colors.red,
107-
shape: BoxShape.circle,
78+
child: Material(
79+
color: Colors.transparent,
80+
child: InkWell(
81+
onTap: () => _onItemTapped(context, index),
82+
borderRadius: BorderRadius.circular(8),
83+
splashColor: AppTheme.activeColor.withValues(alpha: 0.1),
84+
highlightColor: AppTheme.activeColor.withValues(alpha: 0.05),
85+
child: SizedBox(
86+
height: double.infinity,
87+
width: double.infinity,
88+
child: Column(
89+
mainAxisAlignment: MainAxisAlignment.center,
90+
children: [
91+
const SizedBox(height: 2),
92+
SizedBox(
93+
height: 24,
94+
width: 24,
95+
child: Stack(
96+
clipBehavior: Clip.none,
97+
alignment: Alignment.center,
98+
children: [
99+
Icon(
100+
icon,
101+
color: iconColor,
102+
size: 24,
103+
),
104+
if (notificationCount != null && notificationCount > 0)
105+
Positioned(
106+
top: -2,
107+
right: -2,
108+
child: Container(
109+
width: 6,
110+
height: 6,
111+
decoration: const BoxDecoration(
112+
color: Colors.red,
113+
shape: BoxShape.circle,
114+
),
108115
),
109116
),
110-
),
111-
],
117+
],
118+
),
112119
),
113-
),
114-
const SizedBox(height: 4),
115-
Text(
116-
label,
117-
style: TextStyle(
118-
fontSize: 12,
119-
fontWeight: FontWeight.w400,
120-
color: textColor,
121-
height: 1.0,
122-
letterSpacing: -0.2,
120+
const SizedBox(height: 4),
121+
Text(
122+
label,
123+
style: TextStyle(
124+
fontSize: 12,
125+
fontWeight: FontWeight.w400,
126+
color: textColor,
127+
height: 1.0,
128+
letterSpacing: -0.2,
129+
),
123130
),
124-
),
125-
const SizedBox(height: 2),
126-
],
131+
const SizedBox(height: 2),
132+
],
133+
),
127134
),
128135
),
129136
),

0 commit comments

Comments
 (0)