We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to listen to the current index which is in the viewport?
This could be very useful to trigger actions when an index is inside the viewport
The text was updated successfully, but these errors were encountered:
refer to https://github.com/quire-io/scroll-to-index/blob/master/lib/scroll_to_index.dart#L481,
the concept is that you will get the offset to reveal the target widget based on alignment 0 and 1 (means the top and bottom of the viewport).
the code should be like: (never really try it in code, you can follow this concept doing the experiment)
final isInViewport = _offsetToRevealInViewport(10, 0) => 0 && _offsetToRevealInViewport(10, 0) <= 0;
Sorry, something went wrong.
The flutter_scrollview_observer package can help you.
ListViewObserver( child: _buildListView(), onObserve: (resultModel) { print('firstChild.index -- ${resultModel.firstChild?.index}'); print('displaying -- ${resultModel.displayingChildIndexList}'); }, )
No branches or pull requests
Is there a way to listen to the current index which is in the viewport?
This could be very useful to trigger actions when an index is inside the viewport
The text was updated successfully, but these errors were encountered: