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
}
),
};
),
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.