Flutter Dropdown Button Remove on press grey color

Issue

I want to remove this grey button when i’m selecting the value for dropdown button. How can i do it. I try everything
Here its my code

InputDecorator(
      decoration: const InputDecoration(
        border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))),
        contentPadding: EdgeInsets.all(10),
      ),
      child: DropdownButtonHideUnderline(
        child: DropdownButton<dynamic>(
          value: null,
          isDense: true,
          hint: Text(hintText),
          isExpanded: true,
          items: itemList,
          onChanged: (newValue) {},
        ),
      ),
    ),

enter image description here

Solution

One possible way is to change default splashcolor in your ThemeData like this:

theme: ThemeData(
      splashColor: Colors.transparent,
      highlightColor: Colors.transparent,
    ),

A con with this is setting it in your themedata is if you would like to use different colors in other parts of your code.

Otherwise you could also try to use SplashFactory

Answered By – Edmond

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *