play static method

Future<void> play(
  1. SystemSoundType type
)

Play the specified system sound. If that sound is not present on the system, the call is ignored.

The web platform currently does not support playing sounds, so this call will yield no behavior on that platform.

Implementation

static Future<void> play(SystemSoundType type) async {
  await SystemChannels.platform.invokeMethod<void>(
    'SystemSound.play',
    type.toString(),
  );
}