tryJsonEncode static method
Returns a JSON string, or null when value cannot be encoded.
Implementation
static String? tryJsonEncode(dynamic value) {
try {
return jsonEncode(value);
} catch (_) {
return null;
}
}
Returns a JSON string, or null when value cannot be encoded.
static String? tryJsonEncode(dynamic value) {
try {
return jsonEncode(value);
} catch (_) {
return null;
}
}