If the Widget doesn’t support event detection,
wrap the widget in a GestureDetector and pass a function
to the onTap parameter.

    
class SampleTapApp extends StatelessWidget {
  const SampleTapApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: GestureDetector(
          onTap: () {
            developer.log('tap');
          },
          child: const FlutterLogo(
            size: 200.0,
          ),
        ),
      ),
    );
  }
}

Handling other gestures

Using GestureDetector you can listen
to a wide range of gestures such as:

Tapping