mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 09:06:36 +08:00
show search rcmd reason
Closes #921 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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<String, dynamic> 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(
|
||||
'·',
|
||||
' ',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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 (_) {}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user