valueToString static method

String valueToString(
  1. Object? value
)

Implementation

static String valueToString(Object? value) {
  if (value == null) return '';

  if (value is String) {
    return value;
  } else if (value is List) {
    return value.map(valueToString).join(',');
  } else if (value is Map) {
    return value
        .map((key, value) =>
            MapEntry(key, '${valueToString(key)}: ${valueToString(value)}'))
        .values
        .join('; ');
  } else {
    return '$value';
  }
}