flutterchina / flukit

A Flutter UI Kit(一个 Flutter UI组件库),包含 ScaleView, Swiper, PullRefresh, WaterMark, GradientCircularProgressIndicator...
5.65k stars 647 forks source link

pull_refresh.dart 的几个修改意见 #6

Closed crazy365966834 closed 5 years ago

crazy365966834 commented 5 years ago

1、PullRefreshBox 的构造函数可以这样写:

PullRefreshBox({Key key, this.child, @required this.onRefresh, PullRefreshIndicator indicator, this.overScrollEffect})
      : this.indicator = indicator ?? DefaultPullRefreshIndicator(),
        super(key: key);

  final PullRefreshCallback onRefresh;
  final Widget child;
  final TargetPlatform overScrollEffect;
  final PullRefreshIndicator indicator;

2、PullRefreshBoxState 和 _AnimatedRotationBoxState 的initState没有 调用 super.initState() ,这是不合适的。 3、PullRefreshBoxState 中的方法返回Future,但是没有return。