From e8b26db36aec1893b0d3d573c868115ee0cbac60 Mon Sep 17 00:00:00 2001 From: zhouge870103 <260290239@qq.com> Date: Wed, 1 Dec 2021 18:46:05 +0800 Subject: [PATCH] WaterDropHeader add backgroundColor --- lib/src/indicator/waterdrop_header.dart | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/src/indicator/waterdrop_header.dart b/lib/src/indicator/waterdrop_header.dart index cecca80d..e71ac048 100644 --- a/lib/src/indicator/waterdrop_header.dart +++ b/lib/src/indicator/waterdrop_header.dart @@ -16,6 +16,9 @@ import '../smart_refresher.dart'; /// QQ ios refresh header effect class WaterDropHeader extends RefreshIndicator { + /// background color + final Color? backgroundColor; + /// refreshing content final Widget? refresh; @@ -43,6 +46,7 @@ class WaterDropHeader extends RefreshIndicator { size: 15, color: Colors.white, ), + this.backgroundColor, }) : super( key: key, height: 60.0, @@ -150,8 +154,10 @@ class _WaterDropHeaderState extends RefreshIndicatorState ], ); } else if (mode == RefreshStatus.idle || mode == RefreshStatus.canRefresh) { - return FadeTransition( - child: Container( + return Container( + color: widget.backgroundColor, + height: 60.0, + child: FadeTransition( child: Stack( children: [ RotatedBox( @@ -182,12 +188,12 @@ class _WaterDropHeaderState extends RefreshIndicatorState ) ], ), - height: 60.0, - ), - opacity: _dismissCtl); + opacity: _dismissCtl), + ); } return Container( height: 60.0, + color: widget.backgroundColor, child: Center( child: child, ),