style(player): 播放页与首页浮层的控件样式统一
播放页顶部按钮与选集条去掉底色、进度条不再画滑块圆点并压到最底部; 剧名与简介收在互动栏左侧,清屏后只留右下角退出按钮。 首页观看条与进度条共用 20pt 页边距,进度槽底色与播放页一致。
This commit is contained in:
1 parent
d5bcda54d3
commit
543d0aadd5
12 files changed
+298
-297
No files matched your search
@@ -983,9 +983,11 @@ void main() {
|
||||
expect(find.byKey(const Key('player-video-tap')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-bottom-clear-screen')), findsOneWidget);
|
||||
expect(find.byTooltip('Exit clear screen'), findsOneWidget);
|
||||
// 清屏后左侧选集条一起收起,只留右下角的退出按钮。
|
||||
expect(find.byKey(const Key('player-episodes-pill')), findsNothing);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('player-bottom-clear-screen'))),
|
||||
const Size(40, 40),
|
||||
const Size(40, 34),
|
||||
);
|
||||
|
||||
await tester.tapAt(const Offset(80, 300));
|
||||
@@ -1100,8 +1102,8 @@ void main() {
|
||||
expect(find.byKey(const Key('player-speed-boost-hint')), findsNothing);
|
||||
expect(find.byKey(const Key('player-interaction-rail')), findsNothing);
|
||||
expect(find.byTooltip('Exit clear screen'), findsOneWidget);
|
||||
// 清屏态本来显示的选集胶囊与右下按钮,在加速结束后恢复。
|
||||
expect(find.byKey(const Key('player-episodes-pill')), findsOneWidget);
|
||||
// 清屏态只恢复右下退出按钮;左侧选集条在清屏下一直不显示。
|
||||
expect(find.byKey(const Key('player-episodes-pill')), findsNothing);
|
||||
expect(find.byKey(const Key('player-bottom-clear-screen')), findsOneWidget);
|
||||
expect(
|
||||
find.descendant(
|
||||
@@ -1118,7 +1120,7 @@ void main() {
|
||||
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('player-back'))),
|
||||
const Size(36, 36),
|
||||
const Size(40, 40),
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
@@ -1160,17 +1162,12 @@ void main() {
|
||||
.child,
|
||||
isNotNull,
|
||||
);
|
||||
// 选集条给一层浅底色,标出可点区域。
|
||||
expect(
|
||||
tester
|
||||
.widget<Material>(find.byKey(const Key('player-episodes-pill')))
|
||||
.color,
|
||||
AppColors.playerOverlayPill,
|
||||
);
|
||||
expect(
|
||||
tester
|
||||
.widget<Material>(find.byKey(const Key('player-episodes-pill')))
|
||||
.borderRadius,
|
||||
BorderRadius.circular(7),
|
||||
AppColors.textPrimary.withValues(alpha: 0.14),
|
||||
);
|
||||
expect(
|
||||
tester
|
||||
@@ -1186,9 +1183,14 @@ void main() {
|
||||
?.fontSize,
|
||||
13.5,
|
||||
);
|
||||
// 清屏按钮与左侧选集条等高。
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('player-bottom-clear-screen'))),
|
||||
const Size(40, 40),
|
||||
const Size(40, 34),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('player-episodes-pill'))).height,
|
||||
34,
|
||||
);
|
||||
expect(find.byKey(const Key('progress-loading')), findsNothing);
|
||||
expect(find.byKey(const Key('progress-inactive')), findsOneWidget);
|
||||
@@ -1289,7 +1291,8 @@ void main() {
|
||||
matching: find.byIcon(Icons.keyboard_arrow_up_rounded),
|
||||
),
|
||||
);
|
||||
expect(pill.right - arrow.right, closeTo(14, 0.5));
|
||||
// 选集条左右各留 10pt 内边距,箭头不再贴边。
|
||||
expect(pill.right - arrow.right, closeTo(10, 0.5));
|
||||
expect(arrow.left - label.right, closeTo(8, 0.5));
|
||||
});
|
||||
|
||||
@@ -1551,7 +1554,8 @@ void main() {
|
||||
),
|
||||
);
|
||||
expect(chevron.left - title.right, lessThanOrEqualTo(6));
|
||||
expect(chevron.right, lessThanOrEqualTo(320 - 14));
|
||||
// 剧名和简介一样收在互动栏左侧,不再铺到屏幕最右边。
|
||||
expect(chevron.right, lessThanOrEqualTo(320 - 14 - 54));
|
||||
final synopsis = tester.widget<Text>(
|
||||
find.byKey(const Key('player-synopsis')),
|
||||
);
|
||||
@@ -1647,11 +1651,11 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('player-episodes')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('player-episodes-sheet')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-episodes-close')), findsOneWidget);
|
||||
expect(find.byKey(const Key('drama-info-sheet')), findsOneWidget);
|
||||
expect(find.byKey(const Key('drama-info-close')), findsOneWidget);
|
||||
final grid = tester.widget<GridView>(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('player-episodes-sheet')),
|
||||
of: find.byKey(const Key('drama-info-sheet')),
|
||||
matching: find.byType(GridView),
|
||||
),
|
||||
);
|
||||
@@ -1659,14 +1663,14 @@ void main() {
|
||||
grid.gridDelegate as SliverGridDelegateWithFixedCrossAxisCount;
|
||||
expect(delegate.crossAxisCount, 6);
|
||||
final overlay = tester.widget<AnnotatedRegion<SystemUiOverlayStyle>>(
|
||||
find.byKey(const Key('player-episodes-system-overlay')),
|
||||
find.byKey(const Key('drama-info-system-overlay')),
|
||||
);
|
||||
expect(overlay.value.systemNavigationBarColor, AppColors.card);
|
||||
expect(overlay.value.systemNavigationBarContrastEnforced, isFalse);
|
||||
final safeArea = tester.widget<SafeArea>(
|
||||
find
|
||||
.descendant(
|
||||
of: find.byKey(const Key('player-episodes-sheet')),
|
||||
of: find.byKey(const Key('drama-info-sheet')),
|
||||
matching: find.byType(SafeArea),
|
||||
)
|
||||
.first,
|
||||
@@ -2030,7 +2034,7 @@ void _expectFullscreenOverlay(WidgetTester tester) {
|
||||
expect(find.byKey(const Key('player-synopsis')), findsOneWidget);
|
||||
expect(find.byKey(const Key('player-more')), findsOneWidget);
|
||||
for (final key in const [Key('player-back'), Key('player-more')]) {
|
||||
expect(tester.getSize(find.byKey(key)), const Size(36, 36));
|
||||
expect(tester.getSize(find.byKey(key)), const Size(40, 40));
|
||||
}
|
||||
expect(find.byKey(const Key('player-play-toggle')), findsNothing);
|
||||
expect(find.byKey(const Key('player-episodes')), findsOneWidget);
|
||||
|
||||
Reference in new issue
Block a user