customTouchControl method

Widget customTouchControl({
  1. required bool enable,
  2. VoidCallback? onTapWhileDisabled,
})

Enables or disables touch with a custom gesture detector

Implementation

Widget customTouchControl({
  required bool enable,
  VoidCallback? onTapWhileDisabled,
}) {
  return GestureDetector(
    onTap: enable ? null : onTapWhileDisabled,
    child: AbsorbPointer(
      absorbing: !enable,
      child: this,
    ),
  );
}