onChange method
dynamic
onChange(
- String inputValue, [
- int? value
])
Implementation
onChange(String inputValue, [int? value]) {
LogMessage.d("onChange", "inputValue $inputValue");
if (value == 0) {
if (search.text.trim().isNotEmpty) {
clearVisible(true);
} else {
clearVisible(false);
recentChats.refresh();
}
if (lastInputValue != search.text.trim()) {
lastInputValue = search.text.trim();
searchLoading(true);
// frmRecentChatList.clear();
recentSearchList.clear();
if (search.text.trim().isNotEmpty) {
deBouncer.run(() {
pageNum = 1;
fetchRecentChatList();
fetchMessageList();
filterUserList();
});
} else {
LogMessage.d("empty", "empty");
// frmRecentChatList.addAll(recentChats);
}
}
update();
} else {
clearVisible(search.text.isNotEmpty);
if (search.text.trim().isNotEmpty) {
callLogSearchLoading(true);
deBouncer.run(() {
filteredCallLog(search.text.trim());
});
} else {
pageNumber = 1;
_callLogList.clear();
callLogList.clear();
fetchCallLogList();
}
}
}