xxxxxxxxxx
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.pink[400], //background color
onPrimary: Colors.black, //ripple color
)
)
xxxxxxxxxx
Expanded buildPlayButton({Color color, int soundNumber}){
return Expanded(
child: ElevatedButton(
onPressed: () {
playSound(soundNumber);
},
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(color),
),
),
);}
xxxxxxxxxx
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.pressed))
return Colors.green;
return Colors.green;
},
),
),
)