mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 07:36:14 +08:00
opt video appbar
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1289,21 +1289,22 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
final visible =
|
final visible =
|
||||||
!plPlayerController.controlsLock.value &&
|
!plPlayerController.controlsLock.value &&
|
||||||
plPlayerController.showControls.value;
|
plPlayerController.showControls.value;
|
||||||
|
visible
|
||||||
|
? animationController.forward()
|
||||||
|
: animationController.reverse();
|
||||||
return Positioned.fill(
|
return Positioned.fill(
|
||||||
child: ClipRect(
|
child: ClipRect(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
AppBarAni(
|
AppBarAni(
|
||||||
|
isTop: true,
|
||||||
controller: animationController,
|
controller: animationController,
|
||||||
visible: visible,
|
|
||||||
position: 'top',
|
|
||||||
child: widget.headerControl,
|
child: widget.headerControl,
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
AppBarAni(
|
AppBarAni(
|
||||||
|
isTop: false,
|
||||||
controller: animationController,
|
controller: animationController,
|
||||||
visible: visible,
|
|
||||||
position: 'bottom',
|
|
||||||
child:
|
child:
|
||||||
widget.bottomControl ??
|
widget.bottomControl ??
|
||||||
BottomControl(
|
BottomControl(
|
||||||
|
|||||||
@@ -4,23 +4,20 @@ class AppBarAni extends StatelessWidget {
|
|||||||
const AppBarAni({
|
const AppBarAni({
|
||||||
required this.child,
|
required this.child,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
required this.visible,
|
required this.isTop,
|
||||||
this.position,
|
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final AnimationController controller;
|
final AnimationController controller;
|
||||||
final bool visible;
|
final bool isTop;
|
||||||
final String? position;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
visible ? controller.forward() : controller.reverse();
|
|
||||||
return SlideTransition(
|
return SlideTransition(
|
||||||
position:
|
position:
|
||||||
Tween<Offset>(
|
Tween<Offset>(
|
||||||
begin: Offset(0, position! == 'top' ? -1 : 1.1),
|
begin: isTop ? const Offset(0, -1) : const Offset(0, 1.1),
|
||||||
end: Offset.zero,
|
end: Offset.zero,
|
||||||
).animate(
|
).animate(
|
||||||
CurvedAnimation(
|
CurvedAnimation(
|
||||||
@@ -30,7 +27,7 @@ class AppBarAni extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: position! == 'top'
|
gradient: isTop
|
||||||
? const LinearGradient(
|
? const LinearGradient(
|
||||||
begin: Alignment.bottomCenter,
|
begin: Alignment.bottomCenter,
|
||||||
end: Alignment.topCenter,
|
end: Alignment.topCenter,
|
||||||
|
|||||||
Reference in New Issue
Block a user