Giter Site home page Giter Site logo

Comments (8)

CarGuo avatar CarGuo commented on August 16, 2024

先 jumpTo 一个 maxScrollExtent - X 的值,然后在 then 里去 scrollto maxScrollExtent 试试

from gsy_flutter_demo.

tabbg avatar tabbg commented on August 16, 2024

感谢你的回答。X是取什么值合适点呢?我之前有试过先滚动到maxScrollExtent *0.5然后then0.6-0.7-0.8-0.9-1这种方式,但是任然会有概率会跳动一下。

from gsy_flutter_demo.

CarGuo avatar CarGuo commented on August 16, 2024

一般我是取 0.7 左右,然后 then 的时候直接就用 animate to 不用 jump 了,在 animate to 的时候重新get maxScrollExtent

from gsy_flutter_demo.

tabbg avatar tabbg commented on August 16, 2024

第一次jump到0.7的时候需要延时再去animate不?还有就是我这边RefreshIndicator+physics:const AlwaysScrollableScrollPhysics().applyTo(const BouncingScrollPhysics()),下拉刷新时,偶现会一直触发BouncingScrollPhysics的回弹效果,来回一直弹。我将cacheExtent设置到超级大的情况下才解决了此问题。其核心问题大概也是因为maxScrollExtent 高度不确定导致的。

from gsy_flutter_demo.

CarGuo avatar CarGuo commented on August 16, 2024

另外一个思路,跳转到末尾滚动期间修改为 ClampingScrollPhysics ,跳转结束后才改为 BouncingScrollPhysics

from gsy_flutter_demo.

tabbg avatar tabbg commented on August 16, 2024

这个我试过了,没用 哪怕是ClampingScrollPhysics 也会跳动一下。

from gsy_flutter_demo.

CarGuo avatar CarGuo commented on August 16, 2024

嗯嗯,我想叉了,jump 直接改的 position ,可以越过 physics ,我以前大概就是这样

   scroller.jumpTo(
                            scroller.position.maxScrollExtent * 0.7);
                        Future.delayed(Duration(milliseconds: 400), () {
                          scroller.animateTo(scroller.position.maxScrollExtent,
                              duration: Duration(milliseconds: 500),
                              curve: Curves.linear);
                        });
```

from gsy_flutter_demo.

tabbg avatar tabbg commented on August 16, 2024

嗯,这种方式我也试过,但是不能100%保证不跳动一下。我现在使用的方式就是将cacheExtent的值修改到很大,再附带你所说的跳转方式勉强能达到大部分时间不跳动。但是还是不能保证问题。就想找一下看看有没有什么方式避免这种问题。

from gsy_flutter_demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.