浏览代码

add comment for drag_target.

/jiacheng-demo_proctice
jiacheng.gao 3 年前
当前提交
0d094c3e
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 13
      com.unity.uiwidgets/Runtime/widgets/drag_target.cs

13
com.unity.uiwidgets/Runtime/widgets/drag_target.cs


}
}
// 拖动上下文context的封装
public class Draggable<T> : StatefulWidget {
public Draggable(
Key key = null,

}
// 针对长按的Draggable的子类
public class LongPressDraggable<T> : Draggable<T> {
public LongPressDraggable(
Key key = null,

}
}
// 动作的分发,_DragAvatar的创建
// depend: _DragAvatar, DraggableDetails
public class _DraggableState<T> : State<Draggable<T>> {
public override void initState() {
base.initState();

}
// 记录一些drag的细节信息:速度,偏移
public class DraggableDetails {
public DraggableDetails(
bool wasAccepted = false,

}
// 托管函数的封装
public class DragTarget<T> : StatefulWidget {
public DragTarget(
Key key = null,

}
}
// 管理被拖动的对象(_DragAvatar)
// 依赖于_DragAvatar, DragTarget
public class _DragTargetState<T> : State<DragTarget<T>> {
readonly List<_DragAvatar<T>> _candidateAvatars = new List<_DragAvatar<T>>();
readonly List<_DragAvatar<T>> _rejectedAvatars = new List<_DragAvatar<T>>();

}
public delegate void _OnDragEnd(Velocity velocity, Offset offset, bool wasAccepted);
// 被拖动的对象的封装
// 依赖于_DragTargetState
public class _DragAvatar<T> : Drag {
public _DragAvatar(
OverlayState overlayState,

正在加载...
取消
保存