formatted property

String get formatted

Implementation

String get formatted =>
    '''{
${data.entries.map((e) {
      if (e.value is Record) {
        final docStr = (e.value as Record).formatted.split('\n').map((line) => '  $line').join('\n');
        return "${e.key} => $docStr";
      }

      if (e.value is List<Record>) {
        final listStr = (e.value as List<Record>).map((item) => item.formatted.split('\n').map((line) => '  $line').join('\n')).join(',\n  ');
        return "${e.key} => (${(e.value as List<Record>).length}) [\n$listStr\n  ]";
      }
      return "${e.key} => ${e.value}";
    }).join(",\n  ")}
}''';