convertStatusFromJson function

String convertStatusFromJson(
  1. String? str
)

Converts a nullable JSON string into a non-nullable JSON string representing a Status.

If the input string is null or empty, this function returns an empty string. Otherwise, it decodes the string into a Status object using statusFromJson, and then serializes the object back into a JSON string using statusToJson.

str: The nullable JSON string to convert.

Returns a non-nullable JSON string.

Implementation

String convertStatusFromJson(String? str) =>
    (str == null || str.isEmpty) ? "" : statusToJson(statusFromJson(str));