Clickable constructor
const
Clickable({
- Key? key,
- required Widget child,
- WidgetStatesController? statesController,
- bool enabled = true,
- WidgetStateProperty<
Decoration?> ? decoration, - WidgetStateProperty<
MouseCursor?> ? mouseCursor, - WidgetStateProperty<
EdgeInsetsGeometry?> ? padding, - WidgetStateProperty<
TextStyle?> ? textStyle, - WidgetStateProperty<
IconThemeData?> ? iconTheme, - VoidCallback? onPressed,
- FocusNode? focusNode,
- HitTestBehavior behavior = HitTestBehavior.translucent,
- ValueChanged<
bool> ? onHover, - ValueChanged<
bool> ? onFocus, - bool disableTransition = false,
- bool disableHoverEffect = false,
- WidgetStateProperty<
EdgeInsetsGeometry?> ? margin, - VoidCallback? onDoubleTap,
- Map<
LogicalKeySet, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - bool focusOutline = true,
- bool enableFeedback = true,
- WidgetStateProperty<
Matrix4?> ? transform, - VoidCallback? onLongPress,
- GestureTapDownCallback? onTapDown,
- GestureTapUpCallback? onTapUp,
- GestureTapCancelCallback? onTapCancel,
- GestureTapDownCallback? onSecondaryTapDown,
- GestureTapUpCallback? onSecondaryTapUp,
- GestureTapCancelCallback? onSecondaryTapCancel,
- GestureTapDownCallback? onTertiaryTapDown,
- GestureTapUpCallback? onTertiaryTapUp,
- GestureTapCancelCallback? onTertiaryTapCancel,
- GestureLongPressStartCallback? onLongPressStart,
- GestureLongPressUpCallback? onLongPressUp,
- GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate,
- GestureLongPressEndCallback? onLongPressEnd,
- GestureLongPressUpCallback? onSecondaryLongPress,
- GestureLongPressUpCallback? onTertiaryLongPress,
- AlignmentGeometry? marginAlignment,
- bool disableFocusOutline = false,
Creates a Clickable widget.
A clickable area with state-dependent styling and comprehensive gesture support.
Parameters:
child(required): The widget to display and make clickableenabled: Whether the widget is enabled. Defaults totrueonPressed: Primary tap callback. Ifnull, widget is disableddecoration,mouseCursor,padding,textStyle,iconTheme,margin,transform: State-dependent property functions for stylingfocusNode: Optional focus node for keyboard focus managementbehavior: Hit test behavior. Defaults to HitTestBehavior.translucentonHover,onFocus: State change callbacksdisableTransition: Iftrue, disables animation transitions. Defaults tofalsedisableHoverEffect: Iftrue, disables hover visual effects. Defaults tofalseonDoubleTap: Double tap callbackshortcuts,actions: Keyboard shortcuts and actionsfocusOutline: Whether to show focus outline. Defaults totrueenableFeedback: Whether to enable haptic/audio feedback. Defaults totrueonTapDown,onTapUp,onTapCancel: Primary tap gesture callbacksonSecondaryTapDown,onSecondaryTapUp,onSecondaryTapCancel: Secondary tap callbacksonTertiaryTapDown,onTertiaryTapUp,onTertiaryTapCancel: Tertiary tap callbacksonLongPress,onLongPressStart,onLongPressUp,onLongPressMoveUpdate,onLongPressEnd: Long press gesture callbacksonSecondaryLongPress,onTertiaryLongPress: Secondary and tertiary long press callbacksstatesController: Optional controller for programmatic state managementmarginAlignment: Alignment for applying margindisableFocusOutline: Whether to disable the focus outline. Defaults tofalse
Implementation
const Clickable({
super.key,
required this.child,
this.statesController,
this.enabled = true,
this.decoration,
this.mouseCursor,
this.padding,
this.textStyle,
this.iconTheme,
this.onPressed,
this.focusNode,
this.behavior = HitTestBehavior.translucent,
this.onHover,
this.onFocus,
this.disableTransition = false,
this.disableHoverEffect = false,
this.margin,
this.onDoubleTap,
this.shortcuts,
this.actions,
this.focusOutline = true,
this.enableFeedback = true,
this.transform,
this.onLongPress,
this.onTapDown,
this.onTapUp,
this.onTapCancel,
this.onSecondaryTapDown,
this.onSecondaryTapUp,
this.onSecondaryTapCancel,
this.onTertiaryTapDown,
this.onTertiaryTapUp,
this.onTertiaryTapCancel,
this.onLongPressStart,
this.onLongPressUp,
this.onLongPressMoveUpdate,
this.onLongPressEnd,
this.onSecondaryLongPress,
this.onTertiaryLongPress,
this.marginAlignment,
this.disableFocusOutline = false,
});