From d6cc1529b88b1c9300e8aaa18fed66c79392c5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20R=C3=A1=C5=BE?= Date: Wed, 18 Nov 2026 00:15:42 +0100 Subject: [PATCH] fix(voice): keep the track centred while the speed label is shown The speed control sits under the time, so the column grew downwards when playback started and pushed the track and the time up: the pause button stayed centred while the line it belongs to drifted towards the top. Reserving the same height above the track as the speed line below it puts the track's centre back on the play button's centre. --- lib/widgets/voice_player.dart | 37 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/widgets/voice_player.dart b/lib/widgets/voice_player.dart index b979352..cecfb33 100644 --- a/lib/widgets/voice_player.dart +++ b/lib/widgets/voice_player.dart @@ -191,12 +191,16 @@ class _VoicePlayerState extends State with WidgetsBindingObserver { final completed = stateSnapshot.data?.processingState == ProcessingState.completed; // The speed control appears with playback and is gone - // again once the message finished. + // again once the message finished. It sits under the time, + // so the track gets an equal spacer above it to stay + // centred on the play button instead of drifting up. final started = position > Duration.zero && !completed; + const double speedLine = 16; return Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ + if (started) const SizedBox(height: speedLine), Row( children: [ Expanded( @@ -234,20 +238,23 @@ class _VoicePlayerState extends State with WidgetsBindingObserver { ], ), if (started) - Align( - alignment: Alignment.centerRight, - child: Semantics( - button: true, - child: InkWell( - onTap: _cycleSpeed, - child: Padding( - padding: const EdgeInsets.only(right: 4), - child: Text( - speedLabel(_speed), - style: TextStyle( - fontSize: 11, - fontWeight: FontWeight.w600, - color: widget.color, + SizedBox( + height: speedLine, + child: Align( + alignment: Alignment.centerRight, + child: Semantics( + button: true, + child: InkWell( + onTap: _cycleSpeed, + child: Padding( + padding: const EdgeInsets.only(right: 4), + child: Text( + speedLabel(_speed), + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: widget.color, + ), ), ), ),