flutter gesturedetector only in text
GestureDetector(
behavior: HitTestBehavior.translucent, //or HitTestBehavior.opaque
onTap: () {
setState(() {
mainColor = Color.fromRGBO(Random().nextInt(254) + 1,
Random().nextInt(254) + 1, Random().nextInt(254) + 1, 1);
});
},
child: Center(
child: Text('Hey there', style: TextStyle(fontSize: 32.0)),
),
),