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

4.0.0版本的更新存在bug,3.0.1版本正常 #82

Closed popsams closed 2 years ago

popsams commented 2 years ago

重现方式: ExtendedNestedScrollView + SliverAppBar + Tab(2Item)+ PageView(2Item) PageView的children是2个GridView 下面的步骤都是通过滑动PageView来切换,通过Tab切换重现bug概率很低 第一步:不要滑动GridView1,直接PageView左滑切换到GridView2,然后再PageView右滑切换回GridView1 第二步:往上滑动GridView1一些距离,然后PageView左滑切换到GridView2,然后再PageView右滑切换回GridView1 第三步:往上滑动GridView1一些距离,然后再PageView左滑切换到GridView2,这时GridView2位置发生了变化,这应该是个bug 注意:重现的时候,GridView1滑动的距离可以少一点或者多一点多测几次,有时不一定能重现,但是多试几次肯定能重现bug

zmtzawqlp commented 2 years ago

请提供demo 和视频。你可以先退回3.0.0,如果对你影响很大

popsams commented 2 years ago

请提供demo 和视频。你可以先退回3.0.0,如果对你影响很大

代码和重试录屏(代码工程配置可能有点问题,你主要看下UI代码) 下载链接:https://github.com/hylsabella/demo/raw/main/%E4%BB%A3%E7%A0%81%E5%92%8C%E8%A7%86%E9%A2%91%20bugdemo_extended_nested_scroll.zip

zmtzawqlp commented 2 years ago

先看下 https://juejin.cn/user/254742428916408/posts 理解一下新旧实现的原理

我看你用了 PageStorageKey + AutomaticKeepAliveClientMixin, 完全没有必要呀。

用 AutomaticKeepAliveClientMixin 而不是 PageStorageKey。 使用 PageStorageKey 的话。不需要用extended nestedscrollview, 但是如果你是复杂列表会有性能问题

删除 PageStorageKey,无法重现

话说你是不是一直就用错方式了

popsams commented 2 years ago

用PageStorageKey 是因为4.0之前版本代码遗留的,我看你的demo里4.0版本也在用(ExtendedNestedScrollView+PageStorageKey,extened_nested_scroll_view_demo的第103行) 安装你说的方法,把其中4行PageStorageKey 代码删除,其他不动,还是会出现bug,大神你可以多试几次,你改后的demo代码也可以发我看看,我确实没骗你,hylsabella@qq.com

popsams commented 2 years ago

大神,demo代码你得跑起来测试啊,别只是看我代码就说去掉哪行哪行就好了,其实不是那么回事,谢了

zmtzawqlp commented 2 years ago

我确实重现不了,我已经跑过你的demo了

zmtzawqlp commented 2 years ago

我demo 里面有,但是,不是你demo里面那种形式。 我没有给 PageStorageKey+ AutomaticKeepAliveClientMixin

popsams commented 2 years ago

我确实重现不了,我已经跑过你的demo了

你重现的时候,切换页面是通过点击Tab还是滑动PageView,必须要是通过滑动PageView才能重现,晚点我把PageStorageKey屏蔽并重现的情况录屏给你

popsams commented 2 years ago

我demo 里面有,但是,不是你demo里面那种形式。 我没有给 PageStorageKey+ AutomaticKeepAliveClientMixin

加AutomaticKeepAliveClientMixin只是为了避免切换PageView的时候触发GridView的Build重绘,不然要是快速切换PageView每次GridView都得重绘会很卡

popsams commented 2 years ago

我确实重现不了,我已经跑过你的demo了

去掉PageStorageKey后还是会出现问题:

https://user-images.githubusercontent.com/7107285/130553483-b85cd198-c489-4f4c-94c2-3cd672a3ab8a.mp4

popsams commented 2 years ago

大哥,有没有计划解决这个问题呀

popsams commented 2 years ago

你这个项目做的挺好的,能解决目前的问题,可能就是4.0版本重构的时候疏忽了某些地方,导致和3.0.1不一样了,改改就好

zmtzawqlp commented 2 years ago

close duplicate

https://github.com/fluttercandies/extended_nested_scroll_view/issues/89