wrapForTap method
Wraps a GestureTapCallback to provide platform specific feedback for a tap before the provided callback is executed.
On Android the platform-typical click system sound is played. On iOS this is a no-op as that platform usually doesn't provide feedback for a tap.
See also:
- forTap to just trigger the platform-specific feedback without wrapping a GestureTapCallback.
Implementation
static GestureTapCallback wrapForTap(GestureTapCallback callback, BuildContext context) {
if (callback == null)
return null;
return () {
Feedback.forTap(context);
callback();
};
}