Closed liangdas closed 2 years ago
WidgetsBinding?.instance.addPostFrameCallback((timeStamp) { _controller?.scrollListener(); });
使用addPostFrameCallback的原因是StickyHeader先于包裹的滚动组件更新,如果不延后执行scrollListener方法,那么获取的StickyHeaderInfo是滚动组件更新前的数据。
WidgetsBinding?.instance.addPostFrameCallback((timeStamp) { _controller?.scrollListener(); });