Sitelet https://github.com/Dn-a/flutter_tags/issues/71
Skip to content

Programatically select a tag during build and trigger onPressed event #71

Description

@trifox83

My suggestion is to add a new attribute, so when the tags are building, that particular tag will be automatically selected and the onPressed event triggered.

Tags(
  itemCount: list.length,
  itemBuilder: (index) {
    return ItemTags(
      index: index,
      title: list[index].title,
      selected: true, /* ADD THIS ATTRIBUTE */
      onPressed: (item) {
        // Do something
      }
    ),
  };
),

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions