TouchableOpacity class Null safety

Inheritance

Constructors

TouchableOpacity({Key? key, required Widget child, double activeOpacity = 0.2, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCallback? onTap, GestureTapCancelCallback? onTapCancel, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, GestureLongPressStartCallback? onLongPressStart, GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate, GestureLongPressUpCallback? onLongPressUp, GestureLongPressEndCallback? onLongPressEnd, GestureDragDownCallback? onVerticalDragDown, GestureDragStartCallback? onVerticalDragStart, GestureDragUpdateCallback? onVerticalDragUpdate, GestureDragEndCallback? onVerticalDragEnd, GestureDragCancelCallback? onVerticalDragCancel, GestureDragDownCallback? onHorizontalDragDown, GestureDragStartCallback? onHorizontalDragStart, GestureDragUpdateCallback? onHorizontalDragUpdate, GestureDragEndCallback? onHorizontalDragEnd, GestureDragCancelCallback? onHorizontalDragCancel, GestureForcePressStartCallback? onForcePressStart, GestureForcePressPeakCallback? onForcePressPeak, GestureForcePressUpdateCallback? onForcePressUpdate, GestureForcePressEndCallback? onForcePressEnd, GestureDragDownCallback? onPanDown, GestureDragStartCallback? onPanStart, GestureDragUpdateCallback? onPanUpdate, GestureDragEndCallback? onPanEnd, GestureDragCancelCallback? onPanCancel, GestureScaleStartCallback? onScaleStart, GestureScaleUpdateCallback? onScaleUpdate, GestureScaleEndCallback? onScaleEnd, HitTestBehavior? behavior, bool excludeFromSemantics = false, DragStartBehavior dragStartBehavior = DragStartBehavior.start})
Creates a widget that uses Gesture Detector internally and works in the same way but fades the child when the user touches it.

Properties

activeOpacity double
Double value that will be used as the opacity of the child when a pointer down event is registered. Defaults to 0.2, value must be between 1.0 and 0.0 .
final
behavior HitTestBehavior?
How this gesture detector should behave during hit testing.
final
child Widget
The widget below this widget in the tree.
final
dragStartBehavior DragStartBehavior
Determines the way that drag start behavior is handled.
final
excludeFromSemantics bool
Whether to exclude these gestures from the semantics tree. For example, the long-press gesture for showing a tooltip is excluded because the tooltip itself is included in the semantics tree directly and so having a gesture to show it would result in duplication of information.
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDoubleTap GestureTapCallback?
The user has tapped the screen at the same location twice in quick succession.
final
onForcePressEnd GestureForcePressEndCallback?
The pointer is no longer in contact with the screen.
final
onForcePressPeak GestureForcePressPeakCallback?
The pointer is in contact with the screen and has pressed with the maximum force. The amount of force is at least ForcePressGestureRecognizer.peakPressure.
final
onForcePressStart GestureForcePressStartCallback?
The pointer is in contact with the screen and has pressed with sufficient force to initiate a force press. The amount of force is at least ForcePressGestureRecognizer.startPressure.
final
onForcePressUpdate GestureForcePressUpdateCallback?
A pointer is in contact with the screen, has previously passed the ForcePressGestureRecognizer.startPressure and is either moving on the plane of the screen, pressing the screen with varying forces or both simultaneously.
final
onHorizontalDragCancel GestureDragCancelCallback?
The pointer that previously triggered onHorizontalDragDown did not complete.
final
onHorizontalDragDown GestureDragDownCallback?
A pointer has contacted the screen and might begin to move horizontally.
final
onHorizontalDragEnd GestureDragEndCallback?
A pointer that was previously in contact with the screen and moving horizontally is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen.
final
onHorizontalDragStart GestureDragStartCallback?
A pointer has contacted the screen and has begun to move horizontally.
final
onHorizontalDragUpdate GestureDragUpdateCallback?
A pointer that is in contact with the screen and moving horizontally has moved in the horizontal direction.
final
onLongPress GestureLongPressCallback?
Called when a long press gesture has been recognized.
final
onLongPressEnd GestureLongPressEndCallback?
A pointer that has triggered a long-press has stopped contacting the screen.
final
onLongPressMoveUpdate GestureLongPressMoveUpdateCallback?
A pointer has been drag-moved after a long press.
final
onLongPressStart GestureLongPressStartCallback?
Callback for long press start with gesture location.
final
onLongPressUp GestureLongPressUpCallback?
A pointer that has triggered a long-press has stopped contacting the screen.
final
onPanCancel GestureDragCancelCallback?
The pointer that previously triggered onPanDown did not complete.
final
onPanDown GestureDragDownCallback?
A pointer has contacted the screen and might begin to move.
final
onPanEnd GestureDragEndCallback?
A pointer that was previously in contact with the screen and moving is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen.
final
onPanStart GestureDragStartCallback?
A pointer has contacted the screen and has begun to move.
final
onPanUpdate GestureDragUpdateCallback?
A pointer that is in contact with the screen and moving has moved again.
final
onScaleEnd GestureScaleEndCallback?
The pointers are no longer in contact with the screen.
final
onScaleStart GestureScaleStartCallback?
The pointers in contact with the screen have established a focal point and initial scale of 1.0.
final
onScaleUpdate GestureScaleUpdateCallback?
The pointers in contact with the screen have indicated a new focal point and/or scale.
final
onTap GestureTapCallback?
A tap has occurred.
final
onTapCancel GestureTapCancelCallback?
The pointer that previously triggered onTapDown will not end up causing a tap.
final
onTapDown GestureTapDownCallback?
A pointer that might cause a tap has contacted the screen at a particular location.
final
onTapUp GestureTapUpCallback?
A pointer that will trigger a tap has stopped contacting the screen at a particular location.
final
onVerticalDragCancel GestureDragCancelCallback?
The pointer that previously triggered onVerticalDragDown did not complete.
final
onVerticalDragDown GestureDragDownCallback?
A pointer has contacted the screen and might begin to move vertically.
final
onVerticalDragEnd GestureDragEndCallback?
A pointer that was previously in contact with the screen and moving vertically is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen.
final
onVerticalDragStart GestureDragStartCallback?
A pointer has contacted the screen and has begun to move vertically.
final
onVerticalDragUpdate GestureDragUpdateCallback?
A pointer that is in contact with the screen and moving vertically has moved in the vertical direction.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.
@nonVirtualinherited