Skip to main content

InkWell

Stac InkWell allows you to build the Flutter InkWell widget using JSON.
To learn more about the InkWell widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
childMap<String, dynamic>?The widget below this InkWell.
onTapMap<String, dynamic>?Called when the user taps the InkWell.
onDoubleTapMap<String, dynamic>?Called when the user double taps the InkWell.
onLongPressMap<String, dynamic>?Called when the user presses and holds for a long duration.
onTapDownMap<String, dynamic>?Called when a tap gesture starts.
onTapUpMap<String, dynamic>?Called when a tap gesture is lifted.
onTapCancelMap<String, dynamic>?Called when a tap gesture is aborted.
onSecondaryTapMap<String, dynamic>?Called for a secondary tap (e.g., right-click on desktop).
onSecondaryTapUpMap<String, dynamic>?Called when a secondary tap is lifted.
onSecondaryTapDownMap<String, dynamic>?Called when a secondary tap gesture starts.
onSecondaryTapCancelMap<String, dynamic>?Called when a secondary tap gesture is aborted.
onHighlightChangedMap<String, dynamic>?Called when the InkWell highlight changes (pressed state).
onHoverMap<String, dynamic>?Called when a pointer enters or exits the widget area.
mouseCursorStacMouseCursor?Defines the mouse cursor when it hovers over the InkWell.
focusColorString?Color of the focus highlight.
hoverColorString?Color when a pointer hovers over the InkWell.
highlightColorString?Color when the InkWell is pressed.
overlayColorString?Ripple effect color over the child.
splashColorString?The splash color of the ripple.
radiusdouble?Defines the splash radius.
borderRadiusStacBorderRadius?Sets rounded corners for the ripple effect.
customBorderStacBorder?Custom border shape for clipping and ripple.
enableFeedback@Default(true) boolWhether to play feedback (e.g., sound, vibration) on tap.
excludeFromSemantics@Default(false) boolWhether to exclude from accessibility tools like screen readers.
canRequestFocus@Default(true) boolWhether this widget can request focus.
onFocusChangeMap<String, dynamic>?Callback for when the focus changes.
autofocus@Default(false) boolAutomatically focuses when the widget is built.
hoverDurationStacDuration?Duration for the hover animation effect.

Example JSON​

{
"type": "inkWell",
"child": {
"type": "padding",
"padding": {
"top": 20,
"bottom": 20,
"right": 20,
"left": 20
},
"child": {
"type": "text",
"data": "Hello, World! from Inkwell",
"textAlign": "center"
}
},
"splashColor": "#E1BEE7",
"borderRadius": {
"topLeft": 20,
"topRight": 20,
"bottomLeft": 20,
"bottomRight": 20
},
"radius": 20,
"hoverDuration": {
"seconds": 10
},
"onTap": {}
}