Search code examples
flutterdartmenudropdownrounded-corners

Dropdown menu with rounded corners in flutter


I've found out that if I modify the class _DropdownMenuPainter inside material/dropdown.dart and change BorderRadius.circular(2.0) to BorderRadius.circular(24.0), I get my desired outcome, as I want to have rounded corners on my DropdownButton menu.

However I don't think it's a good practice, since the change would not be inside my project. How can I have this modification in my project?


Solution

  • use borderRadius properties in DropdownButton should do the trick.

    DropdownButton(
     borderRadius:BorderRadius.circular(10),
     child: ...
    )