How to change the border color of DropdownMenu? I want to change the border color of DropdownMenu.
2
I can change border color by adding inputDecorationTheme
DropdownMenu( dropdownMenuEntries: [], inputDecorationTheme: InputDecorationTheme( enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: Colors.red, ), ), ), ),
Change the border color using the code below.
InputDecorator( decoration: const InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide( color: Colors.red, // Set your desired border color )), enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: Colors.red, // Set your desired border color )), ), child: DropdownButtonHideUnderline( child: DropdownButton<String>( value: selectedValue, onChanged: (String? newValue) { setState(() { selectedValue = newValue; }); }, items: [ DropdownMenuItem<String>( value: 'Option 1', child: Text('Option 1'), ), DropdownMenuItem<String>( value: 'Option 2', child: Text('Option 2'), ), DropdownMenuItem<String>( value: 'Option 3', child: Text('Option 3'), ), ], ), ), )
Click here to cancel reply.
2
Answers
I can change border color by adding inputDecorationTheme
Change the border color using the code below.