content: // Flutter imports:
  import 'package:flutter/material.dart';
  
  class CustomSliderTrackShape extends RoundedRectSliderTrackShape {
    const CustomSliderTrackShape();
  
    @override
    Rect getPreferredRect({
      required RenderBox parentBox,
      required SliderThemeData sliderTheme,
      Offset offset = Offset.zero,
      bool isEnabled = false,
      bool isDiscrete = false,
    }) {
      final trackHeight = sliderTheme.trackHeight;
      final trackLeft = offset.dx;
      final trackTop = offset.dy + (parentBox.size.height - trackHeight!) / 2;
      final trackWidth = parentBox.size.width;
  
      return Rect.fromLTWH(
        trackLeft,
        trackTop,
        trackWidth,
        trackHeight,
      );
    }
  }
  
  class CustomSliderThumbShape extends RoundSliderThumbShape {
    const CustomSliderThumbShape({
      super.enabledThumbRadius = 6,
    });
  
    @override
    void paint(
      PaintingContext context,
      Offset center, {
      required Animation<double> activationAnimation,
      required Animation<double> enableAnimation,
      required bool isDiscrete,
      required TextPainter labelPainter,
      required RenderBox parentBox,
      required SliderThemeData sliderTheme,
      required TextDirection textDirection,
      required double value,
      required double textScaleFactor,
      required Size sizeWithOverflow,
    }) {
      super.paint(
        context,
        center.translate(-(value - 0.5) / 0.5 * enabledThumbRadius, 0),
        activationAnimation: activationAnimation,
        enableAnimation: enableAnimation,
        isDiscrete: isDiscrete,
        labelPainter: labelPainter,
        parentBox: parentBox,
        sliderTheme: sliderTheme,
        textDirection: textDirection,
        value: value,
        textScaleFactor: textScaleFactor,
        sizeWithOverflow: sizeWithOverflow,
      );
    }
  }
  
  class CustomSliderOverlayShape extends RoundSliderOverlayShape {
    const CustomSliderOverlayShape({this.thumbRadius = 10.0});
    final double thumbRadius;
  
    @override
    void paint(
      PaintingContext context,
      Offset center, {
      required Animation<double> activationAnimation,
      required Animation<double> enableAnimation,
      required bool isDiscrete,
      required TextPainter labelPainter,
      required RenderBox parentBox,
      required SliderThemeData sliderTheme,
      required TextDirection textDirection,
      required double value,
      required double textScaleFactor,
      required Size sizeWithOverflow,
    }) {
      super.paint(
        context,
        center.translate(-(value - 0.5) / 0.5 * thumbRadius, 0),
        activationAnimation: activationAnimation,
        enableAnimation: enableAnimation,
        isDiscrete: isDiscrete,
        labelPainter: labelPainter,
        parentBox: parentBox,
        sliderTheme: sliderTheme,
        textDirection: textDirection,
        value: value,
        textScaleFactor: textScaleFactor,
        sizeWithOverflow: sizeWithOverflow,
      );
    }
  }
  