【发布时间】:2019-06-23 18:36:57
【问题描述】:
我有一个关于用户食物的List<Comment>。
它看起来像这样:
[
{userId: 1,
rating: 4.5
},
{userId: 2,
rating: 4.0
},
{userId: 3,
rating: 3.5
},
{userId: 4,
rating: 3.0
}
...
];
我想获得平均评分。 AVERAGE = Number of ratings : total user,如何在 dart 中应用这个?
【问题讨论】: