fix(player): 统一暂停按钮并自动隐藏控制层

This commit is contained in:
Zhou Weidong committed 2026-10-19 16:16:14 +08:00
1 parent 568f051b7a
commit 03e34b3b57
5 files changed
+353 -171

No files matched your search

@@ -55,7 +55,7 @@ class HomeFeedOverlay extends StatelessWidget {
child: Align(
alignment: Alignment.centerRight,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 10, 12),
padding: const EdgeInsets.fromLTRB(0, 0, 12, 16),
child: _rail(),
),
),
@@ -0,0 +1,41 @@
// Author: fruit.com.cn
import 'package:flutter/material.dart';
import '../../../core/theme/app_colors.dart';
/// Shared play/pause control used by the home feed and full-screen player.
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: 52,
height: 52,
decoration: const BoxDecoration(
color: Color(0x80000000),
shape: BoxShape.circle,
),
child: Icon(
playing ? Icons.pause_rounded : Icons.play_arrow_rounded,
color: AppColors.onPrimary,
size: 26,
),
),
),
);
}
}