Closed amrgetment closed 6 months ago
You could try to scroll through contacts on your mobile to get the idea about why I need it
I understand the usecase. Would need to figure out what the proper API for this would look like. Btw. there are packages such as visibility detector that might be usable for something like this, but in general doing this on sliver level would probably be fastest.
@knopp Thanks for your effort in adding this feature so I can almost replace the Google scrollable_positioned_list library Now I can get the first visible items to update the side alphabet bar I will replace itemPositionsListener by ScrollController listener
widget.itemPositionsListener.itemPositions.addListenerWithCloser(this,
() {
if (widget.itemPositionsListener.itemPositions.value.isNotEmpty) {
final double scrollableItemIndex =
_getFirstScrollableItem().toDouble();
if (scrollableItemIndex != _currentSliderValue) {
setState(() {
_currentSliderValue = scrollableItemIndex;
});
}
}
});
I will let you know if I was able to replace it successfully
Thanks again for your effort
I wonder how to get the first visible item to update the side alphabets for the contacts list like Google or Samsung contacts?