ListFormatGenerator typedef
Signature used by ListFormat to construct the key path for a single element in a list during encoding.
Parameters:
prefix
: The current container key (e.g."foo"
). This is always provided by the encoder.key
: Optional element key. For ListFormat.indices it is the element index as a string ("0"
,"1"
, …). Other formats ignore it.
Returns the key path string to be written for that element (without the
'='
or the value), e.g. "foo[0]"
, "foo[]"
, or "foo"
.
Implementation
typedef ListFormatGenerator = String Function(String prefix, [String? key]);