swipe_plus

Creator: coderz1093

Last updated:

0 purchases

swipe_plus Image
swipe_plus Images

Languages

Categories

Add to Cart

Description:

swipe plus

Swipe Plus. #
For creating a message drag effect. #

Installation #
swipe_plus:
git:
url: https://github.com/DK070202/drag_and_swipe.git
ref: master
copied to clipboard
Usage. #
Wrap your widget with SwipePlus and provide onDragComplete and/or onDragCancel callback.
SwipePlus(
child: someWidget,
onDragComplete: (){
/// TODO : Reply to message.
}
)
copied to clipboard
Available Configuration. #
1.onDragComplete On drag complete call back
/// When horizontal drag is enough to cross [minThreshold] then it will be called.
final VoidCallback? onDragComplete;

copied to clipboard
2.onDragCancel callback for drag cancel.
/// When horizontal drag is not enough to cross [minThreshold] and callback
/// canceled from user.
final VoidCallback? onDragCancel;
copied to clipboard
3.alignment For aligning child.
/// This uses [Align] and [ColoredBox] internally to set Alignment of Widget
/// so, the complete area of widget including whitespace can be available for
/// hit-test.
final Alignment alignment;
copied to clipboard
4.dragDirection It decides the drag direction of child.
/// * If [DragDirection.RTL] then it can dragged from right side to left side.
/// * If [DragDirection.LTR] then it can be dragged from left to to right.
final DragDirection alignment;
copied to clipboard
5.maxTranslation Value of width percentage of child,for max translation in direction.
/// It defines bounds of translation in direction. If it is set to .3 then at
/// max drag you will able to translate 30% of [child] size in any direction.
final double maxTranslation;
copied to clipboard
6.reverseDuration Duration for reverse translation.
/// If drag not completes or if it not crosses the [minThreshold] percentage
/// of width then it play reverse animation with [reverseDuration] duration.
final Duration reverseDuration;
copied to clipboard
7.minThreshold A percentage of minThreshold for calling completeCallback.
/// It helps to define boundary for calling [onDragComplete]. If it is set
/// to .2 and the value of [maxTranslation] is set to .3 then if we leave
/// drag handle at grater than 15% of translation it will consider this action
/// as threshold.
final Duration reverseDuration;
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.