I have two containers in a stack and both containers have GestureDetector.The OnTap for the first container is working fine but it\'s not working with another container. The
GestureDetector is not working when write code inside its block It will be doesn't work
GestureDetector(
onTap: () {
setState(() {
_color = Colors.red;
});
},),
You will write like that it will work
GestureDetector(
onTap: () {
changed();
},),
method
void changed() {
setState(() {
_color = Colors.red;
});}