fix(flutter): 精简播放页更多面板

This commit is contained in:
Zhou Weidong committed 2026-10-20 11:40:15 +08:00
1 parent 08440b0160
commit c4797cd239
8 files changed
+175 -310

No files matched your search

+42 -19
View File
@@ -370,7 +370,7 @@ void main() {
expect(find.byKey(const Key('player-episode-2')), findsOneWidget);
});
testWidgets('should_open_more_actions_and_change_text_size', (tester) async {
testWidgets('should_open_compact_more_actions', (tester) async {
await _pumpApp(tester);
await _openSeriesPlayer(tester);
await tester.tap(find.byKey(const Key('player-more')));
@@ -381,22 +381,35 @@ void main() {
expect(find.byKey(const Key('player-more-quality-AUTO')), findsOneWidget);
expect(find.byKey(const Key('player-more-offline')), findsOneWidget);
expect(find.byKey(const Key('player-more-clear')), findsOneWidget);
expect(find.byKey(const Key('player-more-danmaku')), findsOneWidget);
expect(find.byKey(const Key('player-more-drag-handle')), findsOneWidget);
for (final removed in const [
Key('player-more-not-interested'),
Key('player-more-danmaku'),
Key('player-more-danmaku-settings'),
Key('player-more-text-size'),
Key('player-more-cast'),
Key('player-more-timer'),
Key('player-more-pip'),
Key('player-more-report'),
]) {
expect(find.byKey(removed), findsNothing);
}
expect(
find.byKey(const Key('player-more-danmaku-settings')),
findsOneWidget,
tester.getSize(find.byKey(const Key('player-more-speed-1.0'))).height,
28,
);
expect(
tester
.widget<Text>(
find.descendant(
of: find.byKey(const Key('player-more-speed-1.0')),
matching: find.text('1.0x'),
),
)
.style
?.fontSize,
12,
);
expect(find.byKey(const Key('player-more-cast')), findsOneWidget);
expect(find.byKey(const Key('player-more-timer')), findsOneWidget);
expect(find.byKey(const Key('player-more-text-size')), findsOneWidget);
expect(find.byKey(const Key('player-more-report')), findsOneWidget);
await tester.tap(find.byTooltip('Text size'));
await tester.pumpAndSettle();
expect(find.byKey(const Key('player-text-size-large')), findsOneWidget);
await tester.tap(find.byKey(const Key('player-text-size-large')));
await tester.pumpAndSettle();
expect(find.text('Large'), findsOneWidget);
});
testWidgets('should_disable_quality_not_supplied_by_ticket', (tester) async {
@@ -418,14 +431,24 @@ void main() {
expect(
tester
.widget<ChoiceChip>(find.byKey(const Key('player-more-quality-AUTO')))
.onSelected,
.widget<InkWell>(
find.descendant(
of: find.byKey(const Key('player-more-quality-AUTO')),
matching: find.byType(InkWell),
),
)
.onTap,
isNotNull,
);
expect(
tester
.widget<ChoiceChip>(find.byKey(const Key('player-more-quality-720P')))
.onSelected,
.widget<InkWell>(
find.descendant(
of: find.byKey(const Key('player-more-quality-720P')),
matching: find.byType(InkWell),
),
)
.onTap,
isNull,
);
expect(find.text('720P · Unavailable'), findsOneWidget);