Skip to content

Commit

Permalink
update to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peng8350 committed May 7, 2021
1 parent 6544819 commit 0be096c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

### features
* migrate null-safety
* add needCallback in requestRefresh and requestLoading for avoiding the callback of onRefresh or onLoading
* add needCallback in requestRefresh and requestLoading for avflutoiding the callback of onRefresh or onLoading

### Bug fix
* In NestedScrollView+ClampingScrollPhysics(Android ScrollBehaviour),header can be seen when fling to top.
* unMounted widget used crash error when fast rebuild in requestRefresh
* fix sliverRefreshBody layoutSize instead of -0.001,it will crash error when viewportMainAxis=0

### Other
* Add assert to avoid invalid usage
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ add this line to pubspec.yaml

dependencies:

pull_to_refresh: ^1.6.5
# null-safety version
# pull_to_refresh: 1.6.4-nullsafety.0
pull_to_refresh: ^2.0.0


```

Expand Down
5 changes: 2 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@

dependencies:

pull_to_refresh: ^1.6.5
# null-safety version
# pull_to_refresh: 1.6.4-nullsafety.0
pull_to_refresh: ^2.0.0


```

Expand Down
4 changes: 2 additions & 2 deletions lib/src/internals/slivers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class RenderSliverLoading extends RenderSliverSingleBoxAdapter {
sliverP = viewport.childAfter(sliverP!);
}
// consider about footer layoutExtent,it should be subtracted it's height
return totalScrollExtent >= cons.viewportMainAxisExtent;
return totalScrollExtent > cons.viewportMainAxisExtent;
}

// many sitiuation: 1. reverse 2. not reverse
Expand Down Expand Up @@ -541,7 +541,7 @@ class RenderSliverRefreshBody extends RenderSliverSingleBoxAdapter {
if (childExtent == 1111111) {
child!.layout(
constraints.asBoxConstraints(
maxExtent: constraints.viewportMainAxisExtent - 0.1),
maxExtent: constraints.viewportMainAxisExtent),
parentUsesSize: true);
}
switch (constraints.axis) {
Expand Down
4 changes: 2 additions & 2 deletions propertys.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| enablePullUp | 是否允许上拉 | boolean | false | 可选 |
| onRefresh | 进入下拉刷新时的回调 | () => Void | null | 可选 |
| onLoading | 进入上拉加载时的回调 | () => Void | null | 可选 |
| onOffsetChange | 它将在超出边缘范围拖动时回调 | (bool,double) => Void | null | 可选 |
| onOffsetChange(2.0.0 removed) | 它将在超出边缘范围拖动时回调 | (bool,double) => Void | null | 可选 |
| onTwoLevel | 当准备打开二楼时的回调 | () => Void | null | 可选 |


Expand Down Expand Up @@ -83,7 +83,7 @@
|---------|--------------------------|:-----:|:-----:|:-----:|
| footerBuilder | 默认尾部指示器全局构造器 | () => ? extends LoadIndicator | null | 可选 |
| hideWhenNotFull | 当ScrollView不满一页时,是否要隐藏底部指示器 | bool | false | 可选 |
| autoLoad | 自动加载更多,假如为false,滑动底部不会触发,但提供点击加载更多的方法 | bool | true | 可选 |
| autoLoad(2.0.0 removed) | 自动加载更多,假如为false,滑动底部不会触发,但提供点击加载更多的方法 | bool | true | 可选 |
| enableLoadingWhenFailed | 是否允许通过手势来触发加载更多当失败的状态 | bool | true| 可选 |
| enableLoadingWhenNodata | 是否允许通过手势来触发加载更多当没有更多数据的状态 | bool | false| 可选 |
| footerTriggerDistance | 距离底部边缘触发加载更多的距离,注意这个属性和header的不同,它可以为负数,负数代表越界 | double | 15.0 | 可选 |
Expand Down
4 changes: 2 additions & 2 deletions propertys_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
| enablePullUp | switch of pullupload | boolean | false | optional |
| onRefresh | callback when refreshing | () => Void | null | optional |
| onLoading | callback when loading | () => Void | null | optional |
| onOffsetChange | callBack the Visible range of indicator | (bool,double) => Void | null | optional |
| onOffsetChange(2.0.0 removed) | callBack the Visible range of indicator | (bool,double) => Void | null | optional |
| onTwoLevel | callback when second floor is opening | () => Void | null | 可选 |


Expand Down Expand Up @@ -78,7 +78,7 @@ Load more(footer):
|---------|--------------------------|:-----:|:-----:|:-----:|
| footerBuilder | the footer indicator builder | () => ? extends LoadIndicator | null | 可选 |
| hideWhenNotFull | whether to hide footer when scrollview not enough one page | bool | true | 可选 |
| autoLoad | Autoload more, if false, sliding bottom will not trigger, but provide more click loading methods | bool | true | 可选 |
| autoLoad(2.0.0 removed) | Autoload more, if false, sliding bottom will not trigger, but provide more click loading methods | bool | true | 可选 |
| enableLoadingWhenFailed | whether allowed to use gesture pull-up trigger to load more when failed state | bool | true| 可选 |
| enableLoadingWhenNoData | whether allowed to use gesture pull-up trigger to load more when no more data state | bool | false| 可选 |
| maxUnderScrollExtent | max underScroll distance | double | ios:inf,android:0 | 可选 |
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pull_to_refresh
description: a widget provided to the flutter scroll component drop-down refresh and pull up load.
version: 1.6.5
version: 2.0.0
homepage: https://github.com/peng8350/flutter_pulltorefresh

environment:
Expand Down

0 comments on commit 0be096c

Please sign in to comment.