I use DropdownButtonFormField. Is there a way to change background color of the selected DropdownMenuItem? Please see the attached screen.
It's always gray.
I tried all the options of the DropdownButtonFormField, nothing works.
Thanks to @raw-chicken. I checked the sources and found that DropdownButtonFormField uses InkWell. So the best way I found is to wrap DropdownButtonFormField with the Theme widget and set focusColor:
Theme( data: Theme.of(context).copyWith( focusColor: Colors.amber, ), child: DropdownButtonFormField<String>( value: 'Item 2', onChanged: (value) {}, items: ['Item 1', 'Item 2', 'Item 3'].map((item) { return DropdownMenuItem<String>( value: item, child: Text(item), ); }).toList(), ), )
Thanks to @raw-chicken. I checked the sources and found that DropdownButtonFormField uses InkWell. So the best way I found is to wrap DropdownButtonFormField with the Theme widget and set focusColor: