2

I want to completely remove dropdown menu's trailing icon. I added below code to remove it.

 DropdownMenu<ColorLabel>(
   trailingIcon: SizedBox.shrink(),
   selectedTrailingIcon: SizedBox.shrink(),
   initialSelection: ColorLabel.green,
   controller: colorController,

However the clickable area (or whatever the name is) is still appears. Is it possible to remove completely?

TIAenter image description here

3
  • Does this answer to your question: stackoverflow.com/a/67997808/5882307 ? Commented Jun 26, 2024 at 5:39
  • Well not exactly. The clickable region appears even with Visibility widget method. Commented Jun 26, 2024 at 5:53
  • I think you should create a Flutter Github issue Commented Jul 11, 2024 at 12:15

1 Answer 1

1

You can achieve the space removal with the inputDecorationTheme property. Pass the InputDecorationThemeData object with this property

suffixIconConstraints: BoxConstraints(maxWidth: 0),

NOTE: You still need to add this to remove the icon in the first place.

trailingIcon: SizedBox.shrink(),
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.