API Reference 0.7.1rikulo_gestureDragGestureState

DragGestureState class

The state of dragging.

class DragGestureState extends GestureState {
 final DragGesture _gesture;
 final VelocityProvider _vp;
 Point _position;
 int _time;

 DragGestureState._(DragGesture gesture, this.eventTarget, Point position, int time):
 _gesture = gesture, startPosition = position, _position = position, 
 startTime = time, _time = time, _vp = new VelocityProvider(position, time);

 @override
 final EventTarget eventTarget;
 @override
 int get time => _time;

 /** The associated [DragGesture]. */
 DragGesture get gesture => _gesture;

 /** The timestamp when the gesture starts. */
 final int startTime;
 
 /** The initial touch/cursor position. */
 final Point startPosition;
 
 /** The current touch/cursor position. */
 Point get position => _position;
 
 /** The displacement of the touch/cursor position of this dragging. */
 Point get transition => _position - startPosition;

 /** The current estimated velocity of touched/cursor position movement. */
 Point get velocity => _vp.velocity;

 void snapshot(Point position, int time) {
   _vp.snapshot(position, time);
   _position = position;
   _time = time;
 }
}

Extends

GestureState > DragGestureState

Properties

var data #

inherited from GestureState

Custom data. It is useful if you'd like to store something that will be cleaned up automatically when the gesture is finished.

var data

final EventTarget eventTarget #

The element which receives the event.

docs inherited from GestureState
final EventTarget eventTarget

final DragGesture gesture #

The associated DragGesture.

DragGesture get gesture => _gesture;

final Point position #

The current touch/cursor position.

Point get position => _position;

final Point startPosition #

The initial touch/cursor position.

final Point startPosition

final int startTime #

The timestamp when the gesture starts.

final int startTime

final int time #

The latest timestamp of gesture.

docs inherited from GestureState
@override
int get time => _time;

final Point transition #

The displacement of the touch/cursor position of this dragging.

Point get transition => _position - startPosition;

final Point velocity #

The current estimated velocity of touched/cursor position movement.

Point get velocity => _vp.velocity;

Methods

void snapshot(Point position, int time) #

void snapshot(Point position, int time) {
 _vp.snapshot(position, time);
 _position = position;
 _time = time;
}