feat(flutter): 统一二级页头并恢复新剧暖色
This commit is contained in:
1 parent
7b2970d5c5
commit
1c6c92170d
26 files changed
+492
-427
No files matched your search
@@ -29,6 +29,7 @@ void main() {
|
||||
await _pumpFilterPage(tester);
|
||||
|
||||
expect(find.byKey(const Key('filter-page')), findsOneWidget);
|
||||
_expectUnifiedHeader(tester, const Key('filter-back'));
|
||||
expect(
|
||||
find.byKey(const Key('filter-group-label-category')),
|
||||
findsOneWidget,
|
||||
@@ -184,6 +185,13 @@ final List<Drama> _filterDramas = [
|
||||
),
|
||||
];
|
||||
|
||||
void _expectUnifiedHeader(WidgetTester tester, Key backKey) {
|
||||
expect(tester.getSize(find.byKey(backKey)), const Size(36, 36));
|
||||
final title = tester.widget<Text>(find.byKey(const Key('subpage-title')));
|
||||
expect(title.style?.fontSize, 18);
|
||||
expect(title.style?.fontWeight, FontWeight.w800);
|
||||
}
|
||||
|
||||
Drama _drama({
|
||||
required String id,
|
||||
required String title,
|
||||
|
||||
@@ -29,6 +29,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('ranking-page')), findsOneWidget);
|
||||
_expectUnifiedHeader(tester, const Key('ranking-back'));
|
||||
expect(find.text('TOP 1'), findsOneWidget);
|
||||
expect(
|
||||
tester.widget<Text>(find.byKey(const Key('ranking-title-1'))).data,
|
||||
@@ -46,6 +47,15 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('new-releases-page')), findsOneWidget);
|
||||
_expectUnifiedHeader(tester, const Key('new-releases-back'));
|
||||
final newPage = tester.widget<Scaffold>(
|
||||
find.byKey(const Key('new-releases-page')),
|
||||
);
|
||||
expect(newPage.backgroundColor, AppColors.ink);
|
||||
final badge = tester.widget<Container>(
|
||||
find.byKey(const Key('new-releases-hero-badge')),
|
||||
);
|
||||
expect((badge.decoration! as BoxDecoration).color, AppColors.blue);
|
||||
expect(find.byKey(const Key('new-releases-hero')), findsOneWidget);
|
||||
expect(find.text('Vengeance Rising'), findsWidgets);
|
||||
expect(
|
||||
@@ -68,6 +78,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('reserve-page')), findsOneWidget);
|
||||
_expectUnifiedHeader(tester, const Key('reserve-back'));
|
||||
expect(find.byKey(const Key('reserve-week-strip')), findsOneWidget);
|
||||
for (var index = 0; index < 7; index++) {
|
||||
expect(find.byKey(Key('reserve-day-$index')), findsOneWidget);
|
||||
@@ -207,3 +218,10 @@ List<Drama> _rankDramas(int count) => [
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
void _expectUnifiedHeader(WidgetTester tester, Key backKey) {
|
||||
expect(tester.getSize(find.byKey(backKey)), const Size(36, 36));
|
||||
final title = tester.widget<Text>(find.byKey(const Key('subpage-title')));
|
||||
expect(title.style?.fontSize, 18);
|
||||
expect(title.style?.fontWeight, FontWeight.w800);
|
||||
}
|
||||
Reference in new issue
Block a user