浏览代码

fix sliver

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
114c7175
共有 1 个文件被更改,包括 18 次插入4 次删除
  1. 22
      com.unity.uiwidgets/Runtime/widgets/sliver.cs

22
com.unity.uiwidgets/Runtime/widgets/sliver.cs


void processElement(int index) {
_currentlyUpdatingChildIndex = index;
if (_childElements[index] != null && _childElements[index] != newChildren[index]) {
if(_childElements.getOrDefault(index) != null &&
_childElements.getOrDefault(index) != newChildren.getOrDefault(index))
// if (_childElements[index] != null && _childElements[index] != newChildren[index])
{
Element newChild = updateChild(newChildren[index], _build(index), index);
Element newChild = updateChild(newChildren.getOrDefault(index), _build(index), index);
if (newChild != null) {
_childElements[index] = newChild;
SliverMultiBoxAdaptorParentData parentData = newChild.renderObject.parentData as SliverMultiBoxAdaptorParentData;

}
protected override Element updateChild(Element child, Widget newWidget, object newSlot) {
SliverMultiBoxAdaptorParentData oldParentData = null;
SliverMultiBoxAdaptorParentData oldParentData = child?.renderObject?.parentData as SliverMultiBoxAdaptorParentData;
Element newChild = base.updateChild(child, newWidget, newSlot);
SliverMultiBoxAdaptorParentData newParentData = newChild?.renderObject?.parentData as SliverMultiBoxAdaptorParentData;
// Preserve the old layoutOffset if the renderObject was swapped out.
if (oldParentData != newParentData && oldParentData != null && newParentData != null) {
newParentData.layoutOffset = oldParentData.layoutOffset;
}
return newChild;
/*SliverMultiBoxAdaptorParentData oldParentData = null;
if (child != null && child.renderObject != null) {
oldParentData = (SliverMultiBoxAdaptorParentData) child.renderObject.parentData;
}

newParentData.layoutOffset = oldParentData.layoutOffset;
}
return newChild;
return newChild;*/
}
internal override void forgetChild(Element child) {

正在加载...
取消
保存