convertCallLogsToJson function
Converts a nullable JSON string to a JSON string representation of a CallLogModel, or returns an empty string if null or empty.
This function checks if the input string is null or empty. If it is, it returns an empty string. Otherwise, it converts the string to a CallLogModel object and then back to a JSON string.
str
: The nullable JSON string to be converted.
Returns a JSON string representation of the CallLogModel if str
is not null or empty; otherwise, returns an empty string.
Implementation
String convertCallLogsToJson(String? str) => (str == null || str.isEmpty)
? ""
: callLogListToJson(callLogListFromJson(str));