Skip to content

Commit

Permalink
修复BezierCircleHeader进度条偶尔不隐藏;TaurusHeader添加背景色设置
Browse files Browse the repository at this point in the history
  • Loading branch information
knoyo committed Apr 10, 2020
1 parent d0e448d commit 02448d3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## Next
>Fix: BezierCircleHeader progress bar is occasionally not hidden
>Update: TaurusHeader add backgroundColor parameter
## V 2.1.0
>Fix: After using firstRefreshWidget, pull down refresh does not take effect [issues#250](https://github.com/xuelongqy/flutter_easyrefresh/issues/250),[issues#256](https://github.com/xuelongqy/flutter_easyrefresh/issues/256)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 下个版本
>修复: BezierCircleHeader进度条偶尔不隐藏
>更新: TaurusHeader添加背景色设置
## V 2.1.0
>修复:使用firstRefreshWidget后,下拉刷新不生效 [issues#250](https://github.com/xuelongqy/flutter_easyrefresh/issues/250),[issues#256](https://github.com/xuelongqy/flutter_easyrefresh/issues/256)
Expand Down
5 changes: 5 additions & 0 deletions lib/bezier_circle_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ class BezierCircleHeaderWidgetState extends State<BezierCircleHeaderWidget>
}
});
}
} else if (_refreshState == RefreshMode.done) {
_progressValue = 0.0;
toggleCircle = false;
} else if (_refreshState == RefreshMode.inactive) {
showBackAnimation = false;
_progressValue = 0.0;
toggleCircle = false;
}
return Stack(
children: <Widget>[
Expand Down
13 changes: 11 additions & 2 deletions lib/taurus_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ class TaurusHeader extends Header {
/// Key
final Key key;

/// 背景色
final Color backgroundColor;

final LinkHeaderNotifier linkNotifier = LinkHeaderNotifier();

TaurusHeader({
this.key,
this.backgroundColor = Colors.blue,
bool enableHapticFeedback = false,
}) : super(
extent: 90.0,
Expand Down Expand Up @@ -56,17 +60,22 @@ class TaurusHeader extends Header {
noMore);
return TaurusHeaderWidget(
key: key,
backgroundColor: backgroundColor,
linkNotifier: linkNotifier,
);
}
}

/// 冲上云霄组件
class TaurusHeaderWidget extends StatefulWidget {
/// 背景色
final Color backgroundColor;

final LinkHeaderNotifier linkNotifier;

const TaurusHeaderWidget({
Key key,
this.backgroundColor = Colors.blue,
this.linkNotifier,
}) : super(key: key);

Expand Down Expand Up @@ -203,10 +212,10 @@ class TaurusHeaderWidgetState extends State<TaurusHeaderWidget> {
}
return Stack(
children: <Widget>[
// 蓝天
// 蓝天(背景)
Container(
width: double.infinity,
color: Colors.blue,
color: widget.backgroundColor,
),
// 左边云朵
Positioned(
Expand Down

0 comments on commit 02448d3

Please sign in to comment.