Skip to content

Commit

Permalink
更新:冲上云霄样式
Browse files Browse the repository at this point in the history
  • Loading branch information
knoyo committed Apr 14, 2020
1 parent c4e11ee commit e412fde
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/delivery_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions lib/taurus_footer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -56,17 +61,22 @@ class TaurusFooter extends Footer {
noMore);
return TaurusFooterWidget(
key: key,
backgroundColor: backgroundColor,
linkNotifier: linkNotifier,
);
}
}

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

final LinkFooterNotifier linkNotifier;

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

Expand Down Expand Up @@ -205,7 +215,7 @@ class TaurusFooterWidgetState extends State<TaurusFooterWidget> {
// 蓝天
Container(
width: double.infinity,
color: Colors.blue,
color: widget.backgroundColor,
),
Positioned(
top: 0.0,
Expand Down
3 changes: 2 additions & 1 deletion lib/taurus_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e412fde

Please sign in to comment.