Dump List topic

Dumps any object in Dart that implements Iterable. The default scalar style is ScalarStyle.plain (you can override this).

Flow Sequences

Flow sequences start with [ and terminate with ]. All entries are always dumped on a new line.

dumpAsYaml(
  ['hello', 24, true, 24.0],
  config: ConfiConfig.yaml(
    styling: TreeConfig.flow(forceInline: false),
  ),
);
# Output in yaml
[
  hello,
  24,
  true,
  24.0
]

Tip

You can inline a flow sequence by passing in forceInline as true.

Block Sequences

Block sequences have no explicit starting or terminating indicators. However, entries always have a leading - .

dumpAsYaml(
  ['hello', 24, true, 24.0],
  config: ConfiConfig.yaml(
    styling: TreeConfig.block(scalarStyle: ScalarStyle.literal),
  ),
);
# Output in yaml
- |-
  hello
- |-
  24
- |-
  true
- |-
  24.0

Functions

dumpAsYaml(Object? object, {Config? config, ExpandObject? expand}) String Dump Scalar Dump List Dump Map Dumpable Views
Dumps an object to YAML using the config provided.

Typedefs

IterableToYaml = ObjectFromView<YamlIterableEntry> Dump List
Maps an object to yaml sequence.
YamlIterableEntry = Iterable<Object?> Dump List
A YAML sequence with entries.