Flutter / Dart - How to make a widget clickable?

Words
58
Reading
1 min
Listen
Play
5y

Let's say you have a widget of Image but you want to add a click effect on image.
Putting it inside a button is a bad idea. I have something suitable solution for it.

Widget getImageButton() {
    return InkWell(
        child: Image.asset(
            "assets/branding/three_speak_icon.png",
            width: 60,
            height: 60,
          ),
        onTap: () {
            log('User tapped on this image');
        }
    )
}

Here is how I was able to make clickable views for the app on which I am working using the same code snippet above.

Flutter / Dart - How to make a widget clickable? | Ecency