PressableBox class

Combines Box styling with gesture handling.

Provides press, long press, and focus interactions.

Inheritance

Constructors

PressableBox({Key? key, BoxStyler? style, VoidCallback? onLongPress, FocusNode? focusNode, required Widget child, bool autofocus = false, bool enableFeedback = false, ValueChanged<bool>? onFocusChange, VoidCallback? onPress, MouseCursor? mouseCursor, bool canRequestFocus = true, bool excludeFromSemantics = false, String? semanticsLabel, PressableSemanticsRole semanticsRole = PressableSemanticsRole.button, FocusOnKeyEventCallback? onKeyEvent, WidgetStatesController? controller, Map<Type, Action<Intent>>? actions, HitTestBehavior hitTestBehavior = HitTestBehavior.opaque, bool enabled = true})
const

Properties

actions → Map<Type, Action<Intent>>?
final
autofocus → bool
final
canRequestFocus → bool
final
child → Widget
final
controller → WidgetStatesController?
final
enabled → bool
final
enableFeedback → bool
Enables audible/haptic feedback for gestures.
final
excludeFromSemantics → bool
final
focusNode → FocusNode?
final
hashCode → int
The hash code for this object.
no setterinherited
hitTestBehavior → HitTestBehavior
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mouseCursor → MouseCursor?
final
onFocusChange → ValueChanged<bool>?
final
onKeyEvent → FocusOnKeyEventCallback?
Handles key events before built-in activation while enabled.
final
onLongPress → VoidCallback?
Called when the box is long-pressed.
final
onPress → VoidCallback?
Called when the box is pressed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticsLabel → String?
final
semanticsRole → PressableSemanticsRole
final
style → BoxStyler?
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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, int wrapWidth = 65}) → 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