mod: 播放停止/完成时,appBar可收起
This commit is contained in:
@ -84,6 +84,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
|
|
||||||
// 播放器状态监听
|
// 播放器状态监听
|
||||||
void playerListener(PlayerStatus? status) {
|
void playerListener(PlayerStatus? status) {
|
||||||
|
playerStatus = status!;
|
||||||
if (status == PlayerStatus.completed) {
|
if (status == PlayerStatus.completed) {
|
||||||
// 结束播放退出全屏
|
// 结束播放退出全屏
|
||||||
if (autoExitFullcreen) {
|
if (autoExitFullcreen) {
|
||||||
@ -163,8 +164,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Scaffold(
|
Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
key: videoDetailController.scaffoldKey,
|
key: videoDetailController.scaffoldKey,
|
||||||
// fix 1px black line
|
|
||||||
// backgroundColor: Colors.transparent,
|
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
body: ExtendedNestedScrollView(
|
body: ExtendedNestedScrollView(
|
||||||
controller: _extendNestCtr,
|
controller: _extendNestCtr,
|
||||||
|
@ -24,18 +24,13 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
);
|
);
|
||||||
|
|
||||||
return AppBar(
|
return Container(
|
||||||
backgroundColor: Colors.transparent,
|
color: Colors.transparent,
|
||||||
foregroundColor: Colors.white,
|
height: 85,
|
||||||
elevation: 0,
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||||
scrolledUnderElevation: 0,
|
child: Column(
|
||||||
primary: false,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
toolbarHeight: 85,
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
titleSpacing: 14,
|
|
||||||
title: Column(
|
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 17),
|
|
||||||
Obx(
|
Obx(
|
||||||
() {
|
() {
|
||||||
final int value = _.sliderPosition.value.inSeconds;
|
final int value = _.sliderPosition.value.inSeconds;
|
||||||
@ -45,7 +40,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 7, right: 5, bottom: 6),
|
padding: const EdgeInsets.only(left: 7, right: 7, bottom: 6),
|
||||||
child: ProgressBar(
|
child: ProgressBar(
|
||||||
progress: Duration(seconds: value),
|
progress: Duration(seconds: value),
|
||||||
buffered: Duration(seconds: buffer),
|
buffered: Duration(seconds: buffer),
|
||||||
@ -76,20 +71,6 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
// Obx(
|
|
||||||
// () => ComBtn(
|
|
||||||
// icon: Icon(
|
|
||||||
// _.playerStatus.paused
|
|
||||||
// ? FontAwesomeIcons.play
|
|
||||||
// : _.playerStatus.playing
|
|
||||||
// ? FontAwesomeIcons.pause
|
|
||||||
// : FontAwesomeIcons.rotateRight,
|
|
||||||
// size: 15,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// fuc: () => _.togglePlay(),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
PlayOrPauseButton(
|
PlayOrPauseButton(
|
||||||
controller: _,
|
controller: _,
|
||||||
),
|
),
|
||||||
@ -158,6 +139,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user