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