diff --git a/lib/models/search/result.dart b/lib/models/search/result.dart index af5e2cfb..91070215 100644 --- a/lib/models/search/result.dart +++ b/lib/models/search/result.dart @@ -224,10 +224,12 @@ class SearchLiveItemModel { this.liveTime, this.uname, this.uface, + this.face, this.userCover, this.type, this.title, this.cover, + this.pic, this.online, this.rankIndex, this.rankScore, @@ -242,16 +244,19 @@ class SearchLiveItemModel { String? liveTime; String? uname; String? uface; + String? face; String? userCover; String? type; List? title; String? cover; + String? pic; int? online; int? rankIndex; int? rankScore; int? roomid; int? attentions; String? cateName; + Map? watchedShow; SearchLiveItemModel.fromJson(Map json) { rankOffset = json['rank_offset']; @@ -260,10 +265,12 @@ class SearchLiveItemModel { liveTime = json['live_time']; uname = json['uname']; uface = json['uface']; + face = json['uface']; userCover = json['user_cover']; type = json['type']; title = Em.regTitle(json['title']); cover = json['cover']; + pic = json['cover']; online = json['online']; rankIndex = json['rank_index']; rankScore = json['rank_score']; diff --git a/lib/pages/liveRoom/controller.dart b/lib/pages/liveRoom/controller.dart index 51ffd7a2..b4640c59 100644 --- a/lib/pages/liveRoom/controller.dart +++ b/lib/pages/liveRoom/controller.dart @@ -31,6 +31,9 @@ class LiveRoomController extends GetxController { liveItem = Get.arguments['liveItem']; heroTag = Get.arguments['heroTag'] ?? ''; if (liveItem.pic != null && liveItem.pic != '') { + cover = liveItem.pic; + } + if (liveItem.cover != null && liveItem.cover != '') { cover = liveItem.cover; } } diff --git a/lib/pages/liveRoom/view.dart b/lib/pages/liveRoom/view.dart index 1fe31c9e..8409d4a6 100644 --- a/lib/pages/liveRoom/view.dart +++ b/lib/pages/liveRoom/view.dart @@ -112,68 +112,67 @@ class _LiveRoomPageState extends State { ], ), ), - if (_liveRoomController.liveItem.watchedShow != null) - Container( - height: 45, - padding: const EdgeInsets.only(left: 12, right: 12), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.background, - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor.withOpacity(0.1)), + Container( + height: 45, + padding: const EdgeInsets.only(left: 12, right: 12), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.background, + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor.withOpacity(0.1)), + ), + ), + child: Row(children: [ + SizedBox( + width: 38, + height: 38, + child: IconButton( + onPressed: () {}, + icon: const Icon( + Icons.subtitles_outlined, + size: 21, + ), ), ), - child: Row(children: [ - SizedBox( - width: 38, - height: 38, - child: IconButton( - onPressed: () {}, - icon: const Icon( - Icons.subtitles_outlined, - size: 21, - ), + const Spacer(), + SizedBox( + width: 38, + height: 38, + child: IconButton( + onPressed: () {}, + icon: const Icon( + Icons.hd_outlined, + size: 20, ), ), - const Spacer(), - SizedBox( - width: 38, - height: 38, - child: IconButton( - onPressed: () {}, - icon: const Icon( - Icons.hd_outlined, - size: 20, - ), + ), + SizedBox( + width: 38, + height: 38, + child: IconButton( + onPressed: () => _liveRoomController + .setVolumn(plPlayerController!.volume.value), + icon: Obx(() => Icon( + _liveRoomController.volumeOff.value + ? Icons.volume_off_outlined + : Icons.volume_up_outlined, + size: 21, + )), + ), + ), + SizedBox( + width: 38, + height: 38, + child: IconButton( + onPressed: () => {}, + // plPlayerController!.goToFullscreen(context), + icon: const Icon( + Icons.fullscreen, ), ), - SizedBox( - width: 38, - height: 38, - child: IconButton( - onPressed: () => _liveRoomController - .setVolumn(plPlayerController!.volume.value), - icon: Obx(() => Icon( - _liveRoomController.volumeOff.value - ? Icons.volume_off_outlined - : Icons.volume_up_outlined, - size: 21, - )), - ), - ), - SizedBox( - width: 38, - height: 38, - child: IconButton( - onPressed: () => {}, - // plPlayerController!.goToFullscreen(context), - icon: const Icon( - Icons.fullscreen, - ), - ), - ), - ]), - ), + ), + ]), + ), ], ), ); diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index 4a1f809d..726b0a0d 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -211,13 +211,13 @@ class _SearchPageState extends State with RouteAware { return Obx( () => Container( width: double.infinity, - padding: const EdgeInsets.fromLTRB(10, 25, 4, 0), + padding: const EdgeInsets.fromLTRB(10, 25, 6, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_searchController.historyList.isNotEmpty) Padding( - padding: const EdgeInsets.fromLTRB(6, 0, 1, 2), + padding: const EdgeInsets.fromLTRB(6, 0, 0, 2), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/pages/searchPanel/widgets/live_panel.dart b/lib/pages/searchPanel/widgets/live_panel.dart index f00660e6..02b56d3a 100644 --- a/lib/pages/searchPanel/widgets/live_panel.dart +++ b/lib/pages/searchPanel/widgets/live_panel.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:pilipala/common/constants.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/utils/utils.dart'; @@ -32,6 +33,7 @@ class LiveItem extends StatelessWidget { @override Widget build(BuildContext context) { + String heroTag = Utils.makeHeroTag(liveItem.roomid); return Card( elevation: 0, clipBehavior: Clip.hardEdge, @@ -40,7 +42,10 @@ class LiveItem extends StatelessWidget { ), margin: EdgeInsets.zero, child: InkWell( - onTap: () {}, + onTap: () async { + Get.toNamed('/liveRoom?roomid=${liveItem.roomid}', + arguments: {'liveItem': liveItem, 'heroTag': heroTag}); + }, child: Column( children: [ ClipRRect( @@ -58,7 +63,7 @@ class LiveItem extends StatelessWidget { return Stack( children: [ Hero( - tag: Utils.makeHeroTag(liveItem.roomid), + tag: heroTag, child: NetworkImgLayer( src: liveItem.cover, type: 'emote',