Dn-a / flutter_tags

With flutter tags you can create selectable or input tags that automatically adapt to the screen width
https://pub.dartlang.org/packages/flutter_tags
MIT License
507 stars 127 forks source link

duplicate values in Textfield. #13

Closed asapJ closed 5 years ago

asapJ commented 5 years ago

Entered values shows up twice on the textfield. But logging the content of my String array after onInsert callback, shows no duplicate values from the array. N/B: duplicate is set to false too.

Dn-a commented 5 years ago

@asapJ please post your code

Dn-a commented 5 years ago

@asapJ Resolved?

asapJ commented 5 years ago

Yes, Resolved. I cloned the project, made edits to InputTag and used my local copy.

Dn-a commented 5 years ago

@asapJ what was the problem? If you tell me where, I could fix it

asapJ commented 5 years ago

In the file input_tag.dart, In line 468, before adding the returned value to _tags, I added a check to handle if the _tags List already has the value being added, so there are no duplicates. For some reasons the operation of adding to _tags happens twice. I haven't gone back to look at the code to know why that is so, but adding that check solved this issue. If I am chanced and the issue hasn't been fixed with an update, I'd open a PR @Dn-a

Dn-a commented 5 years ago

@asapJ flutter version? if the problem persists I will apply the fix

gmkado commented 5 years ago

Same issue and fix worked for me [√] Flutter (Channel beta, v1.6.3, on Microsoft Windows [Version 10.0.17134.829], locale en-US) • Flutter version 1.6.3 at C:\Program Files\flutter • Framework revision bc7bc94083 (4 weeks ago), 2019-05-23 10:29:07 -0700 • Engine revision 8dc3a4cde2 • Dart version 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)

Dn-a commented 5 years ago

@gmkado @asapJ fixed in 0.3.2 version.