浏览代码

Fix something wrong while inputting.

/DatePickerDemo
shiyun wen 3 年前
当前提交
a777cb69
共有 2 个文件被更改,包括 20 次插入11 次删除
  1. 2
      AwesomeUIWidgets/Assets/Scripts/DateAndTimePicker.cs
  2. 29
      AwesomeUIWidgets/Assets/Scripts/Widgets/chat_list.cs

2
AwesomeUIWidgets/Assets/Scripts/DateAndTimePicker.cs


{
public class DatePickerDemo : UIWidgetsPanel
public class DateAndTimePicker : UIWidgetsPanel
{
protected void OnEnable()
{

29
AwesomeUIWidgets/Assets/Scripts/Widgets/chat_list.cs


_oldData = new List<object>();
_oldData.AddRange(widget.items);
_oldIndex = 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;
_oldIndex.Add(message1.id);
}
}
}
public override void didUpdateWidget(StatefulWidget oldWidget)

int test = widget.items.IndexOf(item);
if (message1 != null)
{
_listKey.currentState?.insertItem(0);
if (_oldIndex != null && !_oldIndex.Contains(message1.id))
{
_listKey.currentState?.insertItem(0);
}
}
}
}

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;
}

正在加载...
取消
保存