Border radius of selection list of DropdownButtonFormField in flutter

178

Since flutter 2.11.0-pre the native DropdownButtonFormField comes with borderRadius by default.

DropdownButtonFormField(
  borderRadius: BorderRadius.circular(20.0),
  items: // <your items list>
  value: // your value
  onChanged: (value) {}
)

You could consider updating your flutter version to 2.11.0+, just keep in mind it's still in beta.

Share:
178
Tedjoucif
Author by

Tedjoucif

Updated on November 26, 2022

Comments

  • Tedjoucif
    Tedjoucif over 1 year

    I didn't find how to decorate the list that appears when you click on DropdownButton like make radius for the corners as you see in the screenshot below.

    enter image description here

    • Ravindra S. Patil
      Ravindra S. Patil about 2 years
      You want to dropdown is like rounded corner?
    • Tedjoucif
      Tedjoucif about 2 years
      yeah the list that appears when clicking DropDownButton have a rounded corners
  • Tedjoucif
    Tedjoucif about 2 years
    i'm using DropdownButtonFormField that doesn't contain borderRadius,
  • Tedjoucif
    Tedjoucif about 2 years
    i nned to use DropdownButtonFormField because i'm using form
  • Ravindra S. Patil
    Ravindra S. Patil about 2 years
    Ok Wait I will try
  • Tedjoucif
    Tedjoucif about 2 years
    look i is an issue in git github.com/flutter/flutter/pull/95944
  • Sambhav Khandelwal
    Sambhav Khandelwal about 2 years
    It would be better if u could format the code