listMatches method

  1. @override
Future<List<Match>> listMatches({
  1. required Session session,
  2. bool? authoritative,
  3. String? label,
  4. int limit = defaultLimit,
  5. int? maxSize,
  6. int? minSize,
  7. String? query,
})
override

Listing matches

Match Listing takes a number of criteria to filter matches by including player count, a match label and an option to provide a more complex search query.

Matches start in a lobby state. The match exists on the server but the actual gameplay doesn’t start until enough players have joined.

Implementation

@override
Future<List<model.Match>> listMatches({
  required model.Session session,
  bool? authoritative,
  String? label,
  int limit = defaultLimit,
  int? maxSize,
  int? minSize,
  String? query,
}) async {
  final res = await _client.listMatches(
    api.ListMatchesRequest(
      authoritative: api.BoolValue(value: authoritative),
      label: api.StringValue(value: label),
      limit: api.Int32Value(value: limit),
      maxSize: api.Int32Value(value: maxSize),
      minSize: api.Int32Value(value: minSize),
      query: api.StringValue(value: query),
    ),
    options: _getSessionCallOptions(session),
  );

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