fix(flutter): 首页 feed 去底色并优化整集条

This commit is contained in:
Zhou Weidong committed 2026-10-20 14:05:24 +08:00
1 parent f94926cff5
commit 636b369bd4
6 files changed
+171 -97

No files matched your search

@@ -2,6 +2,9 @@
part of 'home_feed_overlay.dart';
const double _thumbSize = 6;
const double _thumbActiveSize = 10;
/// 顶部频道 tab:漫剧点击提示即将上线。
enum _FeedTab {
anime,
@@ -208,10 +211,7 @@ class _FeedProgressBarState extends State<_FeedProgressBar> {
_update(details.localPosition.dx / width),
onHorizontalDragEnd: (_) => _commit(_preview),
onHorizontalDragCancel: () => setState(() => _preview = null),
child: SizedBox(
height: widget.hitHeight,
child: Align(alignment: Alignment.bottomCenter, child: track),
),
child: track,
);
},
);
@@ -233,15 +233,43 @@ class _FeedProgressBarState extends State<_FeedProgressBar> {
}
Widget _track(double fraction, double width) {
final active = _preview != null;
final size = active ? _thumbActiveSize : _thumbSize;
final left = (width * fraction - size / 2)
.clamp(0.0, width - size)
.toDouble();
return SizedBox(
height: widget.height,
height: widget.hitHeight,
child: Stack(
clipBehavior: Clip.none,
children: [
Container(width: width, height: widget.height, color: Colors.white24),
Container(
width: width * fraction,
height: widget.height,
color: AppColors.blue,
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(height: widget.height, color: Colors.white24),
),
Positioned(
left: 0,
bottom: 0,
child: Container(
width: width * fraction,
height: widget.height,
color: AppColors.blue,
),
),
Positioned(
left: left,
bottom: 0,
child: Container(
key: const Key('home-feed-progress-thumb'),
width: size,
height: size,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
),
],
),