我希望我的按钮(白色)在用户选择正确答案时为绿色,在用户选择错误时为红色,然后选择正确的绿色

```RaisedButton (
                      padding: EdgeInsets.fromLTRB(10.0, 8.0, 10.0, 8.0),
                      elevation: 8.0,
                      color: butColor ? Colors.green : Colors.red,
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10)),
                      onPressed: () {
                        setState(() {
                          if (quiz.choices[questionNumber][0] == quiz.correctAnswers[questionNumber]){
                            finalScore = finalScore + 4;
                            butColor = true;

                          }else{
                            debugPrint("Wrong");
                            butColor = false;
                          }

                        });
                      },
                      child: Text(quiz.choices[questionNumber][0],
                      style: TextStyle(
                        fontSize: 22.0,
                        fontFamily: "AlegreyaSans",
                        color: Colors.black
                      ),),
                    ), ```

This is what I get when I try the above code

我也将布尔变量“ butColor”设置为false。

当我尝试将按钮颜色设置为白色并在if语句中执行switch语句时,我仍然只得到白色按钮。