Ejemplo n.º 1
0
 public LongPressDraggable(
     T data,
     Key key                    = null,
     Widget child               = null,
     Widget feedback            = null,
     Axis?axis                  = null,
     Widget childWhenDragging   = null,
     Offset feedbackOffset      = null,
     DragAnchor dragAnchor      = DragAnchor.child,
     int?maxSimultaneousDrags   = null,
     VoidCallback onDragStarted = null,
     DraggableCanceledCallback onDraggableCanceled = null,
     DragEndCallback onDragEnd    = null,
     VoidCallback onDragCompleted = null
     ) : base(
         key: key,
         child: child,
         feedback: feedback,
         data: data,
         axis: axis,
         childWhenDragging: childWhenDragging,
         feedbackOffset: feedbackOffset,
         dragAnchor: dragAnchor,
         maxSimultaneousDrags: maxSimultaneousDrags,
         onDragStarted: onDragStarted,
         onDraggableCanceled: onDraggableCanceled,
         onDragEnd: onDragEnd,
         onDragCompleted: onDragCompleted
         )
 {
 }
Ejemplo n.º 2
0
        public Draggable(
            Key key                    = null,
            Widget child               = null,
            Widget feedback            = null,
            T data                     = default,
            Axis?axis                  = null,
            Widget childWhenDragging   = null,
            Offset feedbackOffset      = null,
            DragAnchor dragAnchor      = DragAnchor.child,
            Axis?affinity              = null,
            int?maxSimultaneousDrags   = null,
            VoidCallback onDragStarted = null,
            DraggableCanceledCallback onDraggableCanceled = null,
            DragEndCallback onDragEnd    = null,
            VoidCallback onDragCompleted = null
            ) : base(key)
        {
            D.assert(child != null);
            D.assert(feedback != null);
            D.assert(maxSimultaneousDrags == null || maxSimultaneousDrags >= 0);

            this.child                = child;
            this.feedback             = feedback;
            this.data                 = data;
            this.axis                 = axis;
            this.childWhenDragging    = childWhenDragging;
            this.feedbackOffset       = feedbackOffset ?? Offset.zero;
            this.dragAnchor           = dragAnchor;
            this.affinity             = affinity;
            this.maxSimultaneousDrags = maxSimultaneousDrags;
            this.onDragStarted        = onDragStarted;
            this.onDraggableCanceled  = onDraggableCanceled;
            this.onDragEnd            = onDragEnd;
            this.onDragCompleted      = onDragCompleted;
        }