json static method
JSON pretty print with enhanced styling
Implementation
static void json(dynamic jsonObject, [String? tag]) {
if (!kDebugMode) return;
try {
String jsonString;
if (jsonObject is Map || jsonObject is List) {
jsonString = _prettyPrintJson(jsonObject);
} else {
jsonString = jsonObject.toString();
}
_logWithStyle(jsonString, 'JSON', tag ?? 'JSON');
} catch (e) {
_logWithStyle('Failed to format JSON: $e', 'ERROR', tag);
}
}