fix(flutter): 首页 feed 静默刷新与进度条细节

This commit is contained in:
Zhou Weidong committed 2026-10-20 14:11:42 +08:00
1 parent a3126723d2
commit 82fe237c24
8 files changed
+190 -17

No files matched your search

@@ -4,6 +4,8 @@ part of 'home_feed_overlay.dart';
const double _thumbSize = 6;
const double _thumbActiveSize = 10;
const double _trackActiveHeight = 4;
const double _lineCenterFromBottom = 6;
/// 顶部频道 tab:漫剧点击提示即将上线。
enum _FeedTab {
@@ -199,10 +201,6 @@ class _FeedProgressBarState extends State<_FeedProgressBar> {
return GestureDetector(
key: const Key('home-feed-progress'),
behavior: HitTestBehavior.opaque,
onTapDown: (details) {
widget.onScrubStart?.call();
_commit(details.localPosition.dx / width);
},
onHorizontalDragStart: (details) {
widget.onScrubStart?.call();
_update(details.localPosition.dx / width);
@@ -233,11 +231,14 @@ class _FeedProgressBarState extends State<_FeedProgressBar> {
}
Widget _track(double fraction, double width) {
final active = _preview != null;
final size = active ? _thumbActiveSize : _thumbSize;
final dragging = _preview != null;
final trackHeight = dragging ? _trackActiveHeight : widget.height;
final size = dragging ? _thumbActiveSize : _thumbSize;
final left = (width * fraction - size / 2)
.clamp(0.0, width - size)
.toDouble();
final lineBottom = _lineCenterFromBottom - trackHeight / 2;
final thumbBottom = _lineCenterFromBottom - size / 2;
return SizedBox(
height: widget.hitHeight,
child: Stack(
@@ -246,21 +247,25 @@ class _FeedProgressBarState extends State<_FeedProgressBar> {
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(height: widget.height, color: Colors.white24),
bottom: lineBottom,
child: Container(
key: const Key('home-feed-progress-track'),
height: trackHeight,
color: Colors.white24,
),
),
Positioned(
left: 0,
bottom: 0,
bottom: lineBottom,
child: Container(
width: width * fraction,
height: widget.height,
height: trackHeight,
color: AppColors.blue,
),
),
Positioned(
left: left,
bottom: 0,
bottom: thumbBottom,
child: Container(
key: const Key('home-feed-progress-thumb'),
width: size,