feat(player): 右侧互动栏图标按参考图替换并放大

This commit is contained in:
Zhou Weidong committed 2026-10-21 10:52:14 +08:00
1 parent e6a31a60df
commit 4b1aea29c7
5 files changed
+128 -24

No files matched your search

+33
View File
@@ -150,6 +150,39 @@ void main() {
tester.widget<Text>(find.byKey(const Key('rail-comments-count'))).data,
'12',
);
expect(
find.descendant(
of: find.byKey(const Key('rail-save')),
matching: find.byIcon(Icons.star_rounded),
),
findsOneWidget,
);
expect(
find.descendant(
of: find.byKey(const Key('rail-like')),
matching: find.byIcon(Icons.favorite_rounded),
),
findsOneWidget,
);
expect(
find.descendant(
of: find.byKey(const Key('rail-share')),
matching: find.byIcon(Icons.reply_rounded),
),
findsOneWidget,
);
expect(
tester
.widget<Transform>(
find.descendant(
of: find.byKey(const Key('rail-share')),
matching: find.byType(Transform),
),
)
.transform
.storage[0],
-1,
);
expect(find.byKey(const Key('progress-loading')), findsOneWidget);
expect(find.byKey(const Key('home-feed-progress-thumb')), findsNothing);
});
+70 -2
View File
@@ -466,7 +466,7 @@ void main() {
expect(bottom.height, lessThanOrEqualTo(200));
expect(bottom.top, greaterThanOrEqualTo(screenHeight * 0.78));
expect(rail.top, greaterThanOrEqualTo(screenHeight * 0.55 - 2));
expect(rail.top, greaterThanOrEqualTo(screenHeight * 0.40));
expect(rail.bottom, lessThanOrEqualTo(bottom.top));
expect(find.byKey(const Key('player-author-note')), findsNothing);
expect(
@@ -478,7 +478,7 @@ void main() {
),
)
.width,
24,
30,
);
await tester.tap(find.byKey(const Key('player-synopsis-toggle')));
@@ -580,6 +580,74 @@ void main() {
expect(railLabel(const Key('player-rail-save')), '3201');
});
testWidgets('should_render_reference_rail_icons_without_background', (
tester,
) async {
await _pumpApp(tester);
await _openSeriesPlayer(tester);
Finder railIcon(Key key, IconData icon) =>
find.descendant(of: find.byKey(key), matching: find.byIcon(icon));
expect(
railIcon(const Key('player-rail-save'), Icons.star_rounded),
findsOneWidget,
);
expect(
railIcon(const Key('player-rail-like'), Icons.favorite_rounded),
findsOneWidget,
);
expect(
railIcon(
const Key('player-rail-comments'),
Icons.chat_bubble_outline_rounded,
),
findsOneWidget,
);
final shareIcon = railIcon(
const Key('player-rail-share'),
Icons.reply_rounded,
);
expect(shareIcon, findsOneWidget);
expect(tester.widget<Icon>(shareIcon).size, 30);
final mirror = tester.widget<Transform>(
find.descendant(
of: find.byKey(const Key('player-rail-share')),
matching: find.byType(Transform),
),
);
expect(mirror.transform.storage[0], -1);
final saveButton = tester.widget<IconButton>(
find.descendant(
of: find.byKey(const Key('player-rail-save')),
matching: find.byType(IconButton),
),
);
expect(saveButton.style?.backgroundColor, isNull);
expect(
tester.getSize(
find.descendant(
of: find.byKey(const Key('player-rail-save')),
matching: find.byType(IconButton),
),
),
const Size(44, 44),
);
expect(
tester
.widget<Text>(
find.descendant(
of: find.byKey(const Key('player-rail-like')),
matching: find.byType(Text),
),
)
.style
?.fontSize,
12,
);
});
testWidgets('should_toggle_synopsis_with_inline_text_button', (tester) async {
await _pumpApp(tester);
await _openSeriesPlayer(tester);