diff --git a/lib/pages/live_room/widgets/bottom_control.dart b/lib/pages/live_room/widgets/bottom_control.dart index 90851e5b..be8ba072 100644 --- a/lib/pages/live_room/widgets/bottom_control.dart +++ b/lib/pages/live_room/widgets/bottom_control.dart @@ -83,7 +83,6 @@ class _BottomControlState extends State { margin: const EdgeInsets.symmetric(horizontal: 10), alignment: Alignment.center, child: PopupMenuButton( - onSelected: widget.controller.toggleVideoFit, initialValue: widget.controller.videoFit.value, color: Colors.black.withOpacity(0.8), itemBuilder: (BuildContext context) { @@ -92,6 +91,9 @@ class _BottomControlState extends State { height: 35, padding: const EdgeInsets.only(left: 30), value: boxFit, + onTap: () { + widget.controller.toggleVideoFit(boxFit); + }, child: Text( "${PlPlayerController.videoFitType[boxFit.index]['desc']}", style: @@ -142,9 +144,6 @@ class _BottomControlState extends State { child: PopupMenuButton( padding: EdgeInsets.zero, initialValue: widget.liveRoomCtr.currentQn, - onSelected: (value) { - widget.liveRoomCtr.changeQn(value); - }, child: Text( widget.liveRoomCtr.currentQnDesc.value, style: const TextStyle(color: Colors.white, fontSize: 13), @@ -153,6 +152,9 @@ class _BottomControlState extends State { return widget.liveRoomCtr.acceptQnList.map((e) { return PopupMenuItem( value: e['code'], + onTap: () { + widget.liveRoomCtr.changeQn(e['code']); + }, child: Text(e['desc']), ); }).toList(); diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index d96fb6c0..faa56cd8 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -401,9 +401,6 @@ class _PLVideoPlayerState extends State margin: const EdgeInsets.symmetric(horizontal: 10), alignment: Alignment.center, child: PopupMenuButton( - onSelected: (SuperResolutionType value) { - plPlayerController.setShader(value.index); - }, initialValue: SuperResolutionType .values[plPlayerController.superResolutionType], color: Colors.black.withOpacity(0.8), @@ -414,6 +411,9 @@ class _PLVideoPlayerState extends State height: 35, padding: const EdgeInsets.only(left: 30), value: type, + onTap: () { + plPlayerController.setShader(type.index); + }, child: Text( type.title, style: @@ -515,9 +515,6 @@ class _PLVideoPlayerState extends State margin: const EdgeInsets.symmetric(horizontal: 10), alignment: Alignment.center, child: PopupMenuButton( - onSelected: (BoxFit value) { - plPlayerController.toggleVideoFit(value); - }, initialValue: plPlayerController.videoFit.value, color: Colors.black.withOpacity(0.8), itemBuilder: (BuildContext context) { @@ -526,6 +523,9 @@ class _PLVideoPlayerState extends State height: 35, padding: const EdgeInsets.only(left: 30), value: boxFit, + onTap: () { + plPlayerController.toggleVideoFit(boxFit); + }, child: Text( "${PlPlayerController.videoFitType[boxFit.index]['desc']}", style: const TextStyle(color: Colors.white, fontSize: 13), @@ -548,9 +548,6 @@ class _PLVideoPlayerState extends State width: widgetWidth, height: 30, child: PopupMenuButton( - onSelected: (int value) { - plPlayerController.setSubtitle(value); - }, initialValue: plPlayerController.vttSubtitles.length < plPlayerController.vttSubtitlesIndex.value ? 0 @@ -563,6 +560,9 @@ class _PLVideoPlayerState extends State .map((entry) { return PopupMenuItem( value: entry.key, + onTap: () { + plPlayerController.setSubtitle(entry.key); + }, child: Text( "${entry.value['title']}", style: const TextStyle(color: Colors.white), @@ -593,9 +593,6 @@ class _PLVideoPlayerState extends State margin: const EdgeInsets.symmetric(horizontal: 10), alignment: Alignment.center, child: PopupMenuButton( - onSelected: (double value) { - plPlayerController.setPlaybackSpeed(value); - }, initialValue: plPlayerController.playbackSpeed, color: Colors.black.withOpacity(0.8), itemBuilder: (BuildContext context) { @@ -604,6 +601,9 @@ class _PLVideoPlayerState extends State height: 35, padding: const EdgeInsets.only(left: 30), value: speed, + onTap: () { + plPlayerController.setPlaybackSpeed(speed); + }, child: Text( "${speed}X", style: const TextStyle(color: Colors.white, fontSize: 13),