fluttercandies / extended_nested_scroll_view

extended nested scroll view to fix following issues. 1.pinned sliver header issue 2.inner scrollables in tabview sync issue 3.pull to refresh is not work. 4.do without ScrollController in NestedScrollView's body
MIT License
591 stars 117 forks source link

设置 controller 后,如何获取滚动的 offset? #81

Closed OHeroJ closed 2 years ago

OHeroJ commented 2 years ago

现在配置,只能监听到 header 部分的滚动。body 里面是其他 scroll, 他们的滚动就无法监测到了。 不知道有没有高招指点下。

现在自己的一个思路就是, 总偏移量 = header 的偏移量 + body 里面scroll 的偏移量。 但是这样做不灵活。

zmtzawqlp commented 2 years ago

https://github.com/fluttercandies/extended_nested_scroll_view/blob/1f3965a6729a7a907162818a8e0586466836f398/example/lib/pages/complex/scroll_to_top.dart#L46

zmtzawqlp commented 2 years ago

_key.currentState.outerController and _key.currentState.innerController

zmtzawqlp commented 2 years ago

你先看看demo 吧。。一般是不会自动去设置 controller 的