toStringShallow method

String toStringShallow(
  1. {String joiner = ', ',
  2. DiagnosticLevel minLevel = DiagnosticLevel.debug}

Returns a one-line detailed description of the object.

This description is often somewhat long. This includes the same information given by toStringDeep, but does not recurse to any children.

joiner specifies the string which is place between each part obtained from debugFillProperties. Passing a string such as '\n ' will result in a multiline string that indents the properties of the object below its name (as per toString).

minLevel specifies the minimum DiagnosticLevel for properties included in the output.

See also:

  • toString, for a brief description of the object.
  • toStringDeep, for a description of the subtree rooted at this object.


String toStringShallow({
  String joiner = ', ',
  DiagnosticLevel minLevel = DiagnosticLevel.debug,
}) {
  String? shallowString;
  assert(() {
    final StringBuffer result = StringBuffer();
    final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
    result.write( n) => !n.isFiltered(minLevel))
    shallowString = result.toString();
    return true;
  return shallowString ?? toString();