updateSectionHeights method

void updateSectionHeights(
  1. int index,
  2. double height
)

Implementation

void updateSectionHeights(int index, double height) {
  bool sameValueFlag = false;

  _sectionHeights.update(
    index,
    (value) {
      if (value == height) {
        sameValueFlag = true;
      }
      return height;
    },
    ifAbsent: () {
      return height;
    },
  );

  if (sameValueFlag) {
    return;
  }

  _calculateTopSnapOffsets();
  _calculateCenterSnapOffsets();
  _calculateBottomSnapOffsets();

  _fixLastAnimatedIndexOffset();
}