From e412fde9acc671ab1983013869a03c59a1fbe2d9 Mon Sep 17 00:00:00 2001 From: knoyo <59814509@qq.com> Date: Tue, 14 Apr 2020 11:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E5=86=B2=E4=B8=8A?= =?UTF-8?q?=E4=BA=91=E9=9C=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/delivery_header.dart | 3 ++- lib/taurus_footer.dart | 14 ++++++++++++-- lib/taurus_header.dart | 3 ++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/delivery_header.dart b/lib/delivery_header.dart index 76cb6b56..9f3bb7d1 100644 --- a/lib/delivery_header.dart +++ b/lib/delivery_header.dart @@ -21,13 +21,14 @@ class DeliveryHeader extends Header { this.key, this.backgroundColor = Colors.transparent, bool enableHapticFeedback = false, + Duration completeDuration = const Duration(seconds: 1), }) : super( extent: 130.0, triggerDistance: 150.0, float: false, enableHapticFeedback: enableHapticFeedback, enableInfiniteRefresh: false, - completeDuration: const Duration(seconds: 1), + completeDuration: completeDuration, ); @override diff --git a/lib/taurus_footer.dart b/lib/taurus_footer.dart index 87a30920..7fb6f537 100644 --- a/lib/taurus_footer.dart +++ b/lib/taurus_footer.dart @@ -12,18 +12,23 @@ class TaurusFooter extends Footer { /// Key final Key key; + /// 背景色 + final Color backgroundColor; + final LinkFooterNotifier linkNotifier = LinkFooterNotifier(); TaurusFooter({ this.key, + this.backgroundColor = Colors.blue, bool enableHapticFeedback = false, + Duration completeDuration: const Duration(seconds: 1), }) : super( extent: 90.0, triggerDistance: 90.0, float: false, enableHapticFeedback: enableHapticFeedback, enableInfiniteLoad: false, - completeDuration: const Duration(seconds: 1), + completeDuration: completeDuration, ); @override @@ -56,6 +61,7 @@ class TaurusFooter extends Footer { noMore); return TaurusFooterWidget( key: key, + backgroundColor: backgroundColor, linkNotifier: linkNotifier, ); } @@ -63,10 +69,14 @@ class TaurusFooter extends Footer { /// 冲上云霄组件 class TaurusFooterWidget extends StatefulWidget { + /// 背景色 + final Color backgroundColor; + final LinkFooterNotifier linkNotifier; const TaurusFooterWidget({ Key key, + this.backgroundColor = Colors.blue, this.linkNotifier, }) : super(key: key); @@ -205,7 +215,7 @@ class TaurusFooterWidgetState extends State { // 蓝天 Container( width: double.infinity, - color: Colors.blue, + color: widget.backgroundColor, ), Positioned( top: 0.0, diff --git a/lib/taurus_header.dart b/lib/taurus_header.dart index a2f3c1af..a4df8ef5 100644 --- a/lib/taurus_header.dart +++ b/lib/taurus_header.dart @@ -21,13 +21,14 @@ class TaurusHeader extends Header { this.key, this.backgroundColor = Colors.blue, bool enableHapticFeedback = false, + Duration completeDuration: const Duration(seconds: 1), }) : super( extent: 90.0, triggerDistance: 90.0, float: false, enableHapticFeedback: enableHapticFeedback, enableInfiniteRefresh: false, - completeDuration: const Duration(seconds: 1), + completeDuration: completeDuration, ); @override