how to know current index visible in viewport(header)
Closed this issue · 1 comments
rahulk3sharma commented
how to know current index visible in viewport(header)
robert-luoqing commented
You can get it by
_stickyHeaderChanged() {
print(
"Sticky Header Change To: ${controller.sliverController.stickyIndex.value}");
}
_fetchStickHeader() async {
await Future.delayed(const Duration(milliseconds: 100));
print(
"Sticky Header Change To: ${controller.sliverController.stickyIndex.value}");
}
@override
void initState() {
_loadCountry();
controller.sliverController.stickyIndex.addListener(_stickyHeaderChanged);
_fetchStickHeader();
super.initState();
}