searchConversation static method
Future<void>
searchConversation({
- required String searchKey,
- String? jidForSearch,
- bool globalSearch = true,
- required dynamic flyCallBack(
- FlyResponse response
This method searches for conversations that match the given searchKey
.
Parameters:
searchKey
- The key used for searching conversations.
jidForSearch
- The JID (Jabber ID) of the user to limit the search to. If null, the search is not limited to a specific user.
globalSearch
- A boolean value that determines the scope of the search. If true, the search is global across all conversations. If false, the search is limited to the current conversation. Defaults to true.
Returns: A Future<void> that completes when the search operation is finished.
Example usage:
await Mirrorfly.searchConversation(
searchKey: "query",
jidForSearch: "user123@example.com",
globalSearch: true,
flyCallBack: (response) {
if (response.isSuccess) {
print("Search successful: ${response.data}");
} else {
print("Search failed: ${response.errorMessage}");
}
},
);
Implementation
static Future<void> searchConversation(
{required String searchKey,
String? jidForSearch,
bool globalSearch = true,
required Function(FlyResponse response) flyCallBack}) {
return FlyChatFlutterPlatform.instance
.searchConversation(searchKey, jidForSearch, globalSearch, flyCallBack);
}