onInkTap method
InkWell
onInkTap(
- VoidCallback callback, {
- Color? splashColor,
- Color? focusColor,
- Color? hoverColor,
- bool enableFeedback = false,
- double? radius,
- BorderRadius? borderRadius,
- MouseCursor? mouseCursor,
Wraps the current Widget
in an InkWell
widget with a tap gesture callback and customizable ink splash parameters.
This method allows you to add a tap gesture with visual feedback to any widget.
Example:
Text('Ink tap me').onInkTap(
() {
print('Widget ink tapped!');
},
splashColor: Colors.red,
borderRadius: BorderRadius.circular(4),
);
@param callback The function to be called when the widget is tapped.
@param splashColor The color of the ink splash.
@param focusColor The color of the focus highlight.
@param hoverColor The color of the hover highlight.
@param enableFeedback Whether to enable feedback for the ink well.
@param radius The radius of the ink splash.
@param borderRadius The border radius of the ink splash.
@param mouseCursor The cursor for mouse pointers.
@return An InkWell
widget wrapping the current widget.
Implementation
InkWell onInkTap(
VoidCallback callback, {
Color? splashColor,
Color? focusColor,
Color? hoverColor,
bool enableFeedback = false,
double? radius,
BorderRadius? borderRadius,
MouseCursor? mouseCursor,
}) {
return InkWell(
onTap: callback,
splashColor: splashColor,
focusColor: focusColor,
hoverColor: hoverColor,
enableFeedback: enableFeedback,
radius: radius,
borderRadius: borderRadius,
mouseCursor: mouseCursor,
child: this,
);
}