getCapabilities method
Gets information about the server's supported feature set and other relevant capabilities.
returns capabilities
:
The custom capabilities the server supports, using the
Java package naming convention.
Implementation
Future<Capabilities> getCapabilities() async {
final requestUri = Uri(path: '_matrix/client/v3/capabilities');
final request = Request('GET', baseUri!.resolveUri(requestUri));
request.headers['authorization'] = 'Bearer ${bearerToken!}';
final response = await httpClient.send(request);
final responseBody = await response.stream.toBytes();
if (response.statusCode != 200) unexpectedResponse(response, responseBody);
final responseString = utf8.decode(responseBody);
final json = jsonDecode(responseString);
return Capabilities.fromJson(json['capabilities'] as Map<String, Object?>);
}