feat(player): 互动栏改用参考图同款图标资源

This commit is contained in:
Zhou Weidong committed 2026-10-21 11:02:05 +08:00
1 parent 35de4095b0
commit cbb9f60f7f
10 files changed
+61 -78

No files matched your search

+23 -22
View File
@@ -474,11 +474,11 @@ void main() {
.getSize(
find.descendant(
of: find.byKey(const Key('player-rail-comments')),
matching: find.byIcon(Icons.chat_bubble_outline_rounded),
matching: find.byType(Image),
),
)
.width,
30,
32,
);
await tester.tap(find.byKey(const Key('player-synopsis-toggle')));
@@ -586,37 +586,31 @@ void main() {
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,
_railAssetName(tester, const Key('player-rail-save')),
'assets/icon/rail/rail_save.png',
);
expect(
railIcon(const Key('player-rail-like'), Icons.favorite_rounded),
findsOneWidget,
_railAssetName(tester, const Key('player-rail-comments')),
'assets/icon/rail/rail_comment.png',
);
expect(
railIcon(
const Key('player-rail-comments'),
Icons.chat_bubble_outline_rounded,
),
findsOneWidget,
_railAssetName(tester, const Key('player-rail-like')),
'assets/icon/rail/rail_like.png',
);
final shareIcon = railIcon(
const Key('player-rail-share'),
Icons.reply_rounded,
expect(
_railAssetName(tester, const Key('player-rail-share')),
'assets/icon/rail/rail_share.png',
);
expect(shareIcon, findsOneWidget);
expect(tester.widget<Icon>(shareIcon).size, 30);
final mirror = tester.widget<Transform>(
final shareImage = tester.widget<Image>(
find.descendant(
of: find.byKey(const Key('player-rail-share')),
matching: find.byType(Transform),
matching: find.byType(Image),
),
);
expect(mirror.transform.storage[0], -1);
expect(shareImage.width, 32);
expect(shareImage.height, 32);
expect(shareImage.colorBlendMode, BlendMode.srcIn);
final saveButton = tester.widget<IconButton>(
find.descendant(
@@ -1132,6 +1126,13 @@ void main() {
});
}
String _railAssetName(WidgetTester tester, Key itemKey) {
final image = tester.widget<Image>(
find.descendant(of: find.byKey(itemKey), matching: find.byType(Image)),
);
return (image.image as AssetImage).assetName;
}
void _expectPlayerNavigationBar(WidgetTester tester) {
final overlay = tester.widget<AnnotatedRegion<SystemUiOverlayStyle>>(
find.byKey(const Key('player-system-overlay')).last,