fix: Hero导致videoPlayer渲染两次
This commit is contained in:
@ -187,9 +187,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
builder: (context, boxConstraints) {
|
||||
double maxWidth = boxConstraints.maxWidth;
|
||||
double maxHeight = boxConstraints.maxHeight;
|
||||
return Hero(
|
||||
tag: videoDetailController.heroTag,
|
||||
child: Stack(
|
||||
return Stack(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: _futureBuilderFuture,
|
||||
@ -197,29 +195,29 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
if (snapshot.hasData &&
|
||||
snapshot.data['status']) {
|
||||
return Obx(
|
||||
() => videoDetailController
|
||||
() => !videoDetailController
|
||||
.autoPlay.value
|
||||
? PLVideoPlayer(
|
||||
controller:
|
||||
plPlayerController!,
|
||||
? const SizedBox()
|
||||
: PLVideoPlayer(
|
||||
controller: plPlayerController!,
|
||||
headerControl: HeaderControl(
|
||||
controller:
|
||||
plPlayerController,
|
||||
videoDetailCtr:
|
||||
videoDetailController,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
}
|
||||
}),
|
||||
),
|
||||
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: videoDetailController
|
||||
.isShowCover.value,
|
||||
visible:
|
||||
videoDetailController.isShowCover.value,
|
||||
child: Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
@ -242,8 +240,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
.isShowCover.value &&
|
||||
videoDetailController
|
||||
.isEffective.value &&
|
||||
!videoDetailController
|
||||
.autoPlay.value,
|
||||
!videoDetailController.autoPlay.value,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
@ -281,8 +278,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
MaterialStateProperty
|
||||
.resolveWith(
|
||||
(states) {
|
||||
.resolveWith((states) {
|
||||
return Theme.of(context)
|
||||
.colorScheme
|
||||
.primaryContainer;
|
||||
@ -300,7 +296,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user