forTap method

Future<void> forTap (BuildContext context)

Provides platform-specific feedback for a tap.

On Android the click system sound is played. On iOS this is a no-op.

See also:

Implementation

static Future<void> forTap(BuildContext context) async {
  context.findRenderObject().sendSemanticsEvent(const TapSemanticEvent());
  switch (_platform(context)) {
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
      return SystemSound.play(SystemSoundType.click);
    default:
      return Future<void>.value();
  }
}