|
|
|
|
|
|
var message1 = ((Dictionary<string, object>)item)["message"] as ChatComponents.Message; |
|
|
|
if (message1 != null) |
|
|
|
{ |
|
|
|
if (_oldIndex != null && _oldIndex.Count != 0 && !_oldIndex.Contains(message1.id)) |
|
|
|
if (oldList != null && oldList.Count != 0 && !oldList.Contains(message1.id)) |
|
|
|
_listKey.currentState?.insertItem(_oldIndex.Count -1); |
|
|
|
_listKey.currentState?.insertItem(oldList.Count -1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
_oldData = new List<object>(widget.items); |
|
|
|
List<string> _newIndex = new List<string>(); |
|
|
|
foreach (var item in widget.items) |
|
|
|
{ |
|
|
|
if (item is Dictionary<string, object> ) |
|
|
|
{ |
|
|
|
var message1 = ((Dictionary<string, object>)item)["message"] as ChatComponents.Message; |
|
|
|
if (message1 != null) |
|
|
|
_newIndex.Add(message1.id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
_oldIndex = _newIndex; |
|
|
|
// List<string> _newIndex = new List<string>();
|
|
|
|
// foreach (var item in widget.items)
|
|
|
|
// {
|
|
|
|
// if (item is Dictionary<string, object> )
|
|
|
|
// {
|
|
|
|
// var message1 = ((Dictionary<string, object>)item)["message"] as ChatComponents.Message;
|
|
|
|
// if (message1 != null)
|
|
|
|
// _newIndex.Add(message1.id);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// _oldIndex = _newIndex;
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|