fix(flutter): 选集条箭头靠右排列

This commit is contained in:
Zhou Weidong committed 2026-10-20 12:19:20 +08:00
1 parent ced0fae64a
commit 90769de3b7
2 files changed
+26 -2

No files matched your search

+2 -2
View File
@@ -259,7 +259,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
),
child: Row(
children: [
Flexible(
Expanded(
child: Text(
'${data.l10n.episodes} · '
'${data.l10n.allEpisodesBadge(data.totalEpisodes)} · '
@@ -274,7 +274,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
),
),
),
const SizedBox(width: 3),
const SizedBox(width: 8),
const Icon(
Icons.keyboard_arrow_up_rounded,
color: AppColors.onPrimary,
+24
View File
@@ -286,6 +286,30 @@ void main() {
expect(find.byKey(const Key('player-interaction-rail')), findsOneWidget);
});
testWidgets('should_push_episodes_arrow_to_pill_right', (tester) async {
// 宽屏下文案不会撑满胶囊,才能验证箭头是否被推到最右侧。
await _pumpApp(tester, size: const Size(900, 844));
await _openSeriesPlayer(tester);
final pill = tester.getRect(find.byKey(const Key('player-episodes-pill')));
final label = tester.getRect(
find
.descendant(
of: find.byKey(const Key('player-episodes-pill')),
matching: find.byType(Text),
)
.first,
);
final arrow = tester.getRect(
find.descendant(
of: find.byKey(const Key('player-episodes-pill')),
matching: find.byIcon(Icons.keyboard_arrow_up_rounded),
),
);
expect(pill.right - arrow.right, closeTo(14, 0.5));
expect(arrow.left - label.right, closeTo(8, 0.5));
});
testWidgets('should_show_rail_counts_from_detail_and_follow_server_results', (
tester,
) async {