Open r07work opened 3 months ago
The widget has initOffset and initOffsetBasedOnBottom two properties. I have not implemented showing the item in the center of the list view. But you can adjust initOffset to implement it.
The item will show in top if reverse = true and initOffsetBasedOnBottom=true. You can adjust initOffset to a distance from the top.
If you search in flutter list view, you can invoke controller.sliverController.jumpToIndex
void jumpToIndex(int index,
{double offset = 0, bool offsetBasedOnBottom = false}
Thank you @robert-luoqing, Let me try this.
I am developing a feature that allows users to search for items and click on a search result. When the results are displayed on the screen, I use
initIndex
to position the selected item within the view.Currently the
initIndex
is being displayed at bottom of screen. How to position initIndex item at center?Thank you!