Skip to content

Commit

Permalink
更新至1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelong committed Mar 2, 2019
1 parent e93199c commit 979776e
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 79 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License](https://img.shields.io/badge/license-MIT-green.svg)](/LICENSE)
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://stackoverflow.com/questions/tagged/flutter?sort=votes)
[![Pub](https://img.shields.io/badge/pub-v1.2.6-orange.svg)](https://pub.dartlang.org/packages/flutter_easyrefresh)
[![Pub](https://img.shields.io/badge/pub-v1.2.7-orange.svg)](https://pub.dartlang.org/packages/flutter_easyrefresh)

## [English](https://github.com/xuelongqy/flutter_easyrefresh/blob/master/README_EN.md) | 中文

Expand Down Expand Up @@ -78,7 +78,7 @@
```
//pub方式
dependencies:
flutter_easyrefresh: ^1.2.6
flutter_easyrefresh: ^1.2.7
//导入方式
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License](https://img.shields.io/badge/license-MIT-green.svg)](/LICENSE)
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://stackoverflow.com/questions/tagged/flutter?sort=votes)
[![Pub](https://img.shields.io/badge/pub-v1.2.6-orange.svg)](https://pub.dartlang.org/packages/flutter_easyrefresh)
[![Pub](https://img.shields.io/badge/pub-v1.2.7-orange.svg)](https://pub.dartlang.org/packages/flutter_easyrefresh)

## English | [中文](https://github.com/xuelongqy/flutter_easyrefresh/blob/master/README.md)

Expand Down Expand Up @@ -78,7 +78,7 @@ Just like the name, EasyRefresh can easily implement pull-down refresh and uploa
```
//pub
dependencies:
flutter_easyrefresh: ^1.2.6
flutter_easyrefresh: ^1.2.7
//import
dependencies:
Expand Down
7 changes: 6 additions & 1 deletion art/md/cn/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,9 @@
## V 1.2.6
>修复:NotificationListener无效问题 [#30](https://github.com/xuelongqy/flutter_easyrefresh/issues/30)
>去除:到达一定高度触发刷新或加载
>修复:刷新或加载结束后无法修改提示文字 [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
>修复:刷新或加载结束后无法修改提示文字 [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
## V 1.2.7
>添加:builder属性,用于添加额外组件,例如滚动条 [#39](https://github.com/xuelongqy/flutter_easyrefresh/issues/39)
>添加:滚动条示例
>添加:淘宝二楼示例 [#26](https://github.com/xuelongqy/flutter_easyrefresh/issues/26)
7 changes: 6 additions & 1 deletion art/md/en/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,9 @@
## V 1.2.6
>Fix: NotificationListener is invalid [#30](https://github.com/xuelongqy/flutter_easyrefresh/issues/30)
>Remove: A certain height is reached to trigger a refresh or load
>Fix: Unable to modify prompt text after refresh or loading [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
>Fix: Unable to modify prompt text after refresh or loading [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
## V 1.2.7
>Add: builder property to add additional components, such as scroll bars [#39](https://github.com/xuelongqy/flutter_easyrefresh/issues/39)
>Add: Scrollbar example
>Add: Taobao second floor example [#26](https://github.com/xuelongqy/flutter_easyrefresh/issues/26)
Binary file modified art/pkg/EasyRefresh.apk
Binary file not shown.
128 changes: 64 additions & 64 deletions example/lib/page/sample/scrollbar_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class _ScrollBarPageState extends State<ScrollBarPage> {
List<String> addStr = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
List<String> str = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
GlobalKey<EasyRefreshState> _easyRefreshKey =
new GlobalKey<EasyRefreshState>();
new GlobalKey<EasyRefreshState>();
GlobalKey<RefreshHeaderState> _headerKey =
new GlobalKey<RefreshHeaderState>();
new GlobalKey<RefreshHeaderState>();
GlobalKey<RefreshFooterState> _footerKey =
new GlobalKey<RefreshFooterState>();
new GlobalKey<RefreshFooterState>();

@override
Widget build(BuildContext context) {
Expand All @@ -28,68 +28,68 @@ class _ScrollBarPageState extends State<ScrollBarPage> {
),
body: Center(
child: new EasyRefresh(
key: _easyRefreshKey,
builder: (context, child, scrollController){
return Scrollbar(child: child);
},
refreshHeader: ClassicsHeader(
key: _headerKey,
refreshText: Translations.of(context).text("pullToRefresh"),
refreshReadyText: Translations.of(context).text("releaseToRefresh"),
refreshingText: Translations.of(context).text("refreshing") + "...",
refreshedText: Translations.of(context).text("refreshed"),
moreInfo: Translations.of(context).text("updateAt"),
bgColor: Colors.transparent,
textColor: Colors.black87,
moreInfoColor: Colors.black54,
showMore: true,
),
refreshFooter: ClassicsFooter(
key: _footerKey,
loadText: Translations.of(context).text("pushToLoad"),
loadReadyText: Translations.of(context).text("releaseToLoad"),
loadingText: Translations.of(context).text("loading"),
loadedText: Translations.of(context).text("loaded"),
noMoreText: Translations.of(context).text("noMore"),
moreInfo: Translations.of(context).text("updateAt"),
bgColor: Colors.transparent,
textColor: Colors.black87,
moreInfoColor: Colors.black54,
showMore: true,
),
child: new ListView.builder(
//ListView的Item
itemCount: str.length,
itemBuilder: (BuildContext context, int index) {
return new Container(
height: 70.0,
child: Card(
child: new Center(
child: new Text(
str[index],
style: new TextStyle(fontSize: 18.0),
),
),
));
}),
onRefresh: () async {
await new Future.delayed(const Duration(seconds: 1), () {
setState(() {
str.clear();
str.addAll(addStr);
});
key: _easyRefreshKey,
builder: (context, child, scrollController) {
return Scrollbar(child: child);
},
refreshHeader: ClassicsHeader(
key: _headerKey,
refreshText: Translations.of(context).text("pullToRefresh"),
refreshReadyText: Translations.of(context).text("releaseToRefresh"),
refreshingText: Translations.of(context).text("refreshing") + "...",
refreshedText: Translations.of(context).text("refreshed"),
moreInfo: Translations.of(context).text("updateAt"),
bgColor: Colors.transparent,
textColor: Colors.black87,
moreInfoColor: Colors.black54,
showMore: true,
),
refreshFooter: ClassicsFooter(
key: _footerKey,
loadText: Translations.of(context).text("pushToLoad"),
loadReadyText: Translations.of(context).text("releaseToLoad"),
loadingText: Translations.of(context).text("loading"),
loadedText: Translations.of(context).text("loaded"),
noMoreText: Translations.of(context).text("noMore"),
moreInfo: Translations.of(context).text("updateAt"),
bgColor: Colors.transparent,
textColor: Colors.black87,
moreInfoColor: Colors.black54,
showMore: true,
),
child: new ListView.builder(
//ListView的Item
itemCount: str.length,
itemBuilder: (BuildContext context, int index) {
return new Container(
height: 70.0,
child: Card(
child: new Center(
child: new Text(
str[index],
style: new TextStyle(fontSize: 18.0),
),
),
));
}),
onRefresh: () async {
await new Future.delayed(const Duration(seconds: 1), () {
setState(() {
str.clear();
str.addAll(addStr);
});
});
},
loadMore: () async {
await new Future.delayed(const Duration(seconds: 1), () {
if (str.length < 20) {
setState(() {
str.addAll(addStr);
});
},
loadMore: () async {
await new Future.delayed(const Duration(seconds: 1), () {
if (str.length < 20) {
setState(() {
str.addAll(addStr);
});
}
});
},
)),
}
});
},
)),
);
}
}
4 changes: 2 additions & 2 deletions example/lib/page/sample_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ class _SamplePageState extends State<SamplePage>
onPressed: () {
Navigator.push(context,
MaterialPageRoute(builder: (BuildContext context) {
return ScrollBarPage();
}));
return ScrollBarPage();
}));
},
icon: Icon(
Icons.border_right,
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Easy refresh example.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.2.6+26
version: 1.2.7+27

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
Expand Down
16 changes: 11 additions & 5 deletions lib/src/refresher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ typedef void HeaderStatusChanged(HeaderStatus status);
typedef void FooterStatusChanged(FooterStatus status);
typedef void HeaderHeightChanged(double height);
typedef void FooterHeightChanged(double height);
typedef Widget TransitionBuilder(BuildContext context, Widget child, ScrollController scrollController);
typedef Widget TransitionBuilder(
BuildContext context, Widget child, ScrollController scrollController);
typedef void AnimationStateChanged(AnimationStates animationStates,
RefreshBoxDirectionStatus refreshBoxDirectionStatus);

Expand Down Expand Up @@ -1177,13 +1178,18 @@ class EasyRefreshState extends State<EasyRefresh>
semanticChildCount: widget.child is ScrollView
? (widget.child as ScrollView).semanticChildCount
: 1,
controller: widget.outerController == null
? _scrollController
: null,
controller: widget.outerController == null ? _scrollController : null,
physics: _scrollPhysics,
slivers: new List.from(slivers, growable: true),
);
var listWidget = widget.builder == null ? listChild : widget.builder(context, listChild, widget.outerController == null ? _scrollController : widget.outerController);
var listWidget = widget.builder == null
? listChild
: widget.builder(
context,
listChild,
widget.outerController == null
? _scrollController
: widget.outerController);
return new Container(
child: Stack(
children: <Widget>[
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: flutter_easyrefresh
description: A widget provided to the flutter scroll component drop-down refresh and pull up load.
version: 1.2.6
version: 1.2.7
author: xuelongqy <[email protected]>
homepage: https://github.com/xuelongqy/flutter_easyrefresh

Expand Down

0 comments on commit 979776e

Please sign in to comment.