From 8fad2251b3536e9468e0fb193939ead98bad3bc6 Mon Sep 17 00:00:00 2001 From: Akash Pattnaik Date: Fri, 10 May 2024 22:46:10 +0530 Subject: [PATCH] feat(player): add volume slider floating label showing percentage (#1445) * docs: broken link in README.md (fixes #1310) (#1311) * docs: remove appimage link in readme #1082 (#1171) * Updating Readme according to #1082 Updating Readme according to #1082 * Added explanation The explanation is now given and the expression is more formal and explanatory, instead of just linking the issue. * add volume level tooltip in volume_slider --------- Co-authored-by: MerkomassDev <70111455+MerkomassDev@users.noreply.github.com> Co-authored-by: Karim <37943746+ksaadDE@users.noreply.github.com> Co-authored-by: Kingkor Roy Tirtho --- lib/collections/env.dart | 2 +- lib/components/player/volume_slider.dart | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/collections/env.dart b/lib/collections/env.dart index 89a777b64..df45cee91 100644 --- a/lib/collections/env.dart +++ b/lib/collections/env.dart @@ -41,4 +41,4 @@ abstract class Env { kIsFlatpak || _enableUpdateChecker == "1"; static String discordAppId = "1176718791388975124"; -} +} \ No newline at end of file diff --git a/lib/components/player/volume_slider.dart b/lib/components/player/volume_slider.dart index 102bbef6e..8483143b2 100644 --- a/lib/components/player/volume_slider.dart +++ b/lib/components/player/volume_slider.dart @@ -1,6 +1,5 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; - import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:spotube/collections/spotube_icons.dart'; @@ -31,11 +30,17 @@ class VolumeSlider extends HookConsumerWidget { } } }, - child: Slider( - min: 0, - max: 1, - value: value, - onChanged: onChanged, + child: SliderTheme( + data: const SliderThemeData( + showValueIndicator: ShowValueIndicator.always, + ), + child: Slider( + min: 0, + max: 1, + label: (value * 100).toStringAsFixed(0), + value: value, + onChanged: onChanged, + ), ), ); return Row(