vec static method
vectors
Implementation
static CustomLayout vec(Layout elementLayout,
{String? property, IntegerLayout? lengthSizeLayout}) {
lengthSizeLayout ??= (lengthSizeLayout?.clone(newProperty: "length") ??
u32(property: "length"));
final length = padding(lengthSizeLayout, propery: "length");
final layout = struct([
length,
seq(elementLayout, offset(length, -length.span), property: 'values'),
]);
return CustomLayout<Map<String, dynamic>, dynamic>(
layout: layout,
encoder: (data) => {"values": data},
decoder: (data) => data["values"],
property: property,
);
}