Flutter change slider height

2,112 views
Skip to first unread message

Eduard Hasanaj

unread,
Jul 10, 2018, 1:04:58 PM7/10/18
to Flutter Dev
Hi,
I need to use slider but unfortunately I cant get the look where I want. I put it inside container, but bar is too small at height. Is there any easy way to set  height

Greg Spencer

unread,
Jul 10, 2018, 1:40:30 PM7/10/18
to Eduard Hasanaj, Flutter Dev
Can you show us an image and describe what you want to achieve? You can change the height of the slider, but that won't change the size of the slider track itself, it will just change the size of the slider widget, so you might not see any visible change.

-Greg.

On Tue, Jul 10, 2018 at 10:05 AM Eduard Hasanaj <eduardh...@gmail.com> wrote:
Hi,
I need to use slider but unfortunately I cant get the look where I want. I put it inside container, but bar is too small at height. Is there any easy way to set  height

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eduard Hasanaj

unread,
Jul 10, 2018, 2:07:18 PM7/10/18
to Flutter Dev
Hmm I need to change the size of track and handler.Is there a way how to do it
?

Greg Spencer

unread,
Jul 10, 2018, 2:19:55 PM7/10/18
to Eduard Hasanaj, Flutter Dev
The slider is very customizable, see the SliderThemeData  and SliderComponentShape classes.  You can draw your own value indicator or thumb however you like. However, the drawing of the track itself is not customizable. I've filed #19216 to address this, so please upvote that if you think this would be helpful.

-Greg.

On Tue, Jul 10, 2018 at 11:07 AM Eduard Hasanaj <eduardh...@gmail.com> wrote:
Hmm I need to change the size of track and handler.Is there a way how to do it
?

Eduard Hasanaj

unread,
Jul 10, 2018, 2:46:59 PM7/10/18
to Flutter Dev
But there is no heigh in ThemeData. I think that it would be better to scale track height based on thumb size.

Greg Spencer

unread,
Jul 10, 2018, 4:26:19 PM7/10/18
to Eduard Hasanaj, Flutter Dev
The behavior you want is not part of the Material specification, so it probably won't appear as a simple parameter in the SliderThemeData, but in Flutter we do try and make it possible for you to customize things if you want something outside of the Material specification. Once #19216 is fixed, you should be able to do what you want, even if it isn't as trivial as you'd like it to be.

We've found that adding parameters for every possible customization makes our API too heavyweight and (ironically) inflexible, because it causes us to make assumptions about the customizations people will want to do.

-Greg.

Eduard Hasanaj

unread,
Jul 10, 2018, 5:43:29 PM7/10/18
to Flutter Dev
Ok, thank you.
Reply all
Reply to author
Forward
0 new messages