Code Monkey home page Code Monkey logo

Comments (11)

zmtzawqlp avatar zmtzawqlp commented on June 11, 2024

这个设置下

from pull_to_refresh_notification.

DizzyDuan avatar DizzyDuan commented on June 11, 2024

pullBackDuration是回弹动画的时间

_kIndicatorSnapDuration是下拉后刷新状态下停留的时间

from pull_to_refresh_notification.

zmtzawqlp avatar zmtzawqlp commented on June 11, 2024

pullBackDuration是回弹动画的时间

_kIndicatorSnapDuration是下拉后刷新状态下停留的时间

刷新状态多久。。跟 onrefresh 多久返回有关系

from pull_to_refresh_notification.

DizzyDuan avatar DizzyDuan commented on June 11, 2024
      PullToRefreshNotification(
        onRefresh: () {
          return Future<bool>.delayed(Duration.zero, () {
            return true;
          });
        },
        pullBackOnRefresh: true,
        maxDragOffset: 200,
        pullBackCurve: Curves.linear,
        pullBackDuration: const Duration(milliseconds: 300),
      ),

使用场景不同,我并不是刷新场景,我直接返回了,依然有停留时间。

from pull_to_refresh_notification.

zmtzawqlp avatar zmtzawqlp commented on June 11, 2024

200毫秒?? 你是啥场景??你着急就fork 改下。我并不清楚你这样做的目的

from pull_to_refresh_notification.

DizzyDuan avatar DizzyDuan commented on June 11, 2024
      PullToRefreshNotification(
        onRefresh: () {
          return Future<bool>.delayed(Duration.zero, () {
            return true;
          });
        },
        pullBackOnRefresh: true,
        maxDragOffset: 200,
        pullBackCurve: Curves.linear,
        pullBackDuration: const Duration(milliseconds: 300),
        child: PullToRefreshContainer((info) {
          double offset = info?.dragOffset ?? 0;
          return Container(
            width: double.infinity,
            height: 220 + offset,
            color: Colors.red,
          );
        }),
      ),

以上是我的使用场景。
maxDragOffset:下拉最大距离。
pullBackDuration:回弹动画时长。

当我下拉到最大距离后,放手,会有停留时间。

当我修改为,
const Duration _kIndicatorSnapDuration = Duration.zero;

就没有停留时间了。

所以我希望可以开放此参数。

from pull_to_refresh_notification.

zmtzawqlp avatar zmtzawqlp commented on June 11, 2024

那你完全可以不用这个组件呢。。你这个动作都没有刷新效果,你用ios 的物理效果就行了。也没有任何状态可言,把产品打一顿吧

from pull_to_refresh_notification.

DizzyDuan avatar DizzyDuan commented on June 11, 2024

WX20220114-105709@2x

可以看_show这个方法,是在执行 animateTo 后才调用了onRefresh

from pull_to_refresh_notification.

DizzyDuan avatar DizzyDuan commented on June 11, 2024

NestedScrollView-TabBarView

SliverAppBar-FlexibleSpaceBar-zoomBackground

效果失效

所以很尴尬

from pull_to_refresh_notification.

zmtzawqlp avatar zmtzawqlp commented on June 11, 2024

我的意思是。你可以自己写。这是刷新组件。不是动画组件

from pull_to_refresh_notification.

DizzyDuan avatar DizzyDuan commented on June 11, 2024

@zmtzawqlp

我明白您的意思。

单纯以刷新组件来说,onRefresh的返回应该是可以控制停留时长的吧。

如果以测试的角度来看,这会是个BUG。App停留了150毫秒后调用onRefresh,访问后台50毫秒返回数据,总停留了200毫秒,App端不看源码的话会很纳闷,怎么会停留这么长时间。

您觉得呢?

from pull_to_refresh_notification.

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.