浏览代码

upgrade reorderable_list

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
51c80bb7
共有 1 个文件被更改,包括 22 次插入12 次删除
  1. 34
      com.unity.uiwidgets/Runtime/material/reorderable_list.cs

34
com.unity.uiwidgets/Runtime/material/reorderable_list.cs


public class ReorderableListView : StatefulWidget {
public ReorderableListView(
Key key = null,
ScrollController scrollController = null,
) {
) : base(key: key) {
D.assert(onReorder != null);
D.assert(children != null);
D.assert(

this.header = header;
this.children = children;
this.scrollController = scrollController;
this.scrollDirection = scrollDirection;
this.padding = padding;
this.onReorder = onReorder;

public readonly List<Widget> children;
public readonly Axis scrollDirection;
public readonly ScrollController scrollController;
public readonly EdgeInsets padding;

return new _ReorderableListContent(
header: widget.header,
children: widget.children,
scrollController: widget.scrollController,
scrollDirection: widget.scrollDirection,
onReorder: widget.onReorder,
padding: widget.padding,

public _ReorderableListContent(
Widget header,
List<Widget> children,
ScrollController scrollController,
Axis scrollDirection,
EdgeInsets padding,
ReorderCallback onReorder,

this.children = children;
this.scrollController = scrollController;
this.scrollDirection = scrollDirection;
this.padding = padding;
this.onReorder = onReorder;

public readonly Widget header;
public readonly List<Widget> children;
public readonly ScrollController scrollController;
public readonly Axis scrollDirection;
public readonly EdgeInsets padding;
public readonly ReorderCallback onReorder;

}
public override void didChangeDependencies() {
_scrollController = PrimaryScrollController.of(context) ?? new ScrollController();
_scrollController = widget.scrollController ?? PrimaryScrollController.of(context) ?? new ScrollController();
base.didChangeDependencies();
}

D.assert(material_.debugCheckHasMaterialLocalizations(context));
return new LayoutBuilder(builder: (BuildContext _, BoxConstraints constraints) => {
List<Widget> wrappedChildren = new List<Widget> { };
if (widget.header != null) {
wrappedChildren.Add(widget.header);
}
for (int i = 0; i < widget.children.Count; i += 1) {
wrappedChildren.Add(_wrap(widget.children[i], i, constraints));
}
Key endWidgetKey = Key.key("DraggableList - End Widget");
Widget finalDropArea;
switch (widget.scrollDirection) {

}
if (widget.reverse == true) {
wrappedChildren.Insert(0, _wrap(
wrappedChildren.Add(_wrap(
else {
if (widget.header != null) {
wrappedChildren.Add(widget.header);
}
for (int i = 0; i < widget.children.Count; i += 1) {
wrappedChildren.Add(_wrap(widget.children[i], i, constraints));
}
if (widget.reverse != true) {
wrappedChildren.Add(_wrap(
finalDropArea, widget.children.Count,
constraints)

正在加载...
取消
保存