play method

Future<void> play(
  1. String name
)

Implementation

Future<void> play(String name) async {
  final soundPath = soundMap[name];
  if (soundPath == null || soundPath.isEmpty) return;

  AudioPlayer().play(AssetSource(soundPath), mode: PlayerMode.lowLatency);
}