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