inkTap method
Widget
inkTap({
- void onTap()?,
- void onDoubleTap()?,
- void onLongPress()?,
- Color? backgroundColor,
- BorderRadius? borderRadius,
- Color? splashColor,
- Color? highlightColor,
- Color? hoverColor,
- EdgeInsets? padding,
- bool enableFeedback = true,
- 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),
),
);
}