jsonPretty method
Json encode an object with supplied indent
or defaultJsonIndent
If conversion failed, return error as String and NOT throw.
Implementation
String jsonPretty({String indent = defaultJsonIndent}) {
try {
return JsonEncoder.withIndent(indent).convert(this);
} catch (e) {
return 'jsonPretty() failed: $e';
}
}