maheshj01 / searchfield

A highly customizable simple and easy to use flutter Widget to add a searchfield to your Flutter Application.This Widget allows you to search and select from list of suggestions.
MIT License
84 stars 63 forks source link

[Question] How to properly move to 'SearchInputDecoration' #177

Closed SonnyBlack closed 2 months ago

SonnyBlack commented 2 months ago

Hi, I have been using your library (1.0.9). In this version, property 'searchInputDecoration' was as 'InputDecoration' class. Now I want to update your library and I need to change it to 'SearchInputDecoration'. I can't find 'prefixIconConstraints' in it, I use it because I need to adjust icon's size (it's too big and looks very ugly). I see that 'SearchInputDecoration' extends from 'InputDecoration', but it seems like I can't to pass 'prefixIconConstraints' to it. I'm not very familiar with flutter/dart, so could someone please explain to me how I can do this. Thanks in advance.

maheshj01 commented 2 months ago

Hi @SonnyBlack, Thanks for filing the issue. Looks like that properties is not added to SearchInputDecoration I will update and publish a new release soon.

maheshj01 commented 2 months ago

Added new properties and released in v1.1.4

@SonnyBlack If you have any questions related to this package feel free to ask, I would be happy to answer. Before you ask please make sure to go through the readme.md and if you don't find what you are looking for, You can post it here on github.

buxiaojiong commented 2 months ago

"both prefixIcon and prefixIconConstraints can't be used at the same time" ? I want uses prefixIcon and prefixIconConstraints at the same time ,because in flutter Textfield can set.

maheshj01 commented 2 months ago

Hi @buxiaojiong thanks for bringing that up, This issue is because of the custom assert

https://github.com/maheshj01/searchfield/blob/e3741fb3927b724efea4a07d6b223a649c140cf5/lib/src/input_decoration.dart#L125

I have removed them and published a new release v1.1.5

SonnyBlack commented 2 months ago

Hi @maheshj01 . Thanks for the very quick reply! I have just tried v1.1.5. Now I am able to use SearchInputDecoration completely with all my settings that I passed to InputDecoration. But, I don't know why - it does not work. I use it in combination with prefixIcon. I also did flutter clean - it does not help.

Here is an example of the current version in use (1.0.9)

Screenshot 2024-09-26 at 12 11 09

And here is example of version (1.1.5)

Screenshot 2024-09-26 at 12 03 08

The values of prefixIconConstraints/prefixIcon are the same

maheshj01 commented 1 month ago

@SonnyBlack new version is out 1.1.6

Thank you again for pointing this out.

SonnyBlack commented 1 month ago

Thanks a lot! Now it works as expected.