Open FarhaanK opened 2 years ago
You can use TextButton as an alternative to FlatButton.
To add color, just add the following code below:
style: TextButton.styleFrom(backgroundColor: Colors.red)
Here's an example:
hi, the FlatButton widget is deprecated the alternatives are TextButton or ElevatedButton but neither seem to have a color property like FlatButton. am i right? which button should i use in this project and how do i define its color?
Icon Button
hi, the FlatButton widget is deprecated the alternatives are TextButton or ElevatedButton but neither seem to have a color property like FlatButton. am i right? which button should i use in this project and how do i define its color?
you can use it
Expanded buildKey({Color color, int soundNumber}) { return Expanded( child: TextButton( style: ButtonStyle( backgroundColor: MaterialStateColor.resolveWith((states) => color)), ), ); }
Expanded( child: TextButton( onPressed: () { playSound(7); }, child: Text(''), style: TextButton.styleFrom(backgroundColor: Colors.purple), ), )
hi, the FlatButton widget is deprecated the alternatives are TextButton or ElevatedButton but neither seem to have a color property like FlatButton. am i right? which button should i use in this project and how do i define its color?