fix(home): 使用图片渲染搜索栏入口

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:52:43 +08:00
1 parent afd8927a9f
commit 953ddec587
4 files changed
+30 -8

No files matched your search

+20 -7
View File
@@ -143,7 +143,9 @@ class HomeGridHeader extends StatelessWidget {
_headerAction(
key: const Key('home-vip-entry'),
frameKey: const Key('home-vip-icon-frame'),
icon: Icons.workspace_premium_outlined,
imageKey: const Key('home-vip-image'),
assetPath: 'assets/icon/crown.png',
fallbackIcon: Icons.workspace_premium_outlined,
color: AppColors.homeCrownGold,
tooltip: l10n.vipMembership,
onTap: callbacks.onOpenVip,
@@ -152,7 +154,9 @@ class HomeGridHeader extends StatelessWidget {
_headerAction(
key: const Key('home-wallet-entry'),
frameKey: const Key('home-wallet-icon-frame'),
icon: Icons.card_giftcard_rounded,
imageKey: const Key('home-wallet-image'),
assetPath: 'assets/icon/gift.png',
fallbackIcon: Icons.card_giftcard_rounded,
color: AppColors.homeGiftPink,
tooltip: l10n.wallet,
onTap: callbacks.onOpenWallet,
@@ -166,7 +170,9 @@ class HomeGridHeader extends StatelessWidget {
Widget _headerAction({
required Key key,
required Key frameKey,
required IconData icon,
required Key imageKey,
required String assetPath,
required IconData fallbackIcon,
required Color color,
required String tooltip,
required VoidCallback onTap,
@@ -189,10 +195,17 @@ class HomeGridHeader extends StatelessWidget {
child: SizedBox.square(
key: frameKey,
dimension: AppDimens.homeActionIcon,
child: Icon(
icon,
size: AppDimens.homeActionIcon,
color: color,
child: Image.asset(
assetPath,
key: imageKey,
width: AppDimens.homeActionIcon,
height: AppDimens.homeActionIcon,
fit: BoxFit.contain,
errorBuilder: (_, _, _) => Icon(
fallbackIcon,
size: AppDimens.homeActionIcon,
color: color,
),
),
),
),