How to update a single value of list item rather than entire list item

Viewed 71

I have used AnimatedList widget with the stream builder. When I got the update from the stream builder, the entire list item was updated and blinked. But I need to update a single value of the list item. How can I do this? Thanks in advance.enter image description here

StreamBuilder(
  initialData: item,
  stream: UserBloc.messageCountStream,
  builder: (context, snapshot) {
    UserData updatedUser = snapshot.data;
    if (item.id == updatedUser.id) {
      item = snapshot.data;
    }
    return CustomCardView(
      datum: item,
      onTap: () {
        if (item.id != 0 && item.id != null) {

        }
      },
    );
  },
);
0 Answers
Related