From 0be096c1a822fb03b38115cd76d1bee7e5afdaa2 Mon Sep 17 00:00:00 2001 From: peng8350 Date: Fri, 7 May 2021 21:29:17 +0800 Subject: [PATCH] update to 2.0.0 --- CHANGELOG.md | 3 ++- README.md | 5 ++--- README_CN.md | 5 ++--- lib/src/internals/slivers.dart | 4 ++-- propertys.md | 4 ++-- propertys_en.md | 4 ++-- pubspec.yaml | 2 +- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd969aed..a338109d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index eb2e7a57..e0e454ef 100644 --- a/README.md +++ b/README.md @@ -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 + ``` diff --git a/README_CN.md b/README_CN.md index 71cf35a2..5e54e965 100644 --- a/README_CN.md +++ b/README_CN.md @@ -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 + ``` diff --git a/lib/src/internals/slivers.dart b/lib/src/internals/slivers.dart index 4fd85ac1..e004286b 100644 --- a/lib/src/internals/slivers.dart +++ b/lib/src/internals/slivers.dart @@ -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 @@ -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) { diff --git a/propertys.md b/propertys.md index eea52dbc..3693cd42 100644 --- a/propertys.md +++ b/propertys.md @@ -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 | 可选 | @@ -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 | 可选 | diff --git a/propertys_en.md b/propertys_en.md index f37a7035..4d605df3 100644 --- a/propertys_en.md +++ b/propertys_en.md @@ -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 | 可选 | @@ -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 | 可选 | diff --git a/pubspec.yaml b/pubspec.yaml index aa46fe88..0c256250 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: