FlatButton is deprecated and shouldn't be used. Used TextButton instead.
On my previous FlatButton
widget, I was able to changed the splash color when on pressed. But now I'm using TextButton
widget, how can I change its color the efficient way on the MaterialApp ThemeData
or directly on the TextButton
widget.
Currenly this is my TextButton
TextButton(
style: TextButton.styleFrom(
primary: Colors.red,
textStyle: TextStyle(
color: Colors.black45,
fontFamily: "Courier Prime",
),
backgroundColor: Colors.transparent,
),
onPressed: () {},
child: Text(
"Student",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
overlayColor is used to indicate that the button is focused, hovered, or pressed.
But I cant find this overlayColor
setState
to change color when pressed – Cray