INNER CODE UNIT · Dart

itemsPerLine

fluttercandies/flutter_scrollview_observer · lib/src/common/observer_controller.dart:1194

    int itemsPerLine = ((obj.constraints.crossAxisExtent + crossAxisSpacing) /
            (childCrossAxisSize + crossAxisSpacing))
        .round();
    // Calculate the number of lines.
    indexOfLine = (index / itemsPerLine).floor();
    // Calculate the offset of the target child widget on the main axis.
    double targetChildLayoutOffset =
        (childMainAxisSize + itemSeparatorHeight) * indexOfLine;

    return ObserveScrollToIndexFixedHeightResultModel(
      childMainAxisSize: childMainAxisSize,
      itemSeparatorHeight: itemSeparatorHeight,
      indexOfLine: indexOfLine,
      targetChildLayoutOffset: targetChildLayoutOffset,
    );
  }

  /// Update the [indexOffsetMap] property.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…