MessageListDiff class
A diffutil.ListDiffDelegate
implementation for comparing lists of Message objects.
Used by diffutil_dart
to calculate differences between old and new message lists
for efficient updates in animated lists.
Constructors
-
MessageListDiff.new(List<
Message> oldList, List<Message> newList) - Creates a diff delegate for comparing two message lists.
Properties
Methods
-
areContentsTheSame(
int oldItemPosition, int newItemPosition) → bool -
Checks if the content of two messages at the given positions is the same.
Uses
equalityChecker
fromfreezed_annotation
for deep comparison. -
areItemsTheSame(
int oldItemPosition, int newItemPosition) → bool -
Checks if two messages at the given positions represent the same item.
Compares messages based on their unique
id
. -
getChangePayload(
int oldItemPosition, int newItemPosition) → Object? -
When areItemsTheSame(int, int) returns true for two items and
areContentsTheSame(int, int) returns false for them, DiffUtil
calls this method to get a payload about the change.
inherited
-
getNewItemAtIndex(
int index) → Message -
inherited
-
getNewListSize(
) → int -
Returns the size of the new list.
inherited
-
getOldItemAtIndex(
int index) → Message -
inherited
-
getOldListSize(
) → int -
Returns the size of the old list.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited