maxXIndex property

int? get maxXIndex

The maximum ChildVicinity.xIndex for children in the x axis.

For each ChildVicinity, the child's relative location is described in terms of x and y indices to facilitate a consistent visitor pattern for all children in the viewport.

This is fairly straightforward in the context of a table implementation, where there is usually the same number of columns in every row and vice versa, each aligned one after the other.

When plotting children more abstractly in two dimensional space, there may be more x indices for a given y index than another y index. An example of this would be a scatter plot where there are more children at the top of the graph than at the bottom.

If null, subclasses of RenderTwoDimensionalViewport can continue call on the builder until null has been returned for each known index of x and y. In some cases, null may not be a terminating result, such as a table with a merged cell spanning multiple indices. Refer to the TwoDimensionalViewport subclass to learn how this value is applied in the specific use case.

If not null, the value must be greater than or equal to -1, where -1 indicates there will be no children at all provided to the TwoDimensionalViewport.

If the value changes, the delegate will call notifyListeners. This informs the RenderTwoDimensionalViewport that any cached information from the delegate is invalid.

This value represents the greatest x index of all ChildVicinitys for the two dimensional scroll view.

See also:

Implementation

int? get maxXIndex => _maxXIndex;
set maxXIndex (int? value)

Implementation

set maxXIndex(int? value) {
  if (value == maxXIndex) {
    return;
  }
  assert(value == null || value >= -1);
  _maxXIndex = value;
  notifyListeners();
}