dumpMapLike<T> method

DumpedCollection dumpMapLike<T>(
  1. T object, {
  2. required Map<Object?, Object?> expand(
    1. T object
    ),
  3. required int indent,
  4. ResolvedTag? tag,
  5. String? anchor,
  6. List<String> comments = const [],
})

Dumps an object as a Map.

The tag and anchor are included with the object after the expand has been called.

Implementation

DumpedCollection dumpMapLike<T>(
  T object, {
  required Map<Object?, Object?> Function(T object) expand,
  required int indent,
  ResolvedTag? tag,
  String? anchor,
  List<String> comments = const [],
}) => dump(
  dumpableType(expand(object))
    ..tag = tag
    ..anchor = anchor
    ..comments.addAll(comments),
  indent,
);