API Reference 0.7.1rikulo_gestureSwipeGesture

SwipeGesture class

The gesture of a swipe.

class SwipeGesture extends Gesture {
 DragGesture _drag;

 /** Construct a swipe gesture on [owner] with the given callback [action()].
  */
 SwipeGesture(this.owner, SwipeGestureAction action) {
   _drag = new DragGesture(owner, 
   end: (DragGestureState state) {
     if (action != null)
       action(new SwipeGestureState._(this, state));
   });
 }
 
 /** The element associated with this swipe gesture (never null).
  */
 final Element owner;

 void stop() {
   if (_drag != null)
     _drag.stop();
 }
 
 void disable() {
   if (_drag != null)
     _drag.disable();
 }
 
 void enable() {
   if (_drag != null)
     _drag.enable();
 }
 
 void destroy() {
   if (_drag != null) {
     _drag.destroy();
     _drag = null;
   }
 }
}

Extends

Gesture > SwipeGesture

Constructors

new SwipeGesture(Element owner, SwipeGestureAction action) #

Construct a swipe gesture on owner with the given callback action().

SwipeGesture(this.owner, SwipeGestureAction action) {
 _drag = new DragGesture(owner, 
 end: (DragGestureState state) {
   if (action != null)
     action(new SwipeGestureState._(this, state));
 });
}

Properties

final Element owner #

The element associated with this swipe gesture (never null).

final Element owner

Methods

void destroy() #

Destroy the gesture. It shall be called to clean up, if it is no longer in use.

docs inherited from Gesture
void destroy() {
 if (_drag != null) {
   _drag.destroy();
   _drag = null;
 }
}

void disable() #

Disable the gesture. The current action will be immediately stopped, if any.

docs inherited from Gesture
void disable() {
 if (_drag != null)
   _drag.disable();
}

void enable() #

Enable the gesture.

docs inherited from Gesture
void enable() {
 if (_drag != null)
   _drag.enable();
}

void stop() #

Stop the current action, if any.

docs inherited from Gesture
void stop() {
 if (_drag != null)
   _drag.stop();
}