⌂
›
Widgets
›
GestureDetector
GestureDetector
GestureDetector control. Build it with the gesture_detector helper.
Example
gesture_detector(
content: text("GestureDetector"),
expand: true,
width: 240,
height: 120,
on_tap: ->(event) {}
)
Properties
adaptive— Adapts to the platform (Material/Cupertino) when true.allowed_devices— Sets the allowed devices property.content— The single child control rendered inside this control.drag_interval— Sets the drag interval property.exclude_from_semantics— Sets the exclude from semantics property.hover_interval— Sets the hover interval property.mouse_cursor— Cursor shown when hovering the control.multi_tap_touches— Sets the multi tap touches property.trackpad_scroll_causes_scale— Sets the trackpad scroll causes scale property.
Common layout and animation properties
align— Alignment of the control within its parent.animate_align— Animates alignment changes.animate_margin— Animates margin changes.animate_offset— Animates offset changes.animate_opacity— Animates opacity changes.animate_position— Animates position changes.animate_rotation— Animates rotation changes.animate_scale— Animates scale changes.animate_size— Animates size changes.aspect_ratio— Width-to-height ratio to maintain.badge— Badge drawn on the corner of the control.bottom— Bottom offset when positioned inside a stack.col— Responsive column span (1-12) per breakpoint.data— Arbitrary value you can attach to the control and read back in handlers.disabled— Disables interaction when true.expand— Fills the available space along the parent's main axis when true.expand_loose— Like expand, but only grows up to the child's natural size.height— Fixed height in logical pixels.key— Stable identity used to preserve state across rebuilds.left— Left offset when positioned inside a stack.margin— Outer spacing around the control.offset— Translation offset applied to the control.opacity— Opacity from 0.0 (transparent) to 1.0 (opaque).right— Right offset when positioned inside a stack.rotate— Rotation applied to the control.rtl— Renders right-to-left when true.scale— Scale transform applied to the control.size_change_interval— Throttle interval for on_size_change, in ms.tooltip— Text shown on hover/long-press.top— Top offset when positioned inside a stack.visible— Hides the control when false.width— Fixed width in logical pixels.
Events
on_animation_end— Fired when an animation completes.on_double_tap— Fired on a double tap.on_double_tap_cancel— Fired on double tap cancel.on_double_tap_down— Fired on double tap down.on_enter— Fired when the pointer enters the control.on_exit— Fired when the pointer leaves the control.on_force_press_end— Fired on force press end.on_force_press_peak— Fired on force press peak.on_force_press_start— Fired on force press start.on_force_press_update— Fired on force press update.on_horizontal_drag_cancel— Fired on horizontal drag cancel.on_horizontal_drag_down— Fired on horizontal drag down.on_horizontal_drag_end— Fired on horizontal drag end.on_horizontal_drag_start— Fired on horizontal drag start.on_horizontal_drag_update— Fired on horizontal drag update.on_hover— Fired when the pointer enters/leaves the control.on_long_press— Fired on a long press.on_long_press_cancel— Fired on long press cancel.on_long_press_down— Fired on long press down.on_long_press_end— Fired on long press end.on_long_press_move_update— Fired on long press move update.on_long_press_start— Fired on long press start.on_long_press_up— Fired on long press up.on_multi_long_press— Fired on multi long press.on_multi_tap— Fired on multi tap.on_pan_cancel— Fired on pan cancel.on_pan_down— Fired on pan down.on_pan_end— Fired on pan end.on_pan_start— Fired on pan start.on_pan_update— Fired on pan update.on_right_pan_end— Fired on right pan end.on_right_pan_start— Fired on right pan start.on_right_pan_update— Fired on right pan update.on_scale_end— Fired on scale end.on_scale_start— Fired on scale start.on_scale_update— Fired on scale update.on_scroll— Fired when the scroll position changes.on_secondary_long_press— Fired on secondary long press.on_secondary_long_press_cancel— Fired on secondary long press cancel.on_secondary_long_press_down— Fired on secondary long press down.on_secondary_long_press_end— Fired on secondary long press end.on_secondary_long_press_move_update— Fired on secondary long press move update.on_secondary_long_press_start— Fired on secondary long press start.on_secondary_long_press_up— Fired on secondary long press up.on_secondary_tap— Fired on secondary tap.on_secondary_tap_cancel— Fired on secondary tap cancel.on_secondary_tap_down— Fired on secondary tap down.on_secondary_tap_up— Fired on secondary tap up.on_size_change— Fired when the control's size changes.on_tap— Fired on a tap.on_tap_cancel— Fired when a tap is cancelled.on_tap_down— Fired when a pointer presses down.on_tap_move— Fired on tap move.on_tap_up— Fired on tap up.on_tertiary_long_press— Fired on tertiary long press.on_tertiary_long_press_cancel— Fired on tertiary long press cancel.on_tertiary_long_press_down— Fired on tertiary long press down.on_tertiary_long_press_end— Fired on tertiary long press end.on_tertiary_long_press_move_update— Fired on tertiary long press move update.on_tertiary_long_press_start— Fired on tertiary long press start.on_tertiary_long_press_up— Fired on tertiary long press up.on_tertiary_tap_cancel— Fired on tertiary tap cancel.on_tertiary_tap_down— Fired on tertiary tap down.on_tertiary_tap_up— Fired on tertiary tap up.on_vertical_drag_cancel— Fired on vertical drag cancel.on_vertical_drag_down— Fired on vertical drag down.on_vertical_drag_end— Fired on vertical drag end.on_vertical_drag_start— Fired on vertical drag start.on_vertical_drag_update— Fired on vertical drag update.
Reference
- Family:
shared - Widget type:
gesturedetector - Helpers:
gesture_detector,gesturedetector