Closed guitar09 closed 4 years ago
Sorry, the current version does not support jump to specified items. There are the following temporary solutions:
var _controller = ExpandableListController();
var _listController = ScrollController();
onTap: () {
bool hasSeparator = false;
int indexInListView = hasSeparator ? sectionIndex * 2 : sectionIndex;
//get section offset, can not get the offset which not visible on screen.
double offset = _controller.containerOffsets[indexInListView];
_listController.animateTo(offset,
duration: Duration(microseconds: 1000), curve: Curves.linear);
});
p where i can associate this value to ExpandableListView?
var _controller = ExpandableListController();
because if i define this variable and print
_controller.containerOffsets;
i received a empty array
I have added an example of scroll to index.
Is it possible to scroll the list to a specific index in the header(pinned)?
for example: scrollControler.jumpTo(sectionIndex);
sorry my bad english