areItemsTheSame method

  1. @override
bool areItemsTheSame(
  1. int oldItemPosition,
  2. int newItemPosition
)

Checks if two messages at the given positions represent the same item. Compares messages based on their unique id.

Implementation

@override
bool areItemsTheSame(int oldItemPosition, int newItemPosition) =>
    oldList[oldItemPosition].id == newList[newItemPosition].id;