greedyArray static method

CustomLayout greedyArray(
  1. Layout elementLayout, {
  2. String? property,
})

arrays with greedy size layout.

Implementation

static CustomLayout greedyArray(Layout elementLayout, {String? property}) {
  final layout = struct([
    seq(elementLayout, greedy(elementSpan: elementLayout.span),
        property: 'values'),
  ]);
  return CustomLayout<Map<String, dynamic>, dynamic>(
    layout: layout,
    decoder: (data) => data['values'],
    encoder: (values) => {'values': values},
    property: property,
  );
}