浏览代码

fix parentdata

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
f3c81067
共有 6 个文件被更改,包括 43 次插入36 次删除
  1. 6
      com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
  2. 3
      com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs
  3. 6
      com.unity.uiwidgets/Runtime/widgets/basic.cs
  4. 2
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  5. 2
      com.unity.uiwidgets/Runtime/widgets/sliver.cs
  6. 60
      com.unity.uiwidgets/Runtime/widgets/table.cs

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


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.rendering {
public class KeepAliveParentDataMixin : ParentData {
bool keepAlive = false;
bool keptAlive { get; }
}
public interface RenderSliverBoxChildManager {
void createChild(int index, RenderBox after = null);

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


using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;

}
void _updateParentDataOfChild(ParentDataElement childElement) {
childElement.applyWidgetOutOfTurn((ParentDataWidget) build(context));
childElement.applyWidgetOutOfTurn((ParentDataWidget<KeepAliveParentDataMixin>) build(context));
}
VoidCallback _createCallback(Listenable handle) {

6
com.unity.uiwidgets/Runtime/widgets/basic.cs


}
}
public class Positioned : ParentDataWidget<Stack> {
public class Positioned : ParentDataWidget<StackParentData> {
public Positioned(Widget child, Key key = null, float? left = null, float? top = null,
float? right = null, float? bottom = null, float? width = null, float? height = null) :
base(key, child) {

}
}
public class Flexible : ParentDataWidget<Flex> {
public class Flexible : ParentDataWidget<FlexParentData> {
public Flexible(
Key key = null,
int flex = 1,

}
}
public class LayoutId : ParentDataWidget<CustomMultiChildLayout> {
public class LayoutId : ParentDataWidget<MultiChildLayoutParentData> {
public LayoutId(
Key key = null,
object id = null,

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


}
}
public abstract class ParentDataWidget<T> : ParentDataWidget where T : RenderObjectWidget {
public abstract class ParentDataWidget<T> : ParentDataWidget where T : ParentData {
public ParentDataWidget(Key key = null, Widget child = null)
: base(key: key, child: child) {
}

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


}
}
public class KeepAlive : ParentDataWidget<SliverWithKeepAliveWidget> {
public class KeepAlive : ParentDataWidget<KeepAliveParentDataMixin> {
public KeepAlive(
Key key = null,
bool keepAlive = true,

60
com.unity.uiwidgets/Runtime/widgets/table.cs


}
public class TableCell : ParentDataWidget<Table> {
public TableCell(
Key key = null,
TableCellVerticalAlignment? verticalAlignment = null,
Widget child = null
) : base(key: key, child: child) {
this.verticalAlignment = verticalAlignment;
}
public readonly TableCellVerticalAlignment? verticalAlignment;
public override void applyParentData(RenderObject renderObject) {
TableCellParentData parentData = (TableCellParentData) renderObject.parentData;
if (parentData.verticalAlignment != verticalAlignment) {
parentData.verticalAlignment = verticalAlignment;
AbstractNodeMixinDiagnosticableTree targetParent = renderObject.parent;
if (targetParent is RenderObject) {
((RenderObject) targetParent).markNeedsLayout();
}
}
}
public override Type debugTypicalAncestorWidgetClass { get => typeof(Table); }
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new EnumProperty<TableCellVerticalAlignment?>("verticalAlignment", verticalAlignment));
}
}
// public class TableCell : ParentDataWidget<Table> {
// public TableCell(
// Key key = null,
// TableCellVerticalAlignment? verticalAlignment = null,
// Widget child = null
// ) : base(key: key, child: child) {
// this.verticalAlignment = verticalAlignment;
// }
//
// public readonly TableCellVerticalAlignment? verticalAlignment;
//
// public override void applyParentData(RenderObject renderObject) {
// TableCellParentData parentData = (TableCellParentData) renderObject.parentData;
// if (parentData.verticalAlignment != verticalAlignment) {
// parentData.verticalAlignment = verticalAlignment;
//
// AbstractNodeMixinDiagnosticableTree targetParent = renderObject.parent;
// if (targetParent is RenderObject) {
// ((RenderObject) targetParent).markNeedsLayout();
// }
// }
// }
//
// public override Type debugTypicalAncestorWidgetClass { get => typeof(Table); }
//
// public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
// base.debugFillProperties(properties);
// properties.add(new EnumProperty<TableCellVerticalAlignment?>("verticalAlignment", verticalAlignment));
// }
// }
}
正在加载...
取消
保存