FlatButton() is deprecated
FarhaanK opened this issue · comments
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?
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),
),
)