updateFavouriteStatus method
Future<void>
updateFavouriteStatus(
- String messageID,
- String chatUserJID,
- bool isFavourite,
- String chatType,
- dynamic callback(
- FlyResponse response
override
This method is used to update the favourite status of a message.
Implementation
@override
Future<void> updateFavouriteStatus(
String messageID,
String chatUserJID,
bool isFavourite,
String chatType,
Function(FlyResponse response)? callback) async {
//favouriteMessage
bool? favResponse;
try {
favResponse = await mirrorFlyMethodChannel
.invokeMethod<bool>('updateFavouriteStatus', {
"messageID": messageID,
"chatUserJID": chatUserJID,
"isFavourite": isFavourite,
"chatType": chatType,
});
LogMessage.d("Favourite Msg Response ", " $favResponse");
callback?.call(FlyResponse(true, FlyConstants.empty, FlyConstants.empty));
// return favResponse;
} on PlatformException catch (e) {
LogMessage.d("Platform Exception =", " $e");
callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(e.code, e.message, e.details)));
} on Exception catch (e) {
LogMessage.d("Exception ", " $e");
callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
}
}