getSliderThemeData function

SliderThemeData getSliderThemeData(
  1. BuildContext context,
  2. Color primaryColor
)

Implementation

SliderThemeData getSliderThemeData(BuildContext context, Color primaryColor) {
  final theme = Theme.of(context);
  return SliderTheme.of(context).copyWith(
    activeTrackColor: primaryColor,
    inactiveTrackColor: theme.colorScheme.surfaceDim,
    thumbColor: primaryColor,
    overlayColor: primaryColor.withValues(alpha: 0.2),
    valueIndicatorColor: primaryColor,
    trackHeight: 4,
    thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 1),
    valueIndicatorShape: const PaddleSliderValueIndicatorShape(),
    // valueIndicatorShape: const RoundSliderOverlayShape(),
    trackShape: const RectangularSliderTrackShape(),
    // valueIndicatorTextStyle:
    // const TextStyle(color: Color(0xff7E3338), fontSize: 14.0),
    rangeThumbShape: const RoundRangeSliderThumbShape(enabledThumbRadius: 14),
    rangeValueIndicatorShape: const PaddleRangeSliderValueIndicatorShape(),
  );
}