From df41729d74996e036f12214938f4b175ae9568c9 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 31 Dec 2024 17:02:12 +0800 Subject: [PATCH] fix: reverse play Signed-off-by: bggRGjQaUbCoE --- lib/common/widgets/list_sheet.dart | 16 +++-- lib/models/video/later.dart | 3 + lib/models/video_detail_res.dart | 6 ++ lib/pages/follow/widgets/follow_list.dart | 2 +- lib/pages/setting/extra_setting.dart | 2 +- lib/pages/subscription_detail/view.dart | 52 ++++++--------- lib/pages/video/detail/controller.dart | 2 +- .../video/detail/introduction/controller.dart | 2 + lib/pages/video/detail/introduction/view.dart | 41 +++++------- .../detail/introduction/widgets/page.dart | 37 +++++------ .../detail/introduction/widgets/season.dart | 39 +++++++---- lib/pages/video/detail/view.dart | 65 +++++++++++-------- 12 files changed, 142 insertions(+), 125 deletions(-) diff --git a/lib/common/widgets/list_sheet.dart b/lib/common/widgets/list_sheet.dart index ad58a5ee..44b34e69 100644 --- a/lib/common/widgets/list_sheet.dart +++ b/lib/common/widgets/list_sheet.dart @@ -28,6 +28,7 @@ class ListSheetContent extends StatefulWidget { this.onReverse, this.showTitle, this.isSupportReverse, + this.isReversed, }); final dynamic index; @@ -41,6 +42,7 @@ class ListSheetContent extends StatefulWidget { final VoidCallback? onReverse; final bool? showTitle; final bool? isSupportReverse; + final bool? isReversed; @override State createState() => _ListSheetContentState(); @@ -381,10 +383,10 @@ class _ListSheetContentState extends State stream: _indexStream?.stream, initialData: _index, builder: (context, snapshot) => _mediumButton( - tooltip: reverse[snapshot.data] ? '正序' : '反序', + tooltip: reverse[snapshot.data] ? '顺序' : '倒序', icon: !reverse[snapshot.data] - ? MdiIcons.sortAscending - : MdiIcons.sortDescending, + ? MdiIcons.sortNumericAscending + : MdiIcons.sortNumericDescending, onPressed: () { setState(() { reverse[_ctr?.index ?? 0] = !reverse[_ctr?.index ?? 0]; @@ -436,8 +438,10 @@ class _ListSheetContentState extends State } Widget get _reverseButton => _mediumButton( - tooltip: '倒序播放', - icon: Icons.u_turn_right, + tooltip: widget.isReversed == true ? '正序播放' : '倒序播放', + icon: widget.isReversed == true + ? MdiIcons.sortDescending + : MdiIcons.sortAscending, onPressed: () async { if (widget.showTitle == false) { // jump to current @@ -479,7 +483,7 @@ class _ListSheetContentState extends State Widget _buildBody(i, episodes) => Material( child: ScrollablePositionedList.separated( padding: EdgeInsets.only( - bottom: MediaQuery.of(context).padding.bottom + 20, + bottom: MediaQuery.of(context).padding.bottom + 80, ), reverse: reverse[i ?? 0], itemCount: episodes.length, diff --git a/lib/models/video/later.dart b/lib/models/video/later.dart index dd4f3154..aee860e2 100644 --- a/lib/models/video/later.dart +++ b/lib/models/video/later.dart @@ -31,6 +31,7 @@ class MediaVideoItemModel { this.forbidFav, this.moreType, this.businessOid, + this.isReversed = false, }); int? id; @@ -64,6 +65,7 @@ class MediaVideoItemModel { bool? forbidFav; int? moreType; int? businessOid; + bool isReversed; factory MediaVideoItemModel.fromJson(Map json) => MediaVideoItemModel( @@ -101,6 +103,7 @@ class MediaVideoItemModel { forbidFav: json["forbid_fav"], moreType: json["more_type"], businessOid: json["business_oid"], + isReversed: false, ); } diff --git a/lib/models/video_detail_res.dart b/lib/models/video_detail_res.dart index 87470c2a..28b84ef8 100644 --- a/lib/models/video_detail_res.dart +++ b/lib/models/video_detail_res.dart @@ -69,6 +69,8 @@ class VideoDetailData { bool? needJumpBv; String? epId; List? staff; + late bool isPageReversed; + late bool isSeasonReversed; VideoDetailData({ this.bvid, @@ -107,6 +109,8 @@ class VideoDetailData { this.needJumpBv, this.epId, this.staff, + this.isPageReversed = false, + this.isSeasonReversed = false, }); VideoDetailData.fromJson(Map json) { @@ -163,6 +167,8 @@ class VideoDetailData { if (json['redirect_url'] != null) { epId = resolveEpId(json['redirect_url']); } + isPageReversed = false; + isSeasonReversed = false; } String resolveEpId(url) { diff --git a/lib/pages/follow/widgets/follow_list.dart b/lib/pages/follow/widgets/follow_list.dart index 30c66064..ea5e587f 100644 --- a/lib/pages/follow/widgets/follow_list.dart +++ b/lib/pages/follow/widgets/follow_list.dart @@ -66,7 +66,7 @@ class _FollowListState extends State { if (index == list.length) { return Container( height: - MediaQuery.of(context).padding.bottom + 60, + MediaQuery.of(context).padding.bottom + 80, padding: EdgeInsets.only( bottom: MediaQuery.of(context).padding.bottom), diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index 63bd4f3e..fe3fd649 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -404,7 +404,7 @@ class _ExtraSettingState extends State { SetSwitchItem( title: '分P/合集:倒序播放从首集开始播放', subTitle: '开启则自动切换为倒序首集,否则保持当前集', - leading: const Icon(Icons.u_turn_right), + leading: Icon(MdiIcons.sort), setKey: SettingBoxKey.reverseFromFirst, defaultVal: true, ), diff --git a/lib/pages/subscription_detail/view.dart b/lib/pages/subscription_detail/view.dart index fc0b08d7..5a51597d 100644 --- a/lib/pages/subscription_detail/view.dart +++ b/lib/pages/subscription_detail/view.dart @@ -228,20 +228,27 @@ class _SubDetailPageState extends State { return Obx( () => subList.isEmpty ? const SliverToBoxAdapter(child: SizedBox()) - : SliverGrid( - gridDelegate: - SliverGridDelegateWithExtentAndRatio( - mainAxisSpacing: 2, - maxCrossAxisExtent: Grid.maxRowWidth * 2, - childAspectRatio: StyleString.aspectRatio * 2.2, + : SliverPadding( + padding: EdgeInsets.only( + bottom: + MediaQuery.paddingOf(context).bottom + 80, ), - delegate: SliverChildBuilderDelegate( - childCount: subList.length, - (BuildContext context, int index) { - return SubVideoCardH( - videoItem: subList[index], - ); - }, + sliver: SliverGrid( + gridDelegate: + SliverGridDelegateWithExtentAndRatio( + mainAxisSpacing: 2, + maxCrossAxisExtent: Grid.maxRowWidth * 2, + childAspectRatio: + StyleString.aspectRatio * 2.2, + ), + delegate: SliverChildBuilderDelegate( + childCount: subList.length, + (BuildContext context, int index) { + return SubVideoCardH( + videoItem: subList[index], + ); + }, + ), ), ), ); @@ -271,25 +278,6 @@ class _SubDetailPageState extends State { } }, ), - SliverToBoxAdapter( - child: Container( - height: MediaQuery.of(context).padding.bottom + 60, - padding: EdgeInsets.only( - bottom: MediaQuery.of(context).padding.bottom, - ), - child: Center( - child: Obx( - () => Text( - _subDetailController.loadingText.value, - style: TextStyle( - color: Theme.of(context).colorScheme.outline, - fontSize: 13, - ), - ), - ), - ), - ), - ) ], ), ); diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 675b4c31..b8ad7087 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -222,7 +222,7 @@ class VideoDetailController extends GetxController videoType == SearchType.video ? _showVideoReply : _showBangumiReply; late final horizontalSeasonPanel = GStorage.horizontalSeasonPanel; - late int seasonCid = 0; + int? seasonCid; late RxInt seasonIndex = 0.obs; late final reverseFromFirst = GStorage.reverseFromFirst; diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 681975a3..6d8a3ea2 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -133,10 +133,12 @@ class VideoIntroController extends GetxController if (videoDetail.value.ugcSeason?.id == result['data']?.ugcSeason?.id) { // keep reversed season result['data']?.ugcSeason = videoDetail.value.ugcSeason; + result['data']?.isSeasonReversed = videoDetail.value.isSeasonReversed; } if (videoDetail.value.cid == result['data']?.cid) { // keep reversed pages result['data']?.pages = videoDetail.value.pages; + result['data']?.isPageReversed = videoDetail.value.isPageReversed; } videoDetail.value = result['data']; videoItem!['staff'] = result['data'].staff; diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 32fa6362..fe79c1ce 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -82,6 +82,7 @@ class _VideoIntroPanelState extends State onShowMemberPage: widget.onShowMemberPage, ) : VideoInfo( + key: ValueKey(widget.heroTag), loadingStatus: false, videoIntroController: videoIntroController, heroTag: widget.heroTag, @@ -109,12 +110,12 @@ class VideoInfo extends StatefulWidget { const VideoInfo({ super.key, this.loadingStatus = false, - required this.videoIntroController, required this.heroTag, required this.showAiBottomSheet, required this.showIntroDetail, required this.showEpisodes, required this.onShowMemberPage, + required this.videoIntroController, }); @override @@ -642,10 +643,9 @@ class _VideoInfoState extends State with TickerProviderStateMixin { ), ), ), - const SizedBox(height: 8), Obx( () => videoIntroController.queryVideoIntroData.value["status"] - ? const SizedBox() + ? const SizedBox.shrink() : Center( child: TextButton.icon( icon: const Icon(Icons.refresh), @@ -676,19 +676,13 @@ class _VideoInfoState extends State with TickerProviderStateMixin { (context.orientation != Orientation.landscape || (context.orientation == Orientation.landscape && videoDetailCtr.horizontalSeasonPanel.not))) - Obx( - () => SeasonPanel( - heroTag: widget.heroTag, - ugcSeason: videoDetail.ugcSeason!, - cid: videoIntroController.lastPlayCid.value != 0 - ? (videoDetail.pages?.isNotEmpty == true - ? videoDetail.pages!.first.cid - : videoIntroController.lastPlayCid.value) - : videoDetail.pages!.first.cid, - changeFuc: videoIntroController.changeSeasonOrbangu, - showEpisodes: widget.showEpisodes, - pages: videoDetail.pages, - ), + SeasonPanel( + heroTag: widget.heroTag, + ugcSeason: videoDetail.ugcSeason!, + changeFuc: videoIntroController.changeSeasonOrbangu, + showEpisodes: widget.showEpisodes, + pages: videoDetail.pages, + videoIntroController: videoIntroController, ), if (!widget.loadingStatus && videoDetail.pages != null && @@ -696,15 +690,12 @@ class _VideoInfoState extends State with TickerProviderStateMixin { (context.orientation != Orientation.landscape || (context.orientation == Orientation.landscape && videoDetailCtr.horizontalSeasonPanel.not))) ...[ - Obx( - () => PagesPanel( - heroTag: widget.heroTag, - videoDetailData: videoIntroController.videoDetail.value, - cid: videoIntroController.lastPlayCid.value, - bvid: videoIntroController.bvid, - changeFuc: videoIntroController.changeSeasonOrbangu, - showEpisodes: widget.showEpisodes, - ), + PagesPanel( + heroTag: widget.heroTag, + videoIntroController: videoIntroController, + bvid: videoIntroController.bvid, + changeFuc: videoIntroController.changeSeasonOrbangu, + showEpisodes: widget.showEpisodes, ), ], ], diff --git a/lib/pages/video/detail/introduction/widgets/page.dart b/lib/pages/video/detail/introduction/widgets/page.dart index 4e78358f..fe024e1a 100644 --- a/lib/pages/video/detail/introduction/widgets/page.dart +++ b/lib/pages/video/detail/introduction/widgets/page.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:math'; +import 'package:PiliPalaX/pages/video/detail/introduction/controller.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:PiliPalaX/models/video_detail_res.dart'; @@ -11,19 +12,17 @@ import '../../../../../utils/id_utils.dart'; class PagesPanel extends StatefulWidget { const PagesPanel({ super.key, - required this.cid, required this.bvid, required this.changeFuc, required this.heroTag, required this.showEpisodes, - required this.videoDetailData, + required this.videoIntroController, }); - final int cid; final String bvid; final Function changeFuc; final String heroTag; final Function showEpisodes; - final VideoDetailData videoDetailData; + final VideoIntroController videoIntroController; @override State createState() => _PagesPanelState(); @@ -36,19 +35,20 @@ class _PagesPanelState extends State { final ScrollController _scrollController = ScrollController(); StreamSubscription? _listener; + List get pages => widget.videoIntroController.videoDetail.value.pages!; + @override void initState() { super.initState(); - cid = widget.cid; + cid = widget.videoIntroController.lastPlayCid.value; _videoDetailController = Get.find(tag: widget.heroTag); - pageIndex = - widget.videoDetailData.pages!.indexWhere((Part e) => e.cid == cid); + pageIndex = pages.indexWhere((Part e) => e.cid == cid); _listener = _videoDetailController.cid.listen((int cid) { this.cid = cid; - pageIndex = max(0, - widget.videoDetailData.pages!.indexWhere((Part e) => e.cid == cid)); + pageIndex = max(0, pages.indexWhere((Part e) => e.cid == cid)); if (!mounted) return; + setState(() {}); const double itemWidth = 150; // 每个列表项的宽度 final double targetOffset = min((pageIndex * itemWidth) - (itemWidth / 2), _scrollController.position.maxScrollExtent); @@ -73,14 +73,14 @@ class _PagesPanelState extends State { return Column( children: [ Padding( - padding: const EdgeInsets.only(top: 10, bottom: 2), + padding: const EdgeInsets.only(top: 8, bottom: 2), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Text('视频选集 '), Expanded( child: Text( - ' 正在播放:${widget.videoDetailData.pages![pageIndex].pagePart}', + ' 正在播放:${pages[pageIndex].pagePart}', overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 12, @@ -98,13 +98,13 @@ class _PagesPanelState extends State { onPressed: () => widget.showEpisodes( null, null, - widget.videoDetailData.pages!, + pages, widget.bvid, IdUtils.bv2av(widget.bvid), cid, ), child: Text( - '共${widget.videoDetailData.pages!.length}集', + '共${pages.length}集', style: const TextStyle(fontSize: 13), ), ), @@ -112,20 +112,19 @@ class _PagesPanelState extends State { ], ), ), - Container( + SizedBox( height: 35, - margin: const EdgeInsets.only(bottom: 8), child: ListView.builder( controller: _scrollController, scrollDirection: Axis.horizontal, - itemCount: widget.videoDetailData.pages!.length, + itemCount: pages.length, itemExtent: 150, itemBuilder: (BuildContext context, int i) { bool isCurrentIndex = pageIndex == i; return Container( width: 150, margin: EdgeInsets.only( - right: i != widget.videoDetailData.pages!.length - 1 ? 10 : 0, + right: i != pages.length - 1 ? 10 : 0, ), child: Material( color: Theme.of(context).colorScheme.onInverseSurface, @@ -136,7 +135,7 @@ class _PagesPanelState extends State { widget.changeFuc( null, widget.bvid, - widget.videoDetailData.pages![i].cid, + pages[i].cid, IdUtils.bv2av(widget.bvid), null, ) @@ -157,7 +156,7 @@ class _PagesPanelState extends State { ], Expanded( child: Text( - widget.videoDetailData.pages![i].pagePart!, + pages[i].pagePart!, maxLines: 1, style: TextStyle( fontSize: 13, diff --git a/lib/pages/video/detail/introduction/widgets/season.dart b/lib/pages/video/detail/introduction/widgets/season.dart index c55c5803..53027726 100644 --- a/lib/pages/video/detail/introduction/widgets/season.dart +++ b/lib/pages/video/detail/introduction/widgets/season.dart @@ -1,5 +1,7 @@ import 'dart:async'; +import 'package:PiliPalaX/pages/video/detail/introduction/controller.dart'; +import 'package:PiliPalaX/utils/extension.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:PiliPalaX/models/video_detail_res.dart'; @@ -9,20 +11,20 @@ class SeasonPanel extends StatefulWidget { const SeasonPanel({ super.key, required this.ugcSeason, - this.cid, required this.changeFuc, required this.heroTag, required this.showEpisodes, required this.pages, this.onTap, + required this.videoIntroController, }); final UgcSeason ugcSeason; - final int? cid; final Function changeFuc; final String heroTag; final Function showEpisodes; final List? pages; final bool? onTap; + final VideoIntroController videoIntroController; @override State createState() => _SeasonPanelState(); @@ -34,12 +36,26 @@ class _SeasonPanelState extends State { StreamSubscription? _listener; List episodes = []; + VideoIntroController get videoIntroController => widget.videoIntroController; + VideoDetailData get videoDetail => + widget.videoIntroController.videoDetail.value; + @override void initState() { super.initState(); _videoDetailController = - Get.find(tag: widget.heroTag) - ..seasonCid = widget.cid!; + Get.find(tag: widget.heroTag); + + _videoDetailController.seasonCid = + videoIntroController.lastPlayCid.value != 0 + ? (videoDetail.pages?.isNotEmpty == true + ? videoDetail.isPageReversed + ? videoDetail.pages!.last.cid + : videoDetail.pages!.first.cid + : videoIntroController.lastPlayCid.value) + : videoDetail.isPageReversed + ? videoDetail.pages!.last.cid + : videoDetail.pages!.first.cid; /// 根据 cid 找到对应集,找到对应 episodes /// 有多个episodes时,只显示其中一个 @@ -55,16 +71,12 @@ class _SeasonPanelState extends State { currentIndex.value = episodes.indexWhere( (EpisodeItem e) => e.cid == _videoDetailController.seasonCid); _listener = _videoDetailController.cid.listen((int cid) { - if (_videoDetailController.seasonCid == cid) { - //refresh - _findEpisode(); - currentIndex.value = episodes.indexWhere( - (EpisodeItem e) => e.cid == _videoDetailController.seasonCid); - return; + if (_videoDetailController.seasonCid != cid) { + bool isPart = widget.pages?.indexWhere((item) => item.cid == cid) != -1; + if (isPart.not) { + _videoDetailController.seasonCid = cid; + } } - bool isPart = widget.pages?.indexWhere((item) => item.cid == cid) != -1; - if (isPart) return; - _videoDetailController.seasonCid = cid; _findEpisode(); currentIndex.value = episodes.indexWhere( (EpisodeItem e) => e.cid == _videoDetailController.seasonCid); @@ -99,7 +111,6 @@ class _SeasonPanelState extends State { top: 8, left: 2, right: 2, - bottom: 2, ), child: Material( color: Theme.of(context).colorScheme.onInverseSurface, diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index a6c2fb04..145fc751 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -1375,9 +1375,7 @@ class _VideoDetailPageState extends State if (needRelated && videoDetailController.showRelatedVideo) ...[ SliverToBoxAdapter( child: Padding( - padding: const EdgeInsets.only( - top: StyleString.safeSpace, - ), + padding: const EdgeInsets.only(top: StyleString.safeSpace), child: Divider( height: 1, indent: 12, @@ -1387,7 +1385,13 @@ class _VideoDetailPageState extends State ), ), RelatedVideoPanel(heroTag: heroTag), - ], + ] else + SliverToBoxAdapter( + child: SizedBox( + height: MediaQuery.paddingOf(context).bottom + + StyleString.safeSpace, + ), + ), ] else if (videoDetailController.videoType == SearchType.media_bangumi) Obx( @@ -1465,42 +1469,35 @@ class _VideoDetailPageState extends State Widget get seasonPanel => Column( children: [ if ((videoIntroController.videoDetail.value.pages?.length ?? 0) > 1) - Obx( - () => Padding( - padding: const EdgeInsets.symmetric(horizontal: 14), - child: PagesPanel( - heroTag: heroTag, - videoDetailData: videoIntroController.videoDetail.value, - cid: videoIntroController.lastPlayCid.value, - bvid: videoIntroController.bvid, - changeFuc: videoIntroController.changeSeasonOrbangu, - showEpisodes: showEpisodes, - ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 14), + child: PagesPanel( + heroTag: heroTag, + videoIntroController: videoIntroController, + bvid: videoIntroController.bvid, + changeFuc: videoIntroController.changeSeasonOrbangu, + showEpisodes: showEpisodes, ), ), if (videoIntroController.videoDetail.value.ugcSeason != null) ...[ - if ((videoIntroController.videoDetail.value.pages?.length ?? 0) > 1) + if ((videoIntroController.videoDetail.value.pages?.length ?? 0) > + 1) ...[ + const SizedBox(height: 8), Divider( height: 1, color: Theme.of(context).colorScheme.outline.withOpacity(0.1), ), + ], Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: SeasonPanel( heroTag: heroTag, onTap: false, ugcSeason: videoIntroController.videoDetail.value.ugcSeason!, - cid: videoIntroController.lastPlayCid.value != 0 - ? (videoIntroController - .videoDetail.value.pages?.isNotEmpty == - true - ? videoIntroController - .videoDetail.value.pages!.first.cid - : videoIntroController.lastPlayCid.value) - : videoIntroController.videoDetail.value.pages!.first.cid, changeFuc: videoIntroController.changeSeasonOrbangu, showEpisodes: showEpisodes, pages: videoIntroController.videoDetail.value.pages, + videoIntroController: videoIntroController, ), ), Expanded( @@ -1510,7 +1507,9 @@ class _VideoDetailPageState extends State season: videoIntroController.videoDetail.value.ugcSeason, bvid: videoDetailController.bvid, aid: IdUtils.bv2av(videoDetailController.bvid), - currentCid: videoDetailController.seasonCid, + currentCid: videoDetailController.seasonCid ?? 0, + isReversed: + videoIntroController.videoDetail.value.isSeasonReversed, changeFucCall: videoDetailController.videoType == SearchType.media_bangumi ? bangumiIntroController.changeSeasonOrbangu @@ -1595,6 +1594,12 @@ class _VideoDetailPageState extends State aid: aid, currentCid: cid, episodes: episodes, + isReversed: + videoDetailController.videoType == SearchType.media_bangumi + ? null + : season != null + ? videoIntroController.videoDetail.value.isSeasonReversed + : videoIntroController.videoDetail.value.isPageReversed, isSupportReverse: videoDetailController.videoType != SearchType.media_bangumi, changeFucCall: @@ -1651,6 +1656,8 @@ class _VideoDetailPageState extends State if (isSeason) { // reverse season + videoIntroController.videoDetail.value.isSeasonReversed = + !videoIntroController.videoDetail.value.isSeasonReversed; videoIntroController.videoDetail.value.ugcSeason! .sections![videoDetailController.seasonIndex.value].episodes = videoIntroController @@ -1672,13 +1679,17 @@ class _VideoDetailPageState extends State .sections![videoDetailController.seasonIndex.value].episodes!.first; if (episode.cid != videoDetailController.cid.value) { changeEpisode(episode); + } else { + videoDetailController.seasonIndex.refresh(); + videoDetailController.cid.refresh(); } } } else { // reverse part + videoIntroController.videoDetail.value.isPageReversed = + !videoIntroController.videoDetail.value.isPageReversed; videoIntroController.videoDetail.value.pages = videoIntroController.videoDetail.value.pages!.reversed.toList(); - videoIntroController.lastPlayCid.refresh(); if (videoDetailController.reverseFromFirst.not) { // keep current episode videoDetailController.cid.refresh(); @@ -1687,6 +1698,8 @@ class _VideoDetailPageState extends State dynamic episode = videoIntroController.videoDetail.value.pages!.first; if (episode.cid != videoDetailController.cid.value) { changeEpisode(episode); + } else { + videoDetailController.cid.refresh(); } } }