📅  最后修改于: 2022-03-11 15:00:18.906000             🧑  作者: Mango
bool isButtonPressed = false;
RaisedButton(
color: isButtonPressed ? Colors.green : Colors.red,
onPressed: () {
setState(() {
isButtonPressed =!isButtonPressed;
});
},
),