This commit is contained in:
2025-06-24 13:05:08 +02:00
parent ba7505c2b3
commit 93a89ba4b9
3 changed files with 67 additions and 67 deletions

View File

@ -6,8 +6,13 @@ import 'package:f0ckapp/controller/settingscontroller.dart';
class VideoControlsOverlay extends StatefulWidget {
final CachedVideoPlayerPlusController controller;
final VoidCallback? onDoubleTap;
const VideoControlsOverlay({super.key, required this.controller});
const VideoControlsOverlay({
super.key,
required this.controller,
this.onDoubleTap,
});
@override
State<VideoControlsOverlay> createState() => _VideoControlsOverlayState();
@ -140,27 +145,9 @@ class _VideoControlsOverlayState extends State<VideoControlsOverlay> {
AnimatedOpacity(
opacity: _controlsVisible && !_isScrubbing ? 1.0 : 0.0,
duration: const Duration(milliseconds: 300),
child: IgnorePointer(
ignoring: !_controlsVisible,
child: Stack(
alignment: Alignment.center,
children: [
IconButton(
icon: Icon(
widget.controller.value.isPlaying
? Icons.pause
: Icons.play_arrow,
size: 64,
color: Theme.of(context).colorScheme.primary,
),
onPressed: _handlePlayPause,
),
Align(
alignment: Alignment.bottomCenter,
child: _buildBottomBar(),
),
],
),
child: Align(
alignment: Alignment.bottomCenter,
child: _buildBottomBar(),
),
),
],
@ -208,6 +195,18 @@ class _VideoControlsOverlayState extends State<VideoControlsOverlay> {
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: Row(
children: [
IconButton(
icon: Icon(
widget.controller.value.isPlaying
? Icons.pause
: Icons.play_arrow,
color: Theme.of(context).colorScheme.primary,
size: 20,
),
onPressed: _handlePlayPause,
constraints: const BoxConstraints(),
padding: EdgeInsets.zero,
),
Text(
_formatDuration(widget.controller.value.position),
style: TextStyle(