Been developing a flutter app and dynamicly building some containers from some Firebase data. I wanted to know if there is a way to get a onTap method for containers (or any wi
Screenshot:
You shouldn't use GestureDetector
because it won't show you any ripple effect (which is core part of a Material design app), so you can use InkWell
, here is the basic example.
Widget _buildContainer() {
return Material(
color: Colors.blue,
child: InkWell(
onTap: () => print("Container pressed"), // handle your onTap here
child: Container(height: 200, width: 200),
),
);
}