play method

Future<void> play()

Воспроизведение звука

Implementation

Future<void> play() async {
  if (sound.file.isEmpty || _isPlaying) return;

  _audioPlayer ??= AudioPlayer();
  await _audioPlayer!.play(DeviceFileSource(sound.file));
  _isPlaying = true;
  notifyListeners();
}