multiselect-dropdown icon indicating copy to clipboard operation
multiselect-dropdown copied to clipboard

InputDecoration field

Open divan opened this issue 1 year ago • 2 comments

Hey,

thanks for the wonderful plugin. Is it possible to use custom InputDecoration with this select?

I believe many people use it in forms, and use either custom InputDecoration or InputDecorationTheme to style form. With this select it seems to be impossible at the moment. To add to the confusion, the inputDecoration field has type Decoration, which is for styling Container, not the inputs.

One option is to use this Decoration property to mimic other inputs' style in the form. However, it doesn't solve the problem with stuff like errorText or helper text. Wrapping it up with InputDecorator class kind of helps, but still looks bad (hovering over the field with a rounded corner produces a highlighted box behind the field, etc), plus looks like a hack.

Is there a discussion of allowing users to provide custom InputDecoration for the field?

divan avatar Apr 25 '24 16:04 divan

Came across the same issue

I tried to apply them with

MultiSelectDropDown<T>(
  hintStyle: Theme.of(context).inputDecorationTheme.hintStyle,
  inputDecoration: BoxDecoration(
    color: Theme.of(context).inputDecorationTheme.fillColor,
    border: Theme.of(context).inputDecorationTheme.border != null 
      ? Border.fromBorderSide(Theme.of(context).inputDecorationTheme.border!.borderSide)
      : Border(bottom: BorderSide(color: Theme.of(context).inputDecorationTheme.outlineBorder?.color ?? Colors.black45)),
  ),
  ...
)

However, it's pretty hard to get borders to work correctly.

On top of that, there's a constraint put in the widget that forces a min height of 52 which can be problematic in most forms

Masadow avatar Apr 26 '24 18:04 Masadow

Try out Dev version

oi-narendra avatar Apr 30 '24 17:04 oi-narendra

Check Beta version.

oi-narendra avatar Aug 01 '24 12:08 oi-narendra

v3.0.0 now supports this. Please migrate to the latest version.

oi-narendra avatar Aug 04 '24 04:08 oi-narendra