customInkWell function

Widget customInkWell({
  1. required Widget child,
  2. required BuildContext context,
  3. dynamic function1(
    1. bool,
    2. int
    )?,
  4. Function? onPressed,
  5. bool isEnable = false,
  6. int no = 0,
  7. Color color = Colors.transparent,
  8. Color? splashColor,
  9. BorderRadius? radius,
})

Implementation

Widget customInkWell(
    {required Widget child,
    required BuildContext context,
    Function(bool, int)? function1,
    Function? onPressed,
    bool isEnable = false,
    int no = 0,
    Color color = Colors.transparent,
    Color? splashColor,
    BorderRadius? radius}) {
  splashColor ??= Theme.of(context).primaryColorLight;
  radius ??= BorderRadius.circular(0);
  return Material(
    color: color,
    child: InkWell(
      borderRadius: radius,
      onTap: () {
        if (function1 != null) {
          function1(isEnable, no);
        } else if (onPressed != null) {
          onPressed();
        }
      },
      splashColor: splashColor,
      child: child,
    ),
  );
}