TKMDragHelper class

Class to create a drag helper. This class use flags to manipulate the drag in Widgets

The most important is define the DragDirection to understand the drag direction in the widget (Where start and end)

TKMDragHelper(
  animationController: animationController,
  maxSlide: 255,
  maxDragStartEdge: MediaQuery.of(context).size.width - 255,
  minDragStartEdge: 60,
  dissableDrag: true,
  orientation: DragOrientation.RigthtToLeft
);

After define DragUtils use a GestureDectector to override

  • onHorizontalDragStart: dragUtils.onDragStart,
  • onHorizontalDragUpdate: dragUtils.onDragUpdate,
  • onHorizontalDragEnd: dragUtils.onDragEnd,

Constructors

TKMDragHelper({required AnimationController animationController, required double maxSlide, required double maxDragStartEdge, required double minDragStartEdge, required DragDirection direction, bool dissableDrag = false})

Properties

animationController AnimationController
Animation controller to link animation with the drag
final
animationStatusBySideLeft bool
no setter
animationStatusBySideRight bool
no setter
canBeDragged bool
Flag to indicate is possible to drag the widget
getter/setter pair
delta double
no setter
direction DragDirection
This argument is to indicate the drag direction where start tand end
final
dissableDrag bool
If the user want to disable drag in some cases
final
hashCode int
The hash code for this object.
no setterinherited
maxDragStartEdge double
Edge maximum to start the drag
final
maxSlide double
Maximum slide in the widget or screen
final
minDragStartEdge double
Edge minimum to start the drag
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDragEnd(DragEndDetails details) → void
When drag is end, if is necessary complete or dismiss the animation
onDragStart(DragStartDetails details) → void
When drag is start, evaluate if limit and edge is true with animationStatus
onDragUpdate(DragUpdateDetails details) → void
When drag is update, update the animationController value
open() → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited