Dumping Sequence 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.
dumpObject(
['hello', 24, true, 24.0],
dumper: ObjectDumper.of(iterableStyle: NodeStyle.flow),
);
# Output in yaml
[
hello,
24,
true,
24.0
]
Tip
You can inline a flow sequence by passing in forceIterablesInline as true.
Block Sequences
Block sequences have no explicit starting or terminating indicators. However, entries always have a leading - .
dumpObject(
['hello', 24, true, 24.0],
dumper: ObjectDumper.of(
iterableStyle: NodeStyle.block,
scalarStyle: ScalarStyle.literal,
),
);
# Output in yaml
- |-
hello
- |-
24
- |-
true
- |-
24.0
Classes
- IterableDumper Dumping Sequence
- A dumper for an Iterable.
- ObjectDumper Dumping Scalars Dumping Sequence Dumping Mapping
- A class used to dump objects.
Functions
-
dumpObject(
Object? object, {required YamlDumper dumper, int indent = 0, bool includeYamlDirective = false, Iterable< Dumping Scalars Dumping Sequence Dumping Mapping Dumping Types Dumping YAML DocumentsDirective> ? directives, OnProperties? objectProperties, bool includeGlobalTags = true, bool includeDocumendEnd = false}) → String -
Dumps an
objectwith the specifiedindent. Uses thedumperprovided.