getUsers method
Implementation
@override
Future<List<User>> getUsers(Room room) async {
final users = <User>[];
final keys = (await _roomMembersBox.getAllKeys())
.where((key) => TupleKey.fromString(key).parts.first == room.id)
.toList();
final states = await _roomMembersBox.getAll(keys);
states.removeWhere((state) => state == null);
states.forEach(
(state) => users.add(Event.fromJson(copyMap(state!), room).asUser),
);
return users;
}