getCallLogList method
Implementation
getCallLogList(Function(List<CallLog> callLogs) onSuccess, Function(CometChatCallsException excep) onError, String response) {
List<CallLog> data = <CallLog>[];
try{
totalPages = jsonDecode(response)['meta']['pagination']["total_pages"];
currentPage = jsonDecode(response)['meta']['pagination']["current_page"];
if (jsonDecode(response)["data"] != null) {
data = <CallLog>[];
jsonDecode(response)["data"].forEach((v) {
data.add(CallLog.fromJson(v));
});
onSuccess(data);
}
}catch (e) {
CometChatCallsUtils.showLog(_tag, "Error: $e");
onError(CometChatCallsException(CometChatCallsConstants.codeError, e.toString(), e.toString()));
}
}