File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -206,8 +206,8 @@ class AssetPickerViewerState extends State<AssetPickerViewer>
206
206
207
207
/// Method to switch [isDisplayingDetail] .
208
208
/// 切换显示详情状态的方法
209
- void switchDisplayingDetail () {
210
- isDisplayingDetail = ! isDisplayingDetail;
209
+ void switchDisplayingDetail ({ bool value} ) {
210
+ isDisplayingDetail = value ?? ! isDisplayingDetail;
211
211
// if (!Platform.isIOS) {
212
212
// SystemChrome.setEnabledSystemUIOverlays(
213
213
// isDisplayingDetail ? SystemUiOverlay.values : <SystemUiOverlay>[],
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class _VideoPageBuilderState extends State<VideoPageBuilder> {
50
50
void dispose () {
51
51
/// Remove listener from the controller and dispose it when widget dispose.
52
52
/// 部件销毁时移除控制器的监听并销毁控制器。
53
+ _controller? .pause ();
53
54
_controller? .removeListener (videoPlayerListener);
54
55
_controller? .dispose ();
55
56
super .dispose ();
@@ -102,6 +103,9 @@ class _VideoPageBuilderState extends State<VideoPageBuilder> {
102
103
if (isPlaying) {
103
104
_controller.pause ();
104
105
} else {
106
+ if (widget.state.isDisplayingDetail) {
107
+ widget.state.switchDisplayingDetail (value: false );
108
+ }
105
109
if (_controller.value.duration == _controller.value.position) {
106
110
_controller
107
111
..seekTo (Duration .zero)
@@ -160,9 +164,7 @@ class _VideoPageBuilderState extends State<VideoPageBuilder> {
160
164
],
161
165
)
162
166
: Center (
163
- child: Text (
164
- Constants .textDelegate.loadFailed,
165
- ),
167
+ child: Text (Constants .textDelegate.loadFailed),
166
168
);
167
169
}
168
170
}
You can’t perform that action at this time.
0 commit comments