jsonSafe function
dynamic
jsonSafe(
- dynamic value
Implementation
dynamic jsonSafe(dynamic value) {
if (value is DateTime) return value.toIso8601String();
if (value is Map) return value.map((k, v) => MapEntry(k, jsonSafe(v)));
if (value is List) return value.map(jsonSafe).toList();
if (value is Set) return value.map(jsonSafe).toSet();
if (value is Iterable) return value.map(jsonSafe).toList();
if (value is Blob) {
return value.toString();
}
return value;
}