letsar / overflow_view

A widget displaying children in a line until there is not enough space and showing a the number of children not rendered.
MIT License
173 stars 23 forks source link

OverflowIndicator alignment on the right / bottom #6

Closed caduandrade closed 3 years ago

caduandrade commented 3 years ago

The OverflowIndicator is positioned next to the children but could be aligned as well on the opposite side, filling the remaining space. Screenshot_20210313_195938

caduandrade commented 3 years ago

If I understood, I think the solution is pretty simple. Could define some bool to configure it. The default value could be false to keep current behavior. Then the change should only add this line:

if (_isAnchored) { offset += availableExtent - childMainSize; }

before line 290 (src/rendering/overflow_view.dart):

overflowIndicatorParentData.offset = _isHorizontal ? Offset(offset, 0) : Offset(0, offset);

Of course, after NullSafety merge, this line number will change ;-) I can try a PR after the NullSafety if you want.

"_isAnchored" is just a suggestion.

Tks!