inkTap method

Widget inkTap({
  1. void onTap()?,
  2. void onDoubleTap()?,
  3. void onLongPress()?,
  4. Color? backgroundColor,
  5. BorderRadius? borderRadius,
  6. Color? splashColor,
  7. Color? highlightColor,
  8. Color? hoverColor,
  9. EdgeInsets? padding,
  10. bool enableFeedback = true,
  11. double? feedbackDuration = 0.5,
})

Ink tap with splash effect

If this is used on Container or Card type widget, then make sure that you don't set the color of that widget, instead pass the color here.

Colors are theme default

It's preffered that padding should be use on widgets like Text, Icon etc

Implementation

Widget inkTap({
  void Function()? onTap,
  void Function()? onDoubleTap,
  void Function()? onLongPress,
  Color? backgroundColor,
  BorderRadius? borderRadius,
  Color? splashColor,
  Color? highlightColor,
  Color? hoverColor,
  EdgeInsets? padding,
  bool enableFeedback = true,
  double? feedbackDuration = 0.5,
}) {
  return Material(
    color: backgroundColor,
    borderRadius: borderRadius,
    child: InkWell(
      enableFeedback: enableFeedback,
      borderRadius: borderRadius,
      highlightColor: highlightColor,
      splashColor: splashColor,
      hoverColor: hoverColor,
      onTap: onTap,
      onDoubleTap: onDoubleTap,
      onLongPress: onLongPress,
      child: padding == null ? this : this.padd(padding),
    ),
  );
}