fix(player): size volume slider handle proportionally

This commit is contained in:
zarzet committed 2026-10-15 22:37:55 +07:00
1 parent 23fe78f30d
commit 47ccf9c9ed
2 files changed
+8 -1

No files matched your search

+6
View File
@@ -16,6 +16,7 @@ class AppSlider extends StatelessWidget {
this.label,
this.semanticFormatterCallback,
this.trackThickness,
this.thumbLength,
});
final double value;
@@ -31,6 +32,10 @@ class AppSlider extends StatelessWidget {
/// default extra-small track.
final double? trackThickness;
/// Expressive handle height; shorten it together with a thinner track so
/// the handle stays in proportion.
final double? thumbLength;
@override
Widget build(BuildContext context) {
if (!materialExpressiveEnabled(context)) {
@@ -54,6 +59,7 @@ class AppSlider extends StatelessWidget {
label: label,
semanticFormatterCallback: semanticFormatterCallback,
trackThickness: trackThickness,
thumbLength: thumbLength,
enabled: onChanged != null,
onChanged: onChanged,
onChangeEnd: onChangeEnd,
+2 -1
View File
@@ -206,8 +206,9 @@ class _PlayerVolumeControlState extends ConsumerState<PlayerVolumeControl> {
onPointerCancel: (_) => release(),
child: AppSlider(
// Thinner than the default track: volume stays secondary
// to the seek bar above it.
// to the seek bar above it. The handle shrinks with it.
trackThickness: 8,
thumbLength: 24,
value: value,
onChanged: enabled ? _setVolume : null,
onChangeEnd: _setVolume,