Limitations while selecting tag
Can anyone please help me how do we limit the selection of tags like I just want to add 3 tags if user going to add more than 3 tags then it will show some error message. When I am trying this I am not able to restrict user while selecting tags more than 3.
in order to find out how many are selected and change items based on it try this
onPressed: (item) {
item.active ? selected++ : selected--;
if (selected == 4 && item.active) {
item.active = false;
selected --;
}
},
when set item.active = false; say "active" can't be setter, because it is final
I hope that when I choose a certain number of labels, then I can’t choose other. How can I achieve them?
@bingweibi that's the same thing I want to ask and @SamadiPour as you mentioned item.active = false but it can't be possible because it is mentioned final in plugin if I changed that code in plugin and remove final from it still it is not changing the status of active item to inactive
@divyankvijayvergiya yeah i was wrong and i don't know any other way :(
As said Item class has this field active which is final else we can change it's value even the user press on it to limit selecting i'm having the same issue