SwayzeHeaderState constructor

SwayzeHeaderState({
  1. required double defaultHeaderExtent,
  2. required int count,
  3. required Iterable<SwayzeHeaderData> headerData,
  4. required int frozenCount,
  5. int? elasticCount,
})

Creates a header state from an unsorted list of SwayzeHeaderData.

This is axis agnostic.

Implementation

SwayzeHeaderState({
  required this.defaultHeaderExtent,
  required this.count,
  required Iterable<SwayzeHeaderData> headerData,
  required int frozenCount,
  int? elasticCount,
})  : _frozenCount = frozenCount,
      elasticCount = elasticCount ?? 0,
      _customSizedHeaders = headerData.fold(
        SplayTreeMap<int, SwayzeHeaderData>(),
        (previousValue, element) {
          previousValue[element.index] = element;
          return previousValue;
        },
      );