我有一个RatingDialog当前为5星,如何将最大星数更改为10?我尝试了其他AlertDialog添加一个RatingBar,但据我所知,它更为复杂,因此,如果可能的话,我希望使用RatingDialog。尝试将RatingDialog的定义中的max rateValue更改为10而不是5-我看不到我的应用程序中的更改。
我的方法代码:
void _showDialog() {
showDialog(
context: context,
barrierDismissible: true,
builder: (context) {
return RatingDialog(
icon: Icon(
Icons.sentiment_satisfied,
color: Colors.grey,
size: 100,
),
title: "How much pain are you in?",
description:
"Tap a star to set your pain rating after this exercise."+
"\n1 = No pain"+
"\n5 = Extreme pain",
submitButton: "SUBMIT",
accentColor: Colors.blueAccent, // optional
onSubmitPressed: (int rating) {
print("onSubmitPressed: rating = $rating");
},
);
});
}