diff --git a/lib/pages/video/widgets/app_bar.dart b/lib/pages/video/widgets/app_bar.dart deleted file mode 100644 index 07f17b4d..00000000 --- a/lib/pages/video/widgets/app_bar.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:PiliPlus/plugin/pl_player/models/play_status.dart'; -import 'package:flutter/material.dart'; - -class ScrollAppBar extends StatelessWidget { - final double scrollVal; - final Function callback; - final PlayerStatus playerStatus; - - const ScrollAppBar({ - super.key, - required this.scrollVal, - required this.callback, - required this.playerStatus, - }); - - @override - Widget build(BuildContext context) { - final double statusBarHeight = MediaQuery.paddingOf(context).top; - final videoHeight = MediaQuery.sizeOf(context).width * 9 / 16; - double scrollDistance = scrollVal; - if (scrollVal > videoHeight - kToolbarHeight) { - scrollDistance = videoHeight - kToolbarHeight; - } - return Positioned( - top: -videoHeight + scrollDistance + kToolbarHeight + 0.5, - left: 0, - right: 0, - child: Opacity( - opacity: scrollDistance / (videoHeight - kToolbarHeight), - child: Container( - height: statusBarHeight + kToolbarHeight, - color: Theme.of(context).colorScheme.surface, - padding: EdgeInsets.only(top: statusBarHeight), - child: AppBar( - primary: false, - centerTitle: true, - title: TextButton( - onPressed: () => callback(), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - const Icon(Icons.play_arrow_rounded), - Text( - playerStatus == PlayerStatus.paused - ? '继续播放' - : playerStatus == PlayerStatus.completed - ? '重新播放' - : '播放中', - ) - ], - ), - ), - ), - ), - ), - ); - } -}