NeoButton, wrap them with NeoInteractable.
Examples
child or builder.
Properties
Required
Provide eitherchild or builder (exactly one).
Content
Widget?
Static child when interaction-driven rebuilds are not needed. Mutually exclusive with
builder.NeoInteractableBuilder?
Builds content from the current interaction snapshot (
isEnabled, isHovered, isPressed, isActive). Mutually exclusive with child.Layout
HitTestBehavior
default:"HitTestBehavior.deferToChild"
Hit-test behavior passed to the underlying gesture detector when press handlers are present.
Styling
bool
default:"true"
Whether the content scales slightly while pressed.
double
default:"0.97"
Scale factor applied while pressed when
enableScale is true.MouseCursor?
Mouse cursor override. When null, uses click when enabled and forbidden when disabled.
State
VoidCallback?
Called on tap when enabled.
bool
default:"true"
When
false, dims via Neo’s disabled opacity, clears hover/press, and ignores input.VoidCallback?
Called when a press begins.
VoidCallback?
Called when a press ends or is cancelled.
VoidCallback?
Called when the pointer enters the interactable region.
VoidCallback?
Called when the pointer leaves the interactable region.
GestureDragStartCallback?
Optional horizontal drag start handler.
GestureDragUpdateCallback?
Optional horizontal drag update handler.
Duration?
Overrides theme
durations.short for the minimum time pressed stays true on quick taps.Builder state
When you need custom hover/press visuals, usebuilder. The snapshot includes:
isEnabled/isHovered/isPressedisActive—truewhen enabled and either hovered or pressed (same feedback on touch and desktop)
Best Practices
- Prefer
childwhen you only need disabled opacity and press scale. - Use
builder+state.isActivewhen your custom widget also needs hover/press color changes. - Keep the wrapper thin — compose layout and styling in the child/builder, leave gestures to
NeoInteractable.
Integration Notes
- Neo widgets such as
NeoButtonuse this shell internally — wrapping your own widgets keeps interaction consistent with the rest of Neo. - Press scale duration follows
theme.durations.short.

