diff --git a/lib/models_new/search/search_trending/list.dart b/lib/models_new/search/search_trending/list.dart index ab8783bc..df3ed440 100644 --- a/lib/models_new/search/search_trending/list.dart +++ b/lib/models_new/search/search_trending/list.dart @@ -3,12 +3,14 @@ class SearchTrendingItemModel { String? showName; String? icon; bool? showLiveIcon; + String? recommendReason; SearchTrendingItemModel({ this.keyword, this.showName, this.icon, this.showLiveIcon, + this.recommendReason, }); factory SearchTrendingItemModel.fromJson(Map json) => @@ -17,5 +19,9 @@ class SearchTrendingItemModel { showName: json['show_name'] as String?, icon: json['icon'] as String?, showLiveIcon: json['show_live_icon'] as bool?, + recommendReason: (json['recommend_reason'] as String?)?.replaceFirst( + 'ยท', + ' ', + ), ); } diff --git a/lib/pages/home/controller.dart b/lib/pages/home/controller.dart index 5fc435c8..0753af5e 100644 --- a/lib/pages/home/controller.dart +++ b/lib/pages/home/controller.dart @@ -77,6 +77,7 @@ class HomeController extends GetxController var res = await Request().get(Api.searchDefault); if (res.data['code'] == 0) { defaultSearch.value = res.data['data']?['name'] ?? ''; + // defaultSearch.value = res.data['data']?['show_name'] ?? ''; } } catch (_) {} } diff --git a/lib/pages/search/widgets/hot_keyword.dart b/lib/pages/search/widgets/hot_keyword.dart index 66f9ac8e..56c6f918 100644 --- a/lib/pages/search/widgets/hot_keyword.dart +++ b/lib/pages/search/widgets/hot_keyword.dart @@ -17,6 +17,10 @@ class HotKeyword extends StatelessWidget { @override Widget build(BuildContext context) { + late final style = TextStyle( + fontSize: 14, + color: Theme.of(context).colorScheme.outline, + ); return Wrap( runSpacing: 0.4, spacing: 5.0, @@ -63,7 +67,9 @@ class HotKeyword extends StatelessWidget { width: 48, height: 15, ), - ), + ) + else if (i.recommendReason?.isNotEmpty == true) + Text(i.recommendReason!, style: style), ], ), ),