markAsUnread static method
Future<void>
markAsUnread(
- BaseMessage baseMessage, {
- required dynamic onSuccess()?,
- required dynamic onError(
- CometChatException excep
Marks a BaseMessage as unread.
The markAsUnread function takes in a BaseMessage object, which represents the message you want to mark as unread.
Implementation
static Future<void> markAsUnread(BaseMessage baseMessage,
{required Function(String)? onSuccess,
required Function(CometChatException excep)? onError}) async {
try {
Map<String, dynamic> map = baseMessage.toJson();
final result =
await channel.invokeMethod('markAsUnread', {'baseMessage': map});
if (onSuccess != null) onSuccess(result);
} on PlatformException catch (p) {
_errorCallbackHandler(null, p, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
}