Skip to content

Commit 979776e

Browse files
author
xuelong
committed
更新至1.2.7
1 parent e93199c commit 979776e

10 files changed

+95
-79
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

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

@@ -78,7 +78,7 @@
7878
```
7979
//pub方式
8080
dependencies:
81-
flutter_easyrefresh: ^1.2.6
81+
flutter_easyrefresh: ^1.2.7
8282
8383
//导入方式
8484
dependencies:

README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

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

@@ -78,7 +78,7 @@ Just like the name, EasyRefresh can easily implement pull-down refresh and uploa
7878
```
7979
//pub
8080
dependencies:
81-
flutter_easyrefresh: ^1.2.6
81+
flutter_easyrefresh: ^1.2.7
8282
8383
//import
8484
dependencies:

art/md/cn/CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,9 @@
117117
## V 1.2.6
118118
>修复:NotificationListener无效问题 [#30](https://github.com/xuelongqy/flutter_easyrefresh/issues/30)
119119
>去除:到达一定高度触发刷新或加载
120-
>修复:刷新或加载结束后无法修改提示文字 [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
120+
>修复:刷新或加载结束后无法修改提示文字 [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
121+
122+
## V 1.2.7
123+
>添加:builder属性,用于添加额外组件,例如滚动条 [#39](https://github.com/xuelongqy/flutter_easyrefresh/issues/39)
124+
>添加:滚动条示例
125+
>添加:淘宝二楼示例 [#26](https://github.com/xuelongqy/flutter_easyrefresh/issues/26)

art/md/en/CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,9 @@
117117
## V 1.2.6
118118
>Fix: NotificationListener is invalid [#30](https://github.com/xuelongqy/flutter_easyrefresh/issues/30)
119119
>Remove: A certain height is reached to trigger a refresh or load
120-
>Fix: Unable to modify prompt text after refresh or loading [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
120+
>Fix: Unable to modify prompt text after refresh or loading [#22](https://github.com/xuelongqy/flutter_easyrefresh/issues/22)
121+
122+
## V 1.2.7
123+
>Add: builder property to add additional components, such as scroll bars [#39](https://github.com/xuelongqy/flutter_easyrefresh/issues/39)
124+
>Add: Scrollbar example
125+
>Add: Taobao second floor example [#26](https://github.com/xuelongqy/flutter_easyrefresh/issues/26)

art/pkg/EasyRefresh.apk

10.5 KB
Binary file not shown.

example/lib/page/sample/scrollbar_page.dart

+64-64
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ class _ScrollBarPageState extends State<ScrollBarPage> {
1414
List<String> addStr = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
1515
List<String> str = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
1616
GlobalKey<EasyRefreshState> _easyRefreshKey =
17-
new GlobalKey<EasyRefreshState>();
17+
new GlobalKey<EasyRefreshState>();
1818
GlobalKey<RefreshHeaderState> _headerKey =
19-
new GlobalKey<RefreshHeaderState>();
19+
new GlobalKey<RefreshHeaderState>();
2020
GlobalKey<RefreshFooterState> _footerKey =
21-
new GlobalKey<RefreshFooterState>();
21+
new GlobalKey<RefreshFooterState>();
2222

2323
@override
2424
Widget build(BuildContext context) {
@@ -28,68 +28,68 @@ class _ScrollBarPageState extends State<ScrollBarPage> {
2828
),
2929
body: Center(
3030
child: new EasyRefresh(
31-
key: _easyRefreshKey,
32-
builder: (context, child, scrollController){
33-
return Scrollbar(child: child);
34-
},
35-
refreshHeader: ClassicsHeader(
36-
key: _headerKey,
37-
refreshText: Translations.of(context).text("pullToRefresh"),
38-
refreshReadyText: Translations.of(context).text("releaseToRefresh"),
39-
refreshingText: Translations.of(context).text("refreshing") + "...",
40-
refreshedText: Translations.of(context).text("refreshed"),
41-
moreInfo: Translations.of(context).text("updateAt"),
42-
bgColor: Colors.transparent,
43-
textColor: Colors.black87,
44-
moreInfoColor: Colors.black54,
45-
showMore: true,
46-
),
47-
refreshFooter: ClassicsFooter(
48-
key: _footerKey,
49-
loadText: Translations.of(context).text("pushToLoad"),
50-
loadReadyText: Translations.of(context).text("releaseToLoad"),
51-
loadingText: Translations.of(context).text("loading"),
52-
loadedText: Translations.of(context).text("loaded"),
53-
noMoreText: Translations.of(context).text("noMore"),
54-
moreInfo: Translations.of(context).text("updateAt"),
55-
bgColor: Colors.transparent,
56-
textColor: Colors.black87,
57-
moreInfoColor: Colors.black54,
58-
showMore: true,
59-
),
60-
child: new ListView.builder(
61-
//ListView的Item
62-
itemCount: str.length,
63-
itemBuilder: (BuildContext context, int index) {
64-
return new Container(
65-
height: 70.0,
66-
child: Card(
67-
child: new Center(
68-
child: new Text(
69-
str[index],
70-
style: new TextStyle(fontSize: 18.0),
71-
),
72-
),
73-
));
74-
}),
75-
onRefresh: () async {
76-
await new Future.delayed(const Duration(seconds: 1), () {
77-
setState(() {
78-
str.clear();
79-
str.addAll(addStr);
80-
});
31+
key: _easyRefreshKey,
32+
builder: (context, child, scrollController) {
33+
return Scrollbar(child: child);
34+
},
35+
refreshHeader: ClassicsHeader(
36+
key: _headerKey,
37+
refreshText: Translations.of(context).text("pullToRefresh"),
38+
refreshReadyText: Translations.of(context).text("releaseToRefresh"),
39+
refreshingText: Translations.of(context).text("refreshing") + "...",
40+
refreshedText: Translations.of(context).text("refreshed"),
41+
moreInfo: Translations.of(context).text("updateAt"),
42+
bgColor: Colors.transparent,
43+
textColor: Colors.black87,
44+
moreInfoColor: Colors.black54,
45+
showMore: true,
46+
),
47+
refreshFooter: ClassicsFooter(
48+
key: _footerKey,
49+
loadText: Translations.of(context).text("pushToLoad"),
50+
loadReadyText: Translations.of(context).text("releaseToLoad"),
51+
loadingText: Translations.of(context).text("loading"),
52+
loadedText: Translations.of(context).text("loaded"),
53+
noMoreText: Translations.of(context).text("noMore"),
54+
moreInfo: Translations.of(context).text("updateAt"),
55+
bgColor: Colors.transparent,
56+
textColor: Colors.black87,
57+
moreInfoColor: Colors.black54,
58+
showMore: true,
59+
),
60+
child: new ListView.builder(
61+
//ListView的Item
62+
itemCount: str.length,
63+
itemBuilder: (BuildContext context, int index) {
64+
return new Container(
65+
height: 70.0,
66+
child: Card(
67+
child: new Center(
68+
child: new Text(
69+
str[index],
70+
style: new TextStyle(fontSize: 18.0),
71+
),
72+
),
73+
));
74+
}),
75+
onRefresh: () async {
76+
await new Future.delayed(const Duration(seconds: 1), () {
77+
setState(() {
78+
str.clear();
79+
str.addAll(addStr);
80+
});
81+
});
82+
},
83+
loadMore: () async {
84+
await new Future.delayed(const Duration(seconds: 1), () {
85+
if (str.length < 20) {
86+
setState(() {
87+
str.addAll(addStr);
8188
});
82-
},
83-
loadMore: () async {
84-
await new Future.delayed(const Duration(seconds: 1), () {
85-
if (str.length < 20) {
86-
setState(() {
87-
str.addAll(addStr);
88-
});
89-
}
90-
});
91-
},
92-
)),
89+
}
90+
});
91+
},
92+
)),
9393
);
9494
}
9595
}

example/lib/page/sample_page.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ class _SamplePageState extends State<SamplePage>
353353
onPressed: () {
354354
Navigator.push(context,
355355
MaterialPageRoute(builder: (BuildContext context) {
356-
return ScrollBarPage();
357-
}));
356+
return ScrollBarPage();
357+
}));
358358
},
359359
icon: Icon(
360360
Icons.border_right,

example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Easy refresh example.
77
# Both the version and the builder number may be overridden in flutter
88
# build by specifying --build-name and --build-number, respectively.
99
# Read more about versioning at semver.org.
10-
version: 1.2.6+26
10+
version: 1.2.7+27
1111

1212
environment:
1313
sdk: ">=2.0.0-dev.68.0 <3.0.0"

lib/src/refresher.dart

+11-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ typedef void HeaderStatusChanged(HeaderStatus status);
1212
typedef void FooterStatusChanged(FooterStatus status);
1313
typedef void HeaderHeightChanged(double height);
1414
typedef void FooterHeightChanged(double height);
15-
typedef Widget TransitionBuilder(BuildContext context, Widget child, ScrollController scrollController);
15+
typedef Widget TransitionBuilder(
16+
BuildContext context, Widget child, ScrollController scrollController);
1617
typedef void AnimationStateChanged(AnimationStates animationStates,
1718
RefreshBoxDirectionStatus refreshBoxDirectionStatus);
1819

@@ -1177,13 +1178,18 @@ class EasyRefreshState extends State<EasyRefresh>
11771178
semanticChildCount: widget.child is ScrollView
11781179
? (widget.child as ScrollView).semanticChildCount
11791180
: 1,
1180-
controller: widget.outerController == null
1181-
? _scrollController
1182-
: null,
1181+
controller: widget.outerController == null ? _scrollController : null,
11831182
physics: _scrollPhysics,
11841183
slivers: new List.from(slivers, growable: true),
11851184
);
1186-
var listWidget = widget.builder == null ? listChild : widget.builder(context, listChild, widget.outerController == null ? _scrollController : widget.outerController);
1185+
var listWidget = widget.builder == null
1186+
? listChild
1187+
: widget.builder(
1188+
context,
1189+
listChild,
1190+
widget.outerController == null
1191+
? _scrollController
1192+
: widget.outerController);
11871193
return new Container(
11881194
child: Stack(
11891195
children: <Widget>[

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_easyrefresh
22
description: A widget provided to the flutter scroll component drop-down refresh and pull up load.
3-
version: 1.2.6
3+
version: 1.2.7
44
author: xuelongqy <xuelongqy@foxmail.com>
55
homepage: https://github.com/xuelongqy/flutter_easyrefresh
66

0 commit comments

Comments
 (0)