searchConversation method
Future<void>
searchConversation(
- String searchKey, [
- String? jidForSearch,
- bool globalSearch = true,
- dynamic callback(
- FlyResponse response
override
This method is used to search the conversation using the keyword.
Implementation
@override
Future<void> searchConversation(String searchKey,
[String? jidForSearch,
bool globalSearch = true,
Function(FlyResponse response)? callback]) async {
//filteredMessageList
String? response;
try {
response =
await mirrorFlyMethodChannel.invokeMethod('searchConversation', {
"searchKey": searchKey,
"jidForSearch": jidForSearch,
"globalSearch": globalSearch
});
callback?.call(FlyResponse(true,
convertChatMessagesJsonFromString(response), FlyConstants.empty));
// return convertChatMessagesJsonFromString(response);
} 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)));
}
}