onTap method

Widget onTap([
  1. VoidCallback? callback
])

Adds an onTap gesture using InkWell over a transparent Material.

Implementation

Widget onTap([VoidCallback? callback]) {
  if (callback == null) return this;

  return Material(
    type: MaterialType.transparency,
    child: InkWell(
      onTap: callback,
      splashColor: Colors.transparent,
      highlightColor: Colors.transparent,
      child: this,
    ),
  );
}