mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
remove unused widget
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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
|
|
||||||
? '重新播放'
|
|
||||||
: '播放中',
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user