getUsers method

  1. @override
Future<List<User>> getUsers({
  1. required Session session,
  2. List<String>? facebookIds,
  3. List<String>? ids,
  4. List<String>? usernames,
})
override

Getting users

In addition to getting the current authenticated player’s user account, Nakama has a convenient way to get a list of other players’ public profiles from their ids or usernames.

Implementation

@override
Future<List<model.User>> getUsers({
  required model.Session session,
  List<String>? facebookIds,
  List<String>? ids,
  List<String>? usernames,
}) async {
  final res = await _client.getUsers(
    api.GetUsersRequest(
      facebookIds: facebookIds,
      ids: ids,
      usernames: usernames,
    ),
    options: _getSessionCallOptions(session),
  );

  return res.users.map((e) => model.User.fromDto(e)).toList(growable: false);
}