播放页顶部按钮与选集条去掉底色、进度条不再画滑块圆点并压到最底部; 剧名与简介收在互动栏左侧,清屏后只留右下角退出按钮。 首页观看条与进度条共用 20pt 页边距,进度槽底色与播放页一致。
52 lines
1.3 KiB
Dart
52 lines
1.3 KiB
Dart
// Author: fruit.com.cn
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../../core/theme/app_colors.dart';
|
|
|
|
const double _toggleSize = 68;
|
|
const double _iconSize = 36;
|
|
|
|
/// 播放/暂停压在画面上,垫一层半透明深色圆底保证亮画面下也能看见。
|
|
const Color _toggleBackground = Color(0x66000000);
|
|
const List<Shadow> _iconShadows = [
|
|
Shadow(color: AppColors.shadow, blurRadius: 12),
|
|
];
|
|
|
|
/// 首页沉浸流与全屏播放器共用的播放/暂停按钮。
|
|
class PlayerCenterToggle extends StatelessWidget {
|
|
const PlayerCenterToggle({
|
|
super.key,
|
|
required this.playing,
|
|
required this.onTap,
|
|
});
|
|
|
|
final bool playing;
|
|
final VoidCallback onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Semantics(
|
|
button: true,
|
|
label: playing ? 'Pause' : 'Play',
|
|
child: GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: _toggleSize,
|
|
height: _toggleSize,
|
|
decoration: const BoxDecoration(
|
|
color: _toggleBackground,
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: Icon(
|
|
playing ? Icons.pause_rounded : Icons.play_arrow_rounded,
|
|
color: AppColors.onPrimary,
|
|
size: _iconSize,
|
|
shadows: _iconShadows,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|