Skip to content

Commit 6faad70

Browse files
home: Add ink splash effect on bottom navbar buttons
1 parent ed0b571 commit 6faad70

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

lib/widgets/home.dart

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -254,26 +254,31 @@ class _NavigationBarButton extends StatelessWidget {
254254
return AnimatedScaleOnTap(
255255
scaleEnd: 0.875,
256256
duration: const Duration(milliseconds: 100),
257-
child: GestureDetector(
258-
behavior: HitTestBehavior.opaque,
259-
onTap: onPressed,
260-
child: Column(
261-
mainAxisSize: MainAxisSize.min,
262-
children: [
263-
SizedBox(height: 34,
264-
child: Center(
265-
child: Icon(icon, size: 24, color: color,))),
266-
Flexible(
267-
child: Text(
268-
label,
269-
style: TextStyle(
270-
fontSize: 12,
271-
color: color,
272-
height: 1.0,),
273-
textAlign: TextAlign.center,
274-
maxLines: 2,
275-
overflow: TextOverflow.ellipsis)),
276-
])));
257+
child: Material(
258+
type: MaterialType.transparency,
259+
child: InkWell(
260+
// TODO(#417): Disable splash effects for all buttons globally.
261+
borderRadius: BorderRadius.all(Radius.circular(4)),
262+
splashFactory: NoSplash.splashFactory,
263+
highlightColor: designVariables.navigationButtonBg,
264+
onTap: onPressed,
265+
child: Column(
266+
mainAxisSize: MainAxisSize.min,
267+
children: [
268+
SizedBox(height: 34,
269+
child: Center(
270+
child: Icon(icon, size: 24, color: color,))),
271+
Flexible(
272+
child: Text(
273+
label,
274+
style: TextStyle(
275+
fontSize: 12,
276+
color: color,
277+
height: 1.0,),
278+
textAlign: TextAlign.center,
279+
maxLines: 2,
280+
overflow: TextOverflow.ellipsis)),
281+
]))));
277282
}
278283
}
279284

0 commit comments

Comments
 (0)