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
508 stars 124 forks source link

Several Issues, and feature request #80

Open Umar-Khan-Yousafzai opened 3 years ago

Umar-Khan-Yousafzai commented 3 years ago

First of all, Thank you for creating this package. There are the following issues.

1) How can I unselect all items?

as you can see in the image below I have tags and there are two buttons one is reset and the other updates. I want to reset the selected tags to unselected when I click the reset button. image

2) I want to add the selected items in a list. I have achieved this behavior by calling onPressed()

 onPressed: (i) {
                           itemsadded.add(i);
                        },

Now Issue is if a user selects and deselects an item. The item gets added twice. I tried i.active==true property but still no use. I tried to remove an item at the index. But Can't understand the functionality on how can I do such a thing.

3) Is it possible for you to add "get_selected_items" in addition to get_all_items. in your tag key.? That will be super easy for people to get their items.

Umar-Khan-Yousafzai commented 3 years ago

Sorry I couldn't see :(

so for future users.
      onPressed: () {
                                  String myWord;
                                  if (categoryId == null) {
                                    myWord = itemsadded.join(',');
                                    Provider.of<DataNavigatorProvider>(context,
                                            listen: false)
                                        .setStringData(myWord);
                                    print("My words are: " + myWord);
                                  }
                                  if (categoryId != null) {
                                    myWord = itemsadded.join(',');
                                    Provider.of<DataNavigatorProvider>(context,
                                            listen: false)
                                        .setStringData(myWord);
                                    myWord + categoryId.toString();
                                    print("My words are: " +
                                        myWord +
                                        "Category ID " +
                                        categoryId.toString());
                                  }
                                },

but what to do about the other two?

how can I unselect all items on a button click and can you add an option in tagstate to get selected items only?

Umar-Khan-Yousafzai commented 3 years ago

Please is anyone going to respond or not? Because we have come a long way and I don't want to change the CHIPS at this point in my application after approval from my client

Umar-Khan-Yousafzai commented 3 years ago

Hi there, I had forked the flutter tags repository and have added three new things to the repository

1) select all items in the list 2) unSelect all items in the list 3) get selected items in the list