浏览代码

refix widgets S

/siyaoH-1.17-PlatformMessage
guanghuispark 4 年前
当前提交
699ae5f4
共有 6 个文件被更改,包括 22 次插入58 次删除
  1. 8
      com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
  2. 3
      com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs
  3. 52
      com.unity.uiwidgets/Runtime/widgets/sliver.cs
  4. 11
      com.unity.uiwidgets/Runtime/widgets/sliver_fill.cs
  5. 4
      com.unity.uiwidgets/Runtime/widgets/sliver_persistent_header.cs
  6. 2
      com.unity.uiwidgets/Runtime/widgets/status_transitions.cs

8
com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs


public bool debugChildIntegrityEnabled {
get { return _debugChildIntegrityEnabled;}
set {
D.assert(value != null);
D.assert(() =>{
_debugChildIntegrityEnabled = value;
return _debugVerifyChildOrder() &&
(!_debugChildIntegrityEnabled || _debugDanglingKeepAlives.isEmpty());
});
}
}
public void setDebugChildIntegrityEnabled(bool enabled) {
D.assert(enabled != null);

3
com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs


}
protected override void performLayout() {
BoxConstraints constraints = this.constraints;
if (child == null) {
size = constraints.smallest;
}

}
RenderBox targetBox = (RenderBox) target;
Matrix4 transform = targetBox.getTransformTo(this);
Matrix4 transform = targetBox.getTransformTo(child);
Rect bounds = MatrixUtils.transformRect(transform, rect);
Size contentSize = child.size;

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


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using com.unity.uiwidgets.Runtime.rendering;
using Unity.UIWidgets.foundation;

D.assert(builder != null);
if (index < 0 || (childCount != null && index >= childCount))
return null;
Widget child;
/*try {
child = builder(context, index);
} catch (exception, stackTrace) {
child = _createErrorWidget(exception, stackTrace);
}*/
child = builder(context, index);
Widget child = builder(context, index);
/*if (addSemanticIndexes) {
int semanticIndex = semanticIndexCallback(child, index);
if (semanticIndex != null)
child = IndexedSemantics(index: semanticIndex + semanticIndexOffset, child: child);
}*/
if (addAutomaticKeepAlives)
child = new AutomaticKeepAlive(child: child);
return new KeyedSubtree(child: child, key: key);

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

}
// Lazily fill the [_keyToIndex].
if (!_keyToIndex.ContainsKey(key)) {
int index = _keyToIndex[null];
int index = _keyToIndex.getOrDefault(null);
while (index < children.Count) {
Widget child = children[index];
if (child.key != null) {

);
if (addRepaintBoundaries)
child = new RepaintBoundary(child: child);
/*if (addSemanticIndexes) {
int semanticIndex = semanticIndexCallback(child, index);
if (semanticIndex != null)
child = IndexedSemantics(index: semanticIndex + semanticIndexOffset, child: child);
}*/
if (addAutomaticKeepAlives)
child = new AutomaticKeepAlive(child: child);
return new KeyedSubtree(child: child, key: key);

}
}
/*public class SliverFillViewport : SliverMultiBoxAdaptorWidget {
public SliverFillViewport(
Key key = null, SliverChildDelegate del = null,
float viewportFraction = 1.0f) : base(key: key, del: del) {
D.assert(viewportFraction > 0.0);
this.viewportFraction = viewportFraction;
}
public readonly float viewportFraction;
public override RenderObject createRenderObject(BuildContext context) {
SliverMultiBoxAdaptorElement element = (SliverMultiBoxAdaptorElement) context;
return new RenderSliverFillViewport(childManager: element, viewportFraction: viewportFraction);
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
((RenderSliverFillViewport) renderObject).viewportFraction = viewportFraction;
}
}*/
public class SliverMultiBoxAdaptorElement : RenderObjectElement, RenderSliverBoxChildManager {
public SliverMultiBoxAdaptorElement(SliverMultiBoxAdaptorWidget widget) : base(widget) {
}

}
}
renderObject.setDebugChildIntegrityEnabled(false); // Moving children will temporary violate the integrity.
//newChildren.Keys.ForEach(processElement);
renderObject.debugChildIntegrityEnabled = false; // Moving children will temporary violate the integrity.
foreach (var key in newChildren.Keys) {
processElement(key);
}

}
} finally {
_currentlyUpdatingChildIndex = null;
renderObject.setDebugChildIntegrityEnabled(true);
renderObject.debugChildIntegrityEnabled = true;
}
}

11
com.unity.uiwidgets/Runtime/widgets/sliver_fill.cs


float viewportFraction = 1.0f,
bool padEnds = true
) : base(key: key) {
D.assert(viewportFraction != null);
D.assert(padEnds != null);
this._delegate = _delegate;
this.viewportFraction = viewportFraction;
this.padEnds = padEnds;

SliverChildDelegate _delegate = null,
float viewportFraction = 1.0f
) :base(key: key, del: _delegate) {
D.assert(viewportFraction != null);
D.assert(viewportFraction > 0.0);
this.viewportFraction = viewportFraction;

int viewportFraction = 0,
Widget sliver = null
) : base(child: sliver) {
D.assert(viewportFraction != null);
D.assert(viewportFraction >= 0);
D.assert(viewportFraction <= 0.5);
this.viewportFraction = viewportFraction;

Widget child = null,
bool hasScrollBody = true,
bool fillOverscroll = false) : base(key: key) {
D.assert(hasScrollBody != null);
D.assert(fillOverscroll != null);
this.child = child;
this.hasScrollBody = hasScrollBody;
this.fillOverscroll = fillOverscroll;

return new _SliverFillRemainingAndOverscroll(child: child);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties); properties.add(new DiagnosticsProperty<Widget>("child", child));
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Widget>("child", child));
List<string> flags = new List<string>();
if (hasScrollBody)
flags.Add("scrollable");

flags.Add("nonscrollable");
//properties.add(IterableProperty<string>("mode", flags));
properties.add(new EnumerableProperty<string>("mode", flags));
}
}

4
com.unity.uiwidgets/Runtime/widgets/sliver_persistent_header.cs


}
protected override void insertChildRenderObject(RenderObject child, object slot) {
D.assert((bool) (renderObject as RenderSliverPersistentHeader).debugValidateChild(child));
(renderObject as RenderSliverPersistentHeader).child = (RenderBox) child;
D.assert((bool) ((RenderSliverPersistentHeader)renderObject).debugValidateChild(child));
((RenderSliverPersistentHeader)renderObject).child = (RenderBox) child;
}
protected override void moveChildRenderObject(RenderObject child, object slot) {

2
com.unity.uiwidgets/Runtime/widgets/status_transitions.cs


namespace Unity.UIWidgets.widgets {
public abstract class StatusTransitionWidget : StatefulWidget {
public StatusTransitionWidget(
protected StatusTransitionWidget(
Animation<float> animation,
Key key = null
) : base(key: key) {

正在加载...
取消
保存