wrapForLongPress method
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:
- forLongPress to just trigger the platform-specific feedback without wrapping a GestureLongPressCallback.
Implementation
static GestureLongPressCallback wrapForLongPress(GestureLongPressCallback callback, BuildContext context) {
if (callback == null)
return null;
return () {
Feedback.forLongPress(context);
callback();
};
}