onLongPress method

Widget onLongPress([
  1. VoidCallback? callback
])

Adds an onLongPress gesture using InkWell over a transparent Material.

Implementation

Widget onLongPress([VoidCallback? callback]) {
  if (callback == null) return this;
  return Material(
    type: MaterialType.transparency,
    child: InkWell(
      onLongPress: callback,
      splashColor: Colors.transparent,
      highlightColor: Colors.transparent,
      child: this,
    ),
  );
}