sessionsByState static method
Session count grouped by stateId.
Implementation
static Future<Map<String, int>> sessionsByState() async {
final records = await getHistory();
final map = <String, int>{};
for (final r in records) {
map[r.stateId] = (map[r.stateId] ?? 0) + 1;
}
return map;
}