var values = [
{'userId': 1, 'rating': 4.5},
{'userId': 2, 'rating': 4.0},
{'userId': 3, 'rating': 3.5},
{'userId': 4, 'rating': 3.0}
];
var result = values.map((m) => m['rating']).reduce((a, b) => a + b) / values.length;
print(result);