wrapForLongPress method

GestureLongPressCallback wrapForLongPress (GestureLongPressCallback callback, BuildContext context)

Wraps a GestureLongPressCallback to provide platform specific feedback for a long press before the provided callback is executed.

On Android the platform-typical vibration is triggered. On iOS this is a no-op as that platform usually doesn't provide feedback for a long press.

See also:

Implementation

static GestureLongPressCallback wrapForLongPress(GestureLongPressCallback callback, BuildContext context) {
  if (callback == null)
    return null;
  return () {
    Feedback.forLongPress(context);
    callback();
  };
}