encodeListItemValue function
void
encodeListItemValue(
- Object? value,
- LineWriter writer,
- int depth,
- ResolvedEncodeOptions options,
Encodes a list item value
Implementation
void encodeListItemValue(Object? value, LineWriter writer, int depth,
ResolvedEncodeOptions options) {
if (isJsonPrimitive(value)) {
writer.pushListItem(depth, encodePrimitive(value, options.delimiter));
} else if (isJsonArray(value)) {
final valueList = value as List<Object?>;
if (isArrayOfPrimitives(valueList)) {
final inline = encodeInlineArrayLine(
valueList, options.delimiter, null, options.lengthMarker);
writer.pushListItem(depth, inline);
}
} else if (isJsonObject(value)) {
encodeObjectAsListItem(
value as Map<String, Object?>, writer, depth, options);
}
}