I am learning FLutter and started with the deprecated version of TextButton i.e FlatButton the colors seems to work but in TextButton version textColor is not working.
Here’s the code:
Widget build(BuildContext context) {
return Center(
child: Column(
children: <Widget>[
Text(
resultPhrase,
style: TextStyle(fontSize: 36, fontWeight: FontWeight.bold),
),
TextButton(
child: Text('Restart Quiz!',),
textColor:Colors.blue,
onPressed: resetHandler,
),
],
),
);
}
I tried Style with foreground colors and it didnt work..am i missing something?
style: TextStyle(color: Colors.purple)
Tried the above through another thread and didnt work.
Is there any way to find most of the descriptions of parameters like they have in Tailwind?
2
Answers
You can use
style
onTextButton
.You can access the "style" of the button like this.