From 296cd863d2ab1916cf52cb94d33786199ef12b92 Mon Sep 17 00:00:00 2001 From: My-Responsitories <107370289+My-Responsitories@users.noreply.github.com> Date: Wed, 16 Apr 2025 20:49:31 +0800 Subject: [PATCH] fix: trending --- lib/pages/search/view.dart | 8 ++++++-- lib/pages/search/widgets/hot_keyword.dart | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index f74aee740..be99b635b 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -218,6 +218,7 @@ class _SearchPageState extends State { isHot ? _searchController.loadingState.value : _searchController.recommendData.value, + isHot, )), ], ), @@ -337,7 +338,8 @@ class _SearchPageState extends State { Icon get historyIcon => Icon(Icons.history, color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.8)); - Widget _buildHotKey(LoadingState loadingState) { + Widget _buildHotKey( + LoadingState loadingState, bool isHot) { return switch (loadingState) { Success() => loadingState.response.list?.isNotEmpty == true ? LayoutBuilder( @@ -350,7 +352,9 @@ class _SearchPageState extends State { : const SizedBox.shrink(), Error() => errorWidget( errMsg: loadingState.errMsg, - callback: _searchController.queryHotSearchList, + callback: isHot + ? _searchController.queryHotSearchList + : _searchController.queryRecommendList, ), _ => const SizedBox.shrink(), }; diff --git a/lib/pages/search/widgets/hot_keyword.dart b/lib/pages/search/widgets/hot_keyword.dart index 160866937..dba174765 100644 --- a/lib/pages/search/widgets/hot_keyword.dart +++ b/lib/pages/search/widgets/hot_keyword.dart @@ -56,6 +56,15 @@ class HotKeyword extends StatelessWidget { height: 15, ), ) + else if (i.showLiveIcon == true) + Padding( + padding: const EdgeInsets.only(left: 4), + child: Image.asset( + 'assets/images/live/live_@28h.gif', + width: 48, + height: 15, + ), + ) ], ), ),