Swipeable class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Swipeable
Constructors
-
Swipeable({required Key key, required Widget child, required SwipeDirectionCallback onSwipe, Widget? background, Widget? secondaryBackground, ConfirmSwipeCallback? confirmSwipe, SwipeDirection direction = SwipeDirection.horizontal, Map<
SwipeDirection, double> dismissThresholds = const <SwipeDirection, double>{}, double maxOffset = 0.4, Duration movementDuration = const Duration(milliseconds: 200), double crossAxisEndOffset = 0.0, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Set<PointerDeviceKind> allowedPointerKinds = const {PointerDeviceKind.invertedStylus, PointerDeviceKind.stylus, PointerDeviceKind.touch}}) -
Creates a widget that calls a function when swiped.
const
Properties
-
allowedPointerKinds
→ Set<
PointerDeviceKind> -
Defines pointer types which are allowed to trigger swipe gesture.
final
- background → Widget?
-
A widget that is stacked behind the child. If secondaryBackground is also
specified then this widget only appears when the child has been dragged
to the right.
final
- child → Widget
-
The widget below this widget in the tree.
final
- confirmSwipe → ConfirmSwipeCallback?
-
Gives the app an opportunity to confirm or veto a pending dismissal.
final
- crossAxisEndOffset → double
-
Defines the end offset across the main axis after the card is dismissed.
final
- direction → SwipeDirection
-
The direction in which the widget can be dismissed.
final
-
dismissThresholds
→ Map<
SwipeDirection, double> -
The offset threshold the item has to be dragged in order to be considered
dismissed.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxOffset → double
-
The maximum horizontal offset the item can move to/
final
- movementDuration → Duration
-
Defines the duration for card to dismiss or to come back to original position if not dismissed.
final
- onSwipe → SwipeDirectionCallback
-
Called when the widget has been dismissed, after finishing resizing.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryBackground → Widget?
-
A widget that is stacked behind the child and is exposed when the child
has been dragged to the left. It may only be specified when background
has also been specified.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _SwipeableState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited