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 {
  _session = session;

  final res = await _api.v2MatchGet(
    authoritative: authoritative,
    label: label,
    limit: limit,
    maxSize: maxSize,
    minSize: minSize,
    query: query,
  );

  return res.body!.matches!.map((e) => model.Match.fromJson(e.toJson())).toList(growable: false);
}