calculate method

  1. @override
List<ItemPosition> calculate()
override

Calculate item positions

Implementation

@override
List<ItemPosition> calculate() {
  _allowedBySpaceAndMaxCoverageAmountItems = _calculateMaxCapacityItems(_length);
  _allowedAmountItems = _getAmountItems();
  _amountHiddenItems = _fullAmountItems - _allowedAmountItems;
  _isInfoItem = _amountHiddenItems > 0;
  if (_isInfoItem) {
    _allowedBySpaceAndMaxCoverageAmountItems = _calculateMaxCapacityItemsWithInfoItem();
    _allowedAmountItems = _getAmountItems();
    _amountHiddenItems = _fullAmountItems - _allowedAmountItems + 1;
    _spaceBetweenItems = _calculateSpaceBetweenItemsWithInfoItem();
  } else {
    _spaceBetweenItems = _calculateSpaceBetweenItems();
  }
  _offsetStep = _calculateOffsetStep();
  _alignmentOffset = _getAlignmentOffset();
  return _generatePositions();
}