fluent_ui icon indicating copy to clipboard operation
fluent_ui copied to clipboard

AutoSuggestBox dynamic T

Open adpmhel24 opened this issue 2 years ago • 5 comments

Please add AutoSuggestBox<T> in version 4.

adpmhel24 avatar Jul 27 '22 07:07 adpmhel24

It is implemented. Check the example app!

bdlukaa avatar Jul 27 '22 13:07 bdlukaa

It is implemented. Check the example app!

I check in the example in version prerelease autosuggestionbox accepts only string in items property

adpmhel24 avatar Jul 27 '22 14:07 adpmhel24

Screenshot_2022-07-27-22-22-56-66_40deb401b9ffe8e1df2f1cc5ba480b12

Here's the example

adpmhel24 avatar Jul 27 '22 14:07 adpmhel24

It's a String by design, since AutoSuggestBox uses a TextField, which can only handle strings.

bdlukaa avatar Aug 04 '22 14:08 bdlukaa

I suggest if type.toString() rather than string only so that we can use models on it. Even in onChanged method I hope will pass na T object as argument. Unlike in old version we can use <T>

adpmhel24 avatar Aug 04 '22 14:08 adpmhel24

@bdlukaa Related with https://github.com/bdlukaa/fluent_ui/issues/244... I think this could be the latest addition in order to allow a fully replacement of Comboboxes with AutoSuggestBox.

I think we could have this change in AutoSuggestBoxItem:

  • old: final String value --> final T? value
  • old: -- --> new: final T label

What are your thoughts?

henry2man avatar Sep 02 '22 09:09 henry2man

I think it's complicated. The main purpose of AutoSuggestBox is text, all callbacks are text-related. For me, it doesn't make sense to make it dynamic

bdlukaa avatar Sep 02 '22 11:09 bdlukaa

I've done a proposal in https://github.com/bdlukaa/fluent_ui/pull/509

henry2man avatar Sep 03 '22 08:09 henry2man