style(recommend): 收窄观看全集按钮

This commit is contained in:
Zhou Weidong committed 2026-10-22 20:16:13 +08:00
1 parent 3690fb1bc4
commit 5abee5f69a
3 files changed
+21 -5

No files matched your search

+1 -1
View File
@@ -1186,4 +1186,4 @@ $ flutter test
- 拖动仅控制视频浮层内容,顶部导航与根底栏保持常驻。 - 拖动仅控制视频浮层内容,顶部导航与根底栏保持常驻。
- 进度条固定中心并动画到 6 高,时间气泡限制在左右 12;end/cancel/pointer 兜底均恢复拖动前状态。 - 进度条固定中心并动画到 6 高,时间气泡限制在左右 12;end/cancel/pointer 兜底均恢复拖动前状态。
- 修复 `scrubCancelRequest` 误置于 `initState` 的编译错误,并清理推荐页未使用变量;`flutter analyze` 无问题。 - 修复 `scrubCancelRequest` 误置于 `initState` 的编译错误,并清理推荐页未使用变量;`flutter analyze` 无问题。
- 观看全集按钮相对进度条上移 8,间距调整为 20;`flutter analyze` 无问题。 - 观看全集按钮相对进度条上移 8,间距调整为 20;按钮改为屏幕宽度 70% 左对齐,`flutter analyze` 无问题。
@@ -1,5 +1,7 @@
// Author: fruit.com.cn // Author: fruit.com.cn
import 'dart:math' as math;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../core/data/models/drama.dart'; import '../../../core/data/models/drama.dart';
@@ -106,7 +108,7 @@ class _HomeFeedInfoPanelState extends State<HomeFeedInfoPanel> {
_synopsis(l10n, synopsis), _synopsis(l10n, synopsis),
], ],
const SizedBox(height: 12), const SizedBox(height: 12),
_watchAll(l10n), _watchAll(context, l10n),
], ],
); );
} }
@@ -245,9 +247,15 @@ class _HomeFeedInfoPanelState extends State<HomeFeedInfoPanel> {
); );
} }
Widget _watchAll(AppLocalizations l10n) { Widget _watchAll(BuildContext context, AppLocalizations l10n) {
return SizedBox( final screenWidth = MediaQuery.sizeOf(context).width;
width: double.infinity, return LayoutBuilder(
builder: (context, constraints) {
final buttonWidth = math.min(screenWidth * 0.7, constraints.maxWidth);
return Align(
alignment: Alignment.centerLeft,
child: SizedBox(
width: buttonWidth,
height: _watchAllHeight, height: _watchAllHeight,
child: DecoratedBox( child: DecoratedBox(
key: const Key('home-feed-full-series-bg'), key: const Key('home-feed-full-series-bg'),
@@ -276,6 +284,9 @@ class _HomeFeedInfoPanelState extends State<HomeFeedInfoPanel> {
), ),
), ),
), ),
),
);
},
); );
} }
+5
View File
@@ -659,6 +659,11 @@ void main() {
final bar = tester.getRect(find.byKey(const Key('home-feed-full-series'))); final bar = tester.getRect(find.byKey(const Key('home-feed-full-series')));
expect(bar.height, 44); expect(bar.height, 44);
final overlayRect = tester.getRect(
find.byKey(const Key('home-feed-gesture')),
);
expect(bar.left, closeTo(overlayRect.left + 14, 0.1));
expect(bar.width, closeTo(overlayRect.width * 0.7, 1));
final buttonBackground = final buttonBackground =
tester tester
.widget<DecoratedBox>( .widget<DecoratedBox>(