浏览代码

Update sliver.cs

fix sliver issue
/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
20464958
共有 1 个文件被更改,包括 11 次插入7 次删除
  1. 18
      com.unity.uiwidgets/Runtime/widgets/sliver.cs

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


}
public class SliverChildListDelegate : SliverChildDelegate {
static readonly Key _defaultNullKey = Key.key("SliverChildListDelegate##DefaultNullKey");
public SliverChildListDelegate(
List<Widget> children,
bool addAutomaticKeepAlives = true,

this.children = children;
this.addAutomaticKeepAlives = addAutomaticKeepAlives;
this.addRepaintBoundaries = addRepaintBoundaries;
_keyToIndex = new Dictionary<Key, int>(){{Key.key("null"), 0}};
_keyToIndex = new Dictionary<Key, int>{{_defaultNullKey, 0}};
}
public readonly bool addAutomaticKeepAlives;

return null;
}
if (!_keyToIndex.ContainsKey(key)) {
int index = _keyToIndex.getOrDefault(Key.key("null"));
int index = _keyToIndex.getOrDefault(_defaultNullKey);
if (child.key != Key.key("null")) {
if (child.key != _defaultNullKey) {
_keyToIndex[Key.key("null")] = index + 1;
_keyToIndex[_defaultNullKey] = index + 1;
_keyToIndex[Key.key("null")] = index;
_keyToIndex[_defaultNullKey] = index;
} else {
return _keyToIndex[key];
}

if (index < 0 || index >= children.Count)
return null;
Widget child = children[index];
Key key = child.key != null? new _SaltedValueKey(child.key) : null;
"The sliver's children must not contain null values, but a null value was found at index $index"
"The sliver's children must not contain null values, but a null value was found at index $index"
Key key = child.key != null? new _SaltedValueKey(child.key) : null;
if (addRepaintBoundaries)
child = new RepaintBoundary(child: child);
if (addAutomaticKeepAlives)

正在加载...
取消
保存