Pressable constructor

Pressable({
  1. Key? key,
  2. required Widget child,
  3. GestureTapCallback? onTap,
  4. GestureTapCallback? onDoubleTap,
  5. GestureLongPressCallback? onLongPress,
  6. Color? focusColor,
  7. Color? hoverColor,
  8. Color? highlightColor,
  9. Color? splashColor,
  10. InteractiveInkFeatureFactory? splashFactory,
  11. double? radius,
  12. BorderRadius? borderRadius,
  13. ShapeBorder? customBorder,
})

Can be used to wrap a Widget so that InkWell animation will occur on top of that Widget

Implementation

Pressable({
  Key? key,
  required Widget child,
  GestureTapCallback? onTap,
  GestureTapCallback? onDoubleTap,
  GestureLongPressCallback? onLongPress,
  Color? focusColor,
  Color? hoverColor,
  Color? highlightColor,
  Color? splashColor,
  InteractiveInkFeatureFactory? splashFactory,
  double? radius,
  BorderRadius? borderRadius,
  ShapeBorder? customBorder,
}) : super(
        key: key,
        children: <Widget>[
          child,
          Positioned.fill(
            child: Material(
              color: Colors.transparent,
              child: InkWell(
                onTap: onTap,
                onDoubleTap: onDoubleTap,
                onLongPress: onLongPress,
                focusColor: focusColor,
                hoverColor: hoverColor,
                highlightColor: highlightColor,
                splashColor: splashColor,
                splashFactory: splashFactory,
                radius: radius,
                borderRadius: borderRadius,
                customBorder: customBorder,
              ),
            ),
          ),
        ],
      );