convertUsersDataJsonFromString function

String convertUsersDataJsonFromString(
  1. String? str
)

Converts a JSON string into a JSON string representing a UserList object.

This function checks if the provided string is null or empty. If it is, it returns an empty string. Otherwise, it converts the string into a UserList object using userListFromJson, and then back into a JSON string using userListToJson.

Parameters: str - A JSON string or null.

Returns: A JSON string representing a UserList object, or an empty string if the input is null or empty.

Implementation

String convertUsersDataJsonFromString(String? str) =>
    (str == null || str.isEmpty) ? "" : userListToJson(userListFromJson(str));