style: 增强我的页渐变与图标配色

This commit is contained in:
Zhou Weidong committed 2026-10-22 21:38:49 +08:00
1 parent 647f6afd77
commit a81bec4d47
6 files changed
+116 -49

No files matched your search

+62 -8
View File
@@ -41,14 +41,6 @@ void main() {
expect(find.byKey(const Key('mine-vip')), findsOneWidget);
expect(find.byKey(const Key('mine-vip-open')), findsOneWidget);
expect(find.byKey(const Key('mine-menu')), findsOneWidget);
final title = tester.widget<Text>(
find.descendant(
of: find.byKey(const Key('mine-page-surface')),
matching: find.text('My'),
),
);
expect(title.style?.fontSize, AppDimens.minePageTitle);
expect(title.style?.fontWeight, FontWeight.w700);
expect(find.byKey(const Key('mine-mini-player')), findsNothing);
final surface = tester.widget<DecoratedBox>(
find.byKey(const Key('mine-page-surface')),
@@ -62,6 +54,25 @@ void main() {
AppColors.mineGradientMiddle,
AppColors.mineGradientBottom,
]);
expect(background.stops, const [0, 0.4, 0.75]);
expect(
find.descendant(
of: find.byKey(const Key('mine-page-surface')),
matching: find.text('My'),
),
findsNothing,
);
final glow = tester.widget<DecoratedBox>(
find.byKey(const Key('mine-page-glow')),
);
final glowDecoration = glow.decoration as BoxDecoration;
final radialGlow = glowDecoration.gradient! as RadialGradient;
expect(radialGlow.center, const Alignment(0, -0.95));
expect(radialGlow.radius, 0.9);
expect(radialGlow.colors, const [
AppColors.mineGradientGlow,
AppColors.transparent,
]);
for (final oldShortcut in const [
Key('mine-watchlist'),
Key('mine-history-shortcut'),
@@ -83,6 +94,49 @@ void main() {
for (final entryKey in entryKeys) {
expect(find.byKey(entryKey), findsOneWidget);
}
const coloredIcons = [
(
Key('mine-wallet'),
Icons.account_balance_wallet_outlined,
AppColors.mineIconWallet,
),
(
Key('mine-downloads'),
Icons.download_outlined,
AppColors.mineIconDownloads,
),
(Key('mine-history'), Icons.history_rounded, AppColors.mineIconHistory),
(
Key('mine-watch-preferences'),
Icons.tune_rounded,
AppColors.mineIconPreferences,
),
(
Key('mine-help'),
Icons.support_agent_rounded,
AppColors.mineIconSupport,
),
(
Key('mine-language'),
Icons.language_rounded,
AppColors.mineIconLanguage,
),
(
Key('mine-settings'),
Icons.settings_outlined,
AppColors.mineIconSettings,
),
];
for (final entry in coloredIcons) {
final icon = tester.widget<Icon>(
find.descendant(
of: find.byKey(entry.$1),
matching: find.byIcon(entry.$2),
),
);
expect(icon.color, entry.$3);
expect(icon.size, AppDimens.mineGridIcon);
}
for (var index = 0; index < 8; index++) {
expect(find.byKey(Key('mine-menu-cell-$index')), findsOneWidget);
}