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

Feature Request: Add controller for Tags #32

Closed sapphire008 closed 5 years ago

sapphire008 commented 5 years ago

It would be very nice if a controller can be called to get the list of active ItemTags. Currently, I have to store the list of active tags in a separate List variable.

Dn-a commented 5 years ago

@sapphire008 new release 0.4.4.

example

final GlobalKey<TagsState> _tagStateKey = GlobalKey<TagsState>();
// Allows you to get a list of all the ItemTags
_getAllItem(){
    List<Item> lst = _tagStateKey.currentState?.getAllItem;
    if(lst!=null)
        lst.where((a) => a.active==true).forEach( ( a) => print(a.title));        
}

check and leave feedback. thanks