fix: trending

This commit is contained in:
My-Responsitories
2025-04-16 20:49:31 +08:00
parent 9ccf91659f
commit 296cd863d2
2 changed files with 15 additions and 2 deletions

View File

@@ -218,6 +218,7 @@ class _SearchPageState extends State<SearchPage> {
isHot
? _searchController.loadingState.value
: _searchController.recommendData.value,
isHot,
)),
],
),
@@ -337,7 +338,8 @@ class _SearchPageState extends State<SearchPage> {
Icon get historyIcon => Icon(Icons.history,
color: Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.8));
Widget _buildHotKey(LoadingState<SearchKeywordData> loadingState) {
Widget _buildHotKey(
LoadingState<SearchKeywordData> loadingState, bool isHot) {
return switch (loadingState) {
Success() => loadingState.response.list?.isNotEmpty == true
? LayoutBuilder(
@@ -350,7 +352,9 @@ class _SearchPageState extends State<SearchPage> {
: const SizedBox.shrink(),
Error() => errorWidget(
errMsg: loadingState.errMsg,
callback: _searchController.queryHotSearchList,
callback: isHot
? _searchController.queryHotSearchList
: _searchController.queryRecommendList,
),
_ => const SizedBox.shrink(),
};

View File

@@ -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,
),
)
],
),
),