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 {
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);
}