Swipable
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Swipable
Constructors
Swipable
- Key? key,
- @required Widget? child,
- void onSwipeRight(
- Offset finalPosition
- void onSwipeLeft(
- Offset finalPosition
- void onSwipeDown(
- Offset finalPosition
- void onSwipeUp(
- Offset finalPosition
- void onPositionChanged(
- DragUpdateDetails details
- void onSwipeStart(
- DragStartDetails details
- void onSwipeCancel(
- Offset position,
- DragEndDetails details
- void onSwipeEnd(
- Offset position,
- DragEndDetails details
- Stream<
double> ? swipe, - int? animationDuration = 300,
- Curve? animationCurve = Curves.easeInOut,
- bool horizontalSwipe = true,
- bool verticalSwipe = true,
- double? threshold = 0.3,
Properties
animationCurve
@param animationCurve Curve Animation timing function.
animationDuration
@param animationDuration int Animation duration (in milliseconds) for the card to swipe atuomatically or get back to its original position on swipe cancel.
child
@param child Widget @required Swipable content.
horizontalSwipe
@param horizontalSwipe bool To enable or disable the swipe in horizontal direction. defaults to true.
onPositionChanged
Callback Hook triggered when the card position changes. @param details DragUpdateDetails
onSwipeCancel
Callback Hook triggered when the card stopped being dragged and doesn't meet the requirement to be swiped. @param details DragEndDetails
onSwipeDown
Callback Hook triggered when the card finished swiping down. @param finalPosition Offset
onSwipeEnd
Callback Hook triggered when the card stopped being dragged and meets the requirement to be swiped. @param details DragEndDetails
onSwipeLeft
Callback Hook triggered when the card finished swiping left. @param finalPosition Offset
onSwipeRight
Callback Hook triggered when the card finished swiping right. @param finalPosition Offset
onSwipeStart
Callback Hook triggered when the card starts being dragged. @param details DragStartDetails
onSwipeUp
Callback Hook triggered when the card finished swiping up. @param finalPosition Offset
swipe
@param swipe Stream<double> Triggers an automatic swipe. Cancels automatically after first emission.R The double value sent corresponds to the direction the card should follow (clockwise radian angle).
threshold
@param threshold double Defines the strength needed for a card to be swiped. The bigger, the easier it is to swipe.
verticalSwipe
@param verticalSwipe bool To enable or disable the swipe in vertical direction. defaults to true.
Methods
createState
Creates the mutable state for this widget at a given location in the tree.
Subclasses should override this method to return a newly created instance of their associated State subclass:
@override
State<SomeWidget> createState() => _SomeWidgetState();
The framework can call this method multiple times over the lifetime of a StatefulWidget. For example, if the widget is inserted into the tree in multiple locations, the framework will create a separate State object for each location. Similarly, if the widget is removed from the tree and later inserted into the tree again, the framework will call createState again to create a fresh State object, simplifying the lifecycle of State objects.