getUuids function Null safety

Future<List<PlayerUuid>> getUuids(
  1. List<String> usernames
)

Returns a List of player UUIDs by a List of player names.

Usernames are not case sensitive and ones which are invalid or not found are omitted.

Implementation

Future<List<PlayerUuid>> getUuids(List<String> usernames) async {
  final response = await requestBody(
      http.post, _mojangApi, 'profiles/minecraft', usernames,
      headers: {'content-type': 'application/json'});
  final list = parseResponseList(response);
  return list.map<PlayerUuid>((v) => PlayerUuid(v['name'], v['id'])).toList();
}