markAsRead method
Implementation
Future<bool> markAsRead(
Channel channel, Authentication authentication) async {
Map<String, String?> body = {"rid": channel.id};
http.Response response = await _httpService.post(
'/api/v1/subscriptions.read',
jsonEncode(body),
authentication,
);
if (response.statusCode == 200) {
if (response.body.isNotEmpty == true) {
return Response.fromMap(jsonDecode(response.body)).success == true;
} else {
return false;
}
}
throw RocketChatException(response.body);
}