|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.gestures; |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void _routePointer(PointerEvent pEvent) { |
|
|
|
void _routePointer(PointerDownEvent pEvent) { |
|
|
|
if (widget.maxSimultaneousDrags != null && |
|
|
|
_activeCount >= widget.maxSimultaneousDrags) { |
|
|
|
return; |
|
|
|
|
|
|
D.assert(!_candidateAvatars.Contains(avatar)); |
|
|
|
D.assert(!_rejectedAvatars.Contains(avatar)); |
|
|
|
|
|
|
|
if (avatar.data is T && (widget.onWillAccept == null || widget.onWillAccept(avatar.data))) { |
|
|
|
if (avatar.data is _DragAvatar<T> && (widget.onWillAccept == null || widget.onWillAccept(avatar.data))) { |
|
|
|
|
|
|
|
_rejectedAvatars.Add(avatar); |
|
|
|
return false; |
|
|
|
else { |
|
|
|
setState(() => { |
|
|
|
_rejectedAvatars.Add(avatar); |
|
|
|
}); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void didLeave(_DragAvatar<T> avatar) { |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Widget _build(BuildContext context) { |
|
|
|
RenderBox box = (RenderBox) overlayState.context.findRenderObject(); |
|
|
|
RenderBox box = overlayState.context.findRenderObject() as RenderBox; |
|
|
|
Offset overlayTopLeft = box.localToGlobal(Offset.zero); |
|
|
|
return new Positioned( |
|
|
|
left: _lastOffset.dx - overlayTopLeft.dx, |
|
|
|