SwipeOrPinchDetector class
Very simple class for swipe and pinch(zoom) gesturing. Swipe can also generate "fling" given a certain velocity threshold. Customers will write their own detectors or use external packages, but the basics of capturing swipe and pinch common to most implementations are covered with the basic GestureControl callbacks used here. Note that swipe is sometimes implemented with the scale arena when there is only one point (i.e. not two fingers).
TBD: We should probably clean this up and make into two separate classes and also allow scale to do both pinch and swipe.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SwipeOrPinchDetector
Constructors
- SwipeOrPinchDetector({Key? key, HitTestBehavior? behavior, void onSwipe(SwipeDirection direction, Offset offset)?, void onPinch(double? scale)?, bool liveFeedback = false, bool pinch = false, @required Widget? child})
-
const
Properties
- behavior → HitTestBehavior?
-
How this gesture detector should behave during hit testing.
final
- child → Widget?
-
The widget below this widget in the tree.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- liveFeedback → bool
-
If true, the callbacks are called every time the gesture gets updated
and provide an Offset value in each callback.
final
- onPinch → void Function(double? scale)?
-
final
- onSwipe → void Function(SwipeDirection direction, Offset offset)?
-
Called when the user has swiped in a particular direction.
final
- pinch → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → DetectorState -
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