Files
SpotiFLAC-Mobile/lib/widgets/app_slider.dart
T
zarzet e56d59c798 feat(theme): adopt Material Symbols and expressive components
The Material theme now draws its main surfaces with rounded Material
Symbols: navigation, player, mini player, queue, settings, sheets,
dialogs and shared controls. AppIcon maps legacy Icons to their symbol
and keeps outlined glyphs unfilled. Mornye keeps its original icons.

Icon buttons, text and filled buttons, dialog actions, sliders, the setup
FAB and indeterminate spinners use the Material 3 Expressive components.
Each wrapper falls back to the standard Flutter widget for Mornye, reduced
motion and custom sizing, so existing layouts and hit areas stay intact.
2026-10-13 18:27:38 +07:00

58 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:material_3_expressive/material_3_expressive.dart';
import 'package:spotiflac_android/theme/material_expressive.dart';
/// Settings slider with the Material 3 Expressive track and handle.
/// Mornye and reduced motion keep the standard [Slider].
class AppSlider extends StatelessWidget {
const AppSlider({
super.key,
required this.value,
required this.onChanged,
this.onChangeEnd,
this.min = 0,
this.max = 1,
this.divisions,
this.label,
this.semanticFormatterCallback,
});
final double value;
final ValueChanged<double>? onChanged;
final ValueChanged<double>? onChangeEnd;
final double min;
final double max;
final int? divisions;
final String? label;
final SemanticFormatterCallback? semanticFormatterCallback;
@override
Widget build(BuildContext context) {
if (!materialExpressiveEnabled(context)) {
return Slider(
value: value,
min: min,
max: max,
divisions: divisions,
label: label,
semanticFormatterCallback: semanticFormatterCallback,
onChanged: onChanged,
onChangeEnd: onChangeEnd,
);
}
return MaterialExpressiveScope(
child: M3ESlider(
value: value,
min: min,
max: max,
divisions: divisions,
label: label,
semanticFormatterCallback: semanticFormatterCallback,
enabled: onChanged != null,
onChanged: onChanged,
onChangeEnd: onChangeEnd,
),
);
}
}