onMessagesRecalled method

  1. @override
void onMessagesRecalled(
  1. List<Message> recalled,
  2. List<Message> replaces
)
override

Implementation

@override
void onMessagesRecalled(List<Message> recalled, List<Message> replaces) {
  bool needReload = false;
  for (var i = 0; i < recalled.length; i++) {
    int index = msgModelList
        .indexWhere((element) => recalled[i].msgId == element.message.msgId);
    if (index != -1) {
      msgModelList[index] =
          msgModelList[index].copyWith(message: replaces[i]);
      needReload = true;
    }
  }
  if (needReload) {
    refresh();
  }
}