to_string_pretty static method

String to_string_pretty({
  1. required dynamic data,
  2. int space = 4,
})

Implementation

static String to_string_pretty({required dynamic data, int space = 4}) {
  if (data is Map || data is List) {
    return JsonEncoder.withIndent(" " * space).convert(data);
  }
  return data.toString();
}