convertProfileDetailsJsonFromString function

String convertProfileDetailsJsonFromString(
  1. String? str
)

Converts a JSON string into a JSON string representing a list of ProfileDetails objects.

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 list of ProfileDetails objects using profileDetailsFromJson, and then back into a JSON string using profileDetailsToJson.

Parameters: str - A JSON string or null.

Returns: A JSON string representing a list of ProfileDetails objects, or an empty string if the input is null or empty.

Implementation

String convertProfileDetailsJsonFromString(String? str) =>
    (str == null || str.isEmpty)
        ? ""
        : profileDetailsToJson(profileDetailsFromJson(str));