poplementions method

Mention poplementions({
  1. required List<APISearchDetail> peopleList,
  2. Color? textcolor,
})

Implementation

Mention poplementions(
    {required List<APISearchDetail> peopleList, Color? textcolor}) {
  return Mention(
    trigger: '@',
    style: const TextStyle(color: Colors.amber),
    data: peopleList.map((people) => people.toJson()).toList(),
    matchAll: false,
    suggestionBuilder: (data) {
      return Material(
        child: ListTile(
          contentPadding: const EdgeInsets.all(0),
          enableFeedback: true,
          leading: CircleAvatar(
            foregroundImage: CachedNetworkImageProvider(data['photo']),
          ),
          title: Text(data['full_name']),
          subtitle: Text(
            "@${data['display']}",
            style: TextStyle(
              color: textcolor,
            ),
          ),
        ),
      );
    },
  );
}