Merge pull request #421 from orz12/opt-videodetail-widget-flicker

opt: 【关注】按钮与自动播放界面跳变
This commit is contained in:
guozhigq
2024-01-20 11:51:09 +08:00
committed by GitHub
2 changed files with 99 additions and 104 deletions

View File

@ -414,14 +414,18 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
),
),
const Spacer(),
AnimatedOpacity(
opacity: loadingStatus ? 0 : 1,
duration: const Duration(milliseconds: 150),
Obx(() => AnimatedOpacity(
opacity: loadingStatus ||
videoIntroController
.followStatus.isEmpty
? 0
: 1,
duration: const Duration(milliseconds: 50),
child: SizedBox(
height: 32,
child: Obx(
() =>
videoIntroController.followStatus.isNotEmpty
() => videoIntroController
.followStatus.isNotEmpty
? TextButton(
onPressed: videoIntroController
.actionRelationMod,
@ -455,7 +459,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
),
),
),
),
)),
],
),
),

View File

@ -392,6 +392,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
},
),
/// 关闭自动播放时 手动播放
if (!videoDetailController
.autoPlay.value) ...<Widget>[
Obx(
() => Visibility(
visible: videoDetailController
@ -416,15 +419,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
),
),
/// 关闭自动播放时 手动播放
Obx(
() => Visibility(
visible: videoDetailController
.isShowCover.value &&
videoDetailController
.isEffective.value &&
!videoDetailController
.autoPlay.value,
.isEffective.value,
child: Stack(
children: [
Positioned(
@ -433,7 +433,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
right: 0,
child: AppBar(
primary: false,
foregroundColor: Colors.white,
foregroundColor:
Colors.white,
elevation: 0,
scrolledUnderElevation: 0,
backgroundColor:
@ -462,27 +463,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
bottom: 10,
child: TextButton.icon(
style: ButtonStyle(
side: MaterialStateProperty
.resolveWith(
(states) {
return BorderSide(
color: Theme.of(context)
.colorScheme
.primary
.withOpacity(0.5),
width: 1);
}),
backgroundColor:
MaterialStateProperty
.resolveWith(
(states) {
return Theme.of(context)
.colorScheme
.background
.withOpacity(0.6);
return Colors.white
.withOpacity(0.8);
}),
),
onPressed: () => handlePlay(),
onPressed: () =>
handlePlay(),
icon: const Icon(
Icons.play_circle_outline,
size: 20,
@ -493,6 +483,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
],
)),
),
]
],
);
},