merge: 使用图片渲染搜索栏入口

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:52:51 +08:00
commit c1d4b61936
4 files changed
+28 -6

No files matched your search

+1 -1
View File
@@ -1115,7 +1115,7 @@ $ flutter test
- 四类卡片去底板/描边,封面统一 3:4、8 圆角、行距 10、封底标题间距 6;状态角标为右上角紧凑异形丝带。 - 四类卡片去底板/描边,封面统一 3:4、8 圆角、行距 10、封底标题间距 6;状态角标为右上角紧凑异形丝带。
- 标题下方恢复左对齐题材文字,使用 `|` 分隔、灰色小字,与封面状态角标保持独立。 - 标题下方恢复左对齐题材文字,使用 `|` 分隔、灰色小字,与封面状态角标保持独立。
- 首页搜索栏到一级、一级到二级、二级到网格间距为 8/8/10;非精选 tab 直接以 10 衔接网格。 - 首页搜索栏到一级、一级到二级、二级到网格间距为 8/8/10;非精选 tab 直接以 10 衔接网格。
- 搜索框右侧皇冠与礼物改为 40 热区、28 彩色图标,透明背景、间距 12,保留礼物角标。 - 搜索框右侧皇冠与礼物使用 28 图片图标,缺图时回退原彩色 Icon;透明热区、间距和角标不变。
- 播放量贴封面右下角(底 2、右 6),火焰图标 11 + 12/w400 纯文字,间距 4,并保留极淡底部渐变。 - 播放量贴封面右下角(底 2、右 6),火焰图标 11 + 12/w400 纯文字,间距 4,并保留极淡底部渐变。
- 修复二级 chip 运行时颜色误用 `const TextStyle` 的编译错误,并校正相关测试 Finder 类型。 - 修复二级 chip 运行时颜色误用 `const TextStyle` 的编译错误,并校正相关测试 Finder 类型。
- 全部短剧的地区、字幕、配音筛选 UI 已占位;以下接口待补:地区、字幕/配音筛选数据。 - 全部短剧的地区、字幕、配音筛选 UI 已占位;以下接口待补:地区、字幕/配音筛选数据。
+18 -5
View File
@@ -143,7 +143,9 @@ class HomeGridHeader extends StatelessWidget {
_headerAction( _headerAction(
key: const Key('home-vip-entry'), key: const Key('home-vip-entry'),
frameKey: const Key('home-vip-icon-frame'), 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, color: AppColors.homeCrownGold,
tooltip: l10n.vipMembership, tooltip: l10n.vipMembership,
onTap: callbacks.onOpenVip, onTap: callbacks.onOpenVip,
@@ -152,7 +154,9 @@ class HomeGridHeader extends StatelessWidget {
_headerAction( _headerAction(
key: const Key('home-wallet-entry'), key: const Key('home-wallet-entry'),
frameKey: const Key('home-wallet-icon-frame'), 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, color: AppColors.homeGiftPink,
tooltip: l10n.wallet, tooltip: l10n.wallet,
onTap: callbacks.onOpenWallet, onTap: callbacks.onOpenWallet,
@@ -166,7 +170,9 @@ class HomeGridHeader extends StatelessWidget {
Widget _headerAction({ Widget _headerAction({
required Key key, required Key key,
required Key frameKey, required Key frameKey,
required IconData icon, required Key imageKey,
required String assetPath,
required IconData fallbackIcon,
required Color color, required Color color,
required String tooltip, required String tooltip,
required VoidCallback onTap, required VoidCallback onTap,
@@ -189,8 +195,14 @@ class HomeGridHeader extends StatelessWidget {
child: SizedBox.square( child: SizedBox.square(
key: frameKey, key: frameKey,
dimension: AppDimens.homeActionIcon, dimension: AppDimens.homeActionIcon,
child: Icon( child: Image.asset(
icon, assetPath,
key: imageKey,
width: AppDimens.homeActionIcon,
height: AppDimens.homeActionIcon,
fit: BoxFit.contain,
errorBuilder: (_, _, _) => Icon(
fallbackIcon,
size: AppDimens.homeActionIcon, size: AppDimens.homeActionIcon,
color: color, color: color,
), ),
@@ -200,6 +212,7 @@ class HomeGridHeader extends StatelessWidget {
), ),
), ),
), ),
),
if (badge != null && badge > 0) if (badge != null && badge > 0)
Positioned( Positioned(
key: const Key('home-wallet-badge'), key: const Key('home-wallet-badge'),
+1
View File
@@ -81,6 +81,7 @@ flutter:
# the material Icons class. # the material Icons class.
uses-material-design: true uses-material-design: true
assets: assets:
- assets/icon/
- assets/icon/splash_logo.png - assets/icon/splash_logo.png
- assets/icon/splash_logo_android12.png - assets/icon/splash_logo_android12.png
- assets/icon/rail/ - assets/icon/rail/
+8
View File
@@ -74,6 +74,14 @@ void main() {
tester.getCenter(find.byKey(const Key('home-vip-icon-frame'))).dy, tester.getCenter(find.byKey(const Key('home-vip-icon-frame'))).dy,
tester.getCenter(find.byKey(const Key('home-wallet-icon-frame'))).dy, tester.getCenter(find.byKey(const Key('home-wallet-icon-frame'))).dy,
); );
final crownImage = tester.widget<Image>(
find.byKey(const Key('home-vip-image')),
);
final giftImage = tester.widget<Image>(
find.byKey(const Key('home-wallet-image')),
);
expect((crownImage.image as AssetImage).assetName, 'assets/icon/crown.png');
expect((giftImage.image as AssetImage).assetName, 'assets/icon/gift.png');
expect( expect(
tester.getCenter(vipEntry).dy, tester.getCenter(vipEntry).dy,
closeTo(tester.getCenter(searchEntry).dy, 0.1), closeTo(tester.getCenter(searchEntry).dy, 0.1),