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

@@ -14,6 +14,7 @@ import 'interaction_rail.dart';
part 'home_feed_overlay_parts.dart';
const Color _overlayPill = Color(0x66000000);
const Color _fullBarBackground = Color(0x4D000000);
const double _topIconSize = 36;
const double _topIconGlyph = 22;
const double _tabGap = 22;
@@ -25,7 +26,7 @@ const double _metaFontSize = 12;
const double _tagFontSize = 11;
const double _fullBarHeight = 44;
const double _progressHeight = 2;
const double _progressHitHeight = 20;
const double _progressHitHeight = 24;
const int _maxTags = 4;
final RegExp _tagSplitter = RegExp(r'[,/、·]');
@@ -100,7 +101,7 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
_header(context),
Expanded(
child: Align(
alignment: const Alignment(1.0, 0.45),
alignment: const Alignment(1.0, 0.68),
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 10, 16),
child: _rail(),
@@ -358,6 +359,12 @@ class _HomeFeedOverlayState extends State<HomeFeedOverlay> {
height: _fullBarHeight,
child: Stack(
children: [
Positioned.fill(
child: Container(
key: const Key('home-feed-full-series-bg'),
color: _fullBarBackground,
),
),
Positioned.fill(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14),
@@ -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,