We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Secondary track in SfSlider

It seems like the readme for SfSlider implies that there is a possibility of using a secondary track in the slider somehow. In the top most slider of the picture(https://help.syncfusion.com/flutter/slider/overview you can see that there's a dark green track for active, a light green for inactive and then there's still a segment of light red track in the end. However I can't seem to find an answer for this anywhere in the Syncfusion manual. Is there such a feature in the slider and if there is, how is it supposed to be accessed?


3 Replies

LA Lavanya Anaimuthu Syncfusion Team February 9, 2023 08:49 AM UTC

Hi Joakim Eriksson,


We have achieved your requirements using the trackShape and thumShape properties in the Slider. We extended the SfTrackShape and SfThumbShape classes and customized the track and thumb colors based on the slider values in paint method. We have then assigned these classes to the trackShape and thumShape properties. A sample has been prepared and is shared below for your reference.




Regards,

Lavanya A.


Attachment: f180434_db880f0c.zip



JE Joakim Eriksson February 10, 2023 04:27 PM UTC

Thank you! I had a hunch that if there's something it's in the TrackShape class. I will use your example to decypher the track colors.



YG Yuvaraj Gajaraj Syncfusion Team February 13, 2023 01:45 PM UTC

Hi Joakim,


Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.


Regards,

Yuvaraj.


Loader.
Live Chat Icon For mobile
Up arrow icon