listMatches method
Future<List<Match> >
listMatches({
- required Session session,
- bool? authoritative,
- String? label,
- int limit = defaultLimit,
- int? maxSize,
- int? minSize,
- 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);
}