fix(flutter): 简介灰字统一并透明暂停按钮
This commit is contained in:
1 parent
427e7a7897
commit
02763c3dfb
4 files changed
+38
-25
No files matched your search
@@ -33,16 +33,16 @@ void main() {
|
||||
Key('player-play-toggle'),
|
||||
]) {
|
||||
expect(tester.getSize(find.byKey(key)), const Size(52, 52));
|
||||
final container = tester.widget<Container>(
|
||||
// 暂停按钮改为透明背景,容器已不再绘制任何底色或装饰。
|
||||
expect(
|
||||
find.descendant(of: find.byKey(key), matching: find.byType(Container)),
|
||||
findsNothing,
|
||||
);
|
||||
final decoration = container.decoration! as BoxDecoration;
|
||||
expect(decoration.color, AppColors.blue);
|
||||
expect(decoration.shape, BoxShape.circle);
|
||||
final icon = tester.widget<Icon>(
|
||||
find.descendant(of: find.byKey(key), matching: find.byType(Icon)),
|
||||
);
|
||||
expect(icon.size, 26);
|
||||
expect(icon.color, AppColors.onPrimary);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -380,6 +380,30 @@ void main() {
|
||||
expect(tester.widget<Text>(synopsis).maxLines, 1);
|
||||
});
|
||||
|
||||
testWidgets('should_share_one_muted_style_across_label_and_synopsis', (
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester);
|
||||
await _openSeriesPlayer(tester);
|
||||
|
||||
TextStyle styleOf(Finder finder) =>
|
||||
tester.widget<Text>(finder).style ?? const TextStyle();
|
||||
final label = styleOf(find.byKey(const Key('player-episode-label')));
|
||||
final synopsis = styleOf(find.byKey(const Key('player-synopsis')));
|
||||
final separator = styleOf(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('player-episode-synopsis')),
|
||||
matching: find.text('|'),
|
||||
),
|
||||
);
|
||||
for (final style in [label, synopsis, separator]) {
|
||||
expect(style.fontSize, 12);
|
||||
expect(style.fontWeight, FontWeight.w500);
|
||||
expect(style.color?.withValues(alpha: 1), AppColors.playerMuted);
|
||||
}
|
||||
expect(separator.color, isNot(Colors.white));
|
||||
});
|
||||
|
||||
testWidgets('should_fit_long_title_and_synopsis_at_320_width', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in new issue
Block a user