Tapping the container triggers the onTap()
handler but does not show any ink splash effect.
class _MyHomePageState extends State
A better way is to use the Ink widget instead of any other widget.
Instead of defining color
inside container you can define it in Ink
widget itself.
Below code will work.
Ink(
color: Colors.orange,
child: InkWell(
child: Container(
width: 100,
height: 100,
),
onTap: () {},
),
)
Do not forget to add a
onTap: () {}
in theInkWell
else it will not show the ripple effect too.