HitTestBehavior enum
Controls how a widget behaves during hit testing.
This determines whether a widget absorbs hit test events or allows them to pass through to widgets behind it in the paint order.
Values
- deferToChild → const HitTestBehavior
-
Only receives events if a child was hit.
The widget itself will not be added to the hit test result unless one of its children reports a hit. This is the default for GestureDetector.
- opaque → const HitTestBehavior
-
Receives events within its bounds and blocks targets behind it.
The widget always adds itself to the hit test result when the pointer is within bounds, preventing siblings painted earlier (behind) from receiving the event.
- translucent → const HitTestBehavior
-
Receives events within its bounds but allows targets behind it to also receive the event.
The widget adds itself to the hit test result but returns
falsefrom hit testing when no child was hit, allowing earlier-painted siblings to also participate.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
HitTestBehavior> - A constant List of the values in this enum, in order of their declaration.