ripple method

Widget ripple({
  1. Key? key,
  2. Color? focusColor,
  3. Color? hoverColor,
  4. Color? highlightColor,
  5. Color? splashColor,
  6. InteractiveInkFeatureFactory? splashFactory,
  7. double? radius,
  8. ShapeBorder? customBorder,
  9. bool enableFeedback = true,
  10. bool excludeFromSemantics = false,
  11. FocusNode? focusNode,
  12. bool canRequestFocus = true,
  13. bool autoFocus = false,
  14. 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,
          );