ripple method
Widget
ripple({
- Key? key,
- Color? focusColor,
- Color? hoverColor,
- Color? highlightColor,
- Color? splashColor,
- InteractiveInkFeatureFactory? splashFactory,
- double? radius,
- ShapeBorder? customBorder,
- bool enableFeedback = true,
- bool excludeFromSemantics = false,
- FocusNode? focusNode,
- bool canRequestFocus = true,
- bool autoFocus = false,
- bool enable = true,
Implementation
Widget ripple({
Key? key,
Color? focusColor,
Color? hoverColor,
Color? highlightColor,
Color? splashColor,
InteractiveInkFeatureFactory? splashFactory,
double? radius,
ShapeBorder? customBorder,
bool enableFeedback = true,
bool excludeFromSemantics = false,
FocusNode? focusNode,
bool canRequestFocus = true,
bool autoFocus = false,
bool enable = true,
}) =>
enable
? Builder(
key: key,
builder: (BuildContext context) {
// TODO: PERFORMANCE: findAncestorWidgetOfExactType vs InheritedWidget performance
GestureDetector? gestures =
context.findAncestorWidgetOfExactType<GestureDetector>();
return Material(
color: Colors.transparent,
child: InkWell(
focusColor: focusColor,
hoverColor: hoverColor,
highlightColor: highlightColor,
splashColor: splashColor,
splashFactory: splashFactory,
radius: radius,
customBorder: customBorder,
enableFeedback: enableFeedback,
excludeFromSemantics: excludeFromSemantics,
focusNode: focusNode,
canRequestFocus: canRequestFocus,
autofocus: autoFocus,
onTap: gestures?.onTap,
child: this,
),
);
},
)
: Builder(
key: key,
builder: (context) => this,
);