findPlayers method
find players by name
Implementation
Future<List<Player>> findPlayers(String prefix) async {
List<Player> players = [];
var res = await send(
method: "GET",
url:
"${Endpoints().userSearch}/$accountId?prefix=${Uri.encodeQueryComponent(prefix)}&platform=EPIC",
);
for (final p in res) {
players.add(Player(
p["accountId"],
displayName: (p["matches"] as List?)?.first?["value"] ?? p["accountId"],
));
}
return players;
}