From 9eaf20d90376481b69af44f0510c8ef3f5dd7e38 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 28 Mar 2022 20:13:20 +0200 Subject: [PATCH] fix: Make audioplayer waveforms thinner and better clickable --- lib/pages/chat/events/audio_player.dart | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/pages/chat/events/audio_player.dart b/lib/pages/chat/events/audio_player.dart index 5a6c8a62..9b6177a7 100644 --- a/lib/pages/chat/events/audio_player.dart +++ b/lib/pages/chat/events/audio_player.dart @@ -215,15 +215,19 @@ class _AudioPlayerState extends State { (maxPosition / AudioPlayerWidget.wavesCount) .round() * i)), - child: Opacity( - opacity: currentPosition > i ? 1 : 0.5, - child: Container( - margin: const EdgeInsets.symmetric(horizontal: 1), - decoration: BoxDecoration( - color: widget.color, - borderRadius: BorderRadius.circular(64), - ), - height: 64 * (waveform[i] / 1024)), + child: Container( + height: 32, + alignment: Alignment.center, + child: Opacity( + opacity: currentPosition > i ? 1 : 0.5, + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 1), + decoration: BoxDecoration( + color: widget.color, + borderRadius: BorderRadius.circular(64), + ), + height: 32 * (waveform[i] / 1024)), + ), ), ), )