Changing the DropdownButton Arrow Style

1,845 views
Skip to first unread message

Matthew Jones

unread,
Feb 26, 2019, 4:10:49 PM2/26/19
to Flutter Dev
I have spent a considerable amount of time searching for an answer to this question, but have yet to find an answer. I am fairly new to Flutter, so I apologize if I'm missing something obvious.

My designer wants to customize the arrow on our dropdown buttons. So it should look something like this:

Screen Shot 2019-02-26 at 4.05.44 PM.png


The issue is that I can't find anything in the documentation about how to do this. I've found discussions about changing the color of the default arrow, but not replacing it entirely. 


Is there a way of modifying the DropdownButton instance so it displays the custom arrow? If not, is there another class I can modify to make this work? I'd rather not try to build a custom dropdown widget from the ground up. 


Thanks!


- Matthew


Matthew Jones

unread,
Feb 26, 2019, 4:21:30 PM2/26/19
to Flutter Dev
Just an update... I found this:

Apparently, as of right now, there's no way to modify the DropdownButton class.  You can change the size of the default material down caret icon, but you can't replace it. 

If anyone knows a workaround it would be greatly appreciated.  

Steven McDowall

unread,
Feb 26, 2019, 5:19:11 PM2/26/19
to Matthew Jones, Flutter Dev

Work around -- grab the code for the DropDown and put it in your project and hack it to do what you want .. 

I did that with ExpansionTile when it didn't support something I needed (it has since) .. 

Just change the name to something like EXDropdownButton so not to conflate it with the original if/when they ever fix it should be easy to change them back .. 



--
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.

Matthew Jones

unread,
Feb 27, 2019, 8:16:55 AM2/27/19
to Flutter Dev
That seems like it would work. Thanks for the help!

Steven McDowall

unread,
Feb 27, 2019, 9:21:00 AM2/27/19
to Matthew Jones, Flutter Dev

If you create a nice generic enhancement -- you can even PR it back and get it officially added !  

Matthew Jones

unread,
Feb 28, 2019, 3:49:17 PM2/28/19
to Flutter Dev
I wrote the functionality in and sent a PR to the project. We'll see if it gets accepted... 
Reply all
Reply to author
Forward
0 new messages